From 6ed3c3367125fac3f5574558db102a7eba19de55 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:14:33 +0800 Subject: [PATCH 01/18] docs(skill): app-implement-feature follows concept folders with Internal/ Concept folders instead of Domain/Infrastructure layers: public face at the top, implementations in Internal/, the bare outside call in Internal/System/. Roles named for what they are (no Service/Manager/ Repository suffixes), a canonical-model step and the five domain questions (references/domain-shape.md), no approval gate. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/app-implement-feature/SKILL.md | 301 +++++++++++------- .../references/architecture-diagrams.md | 173 +++++----- .../references/domain-models.md | 33 +- .../references/domain-shape.md | 64 ++++ .../references/swift-observable.md | 12 +- .../references/tdd-patterns.md | 116 +++---- 6 files changed, 423 insertions(+), 276 deletions(-) create mode 100644 .claude/skills/app-implement-feature/references/domain-shape.md diff --git a/.claude/skills/app-implement-feature/SKILL.md b/.claude/skills/app-implement-feature/SKILL.md index c71d1acb..c274db7a 100644 --- a/.claude/skills/app-implement-feature/SKILL.md +++ b/.claude/skills/app-implement-feature/SKILL.md @@ -1,12 +1,12 @@ --- name: app-implement-feature description: | - Guide for implementing features following architecture-first design, TDD, rich domain models, and Swift 6.2 patterns. Use this skill when: + Guide for implementing features in a Swift app laid out by concept, not by layer: each concept folder holds its public face (rich values, @Mockable roles named for what they are), its implementations in Internal/, and the bare outside call in Internal/System/; no Domain/ or Infrastructure/ folders. Covers placing the change in docs/CANONICAL_MODEL.md, Chicago-school TDD and Swift 6.2 patterns. Use this skill when: (1) Adding new functionality to a Swift app (2) Creating domain models that follow user's mental model (3) Building SwiftUI views that consume domain models directly (4) User asks "how do I implement X" or "add feature Y" - (5) Implementing any feature that spans Domain, Infrastructure, and App layers + (5) Implementing any feature that spans a concept folder, its Internal/ implementations, and the App --- # Implement Feature @@ -17,69 +17,73 @@ Implement features using architecture-first design, TDD, rich domain models, and ``` ┌─────────────────────────────────────────────────────────────┐ -│ 1. ARCHITECTURE DESIGN (Required - User Approval Needed) │ +│ 0. DESIGN (no approval gate — design, then build) │ ├─────────────────────────────────────────────────────────────┤ -│ • Analyze requirements │ -│ • Create component diagram │ -│ • Show data flow and interactions │ -│ • Present to user for review │ -│ • Wait for approval before proceeding │ +│ • Place it in the canonical model (docs/CANONICAL_MODEL.md) │ +│ • Name every type for what it is in the domain │ +│ • Diagram: public face · Internal/ · Internal/System/ │ +│ • Show the design and the files to touch, then go on │ └─────────────────────────────────────────────────────────────┘ │ - ▼ (User Approves) + ▼ ┌─────────────────────────────────────────────────────────────┐ -│ 2. TDD IMPLEMENTATION │ +│ 1-3. TDD IMPLEMENTATION │ ├─────────────────────────────────────────────────────────────┤ -│ • Domain model tests → Domain models │ -│ • Infrastructure tests → Implementations │ -│ • Integration and views │ +│ • Public face: value types, @Mockable roles (/) │ +│ • Implementations (/Internal/) │ +│ • Bare outside call (/Internal/System/, ≤100 LOC) │ +│ • The way in: App wiring and views │ └─────────────────────────────────────────────────────────────┘ ``` -## Phase 0: Architecture Design (MANDATORY) +## Phase 0: Design -Before writing any code, create an architecture diagram and get user approval. +Design before writing code, show it, then build it test-first. Don't stop to +ask for approval; the user interrupts if the design is wrong. Ask only when a +decision is genuinely theirs (a concept that fits no folder, a changed law). -### Step 1: Analyze Requirements +### Step 1: Place it in the canonical model -Identify: -- What new models/types are needed -- Which existing components will be modified -- Data flow between components -- External dependencies (APIs, databases, CLI tools) +`docs/CANONICAL_MODEL.md` is the single map of the domain: the tree of +concepts, the words (ubiquitous language), every law with its **one owner**, +and the folder each concept lives in. Read it, then answer: + +| Question | If yes | +|---|---| +| Which concept owns the question it answers? | its type goes in `Sources//`, its implementation in that concept's `Internal/`. A concept that fits no folder is a missing word — ask before inventing a folder | +| Which node is told? | a new verb lands on one node of the tree; `App/` only parses, calls and renders | +| Does it add or change a law? | it gets **one** owner — the type that holds the data. Grep for the rule first: if it is already written, that is the owner, or the duplicate to remove | +| Does it need the outside world? | a `@Mockable` role in the public face, named for the role ([Naming](#4-name-every-abstraction-for-its-role)), implemented in `Internal/` | +| Does what differs between cases become a branch? | make it data: a table, a value, a registration — not an `if` | + +When the doc doesn't cover the change, write it into `CANONICAL_MODEL.md` +first (tree lines, a law with its owner, a word in the glossary). That diff +is part of the design. If the project has no `CANONICAL_MODEL.md` yet, start +one with just the concepts this feature touches. Code that disagrees with the +doc is behind; don't bend the design to it. + +Then ask the five questions of every type the change touches — would the user +say it, does it decide about itself, can you see every state, is it as small as +it can be, is what differs data — and check each concept it touches → +[domain-shape.md](references/domain-shape.md). ### Step 2: Create Architecture Diagram -Use ASCII diagram showing all components and their interactions: +Use an ASCII diagram showing the concept folder, what sits in its public face, +what sits in `Internal/`, and the one bare call in `Internal/System/`: ``` -┌─────────────────────────────────────────────────────────────────────┐ -│ ARCHITECTURE │ -├─────────────────────────────────────────────────────────────────────┤ -│ │ -│ ┌─────────────┐ ┌──────────────────┐ ┌──────────────────┐ │ -│ │ External │ │ Infrastructure │ │ Domain │ │ -│ └─────────────┘ └──────────────────┘ └──────────────────┘ │ -│ │ -│ ┌─────────────┐ ┌──────────────────┐ ┌──────────────────┐ │ -│ │ API/DB │────▶│ Repository/ │────▶│ DomainModel │ │ -│ │ (external) │ │ Client │ │ (rich behavior) │ │ -│ └─────────────┘ └──────────────────┘ └──────────────────┘ │ -│ │ │ │ -│ │ ▼ │ -│ │ ┌──────────────────┐ │ -│ │ │ DomainService │ │ -│ └─────────────▶│ (actor) │ │ -│ └──────────────────┘ │ -│ │ │ -│ ▼ │ -│ ┌──────────────────────────────────┐ │ -│ │ App Layer │ │ -│ │ ┌────────────────────────────┐ │ │ -│ │ │ SwiftUI Views │ │ │ -│ │ └────────────────────────────┘ │ │ -│ └──────────────────────────────────┘ │ -└─────────────────────────────────────────────────────────────────────┘ +Sources/Orders/ Orders/Internal/ Orders/Internal/System/ +┌──────────────────┐ ┌──────────────────────┐ any ┌────────────────────────┐ +│ Order, OrderItem │ │ APIOrders │ HTTP │ URLSessionHTTP │ +│ (values + rules) │ ◀──────── │ (request, decode, │ ───────▶ │ (≤100 lines: only the │ +│ Orders │ implements│ map DTO → Order, │ │ URLSession call) │ +│ (@Mockable role) │ │ error mapping) │ ◀─ Mock └────────────────────────┘ +│ OrderBook (actor)│ └──────────────────────┘ HTTP +└──────────────────┘ in tests + ▲ + │ imports the public face only +Sources/App/ SwiftUI views + entry point (wires Internal/ implementations in) ``` ### Step 3: Document Component Interactions @@ -91,21 +95,17 @@ List each component with: - **Dependencies**: What it needs ``` -| Component | Purpose | Inputs | Outputs | Dependencies | -|-----------------|----------------------|----------------|----------------|----------------| -| UserRepository | Fetch user data | userId | User | NetworkClient | -| OrderService | Manage order logic | Order, User | OrderResult | UserRepository | +| Component | Purpose | Inputs | Outputs | Dependencies | +|------------|-----------------------|--------------|--------------|--------------| +| Users | Find and save users | UserId | User | HTTP | +| OrderBook | Keep orders current | Order, User | Order | Orders | ``` -### Step 4: Present for User Approval - -**IMPORTANT**: Always ask user to review the architecture before implementing. +### Step 4: Show the design, then build -Use AskUserQuestion tool with options: -- "Approve - proceed with implementation" -- "Modify - I have feedback on the design" - -Do NOT proceed to Phase 1 until user explicitly approves. +Present the `CANONICAL_MODEL.md` diff (if any), the diagram and a "files to +touch" list ([template](references/architecture-diagrams.md#design-presentation-template)), +then go straight to Phase 1. No approval question. --- @@ -167,30 +167,80 @@ struct OrderRow: View { ```swift @Mockable -public protocol OrderRepository: Sendable { +public protocol Orders: Sendable { + func all() async throws -> [Order] func fetch(id: OrderId) async throws -> Order func save(_ order: Order) async throws } @Mockable -public protocol NetworkClient: Sendable { +public protocol HTTP: Sendable { func request(_ endpoint: Endpoint) async throws -> T } ``` +### 4. Name every abstraction for its role + +Every `@Mockable` protocol, actor and adapter is named **for what it is in the +domain**, never for its architectural pattern: + +- **Never `XxxService`, `XxxManager`, `XxxPort`, `XxxHelper`.** If you reach for + one, the abstraction isn't named yet — keep going until the noun describes + what the thing *is* (`OrderBook`, `Checkout`, `HTTP`, `Subprocess`). If no + noun comes, the abstraction probably shouldn't exist yet. +- **Aggregate persistence takes the plural of the aggregate** — `Orders`, + `Users`, `Books` — never the suffix `XxxRepository`. This carve-out is only + for collection-like load / save / delete by identity; anything else (an + adapter, an event source, a process) gets a role noun. +- **Implementations are named for how they do it**: `APIOrders`, + `SQLiteOrders`, `URLSessionHTTP`, `InMemoryOrders` — each plays the role it + is named after. +- **Tests are named for the outcome**, in the user's words: + `` `should show the new status after an update` ``, never the method or + mechanism (`returns`, `calls`, `fetches`). + ## Architecture -| Layer | Location | Purpose | -|-------|----------|---------| -| **Domain** | `Sources/Domain/` | Rich models, protocols, actors (single source of truth) | -| **Infrastructure** | `Sources/Infrastructure/` | Repositories, clients, adapters | -| **App** | `Sources/App/` | SwiftUI views consuming domain directly (no ViewModel) | +**No `Domain/` folder, no `Infrastructure/` folder.** Code is grouped by the +concept it is about, not by the layer it sits in. Every folder has the same +shape: + +``` +Sources/ +├── / # shared kernel: ids, errors, small values — imports nothing of ours +├── Orders/ # one folder per concept (nest sub-concepts: Orders/Items/) +│ ├── Order.swift # PUBLIC FACE — values with behaviour, +│ ├── OrderStatus.swift # @Mockable roles, actors; what other folders may use +│ ├── Orders.swift # (Orders = the collection of Order: load / save by id) +│ └── Internal/ # IMPLEMENTATIONS — adapters that play the roles, +│ ├── APIOrders.swift # DTOs, mappers, wire formats; decisions, unit-tested +│ ├── OrderDTO.swift +│ └── System/ # THE BARE OUTSIDE CALL — URLSession, a DB driver, +│ └── URLSessionHTTP.swift # Process, a private symbol; ≤100 lines, no decisions +└── App/ # THE WAY IN — SwiftUI views (no ViewModel), entry point, wiring +Tests/Tests/ # mirrors Sources/ folder for folder +├── Orders/OrderTests.swift +└── Orders/Internal/APIOrdersTests.swift +``` + +| Part | Location | Holds | Tested how | +|------|----------|-------|------------| +| **Public face** | `Sources//` | rich value types, `@Mockable` role protocols, actors — the single source of truth | 100%, state-based | +| **Implementations** | `Sources//Internal/` | the adapters that play the roles, DTOs, mappers — every decision about the outside | ≥90%, via the collaborator's `MockXxx` | +| **Bare outside call** | `Sources//Internal/System/` | the irreducible call (`URLSession`, `Process`, `dlopen`, a socket), ≤100 lines | integration-only; the only code coverage leaves out | +| **The way in** | `Sources/App/` (or `Commands/`, `Server/`) | views, entry point, registration — parse, call, render; no rules | views are thin; wiring by a smoke test | + +**Rules:** +- **Imports flow inward**: `App → → `. A concept never imports another concept's `Internal/`; it may use another concept's public face only. +- **`Internal/` is a fence, not just a folder**: nothing outside the concept names a type in its `Internal/`, except the composition root in `App/` that wires an implementation into a role. Prefer `internal` access; make an `Internal/` type `public` only when the concept is its own module and `App/` must construct it. +- **Split adapters that wrap I/O**: the decisions (request building, decoding, mapping, retries, error mapping) live in `Internal/` and are tested through a small `@Mockable` collaborator (`HTTP`, `Subprocess`); only the call itself goes in `Internal/System/`. If a `System/` file grows a decision, move the decision up. +- **A concept that fits no folder is a missing word** — ask before inventing a folder. **Key patterns:** -- **Repository Pattern** - Abstract data access behind protocols +- **Collections of aggregates** - Data access behind a plural-noun protocol (`Orders`) in the public face - **Protocol-Based DI** - `@Mockable` for testing - **Chicago School TDD** - Test state, not interactions -- **No ViewModel layer** - Views consume domain directly +- **No ViewModel layer** - Views consume the public face directly ## TDD Workflow (Chicago School) @@ -200,93 +250,130 @@ We follow **Chicago school TDD** (state-based testing): - Mocks stub dependencies to return data, not to verify calls - Design emerges from tests (emergent design) -### Phase 1: Domain Model Tests +### Phase 1: Public Face Tests (`Tests/...//`) -Test state and computed properties: +Test the values and actors in the concept folder through their state and +computed properties: ```swift @Suite struct OrderTests { - @Test func `order computes total from items`() { - // Given + @Test func `should total an order from its items`() { let order = Order(items: [ OrderItem(price: 10, quantity: 2), OrderItem(price: 5, quantity: 1) ], status: .pending) - // When/Then #expect(order.totalAmount == 25) } - @Test func `pending order can be cancelled`() { - // Given - let order = Order(items: [], status: .pending) + @Test func `should let a pending order be cancelled`() { + #expect(Order(items: [], status: .pending).canBeCancelled == true) + } - // When/Then - #expect(order.canBeCancelled == true) + @Test func `should refuse to cancel an order once shipped`() { + #expect(Order(items: [], status: .shipped).canBeCancelled == false) } +} +``` - @Test func `shipped order cannot be cancelled`() { - // Given - let order = Order(items: [], status: .shipped) +An actor in the public face is tested against a stubbed role: - // When/Then - #expect(order.canBeCancelled == false) +```swift +@Suite +struct OrderBookTests { + @Test func `should give back the order it was asked for`() async throws { + let orders = MockOrders() + given(orders).fetch(id: any()).willReturn(Order(items: [], status: .pending)) + + let book = OrderBook(orders: orders) + + #expect(try await book.getOrder(OrderId("123")).status == .pending) } } ``` -### Phase 2: Infrastructure Tests +### Phase 2: Implementation Tests (`Tests/...//Internal/`) -Stub dependencies to return data, assert on resulting state: +An adapter in `Internal/` holds every decision about the outside world +(request, decode, map, error mapping). Test it through its collaborator's +mock (`MockHTTP`) and assert on the domain value it produces: ```swift @Suite -struct OrderServiceTests { - @Test func `service returns order on success`() async throws { - // Given - stub dependency to return data (not verify calls) - let mockRepo = MockOrderRepository() - let expectedOrder = Order(items: [], status: .pending) - given(mockRepo).fetch(id: any()).willReturn(expectedOrder) +struct APIOrdersTests { + @Test func `should load an order when the API answers`() async throws { + let http = MockHTTP() + given(http).request(any()).willReturn( + OrderDTO(id: "123", status: "pending", items: []) + ) + + let order = try await APIOrders(http: http).fetch(id: OrderId("123")) + + #expect(order.id.value == "123") + #expect(order.status == .pending) + } - let service = OrderService(repository: mockRepo) + @Test func `should fail when the network is down`() async { + let http = MockHTTP() + given(http).request(any()).willThrow(NetworkError.connectionFailed) - // When - let result = try await service.getOrder(id: "123") + await #expect(throws: OrdersError.networkError) { + try await APIOrders(http: http).fetch(id: OrderId("123")) + } + } +} +``` - // Then - verify returned state, not interactions - #expect(result.status == .pending) +The bare call in `Internal/System/` (`URLSessionHTTP`) is the collaborator's +real implementation. It has no decisions to unit-test; prove it once against +the real thing, tagged so the normal loop can skip it, with a time limit: + +```swift +@Suite(.tags(.system)) +struct URLSessionHTTPTests { + @Test(.timeLimit(.minutes(1))) + func `should reach a live server`() async throws { + let status: HealthDTO = try await URLSessionHTTP().request(.health) + #expect(status.ok == true) } } ``` +If you can't drive the adapter through a `MockXxx`, it isn't split +correctly: move the decision out of `System/` and back into `Internal/`. + ### Phase 3: Integration -Wire up in app entry point and create views. +Wire the `Internal/` implementations into their roles at the app entry point (the only place outside the concept that names them), and create views that consume the public face. ## References - [Architecture diagram patterns](references/architecture-diagrams.md) - ASCII diagram examples - [Swift 6.2 @Observable patterns](references/swift-observable.md) +- [Think the domain first](references/domain-shape.md) - five questions, check by concept - [Rich domain model patterns](references/domain-models.md) - [TDD test patterns](references/tdd-patterns.md) ## Checklist -### Architecture Design (Phase 0) -- [ ] Analyze requirements and identify components -- [ ] Create ASCII architecture diagram with component interactions -- [ ] Document component table (purpose, inputs, outputs, dependencies) -- [ ] **Get user approval before proceeding** +### Design (Phase 0) +- [ ] Place the change in `docs/CANONICAL_MODEL.md` (concept, owner of every law it adds); update the doc first if it doesn't cover it +- [ ] Ask the five questions of every type touched ([domain-shape](references/domain-shape.md)) +- [ ] Name every new type for its domain role — no `Service` / `Manager` / `Port` / `Repository` suffixes +- [ ] Create ASCII diagram: public face · `Internal/` · `Internal/System/` +- [ ] Show the design and files to touch, then proceed (no approval question) ### Implementation (Phases 1-3) - Chicago School TDD - [ ] Write failing test asserting expected STATE (Red) - [ ] Write minimal code to pass the test (Green) - [ ] Refactor while keeping tests green -- [ ] Define domain models in `Sources/Domain/` with behavior +- [ ] Define the public face in `Sources//` (values with behavior, `@Mockable` roles) - [ ] Test state changes and return values (not interactions) - [ ] Define protocols with `@Mockable` for external dependencies - [ ] Stub mocks to return data, assert on resulting state -- [ ] Implement infrastructure in `Sources/Infrastructure/` -- [ ] Create views consuming domain models directly +- [ ] Implement adapters in `Sources//Internal/`; bare outside call only in `Internal/System/` (≤100 lines) +- [ ] Tests mirror `Sources/` folder for folder (`Tests/Tests//Internal/…`) +- [ ] No new `Domain/` or `Infrastructure/` folder; nothing outside the concept (except the App wiring) names an `Internal/` type +- [ ] Create views consuming the public face directly - [ ] Run `swift test` to verify all tests pass diff --git a/.claude/skills/app-implement-feature/references/architecture-diagrams.md b/.claude/skills/app-implement-feature/references/architecture-diagrams.md index df6e118a..95b23900 100644 --- a/.claude/skills/app-implement-feature/references/architecture-diagrams.md +++ b/.claude/skills/app-implement-feature/references/architecture-diagrams.md @@ -4,41 +4,40 @@ ASCII diagrams for documenting feature architecture before implementation. ## Table of Contents -- [Layered Architecture](#layered-architecture) +- [Concept Folder Layout](#concept-folder-layout) - [Data Flow Diagrams](#data-flow-diagrams) - [Sequence Diagrams](#sequence-diagrams) - [Component Interaction Tables](#component-interaction-tables) --- -## Layered Architecture +## Concept Folder Layout -### Three-Layer Pattern (Standard) +No `Domain/` or `Infrastructure/` layer folders: each concept folder carries +its public face at the top, its implementations in `Internal/`, and the bare +outside call in `Internal/System/`. + +### One Concept (Standard) ``` ┌─────────────────────────────────────────────────────────────────────┐ │ FEATURE: [Feature Name] │ ├─────────────────────────────────────────────────────────────────────┤ │ │ -│ EXTERNAL INFRASTRUCTURE DOMAIN │ -│ ┌─────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ -│ │ [Source] │──────▶│ [Repository/ │────▶│ [Model] │ │ -│ │ (API/DB) │ │ Client] │ │ (value types) │ │ -│ └─────────────┘ └─────────────────┘ └─────────────────┘ │ -│ │ │ -│ ▼ │ -│ ┌─────────────────┐ │ -│ │ [Service] │ │ -│ │ (actor) │ │ -│ └─────────────────┘ │ -│ │ │ -│ ▼ │ -│ ┌───────────────────────────────────────┐ │ -│ │ APP LAYER │ │ -│ │ ┌─────────────────────────────────┐ │ │ -│ │ │ [Views/Registration] │ │ │ -│ │ └─────────────────────────────────┘ │ │ -│ └───────────────────────────────────────┘ │ +│ Sources/[Concept]/ [Concept]/Internal/ Internal/System/ │ +│ ┌─────────────────┐ ┌─────────────────┐ ┌───────────────┐ │ +│ │ [Model] │◀──────│ [Adapter] │──▶│ [Bare call] │──▶ API/DB +│ │ (value types) │ impl. │ (decode, map, │ │ (≤100 lines, │ │ +│ │ [Role] │ │ decisions) │ │ no decisions)│ │ +│ │ (@Mockable) │ └─────────────────┘ └───────────────┘ │ +│ │ [Actor] │ │ +│ └─────────────────┘ │ +│ ▲ public face only │ +│ ┌───────────────────────────────────────┐ │ +│ │ Sources/App/ │ │ +│ │ [Views] · [Entry point: wires │ │ +│ │ Internal/ adapters in] │ │ +│ └───────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────────────────┘ ``` @@ -48,65 +47,50 @@ ASCII diagrams for documenting feature architecture before implementation. ┌─────────────────────────────────────────────────────────────────────────┐ │ Swift App System │ ├─────────────────────────────────────────────────────────────────────────┤ -│ │ -│ ┌────────────────────────────────────────────────────────────────────┐ │ -│ │ Domain Layer │ │ -│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │ │ -│ │ │ Order │ │ User │ │ OrderManager (actor) │ │ │ -│ │ │ OrderStatus │ │ Product │ │ CartService │ │ │ -│ │ └──────────────┘ └──────────────┘ └──────────────────────────┘ │ │ -│ └────────────────────────────────────────────────────────────────────┘ │ -│ ▲ │ -│ │ implements │ -│ ┌────────────────────────────────────────────────────────────────────┐ │ -│ │ Infrastructure Layer │ │ -│ │ ┌────────────────────────────────────────────────────────────┐ │ │ -│ │ │ Repositories │ │ │ -│ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │ │ │ -│ │ │ │ Order │ │ User │ │ Product │ │ [NewRepo] │ │ │ │ -│ │ │ │ Repo │ │ Repo │ │ Repo │ │ │ │ │ │ -│ │ │ └──────────┘ └──────────┘ └──────────┘ └──────────────┘ │ │ │ -│ │ └────────────────────────────────────────────────────────────┘ │ │ -│ │ │ │ -│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │ │ -│ │ │ NetworkClient│ │ DatabaseClient│ │ NotificationService │ │ │ -│ │ └──────────────┘ └──────────────┘ └──────────────────────────┘ │ │ -│ └────────────────────────────────────────────────────────────────────┘ │ -│ ▲ │ -│ │ uses │ -│ ┌────────────────────────────────────────────────────────────────────┐ │ -│ │ App Layer │ │ -│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │ │ -│ │ │ AppState │ │ Views │ │ App Entry Point │ │ │ -│ │ │ (@Observable)│ │ │ │ (registration) │ │ │ -│ │ └──────────────┘ └──────────────┘ └──────────────────────────┘ │ │ -│ └────────────────────────────────────────────────────────────────────┘ │ +│ Sources/App/ views (@Observable state) · entry point/wiring │ +│ │ imports public faces │ +│ ▼ │ +│ ┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────┐ │ +│ │ Orders/ │ │ Users/ │ │ [NewConcept]/ │ │ +│ │ Order, OrderStatus │ │ User │ │ [Model] │ │ +│ │ Orders │ │ Users │ │ [Role] │ │ +│ │ OrderBook (actor) │ │ │ │ │ │ +│ │ Internal/ │ │ Internal/ │ │ Internal/ │ │ +│ │ APIOrders │ │ APIUsers │ │ [Adapter] │ │ +│ │ OrderDTO │ │ System/ │ │ System/ │ │ +│ └──────────────────────┘ └──────────────────────┘ └──────────────────┘ │ +│ │ every concept may use │ +│ ▼ │ +│ Sources/Core/ ids · errors · HTTP role │ +│ Internal/System/ URLSessionHTTP (the one network call) │ └─────────────────────────────────────────────────────────────────────────┘ ``` +Concepts never reach into each other's `Internal/`. + --- ## Data Flow Diagrams -### Repository Data Flow +### Collection Data Flow (Orders → APIOrders) ``` ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ -│ API/DB │────▶│ Repository│────▶│ Mapper │────▶│ Domain │ +│ API/DB │────▶│ APIOrders │────▶│ Mapper │────▶│ Domain │ │ Response │ │ Fetch │ │ Logic │ │ Model │ └───────────┘ └───────────┘ └───────────┘ └───────────┘ Raw Fetch Parse Domain Data Data Data Model ``` -### Service Orchestration Flow +### Actor Orchestration Flow ``` ┌─────────────────────────────────────────────────────────────────────┐ -│ SERVICE FLOW │ +│ ACTOR FLOW │ ├─────────────────────────────────────────────────────────────────────┤ │ │ -│ View ──▶ Service (actor) ──▶ Repository.fetch() ──▶ API/DB │ +│ View ──▶ OrderBook (actor) ──▶ Orders.fetch() ──▶ API/DB │ │ │ │ │ │ │ ▼ │ │ │ ┌─────────────────┐ │ @@ -135,7 +119,7 @@ ASCII diagrams for documenting feature architecture before implementation. ``` ┌─────────┐ ┌───────────┐ ┌─────────────┐ ┌──────────────┐ -│ Repo │────▶│ Try Fetch │────▶│ Success │────▶│ Return Data │ +│ Orders │────▶│ Try Fetch │────▶│ Success │────▶│ Return Data │ └─────────┘ └───────────┘ └─────────────┘ └──────────────┘ │ ▼ (failure) @@ -146,7 +130,7 @@ ASCII diagrams for documenting feature architecture before implementation. │ ▼ ┌─────────────────┐ - │ Service handles │ + │ Actor handles │ │ or propagates │ └─────────────────┘ ``` @@ -158,7 +142,7 @@ ASCII diagrams for documenting feature architecture before implementation. ### User Action Flow ``` -User View Service Repository API +User View OrderBook Orders API │ │ │ │ │ │──tap()──────▶│ │ │ │ │ │──action()────▶│ │ │ @@ -176,7 +160,7 @@ User View Service Repository API ### State Change Notification ``` -Repository Service @Observable View +Orders OrderBook @Observable View │ │ │ │ │──model─────────▶│ │ │ │ │──update()────▶│ │ @@ -195,46 +179,52 @@ Repository Service @Observable View ### Standard Table Format ``` -| Component | Purpose | Inputs | Outputs | Dependencies | -|------------------|-------------------------|------------------|-----------------|-------------------| -| OrderRepository | Fetches orders from API | OrderId | Order | NetworkClient | -| OrderManager | Manages order lifecycle | Order, Status | Updated Order | OrderRepository | -| OrderMapper | Converts DTO to domain | OrderDTO | Order | None | +| Component | Purpose | Inputs | Outputs | Dependencies | +|--------------|----------------------------|----------------|----------------|--------------| +| Orders | The collection of orders | OrderId | Order | - | +| APIOrders | Plays Orders over the API | OrderId | Order | HTTP | +| OrderBook | Keeps orders current | Order, Status | Updated Order | Orders | +| OrderMapper | Converts DTO to an Order | OrderDTO | Order | None | ``` ### Extended Table (for complex features) ``` -| Component | Layer | Protocol | Creates/Modifies | Test File | -|------------------|----------------|--------------------|---------------------|--------------------------------| -| APIOrderRepo | Infrastructure | OrderRepository | Creates | APIOrderRepositoryTests.swift | -| OrderMapper | Infrastructure | - | Creates | OrderMapperTests.swift | -| OrderManager | Domain | - | Manages | OrderManagerTests.swift | -| OrderListView | App | - | Displays | - | +| Component | Place | Protocol | Creates/Modifies | Test File | +|-----------------|------------------------|----------|------------------|-------------------------| +| APIOrders | Orders/Internal/ | Orders | Creates | APIOrdersTests.swift | +| OrderMapper | Orders/Internal/ | - | Creates | OrderMapperTests.swift | +| URLSessionHTTP | Core/Internal/System/ | HTTP | Creates | (integration only) | +| OrderBook | Orders/ (public face) | - | Manages | OrderBookTests.swift | +| OrderListView | App/ | - | Displays | - | ``` ### Files to Create/Modify Table ``` -| File Path | Action | Description | -|-------------------------------------------------|----------|--------------------------------------| -| Sources/Infrastructure/API/OrderRepository.swift | Create | Implements OrderRepository protocol | -| Sources/Domain/Services/OrderManager.swift | Create | Actor managing order state | -| Tests/InfrastructureTests/OrderRepositoryTests.swift | Create | Repository behavior tests | -| Sources/App/Views/OrderListView.swift | Create | SwiftUI view for orders | -| Sources/App/App.swift | Modify | Register dependencies | +| File Path | Action | Description | +|------------------------------------------------------|--------|---------------------------------| +| docs/CANONICAL_MODEL.md | Modify | Orders in the tree, laws, words | +| Sources/Orders/Orders.swift | Create | @Mockable collection (face) | +| Sources/Orders/OrderBook.swift | Create | Actor keeping orders current | +| Sources/Orders/Internal/APIOrders.swift | Create | Plays Orders over the API | +| Tests/AppTests/Orders/OrderBookTests.swift | Create | Actor behavior tests | +| Tests/AppTests/Orders/Internal/APIOrdersTests.swift | Create | Adapter behavior tests | +| Sources/App/Views/OrderListView.swift | Create | SwiftUI view for orders | +| Sources/App/App.swift | Modify | Wire APIOrders into Orders | ``` --- -## Approval Prompt Template +## Design Presentation Template -After presenting the architecture, ask for user approval: +Show the design, then start Phase 1 — no approval question: ``` -## Architecture Review +## Design: [Feature Name] -I've designed the architecture for [Feature Name]: +### Canonical model +[diff to docs/CANONICAL_MODEL.md, or "already covered by §"] [Diagram Here] @@ -246,12 +236,9 @@ I've designed the architecture for [Feature Name]: ### Files to Create/Modify -- `Sources/.../NewFile.swift` - [Description] -- `Tests/.../NewTests.swift` - [Description] +- `Sources//NewType.swift` - [Description] +- `Sources//Internal/NewAdapter.swift` - [Description] +- `Tests/Tests//NewTypeTests.swift` - [Description] -**Ready to proceed with TDD implementation?** +Starting with the first failing test: `should [when ]`. ``` - -Use AskUserQuestion with: -- "Approve - proceed with implementation" -- "Modify - I have feedback on the design" diff --git a/.claude/skills/app-implement-feature/references/domain-models.md b/.claude/skills/app-implement-feature/references/domain-models.md index e3a9e16c..42762ce0 100644 --- a/.claude/skills/app-implement-feature/references/domain-models.md +++ b/.claude/skills/app-implement-feature/references/domain-models.md @@ -87,14 +87,13 @@ public protocol PaymentProcessor: Sendable { func refund(transactionId: String, amount: Decimal) async throws -> RefundResult } +// Aggregate persistence takes the plural of the aggregate — never `XxxRepository`. @Mockable -public protocol Repository: Sendable { - associatedtype Entity - associatedtype ID - - func findById(_ id: ID) async throws -> Entity? - func save(_ entity: Entity) async throws - func delete(_ id: ID) async throws +public protocol Orders: Sendable { + func all() async throws -> [Order] + func fetch(id: OrderId) async throws -> Order + func save(_ order: Order) async throws + func delete(id: OrderId) async throws } ``` @@ -196,30 +195,36 @@ public enum OrderStatus: Int, Comparable, Sendable, CaseIterable { ## Actors for Thread Safety -Use actors for stateful domain services: +Use actors for stateful domain objects (named for what they are, never `XxxManager`): ```swift -public actor OrderManager { - private let repository: any OrderRepository +public actor OrderBook { + private let orders: any Orders private var cachedOrders: [OrderId: Order] = [:] - public init(repository: any OrderRepository) { - self.repository = repository + public init(orders: any Orders) { + self.orders = orders } public func getOrder(_ id: OrderId) async throws -> Order { if let cached = cachedOrders[id] { return cached } - let order = try await repository.fetch(id: id) + let order = try await orders.fetch(id: id) cachedOrders[id] = order return order } + public func all() async throws -> [Order] { + let all = try await orders.all() + for order in all { cachedOrders[order.id] = order } + return all + } + public func updateStatus(_ id: OrderId, to status: OrderStatus) async throws { var order = try await getOrder(id) order = order.withStatus(status) - try await repository.save(order) + try await orders.save(order) cachedOrders[id] = order } diff --git a/.claude/skills/app-implement-feature/references/domain-shape.md b/.claude/skills/app-implement-feature/references/domain-shape.md new file mode 100644 index 00000000..5c18a77d --- /dev/null +++ b/.claude/skills/app-implement-feature/references/domain-shape.md @@ -0,0 +1,64 @@ +# Think the domain first + +Before any change, a fix too, ask how the domain should be, not only where the +line fits. The aim is a domain that is **easy to understand**: someone new +reads a type's surface and can explain it in the user's words. Borrow from DDD +only what serves that; no pattern is added for its own sake. + +The tree, the words, every law and its owner are in `docs/CANONICAL_MODEL.md`; +the Swift patterns in [domain-models.md](domain-models.md). + +## Five questions, of every type the change touches + +**1. Would the user say it?** +Names come from what the user sees (the screens, the CLI, the API), never the +mechanism. If the facts need a concept the code doesn't have, it is hiding as +an optional or a flag. *"Cancellable" is a word users meet; `statusCode < 3` +is not.* + +**2. Does the thing decide about itself?** +A rule lives on the thing it is about; callers tell it, they don't read its +state and decide. *Three views writing `order.status == .pending || +order.status == .processing` means the rule is `Order.canBeCancelled`, and +callers ask for it.* + +**3. Can you see every state?** +Each state a user can meet is a case with its data; one value never means two +things. *A payment that timed out may have gone through: it is `unconfirmed`, +not `failed`. A missing answer is a case (`unknown`), not a thrown error.* + +**4. Is it as small as it can be?** +A value when it is data with rules; an actor or class only when it changes +over time; a `@Mockable` protocol only at the outside world (a network, a +database, a process), named for its role. No type, layer or flag the change +doesn't need — but never drop a rule the domain keeps. + +**5. Is what differs between cases data?** +A table, a value, a registration — never `if kind == "premium"` or a subclass +per variant. *A shipping rule per country is a lookup in `ShippingRates`, not +a `switch` in the checkout view.* + +## Check by concept + +The five questions look at one type. To find what is wrong across the domain, +check each **concept folder** as a whole. Each row names a smell you can grep +for. + +| # | Ask | The smell | +|---|---|---| +| 1 | **Does anything cross the fence?** Only a public face or an id may | another concept's `Internal/` type used here; `App/` building an adapter it should only wire | +| 2 | **Does every word mean one thing here?** | one name for two facts | +| 3 | **Does every law have one owner?** | the same rule written twice, drifting; a caller reading state to decide | +| 4 | **Is the business above, and the technique below?** | a request, SQL or JSON assembled in the public face or in `App/`; a domain decision in `Internal/System/` | +| 5 | **Does a new case add data, not an edit?** | a `switch` on a variant name; one type changing for several reasons | +| 6 | **Does the question have a home?** | a rule that lives only in a doc, a view, or a comment | + +A finding goes in `CANONICAL_MODEL.md`: as a fix when a law already says what +is right, or as an open question when the design must decide first. + +## Keep it in scope + +- Fix what these questions find **in the types the change touches**, test + first. Record the rest in `CANONICAL_MODEL.md` for its own change. +- A new aggregate, a moved law or a changed owner is a design change: write it + into `CANONICAL_MODEL.md` first, as part of the Phase 0 design. diff --git a/.claude/skills/app-implement-feature/references/swift-observable.md b/.claude/skills/app-implement-feature/references/swift-observable.md index 32f52f8a..66251fa1 100644 --- a/.claude/skills/app-implement-feature/references/swift-observable.md +++ b/.claude/skills/app-implement-feature/references/swift-observable.md @@ -178,10 +178,10 @@ final class OrderState: @unchecked Sendable { private(set) var orders: [Order] = [] private(set) var isLoading: Bool = false - private let manager: OrderManager // Actor + private let book: OrderBook // Actor - init(manager: OrderManager) { - self.manager = manager + init(book: OrderBook) { + self.book = book } @MainActor @@ -190,7 +190,7 @@ final class OrderState: @unchecked Sendable { defer { isLoading = false } do { - orders = try await manager.fetchAll() + orders = try await book.all() } catch { // Handle error } @@ -199,10 +199,10 @@ final class OrderState: @unchecked Sendable { @MainActor func updateStatus(_ orderId: OrderId, to status: OrderStatus) async { do { - try await manager.updateStatus(orderId, to: status) + try await book.updateStatus(orderId, to: status) // Refresh the specific order if let index = orders.firstIndex(where: { $0.id == orderId }) { - orders[index] = try await manager.fetch(orderId) + orders[index] = try await book.getOrder(orderId) } } catch { // Handle error diff --git a/.claude/skills/app-implement-feature/references/tdd-patterns.md b/.claude/skills/app-implement-feature/references/tdd-patterns.md index a0cc1421..f25b0b04 100644 --- a/.claude/skills/app-implement-feature/references/tdd-patterns.md +++ b/.claude/skills/app-implement-feature/references/tdd-patterns.md @@ -17,11 +17,11 @@ Use `@Test` and `@Suite` instead of XCTest: ```swift import Testing import Foundation -@testable import Domain +@testable import App // the module that holds Sources/Orders/ @Suite struct OrderTests { - @Test func `order at pending status can be cancelled`() { + @Test func `should let a pending order be cancelled`() { let order = Order(items: [], status: .pending) #expect(order.canBeCancelled == true) } @@ -31,7 +31,7 @@ struct OrderTests { ## Given-When-Then Structure ```swift -@Test func `order computes total from items`() { +@Test func `should total an order from its items`() { // Given let order = Order(items: [ OrderItem(price: 10, quantity: 2), @@ -54,13 +54,14 @@ Define mockable protocols for external dependencies: import Mockable @Mockable -public protocol OrderRepository: Sendable { +public protocol Orders: Sendable { + func all() async throws -> [Order] func fetch(id: OrderId) async throws -> Order func save(_ order: Order) async throws } @Mockable -public protocol NetworkClient: Sendable { +public protocol HTTP: Sendable { func request(_ endpoint: Endpoint) async throws -> T } ``` @@ -71,26 +72,26 @@ public protocol NetworkClient: Sendable { import Mockable @Suite -struct OrderServiceTests { - @Test func `service returns order on fetch`() async throws { +struct OrderBookTests { + @Test func `should give back the order it was asked for`() async throws { // Given - STUB dependencies to return data - let mockRepo = MockOrderRepository() + let mockOrders = MockOrders() let expectedOrder = Order( id: OrderId("123"), items: [OrderItem(price: 10, quantity: 1)], status: .pending ) - given(mockRepo).fetch(id: any()).willReturn(expectedOrder) + given(mockOrders).fetch(id: any()).willReturn(expectedOrder) - let service = OrderService(repository: mockRepo) + let book = OrderBook(orders: mockOrders) // When - let result = try await service.getOrder(id: "123") + let result = try await book.getOrder(OrderId("123")) // Then - verify STATE, not that methods were called #expect(result.status == .pending) #expect(result.totalAmount == 10) - // AVOID: verify(mockRepo).fetch(id: any()).called(1) // London school - don't do this + // AVOID: verify(mockOrders).fetch(id: any()).called(1) // London school - don't do this } } ``` @@ -104,7 +105,7 @@ Test state and computed properties: ```swift @Suite struct MoneyTests { - @Test func `money adds correctly with same currency`() { + @Test func `should add two amounts in the same currency`() { let money1 = Money(amount: 10, currency: .usd) let money2 = Money(amount: 5, currency: .usd) @@ -114,7 +115,7 @@ struct MoneyTests { #expect(result.currency == .usd) } - @Test func `money formats with currency symbol`() { + @Test func `should show an amount with its currency symbol`() { let money = Money(amount: 99.99, currency: .usd) #expect(money.formatted == "$99.99") @@ -123,15 +124,15 @@ struct MoneyTests { @Suite struct OrderStatusTests { - @Test func `pending status needs attention`() { + @Test func `should need attention while pending`() { #expect(OrderStatus.pending.needsAttention == true) } - @Test func `delivered status is terminal`() { + @Test func `should be final once delivered`() { #expect(OrderStatus.delivered.isTerminal == true) } - @Test func `shipped status does not need attention`() { + @Test func `should not need attention once shipped`() { #expect(OrderStatus.shipped.needsAttention == false) } } @@ -140,31 +141,31 @@ struct OrderStatusTests { ## Async Test Patterns ```swift -@Test func `repository returns order on success`() async throws { +@Test func `should load an order when the API answers`() async throws { // Given - let mockClient = MockNetworkClient() - given(mockClient).request(any()).willReturn( + let mockHTTP = MockHTTP() + given(mockHTTP).request(any()).willReturn( OrderDTO(id: "123", status: "pending", items: []) ) - let repository = APIOrderRepository(client: mockClient) + let orders = APIOrders(http: mockHTTP) // When - let order = try await repository.fetch(id: OrderId("123")) + let order = try await orders.fetch(id: OrderId("123")) // Then #expect(order.id.value == "123") #expect(order.status == .pending) } -@Test func `repository throws when network fails`() async { +@Test func `should fail when the network is down`() async { // Given - let mockClient = MockNetworkClient() - given(mockClient).request(any()).willThrow(NetworkError.connectionFailed) - let repository = APIOrderRepository(client: mockClient) + let mockHTTP = MockHTTP() + given(mockHTTP).request(any()).willThrow(NetworkError.connectionFailed) + let orders = APIOrders(http: mockHTTP) // When/Then - await #expect(throws: RepositoryError.networkError) { - try await repository.fetch(id: OrderId("123")) + await #expect(throws: OrdersError.networkError) { + try await orders.fetch(id: OrderId("123")) } } ``` @@ -173,35 +174,35 @@ struct OrderStatusTests { ```swift @Suite -struct OrderManagerTests { - @Test func `manager caches fetched orders`() async throws { +struct OrderBookTests { + @Test func `should serve an order again without refetching it`() async throws { // Given - let mockRepo = MockOrderRepository() + let mockOrders = MockOrders() let order = Order(id: OrderId("123"), items: [], status: .pending) - given(mockRepo).fetch(id: any()).willReturn(order) + given(mockOrders).fetch(id: any()).willReturn(order) - let manager = OrderManager(repository: mockRepo) + let book = OrderBook(orders: mockOrders) // When - fetch twice - let first = try await manager.getOrder(OrderId("123")) - let second = try await manager.getOrder(OrderId("123")) + let first = try await book.getOrder(OrderId("123")) + let second = try await book.getOrder(OrderId("123")) // Then - both return same order (cached) #expect(first.id == second.id) } - @Test func `manager updates order status`() async throws { + @Test func `should show the new status after an update`() async throws { // Given - let mockRepo = MockOrderRepository() + let mockOrders = MockOrders() var order = Order(id: OrderId("123"), items: [], status: .pending) - given(mockRepo).fetch(id: any()).willReturn(order) - given(mockRepo).save(any()).willReturn(()) + given(mockOrders).fetch(id: any()).willReturn(order) + given(mockOrders).save(any()).willReturn(()) - let manager = OrderManager(repository: mockRepo) + let book = OrderBook(orders: mockOrders) // When - try await manager.updateStatus(OrderId("123"), to: .processing) - let updated = try await manager.getOrder(OrderId("123")) + try await book.updateStatus(OrderId("123"), to: .processing) + let updated = try await book.getOrder(OrderId("123")) // Then - verify state changed #expect(updated.status == .processing) @@ -212,20 +213,23 @@ struct OrderManagerTests { ## Test Organization ``` -Tests/ -├── DomainTests/ -│ ├── Models/ -│ │ ├── OrderTests.swift # Domain model behavior -│ │ ├── MoneyTests.swift # Value object behavior -│ │ └── OrderStatusTests.swift # Enum behavior -│ └── Services/ -│ └── OrderManagerTests.swift # Actor behavior -└── InfrastructureTests/ - └── Repositories/ - ├── APIOrderRepositoryTests.swift # Repository behavior - └── OrderParsingTests.swift # Parsing logic +Tests/AppTests/ # mirrors Sources/ folder for folder +├── Core/ +│ └── MoneyTests.swift # Value object behavior +└── Orders/ + ├── OrderTests.swift # Public face: model behavior + ├── OrderStatusTests.swift # Enum behavior + ├── OrderBookTests.swift # Actor behavior + └── Internal/ + ├── APIOrdersTests.swift # Adapter behavior via MockHTTP + ├── OrderParsingTests.swift # Parsing logic + └── System/ + └── URLSessionHTTPTests.swift # Integration only (real call, time-limited) ``` +A test lives at the same path as the source it covers. `Internal/System/` is +the only folder coverage leaves out; everything else is unit-tested. + ## Running Tests ```bash @@ -233,7 +237,7 @@ Tests/ swift test # Run specific test suite -swift test --filter DomainTests +swift test --filter OrderTests # Run specific test swift test --filter "OrderTests/order computes total from items" @@ -246,7 +250,7 @@ swift test --filter "OrderTests/order computes total from items" | Test Type | What to Assert | |---------------------|---------------------------------------------------| | Domain models | Computed properties, state after mutations | -| Services/Repos | Return values, thrown errors, resulting state | +| Actors/collections | Return values, thrown errors, resulting state | | Actors | State after operations complete | ### What NOT to Test From e26f578fca9478dfeaa207950dd60b01d5522146 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:14:34 +0800 Subject: [PATCH 02/18] refactor: one ASCKit module laid out by concept folders Domain/ and Infrastructure/ (two modules mirroring each other) become Sources/ASCKit// with each implementation in the concept's Internal/. DomainTests + InfrastructureTests become ASCKitTests, same layout. Pure move: 2,913 tests unchanged and green. Library users replace import Domain / import Infrastructure with import ASCKit. Design: docs/features/concept-folders/design.md Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 + Package.swift | 36 ++--- Sources/ASCCommand/ClientProvider.swift | 3 +- .../Commands/AgeRating/AgeRatingCommand.swift | 2 +- .../AnalyticsReportsDelete.swift | 2 +- .../AnalyticsReportsInstancesList.swift | 2 +- .../AnalyticsReportsList.swift | 2 +- .../AnalyticsReportsReportsList.swift | 2 +- .../AnalyticsReportsRequest.swift | 2 +- .../AnalyticsReportsSegmentsList.swift | 2 +- .../AppCategories/AppCategoriesCommand.swift | 2 +- ...AppClipExperienceLocalizationsCreate.swift | 2 +- ...AppClipExperienceLocalizationsDelete.swift | 2 +- .../AppClipExperienceLocalizationsList.swift | 2 +- .../AppClipExperiencesCreate.swift | 2 +- .../AppClipExperiencesDelete.swift | 2 +- .../AppClipExperiencesList.swift | 2 +- .../Commands/AppClips/AppClipsList.swift | 2 +- .../AppInfoLocalizationsCommand.swift | 2 +- .../Commands/AppInfos/AppInfosCommand.swift | 2 +- .../AppPreviewSetsCommand.swift | 2 +- .../AppPreviews/AppPreviewsCommand.swift | 2 +- .../Commands/AppShots/AppShotsCommand.swift | 2 +- .../Commands/AppShots/AppShotsConfig.swift | 5 +- .../Commands/AppShots/AppShotsExport.swift | 3 +- .../AppShots/AppShotsGalleryTemplates.swift | 2 +- .../Commands/AppShots/AppShotsGenerate.swift | 3 +- .../Commands/AppShots/AppShotsTemplates.swift | 3 +- .../Commands/AppShots/AppShotsThemes.swift | 2 +- .../Commands/AppShots/AppShotsUtils.swift | 2 +- .../Commands/AppWall/AppWallSubmit.swift | 3 +- .../ASCCommand/Commands/Apps/AppsList.swift | 2 +- .../Commands/Apps/AppsPricePointsList.swift | 2 +- .../Commands/Apps/AppsPricesSet.swift | 2 +- .../ASCCommand/Commands/Apps/AppsUpdate.swift | 2 +- .../Availability/AppAvailabilityCreate.swift | 2 +- .../Availability/AppAvailabilityGet.swift | 2 +- .../AssetLibrary/AssetImagesCommand.swift | 2 +- .../AssetLibrary/AssetLibraryCommand.swift | 2 +- .../AssetLibrary/AssetPlacementsCommand.swift | 2 +- .../AssetLibrary/AssetVideosCommand.swift | 2 +- .../Commands/Auth/AuthCommand.swift | 3 +- .../ASCCommand/Commands/Auth/AuthList.swift | 3 +- .../ASCCommand/Commands/Auth/AuthLogin.swift | 3 +- .../ASCCommand/Commands/Auth/AuthLogout.swift | 3 +- .../ASCCommand/Commands/Auth/AuthUpdate.swift | 3 +- .../ASCCommand/Commands/Auth/AuthUse.swift | 3 +- .../BetaAppLocalizationsCreate.swift | 2 +- .../BetaAppLocalizationsDelete.swift | 2 +- .../BetaAppLocalizationsGet.swift | 2 +- .../BetaAppLocalizationsList.swift | 2 +- .../BetaAppLocalizationsUpdate.swift | 2 +- .../BetaReview/BetaReviewDetailGet.swift | 2 +- .../BetaReview/BetaReviewDetailUpdate.swift | 4 +- .../BetaReviewSubmissionsCreate.swift | 2 +- .../BetaReview/BetaReviewSubmissionsGet.swift | 2 +- .../BetaReviewSubmissionsList.swift | 2 +- .../Commands/Builds/BuildsAddBetaGroup.swift | 2 +- .../Commands/Builds/BuildsArchive.swift | 3 +- .../Commands/Builds/BuildsList.swift | 2 +- .../Commands/Builds/BuildsNextNumber.swift | 2 +- .../Builds/BuildsRemoveBetaGroup.swift | 2 +- .../BuildsSetEncryptionCompliance.swift | 2 +- .../Builds/BuildsUpdateBetaNotes.swift | 2 +- .../Commands/Builds/BuildsUpload.swift | 2 +- .../Commands/Builds/BuildsUploadsDelete.swift | 2 +- .../Commands/Builds/BuildsUploadsGet.swift | 2 +- .../Commands/Builds/BuildsUploadsList.swift | 2 +- .../Commands/BundleIDs/BundleIDsCreate.swift | 2 +- .../Commands/BundleIDs/BundleIDsDelete.swift | 2 +- .../Commands/BundleIDs/BundleIDsList.swift | 2 +- .../Certificates/CertificatesCreate.swift | 2 +- .../Certificates/CertificatesList.swift | 2 +- .../Certificates/CertificatesRevoke.swift | 2 +- .../Commands/Devices/DevicesList.swift | 2 +- .../Commands/Devices/DevicesRegister.swift | 2 +- ...perimentTreatmentLocalizationsCreate.swift | 2 +- ...perimentTreatmentLocalizationsDelete.swift | 2 +- ...ExperimentTreatmentLocalizationsList.swift | 2 +- .../ExperimentTreatmentsCreate.swift | 2 +- .../ExperimentTreatmentsDelete.swift | 2 +- .../ExperimentTreatmentsList.swift | 2 +- .../ExperimentTreatmentsUpdate.swift | 2 +- .../Experiments/ExperimentsCreate.swift | 2 +- .../Experiments/ExperimentsDelete.swift | 2 +- .../Commands/Experiments/ExperimentsGet.swift | 2 +- .../Experiments/ExperimentsList.swift | 2 +- .../Experiments/ExperimentsStart.swift | 2 +- .../Experiments/ExperimentsStop.swift | 2 +- .../Experiments/ExperimentsUpdate.swift | 2 +- .../GameCenter/GameCenterCommand.swift | 2 +- .../GameCenterModerationCommand.swift | 2 +- .../Availability/IAPAvailabilityCreate.swift | 2 +- .../IAP/Availability/IAPAvailabilityGet.swift | 2 +- .../ASCCommand/Commands/IAP/IAPCreate.swift | 2 +- .../ASCCommand/Commands/IAP/IAPDelete.swift | 2 +- Sources/ASCCommand/Commands/IAP/IAPList.swift | 2 +- .../Commands/IAP/IAPPricePointsList.swift | 2 +- .../Commands/IAP/IAPPricesSet.swift | 2 +- .../ASCCommand/Commands/IAP/IAPSubmit.swift | 2 +- .../ASCCommand/Commands/IAP/IAPUnsubmit.swift | 2 +- .../ASCCommand/Commands/IAP/IAPUpdate.swift | 2 +- .../Commands/IAP/IAPVersionsList.swift | 2 +- .../IAPEqualizationsList.swift | 2 +- .../Commands/IAPImages/IAPImagesDelete.swift | 2 +- .../Commands/IAPImages/IAPImagesList.swift | 2 +- .../Commands/IAPImages/IAPImagesUpload.swift | 2 +- .../IAPLocalizationsCreate.swift | 2 +- .../IAPLocalizationsDelete.swift | 2 +- .../IAPLocalizationsList.swift | 2 +- .../IAPLocalizationsUpdate.swift | 2 +- .../IAPOfferCodeCustomCodesCreate.swift | 2 +- .../IAPOfferCodeCustomCodesList.swift | 2 +- .../IAPOfferCodeCustomCodesUpdate.swift | 2 +- .../IAPOfferCodeOneTimeCodesCreate.swift | 2 +- .../IAPOfferCodeOneTimeCodesList.swift | 2 +- .../IAPOfferCodeOneTimeCodesUpdate.swift | 2 +- .../IAPOfferCodeOneTimeCodesValues.swift | 2 +- .../IAPOfferCodes/IAPOfferCodesCreate.swift | 2 +- .../IAPOfferCodes/IAPOfferCodesList.swift | 2 +- .../IAPOfferCodesPricesList.swift | 2 +- .../IAPOfferCodes/IAPOfferCodesUpdate.swift | 2 +- .../IAPPriceScheduleGet.swift | 2 +- .../IAPReviewScreenshotDelete.swift | 2 +- .../IAPReviewScreenshotGet.swift | 2 +- .../IAPReviewScreenshotUpload.swift | 2 +- .../Commands/Init/InitCommand.swift | 3 +- .../Commands/Iris/Auth/IrisAuthLogin.swift | 2 +- .../Commands/Iris/Auth/IrisAuthLogout.swift | 2 +- .../Iris/Auth/IrisAuthVerifyCode.swift | 2 +- .../IrisIAPSubmissionsCreate.swift | 2 +- .../IrisIAPSubmissionsDelete.swift | 2 +- .../Commands/Iris/IrisAppsCreate.swift | 2 +- .../Commands/Iris/IrisAppsList.swift | 2 +- .../ASCCommand/Commands/Iris/IrisStatus.swift | 2 +- .../IrisResolutionCenterGet.swift | 2 +- .../Performance/DiagnosticLogsCommand.swift | 2 +- .../Performance/DiagnosticsCommand.swift | 2 +- .../Performance/PerfMetricsCommand.swift | 2 +- .../Performance/PerfOverviewCommand.swift | 2 +- .../Commands/Plugins/PluginsInstall.swift | 2 +- .../Commands/Plugins/PluginsList.swift | 2 +- .../Commands/Plugins/PluginsMarket.swift | 2 +- .../Commands/Plugins/PluginsUninstall.swift | 2 +- .../Commands/Plugins/PluginsUpdate.swift | 2 +- .../Commands/Plugins/PluginsUpdates.swift | 2 +- .../Commands/Profiles/ProfilesCreate.swift | 2 +- .../Commands/Profiles/ProfilesDelete.swift | 2 +- .../Commands/Profiles/ProfilesList.swift | 2 +- .../PromotedPurchasesCreate.swift | 2 +- .../PromotedPurchasesDelete.swift | 2 +- .../PromotedPurchasesList.swift | 2 +- .../PromotedPurchasesUpdate.swift | 2 +- .../Reports/FinanceReportsDownload.swift | 3 +- .../Reports/SalesReportsDownload.swift | 3 +- .../Reports/SalesReportsSummary.swift | 3 +- .../Reports/VendorNumberResolver.swift | 2 +- .../ReviewSubmissionItemsAdd.swift | 2 +- .../ReviewSubmissionItemsList.swift | 2 +- .../ReviewSubmissionItemsRemove.swift | 2 +- .../ReviewSubmissionsCreate.swift | 2 +- .../ReviewSubmissionsGet.swift | 2 +- .../ReviewSubmissionsList.swift | 2 +- .../ReviewSubmissionsSubmit.swift | 2 +- .../Reviews/ReviewResponsesCreate.swift | 2 +- .../Reviews/ReviewResponsesDelete.swift | 2 +- .../Commands/Reviews/ReviewResponsesGet.swift | 2 +- .../Commands/Reviews/ReviewsGet.swift | 2 +- .../Commands/Reviews/ReviewsList.swift | 2 +- .../ScreenshotSetsCommand.swift | 2 +- .../ScreenshotSets/ScreenshotSetsCreate.swift | 2 +- .../ScreenshotSets/ScreenshotSetsDelete.swift | 2 +- .../Screenshots/ScreenshotImportFiles.swift | 2 +- .../Screenshots/ScreenshotsCommand.swift | 2 +- .../Screenshots/ScreenshotsDelete.swift | 2 +- .../Screenshots/ScreenshotsImport.swift | 2 +- .../Screenshots/ScreenshotsUpload.swift | 2 +- .../Shared/OfferCodePriceParser.swift | 2 +- .../Commands/Simulators/SimulatorsBoot.swift | 2 +- .../Commands/Simulators/SimulatorsList.swift | 2 +- .../Simulators/SimulatorsShutdown.swift | 2 +- .../Commands/Skills/SkillUpdateChecker.swift | 2 +- .../Commands/Skills/SkillsCheck.swift | 2 +- .../Commands/Skills/SkillsInstall.swift | 2 +- .../Commands/Skills/SkillsInstalled.swift | 2 +- .../Commands/Skills/SkillsList.swift | 2 +- .../Commands/Skills/SkillsUninstall.swift | 2 +- .../Commands/Skills/SkillsUpdate.swift | 2 +- .../SubscriptionEqualizationsList.swift | 2 +- ...SubscriptionGroupLocalizationsCreate.swift | 2 +- ...SubscriptionGroupLocalizationsDelete.swift | 2 +- .../SubscriptionGroupLocalizationsList.swift | 2 +- ...SubscriptionGroupLocalizationsUpdate.swift | 2 +- .../SubscriptionGroupVersionsList.swift | 2 +- .../SubscriptionGroupsCreate.swift | 2 +- .../SubscriptionGroupsDelete.swift | 2 +- .../SubscriptionGroupsList.swift | 2 +- .../SubscriptionGroupsUpdate.swift | 2 +- .../SubscriptionImagesDelete.swift | 2 +- .../SubscriptionImagesList.swift | 2 +- .../SubscriptionImagesUpload.swift | 2 +- .../SubscriptionLocalizationsCreate.swift | 2 +- .../SubscriptionLocalizationsDelete.swift | 2 +- .../SubscriptionLocalizationsList.swift | 2 +- .../SubscriptionLocalizationsUpdate.swift | 2 +- ...bscriptionOfferCodeCustomCodesCreate.swift | 2 +- ...SubscriptionOfferCodeCustomCodesList.swift | 2 +- ...bscriptionOfferCodeCustomCodesUpdate.swift | 2 +- ...scriptionOfferCodeOneTimeCodesCreate.swift | 2 +- ...ubscriptionOfferCodeOneTimeCodesList.swift | 2 +- ...scriptionOfferCodeOneTimeCodesUpdate.swift | 2 +- ...scriptionOfferCodeOneTimeCodesValues.swift | 2 +- .../SubscriptionOfferCodesCreate.swift | 2 +- .../SubscriptionOfferCodesList.swift | 2 +- .../SubscriptionOfferCodesPricesList.swift | 2 +- .../SubscriptionOfferCodesUpdate.swift | 2 +- .../SubscriptionOffersCreate.swift | 2 +- .../SubscriptionOffersDelete.swift | 2 +- .../SubscriptionOffersList.swift | 2 +- .../SubscriptionPriceScheduleGet.swift | 2 +- .../SubscriptionPromotionalOffersCreate.swift | 2 +- .../SubscriptionPromotionalOffersDelete.swift | 2 +- .../SubscriptionPromotionalOffersList.swift | 2 +- ...scriptionPromotionalOffersPricesList.swift | 2 +- .../SubscriptionReviewScreenshotDelete.swift | 2 +- .../SubscriptionReviewScreenshotGet.swift | 2 +- .../SubscriptionReviewScreenshotUpload.swift | 2 +- .../SubscriptionAvailabilityCreate.swift | 2 +- .../SubscriptionAvailabilityGet.swift | 2 +- .../SubscriptionPricePointsList.swift | 2 +- .../Subscriptions/SubscriptionPricesSet.swift | 2 +- .../SubscriptionPricesSetBatch.swift | 2 +- .../SubscriptionVersionsList.swift | 2 +- .../Subscriptions/SubscriptionsCreate.swift | 2 +- .../Subscriptions/SubscriptionsDelete.swift | 2 +- .../Subscriptions/SubscriptionsList.swift | 2 +- .../Subscriptions/SubscriptionsSubmit.swift | 2 +- .../Subscriptions/SubscriptionsUnsubmit.swift | 2 +- .../Subscriptions/SubscriptionsUpdate.swift | 2 +- Sources/ASCCommand/Commands/TUI/TUIApp.swift | 3 +- .../Territories/TerritoriesList.swift | 2 +- .../TestFlight/TestFlightCommand.swift | 2 +- .../Users/UserInvitationsCancel.swift | 2 +- .../Users/UserInvitationsInvite.swift | 2 +- .../Commands/Users/UserInvitationsList.swift | 2 +- .../ASCCommand/Commands/Users/UsersList.swift | 2 +- .../Commands/Users/UsersRemove.swift | 2 +- .../Commands/Users/UsersUpdate.swift | 2 +- .../VersionLocalizationsCommand.swift | 2 +- .../VersionLocalizationsCreate.swift | 2 +- .../VersionLocalizationsUpdate.swift | 2 +- .../VersionReviewDetailCommand.swift | 2 +- .../Versions/VersionsCheckReadiness.swift | 2 +- .../Commands/Versions/VersionsCommand.swift | 2 +- .../Commands/Versions/VersionsCreate.swift | 2 +- .../Commands/Versions/VersionsSetBuild.swift | 2 +- .../Commands/Versions/VersionsSubmit.swift | 2 +- .../Commands/Versions/VersionsUpdate.swift | 2 +- .../Web/Controllers/AgeRatingController.swift | 3 +- .../AppAvailabilityController.swift | 3 +- .../Controllers/AppCategoriesController.swift | 3 +- .../Web/Controllers/AppInfosController.swift | 3 +- .../Controllers/AppPricingController.swift | 3 +- .../Web/Controllers/AppShotsController.swift | 3 +- .../Web/Controllers/AppsController.swift | 3 +- .../Controllers/AssetLibraryController.swift | 3 +- .../Web/Controllers/AuthController.swift | 3 +- .../BetaAppLocalizationsController.swift | 3 +- .../Web/Controllers/BuildsController.swift | 3 +- .../Controllers/CodeSigningController.swift | 3 +- .../CustomerReviewsController.swift | 3 +- .../Controllers/DiagnosticsController.swift | 3 +- .../Controllers/ExperimentsController.swift | 3 +- .../Controllers/GameCenterController.swift | 3 +- .../IAPAvailabilityController.swift | 3 +- .../Web/Controllers/IAPController.swift | 3 +- .../IAPEqualizationsController.swift | 3 +- .../IAPLocalizationsController.swift | 3 +- .../IAPOfferCodeOneTimeCodesController.swift | 3 +- .../Controllers/IAPOfferCodesController.swift | 3 +- .../IAPPricePointsController.swift | 3 +- .../IAPPriceScheduleController.swift | 3 +- .../Web/Controllers/IAPPricesController.swift | 3 +- .../Web/Controllers/IAPReviewController.swift | 3 +- .../Controllers/IAPSubmissionController.swift | 3 +- .../IrisIAPSubmissionsController.swift | 3 +- .../IrisResolutionCenterController.swift | 3 +- .../OfferCodePricesController.swift | 3 +- .../Controllers/PerfMetricsController.swift | 3 +- .../Controllers/PerfOverviewController.swift | 3 +- .../Web/Controllers/PluginsController.swift | 3 +- .../ProductVersionsController.swift | 3 +- .../PromotedPurchasesController.swift | 3 +- .../ReviewSubmissionsController.swift | 3 +- .../Web/Controllers/RootController.swift | 3 +- .../ScreenshotImportController.swift | 3 +- .../ScreenshotSetsController.swift | 3 +- .../Controllers/ScreenshotsController.swift | 3 +- .../Controllers/SimulatorsController.swift | 2 +- .../SubscriptionAvailabilityController.swift | 3 +- .../SubscriptionEqualizationsController.swift | 3 +- ...criptionGroupLocalizationsController.swift | 3 +- .../SubscriptionGroupsController.swift | 3 +- ...criptionIntroductoryOffersController.swift | 3 +- .../SubscriptionLocalizationsController.swift | 3 +- ...ptionOfferCodeOneTimeCodesController.swift | 3 +- .../SubscriptionOfferCodesController.swift | 3 +- .../SubscriptionPricePointsController.swift | 3 +- .../SubscriptionPriceScheduleController.swift | 3 +- .../SubscriptionPricesController.swift | 3 +- ...scriptionPromotionalOffersController.swift | 3 +- .../SubscriptionReviewController.swift | 3 +- .../SubscriptionSubmissionController.swift | 3 +- .../Controllers/SubscriptionsController.swift | 3 +- .../Controllers/TerritoriesController.swift | 2 +- .../Controllers/TestFlightController.swift | 3 +- .../VersionLocalizationsController.swift | 3 +- .../VersionSubmissionController.swift | 3 +- .../Web/Controllers/VersionsController.swift | 3 +- .../Controllers/WinBackOffersController.swift | 3 +- .../ASCCommand/Commands/Web/RESTRoutes.swift | 3 +- .../ASCCommand/Commands/Web/WebCommand.swift | 3 +- .../WinBackOffers/WinBackOffersCreate.swift | 2 +- .../WinBackOffers/WinBackOffersDelete.swift | 2 +- .../WinBackOffers/WinBackOffersList.swift | 2 +- .../WinBackOffersPricesList.swift | 2 +- .../WinBackOffers/WinBackOffersUpdate.swift | 2 +- .../XcodeCloud/XcodeCloudCommand.swift | 2 +- Sources/ASCCommand/GlobalOptions.swift | 2 +- Sources/ASCCommand/OutputFormatter.swift | 2 +- .../AppWall/AppWallApp.swift | 0 .../AppWall/AppWallError.swift | 0 .../AppWall/AppWallRepository.swift | 0 .../AppWall/AppWallSubmission.swift | 0 .../Internal}/GitHubAppWallRepository.swift | 1 - .../Apps/App+RESTRoutes.swift | 0 Sources/{Domain => ASCKit}/Apps/App.swift | 0 .../Apps/AppClips/AppClip.swift | 0 .../Apps/AppClips/AppClipRepository.swift | 0 .../AppClipDefaultExperience.swift | 0 ...AppClipDefaultExperienceLocalization.swift | 0 .../Internal}/SDKAppClipRepository.swift | 27 ++-- .../Apps/AppInfos/AgeRatingDeclaration.swift | 0 .../AgeRatingDeclarationRepository.swift | 0 .../Apps/AppInfos/AppCategory.swift | 0 .../Apps/AppInfos/AppInfo+RESTRoutes.swift | 0 .../Apps/AppInfos/AppInfo.swift | 0 .../Apps/AppInfos/AppInfoLocalization.swift | 0 .../Apps/AppInfos/AppInfoRepository.swift | 0 .../SDKAgeRatingDeclarationRepository.swift | 21 ++- .../Internal}/SDKAppCategoryRepository.swift | 9 +- .../Internal}/SDKAppInfoRepository.swift | 19 ++- .../Apps/AppRepository.swift | 0 .../Apps/AssetLibrary/AppAssetLibrary.swift | 0 .../AssetLibrary+RESTRoutes.swift | 0 .../AssetLibrary/AssetLibraryRepository.swift | 0 .../Apps/AssetLibrary/AssetLibraryTypes.swift | 0 .../AssetLibrary/AssetProcessingWait.swift | 0 .../Internal}/SDKLibraryImageRepository.swift | 1 - .../AssetLibrary/Images/LibraryImage.swift | 0 .../Images/LibraryImageRepository.swift | 0 .../Import/ScreenshotImport+RESTRoutes.swift | 0 .../Import/ScreenshotImportGroupResult.swift | 0 .../Import/ScreenshotImportPlan.swift | 0 .../Internal}/AssetLibraryDTOs.swift | 0 .../Internal}/SDKAssetLibraryRepository.swift | 5 +- .../Placements/AssetPlacement.swift | 0 .../Placements/AssetPlacementRepository.swift | 0 .../Internal}/AssetPlacementDTOs.swift | 1 - .../SDKAssetPlacementRepository.swift | 1 - .../RefData/AssetPlacementGroup.swift | 0 .../Internal}/SDKLibraryVideoRepository.swift | 1 - .../AssetLibrary/Videos/LibraryVideo.swift | 0 .../Videos/LibraryVideoRepository.swift | 0 .../Apps/Availability/AppAvailability.swift | 0 .../AppAvailabilityRepository.swift | 0 .../AppTerritoryAvailability.swift | 0 .../SDKAppAvailabilityRepository.swift | 13 +- .../Apps/Builds/BetaBuildLocalization.swift | 0 .../BetaBuildLocalizationRepository.swift | 0 .../Apps/Builds/Build.swift | 0 .../Apps/Builds/BuildRepository.swift | 0 .../Apps/Builds/BuildUpload.swift | 0 .../Apps/Builds/BuildUploadRepository.swift | 0 .../Internal}/OpenAPIBuildRepository.swift | 13 +- .../SDKBetaBuildLocalizationRepository.swift | 9 +- .../Internal}/SDKBuildUploadRepository.swift | 23 ++- .../Apps/Builds/NextBuildNumber.swift | 0 .../Internal}/ProcessXcodeBuildRunner.swift | 1 - .../Builds/XcodeBuild/XcodeBuildRunner.swift | 0 ...AppStoreVersionExperiment+RESTRoutes.swift | 0 .../AppStoreVersionExperiment.swift | 0 .../Experiments/ExperimentRepository.swift | 0 .../Experiments/ExperimentTreatment.swift | 0 .../ExperimentTreatmentLocalization.swift | 0 .../Internal}/SDKExperimentRepository.swift | 41 +++--- .../InAppPurchaseAvailability.swift | 0 .../InAppPurchaseAvailabilityRepository.swift | 0 ...KInAppPurchaseAvailabilityRepository.swift | 15 +- .../InAppPurchase+RESTRoutes.swift | 0 .../Apps/InAppPurchases/InAppPurchase.swift | 0 .../InAppPurchasePricePoint.swift | 0 .../InAppPurchasePriceRepository.swift | 0 .../InAppPurchasePriceSchedule.swift | 0 .../InAppPurchaseRepository.swift | 0 .../InAppPurchaseSubmission.swift | 0 .../InAppPurchaseSubmissionRepository.swift | 0 .../SDKInAppPurchasePriceRepository.swift | 47 +++--- .../SDKInAppPurchaseRepository.swift | 23 ++- ...SDKInAppPurchaseSubmissionRepository.swift | 5 +- .../InAppPurchaseLocalization.swift | 0 .../InAppPurchaseLocalizationRepository.swift | 0 ...KInAppPurchaseLocalizationRepository.swift | 15 +- .../OfferCodes/InAppPurchaseOfferCode.swift | 0 .../InAppPurchaseOfferCodeCustomCode.swift | 0 ...InAppPurchaseOfferCodeOneTimeUseCode.swift | 0 .../InAppPurchaseOfferCodePrice.swift | 0 .../InAppPurchaseOfferCodeRepository.swift | 0 .../SDKInAppPurchaseOfferCodeRepository.swift | 53 ++++--- .../InAppPurchaseReviewRepository.swift | 0 .../InAppPurchaseReviewScreenshot.swift | 0 .../SDKInAppPurchaseReviewRepository.swift | 33 ++--- .../Apps/Internal}/OpenAPIAppRepository.swift | 19 ++- .../Apps/Performance/DiagnosticLogEntry.swift | 0 .../Performance/DiagnosticSignatureInfo.swift | 0 .../Performance/DiagnosticsRepository.swift | 0 .../Internal}/SDKDiagnosticsRepository.swift | 1 - .../Internal}/SDKPerfMetricsRepository.swift | 1 - .../Internal}/SDKPerfOverviewRepository.swift | 7 +- .../Performance/PerfMetricsRepository.swift | 0 .../Performance/PerfOverviewRepository.swift | 0 .../Apps/Performance/PerfPowerMetric.swift | 0 .../Performance/Performance+RESTRoutes.swift | 0 .../Performance/PerformanceOverview.swift | 0 .../Apps/Pricing/AppPricePoint.swift | 0 .../Apps/Pricing/AppPriceSchedule.swift | 0 .../Apps/Pricing/AppPricing+RESTRoutes.swift | 0 .../Internal}/SDKPricingRepository.swift | 9 +- .../Apps/Pricing/PricingRepository.swift | 0 .../SDKProductVersionRepository.swift | 15 +- .../ProductVersion+RESTRoutes.swift | 0 .../Apps/ProductVersions/ProductVersion.swift | 0 .../ProductVersionRepository.swift | 0 .../SDKPromotedPurchaseRepository.swift | 13 +- .../PromotedPurchases/PromotedPurchase.swift | 0 .../PromotedPurchaseRepository.swift | 0 .../Apps/Reviews/CustomerReview.swift | 0 .../Reviews/CustomerReviewRepository.swift | 0 .../Apps/Reviews/CustomerReviewResponse.swift | 0 .../SDKCustomerReviewRepository.swift | 19 ++- ...DKSubscriptionAvailabilityRepository.swift | 15 +- .../SubscriptionAvailability.swift | 0 .../SubscriptionAvailabilityRepository.swift | 0 .../SDKSubscriptionGroupRepository.swift | 11 +- .../SDKSubscriptionPriceRepository.swift | 47 +++--- .../Internal}/SDKSubscriptionRepository.swift | 19 ++- .../SDKSubscriptionSubmissionRepository.swift | 5 +- ...scriptionIntroductoryOfferRepository.swift | 21 ++- .../SubscriptionIntroductoryOffer.swift | 0 ...scriptionIntroductoryOfferRepository.swift | 0 ...scriptionGroupLocalizationRepository.swift | 15 +- ...DKSubscriptionLocalizationRepository.swift | 15 +- .../SubscriptionGroupLocalization.swift | 0 ...scriptionGroupLocalizationRepository.swift | 0 .../SubscriptionLocalization.swift | 0 .../SubscriptionLocalizationRepository.swift | 0 .../SDKSubscriptionOfferCodeRepository.swift | 73 +++++---- .../OfferCodes/SubscriptionOfferCode.swift | 0 .../SubscriptionOfferCodeCustomCode.swift | 0 .../SubscriptionOfferCodeOneTimeUseCode.swift | 0 .../SubscriptionOfferCodePrice.swift | 0 .../SubscriptionOfferCodeRepository.swift | 0 ...bscriptionPromotionalOfferRepository.swift | 29 ++-- .../SubscriptionPromotionalOffer.swift | 0 .../SubscriptionPromotionalOfferPrice.swift | 0 ...bscriptionPromotionalOfferRepository.swift | 0 .../SDKSubscriptionReviewRepository.swift | 33 ++--- .../Review/SubscriptionPromotionalImage.swift | 0 .../Review/SubscriptionReviewRepository.swift | 0 .../Review/SubscriptionReviewScreenshot.swift | 0 .../Subscription+RESTRoutes.swift | 0 .../Apps/Subscriptions/Subscription.swift | 0 .../Subscriptions/SubscriptionGroup.swift | 0 .../SubscriptionGroupRepository.swift | 0 .../Subscriptions/SubscriptionPrice.swift | 0 .../SubscriptionPricePoint.swift | 0 .../SubscriptionPriceRepository.swift | 0 .../SubscriptionPriceSchedule.swift | 0 .../SubscriptionRepository.swift | 0 .../SubscriptionSubmission.swift | 0 .../SubscriptionSubmissionRepository.swift | 0 .../Internal}/SDKWinBackOfferRepository.swift | 47 +++--- .../WinBackOffers/WinBackOffer.swift | 0 .../WinBackOfferRepository.swift | 0 .../Apps/TestFlight/BetaAppLocalization.swift | 0 .../BetaAppLocalizationRepository.swift | 0 .../Apps/TestFlight/BetaAppReviewDetail.swift | 0 .../TestFlight/BetaAppReviewRepository.swift | 0 .../TestFlight/BetaAppReviewSubmission.swift | 0 .../TestFlight/BetaGroup+RESTRoutes.swift | 0 .../Apps/TestFlight/BetaGroup.swift | 0 .../Apps/TestFlight/BetaTester.swift | 0 .../OpenAPITestFlightRepository.swift | 19 ++- .../SDKBetaAppLocalizationRepository.swift | 17 +-- .../SDKBetaAppReviewRepository.swift | 23 ++- .../TestFlight/TestFlightRepository.swift | 0 .../Apps/Versions/AppStoreReviewDetail.swift | 0 .../Versions/AppStoreVersion+RESTRoutes.swift | 0 .../Apps/Versions/AppStoreVersion.swift | 0 .../Apps/Versions/AppStoreVersionState.swift | 0 .../Internal}/SDKReviewDetailRepository.swift | 13 +- .../Internal}/SDKVersionRepository.swift | 25 ++-- .../AppStoreVersionLocalization.swift | 0 .../Internal}/SDKLocalizationRepository.swift | 11 +- .../PreviewSets/AppPreviewSet.swift | 0 .../PreviewSets/AppPreviews/AppPreview.swift | 0 .../Internal}/OpenAPIPreviewRepository.swift | 25 ++-- .../PreviewSets/PreviewRepository.swift | 0 .../PreviewSets/PreviewType.swift | 0 .../ScreenshotSets/AppScreenshotSet.swift | 0 .../OpenAPIScreenshotRepository.swift | 23 ++- .../ScreenshotDisplayType.swift | 0 .../ScreenshotSets/ScreenshotImport.swift | 0 .../ScreenshotSets/ScreenshotRepository.swift | 0 .../Screenshots/AppScreenshot.swift | 0 .../VersionLocalizationRepository.swift | 0 .../Versions/ReviewDetailRepository.swift | 0 .../Apps/Versions/ReviewDetailUpdate.swift | 0 .../Apps/Versions/VersionReadiness.swift | 0 .../Apps/Versions/VersionRepository.swift | 0 .../Auth/AuthCredentials.swift | 0 .../{Domain => ASCKit}/Auth/AuthError.swift | 0 .../Auth/AuthProvider.swift | 0 .../{Domain => ASCKit}/Auth/AuthStatus.swift | 0 .../{Domain => ASCKit}/Auth/AuthStorage.swift | 0 .../Auth/ConnectAccount.swift | 0 .../Auth/CredentialSource.swift | 0 .../Internal}/CompositeAuthProvider.swift | 1 - .../Internal}/EnvironmentAuthProvider.swift | 1 - .../Auth/Internal}/FileAuthProvider.swift | 1 - .../Auth/Internal}/FileAuthStorage.swift | 1 - .../Auth/Iris/IrisAuthCredentials.swift | 0 .../Auth/Iris/IrisAuthError.swift | 0 .../Auth/Iris/IrisAuthRepository.swift | 0 .../Auth/Iris/IrisAuthSession.swift | 0 .../Auth/Iris/IrisAuthSummary.swift | 0 .../Auth/Iris/IrisSessionRepository.swift | 0 .../Auth/Iris/PendingTwoFactorState.swift | 0 .../Auth/Iris/TwoFactorChallenge.swift | 0 .../CodeSigning/BundleIDs/BundleID.swift | 0 .../BundleIDs/BundleIDRepository.swift | 0 .../Certificates/Certificate.swift | 0 .../Certificates/CertificateRepository.swift | 0 .../CodeSigning/CodeSigning+RESTRoutes.swift | 0 .../CodeSigning/Devices/Device.swift | 0 .../Devices/DeviceRepository.swift | 0 .../Internal}/SDKBundleIDRepository.swift | 11 +- .../Internal}/SDKCertificateRepository.swift | 13 +- .../Internal}/SDKDeviceRepository.swift | 15 +- .../Internal}/SDKProfileRepository.swift | 15 +- .../CodeSigning/Profiles/Profile.swift | 0 .../Profiles/ProfileRepository.swift | 0 .../GameCenter/GameCenter+RESTRoutes.swift | 0 .../GameCenter/GameCenterAchievement.swift | 0 .../GameCenter/GameCenterDetail.swift | 0 .../GameCenter/GameCenterLeaderboard.swift | 0 .../GameCenter/GameCenterRepository.swift | 0 .../Internal}/SDKGameCenterRepository.swift | 35 +++-- .../GameCenterModerationRepository.swift | 0 .../Moderation/GameCenterPlayer.swift | 0 .../GameCenterScoreModeration.swift | 0 .../SDKGameCenterModerationRepository.swift | 17 +-- .../Iris/AppBundles/AppBundle.swift | 0 .../Internal}/IrisCreateAppDocument.swift | 0 .../IrisSDKAppBundleRepository.swift | 1 - .../AppBundles/IrisAppBundleRepository.swift | 0 .../IrisSDKInAppPurchaseStateRepository.swift | 1 - ...SDKInAppPurchaseSubmissionRepository.swift | 1 - .../IrisInAppPurchaseStateRepository.swift | 0 .../IrisInAppPurchaseSubmission.swift | 0 ...risInAppPurchaseSubmissionRepository.swift | 0 .../Auth/CompositeIrisCookieProvider.swift | 1 - .../Auth/FileIrisSessionRepository.swift | 1 - .../Iris/Internal}/Auth/IdmsaAPIClient.swift | 1 - .../Auth/IrisAuthSDKRepository.swift | 3 +- .../Iris/Internal}/Auth/OlympusClient.swift | 0 .../Internal}/Auth/SRP/AppleHashcash.swift | 0 .../Internal}/Auth/SRP/AppleSRPClient.swift | 0 .../Auth/StoredSRPIrisCookieProvider.swift | 1 - .../Internal}/BrowserIrisCookieProvider.swift | 1 - .../Iris/Internal}/IrisClient.swift | 1 - .../Iris/IrisCookieProvider.swift | 0 .../{Domain => ASCKit}/Iris/IrisSession.swift | 0 .../{Domain => ASCKit}/Iris/IrisStatus.swift | 0 .../IrisSDKResolutionCenterRepository.swift | 15 +- .../IrisResolutionCenterRepository.swift | 0 .../ResolutionCenterAttachment.swift | 0 .../ResolutionCenterDetail+RESTRoutes.swift | 0 .../ResolutionCenterDetail.swift | 0 .../ResolutionCenterMessage.swift | 0 .../ReviewRejectionReason.swift | 0 .../Internal}/GitHubPluginSource.swift | 1 - .../Internal}/PluginMarketRepository.swift | 1 - .../{Domain => ASCKit}/Plugins/Plugin.swift | 0 .../Plugins/PluginRepository.swift | 0 .../Plugins/PluginSource.swift | 0 .../Plugins/PluginUpdate.swift | 0 .../Internal}/FileProjectConfigStorage.swift | 1 - .../Projects/ProjectConfig.swift | 0 .../Projects/ProjectConfigStorage.swift | 0 .../Reports/Analytics/AnalyticsFilter.swift | 0 .../Reports/Analytics/AnalyticsReport.swift | 0 .../Analytics/AnalyticsReportInstance.swift | 0 .../Analytics/AnalyticsReportRepository.swift | 0 .../Analytics/AnalyticsReportRequest.swift | 0 .../Analytics/AnalyticsReportSegment.swift | 0 .../SDKAnalyticsReportRepository.swift | 33 ++--- .../Reports/FinanceReportFilter.swift | 0 .../Internal}/SDKReportRepository.swift | 1 - .../Reports/Internal}/TSVParser.swift | 0 .../Reports/ReportRepository.swift | 0 .../Reports/SalesReportFilter.swift | 0 .../Screenshots/AppShotTemplate.swift | 0 .../Screenshots/AppShotsConfig.swift | 0 .../Screenshots/AppShotsConfigStorage.swift | 0 .../Screenshots/Gallery/AppShot.swift | 0 .../Screenshots/Gallery/Gallery.swift | 0 .../Gallery/GalleryHTMLRenderer.swift | 0 .../Screenshots/Gallery/GalleryPalette.swift | 0 .../Screenshots/Gallery/GalleryTemplate.swift | 0 .../Gallery/GalleryTemplateRepository.swift | 0 .../Screenshots/Gallery/HTMLComposer.swift | 0 .../Gallery/Resources/keyframes.mustache | 0 .../Gallery/Resources/page-wrapper.mustache | 0 .../Gallery/Resources/preview-page.mustache | 0 .../Gallery/Resources/preview-screen.mustache | 0 .../Gallery/Resources/screen.mustache | 0 .../Gallery/Resources/theme-vars.mustache | 0 .../Gallery/Resources/wireframe.mustache | 0 .../Screenshots/Gallery/ScreenLayout.swift | 0 .../Screenshots/HTMLRenderer.swift | 0 .../AggregateGalleryTemplateRepository.swift | 1 - .../AggregateTemplateRepository.swift | 1 - .../Internal}/AggregateThemeRepository.swift | 1 - .../Internal}/FileAppShotsConfigStorage.swift | 1 - .../Internal}/WebKitHTMLRenderer.swift | 1 - .../Screenshots/ScreenTheme.swift | 0 .../ScreenshotPlans+RESTRoutes.swift | 0 .../Screenshots/TemplateRepository.swift | 0 .../Screenshots/ThemeDesign.swift | 0 .../Screenshots/ThemeDesignApplier.swift | 0 .../Screenshots/ThemedPage.swift | 0 .../{Domain => ASCKit}/Shared/APIError.swift | 0 .../{Domain => ASCKit}/Shared/APIRoot.swift | 0 .../Shared/Affordance.swift | 0 .../Shared/AffordanceProviding.swift | 0 .../Shared/AffordanceRegistry.swift | 0 .../Shared/ImageAsset.swift | 0 .../Shared/Internal}/APIClient.swift | 0 .../Shared/Internal}/ClientFactory.swift | 1 - .../Shared/Internal}/DataExtensions.swift | 0 .../Shared/Internal}/HTTPPerforming.swift | 0 .../Shared/Internal}/SDKFilter.swift | 0 .../Internal}/UploadOperationsExecutor.swift | 1 - .../Shared/OfferCodeEnvironment.swift | 0 .../Shared/OfferCodePriceInput.swift | 0 .../Shared/OutputFormat.swift | 0 .../Shared/PaginatedResponse.swift | 0 .../Shared/Presentable.swift | 0 .../Shared/RESTPathResolver.swift | 0 .../Internal}/SimctlSimulatorRepository.swift | 1 - .../Simulators/Simulator.swift | 0 .../Simulators/SimulatorRepository.swift | 0 .../Simulators/SimulatorState.swift | 0 .../Internal}/FileSkillConfigStorage.swift | 1 - .../Internal}/ProcessSkillRepository.swift | 1 - .../Skills/Internal}/ShellRunner.swift | 0 Sources/{Domain => ASCKit}/Skills/Skill.swift | 0 .../Skills/SkillCheckResult.swift | 0 .../Skills/SkillConfig.swift | 0 .../Skills/SkillConfigStorage.swift | 0 .../Skills/SkillRepository.swift | 0 .../OpenAPISubmissionRepository.swift | 49 +++--- .../Submissions/ReviewItemTarget.swift | 0 .../ReviewSubmission+RESTRoutes.swift | 0 .../Submissions/ReviewSubmission.swift | 0 .../Submissions/ReviewSubmissionError.swift | 0 .../Submissions/ReviewSubmissionItem.swift | 0 .../ReviewSubmissionItemState.swift | 0 .../Submissions/ReviewSubmissionState.swift | 0 .../Submissions/SubmissionPlan.swift | 0 .../Submissions/SubmissionRepository.swift | 0 .../Internal}/SDKTerritoryRepository.swift | 5 +- .../Territories/Territory.swift | 0 .../Territories/TerritoryRepository.swift | 0 .../Users/Internal}/SDKUserRepository.swift | 23 ++- .../{Domain => ASCKit}/Users/TeamMember.swift | 0 .../Users/UserInvitationRecord.swift | 0 .../Users/UserRepository.swift | 0 .../{Domain => ASCKit}/Users/UserRole.swift | 0 .../Web/ASCWebServer.swift | 1 - .../Web/CORSMiddleware.swift | 0 .../Web/SelfSignedCert.swift | 0 .../SDKXcodeCloudBuildRunRepository.swift | 1 - .../SDKXcodeCloudProductRepository.swift | 1 - .../SDKXcodeCloudWorkflowRepository.swift | 1 - .../XcodeCloud/XcodeCloud+RESTRoutes.swift | 0 .../XcodeCloud/XcodeCloudBuildRun.swift | 0 .../XcodeCloudBuildRunRepository.swift | 0 .../XcodeCloud/XcodeCloudProduct.swift | 0 .../XcodeCloudProductRepository.swift | 0 .../XcodeCloud/XcodeCloudWorkflow.swift | 0 .../XcodeCloudWorkflowRepository.swift | 0 .../AgeRating/AgeRatingGetTests.swift | 2 +- .../AgeRating/AgeRatingUpdateTests.swift | 2 +- .../AnalyticsReportsTests.swift | 2 +- .../AppCategoriesListTests.swift | 2 +- .../AppClipExperienceLocalizationsTests.swift | 2 +- .../AppClipExperiencesTests.swift | 2 +- .../Commands/AppClips/AppClipsListTests.swift | 2 +- .../AppInfoLocalizationsCreateTests.swift | 2 +- .../AppInfoLocalizationsDeleteTests.swift | 2 +- .../AppInfoLocalizationsListTests.swift | 2 +- .../AppInfoLocalizationsUpdateTests.swift | 2 +- .../Commands/AppInfos/AppInfosListTests.swift | 2 +- .../AppInfos/AppInfosUpdateTests.swift | 2 +- .../AppPreviewSetsCommandTests.swift | 2 +- .../AppPreviews/AppPreviewsCommandTests.swift | 2 +- .../AppShots/AppShotsConfigTests.swift | 6 +- .../AppShots/AppShotsExportTests.swift | 2 +- .../AppShotsGalleryTemplatesTests.swift | 2 +- .../AppShots/AppShotsGenerateTests.swift | 2 +- .../AppShots/AppShotsTemplatesTests.swift | 2 +- .../AppShots/AppShotsThemesTests.swift | 2 +- .../Commands/AppWall/AppWallSubmitTests.swift | 2 +- .../Apps/AppPricingCommandsTests.swift | 2 +- .../Commands/Apps/AppsListTests.swift | 2 +- .../Commands/Apps/AppsUpdateTests.swift | 2 +- .../AppAvailabilityCreateTests.swift | 2 +- .../AppAvailabilityGetTests.swift | 2 +- .../AssetImagesCommandTests.swift | 2 +- .../AssetLibraryCommandTests.swift | 2 +- .../AssetPlacementsCommandTests.swift | 2 +- .../AssetVideosCommandTests.swift | 2 +- .../Commands/Auth/AuthCheckTests.swift | 2 +- .../Commands/Auth/AuthListTests.swift | 2 +- .../Commands/Auth/AuthLoginTests.swift | 2 +- .../Commands/Auth/AuthLogoutTests.swift | 2 +- .../Commands/Auth/AuthUpdateTests.swift | 2 +- .../Commands/Auth/AuthUseTests.swift | 2 +- .../BetaAppLocalizationsCreateTests.swift | 2 +- .../BetaAppLocalizationsDeleteTests.swift | 2 +- .../BetaAppLocalizationsGetTests.swift | 2 +- .../BetaAppLocalizationsListTests.swift | 2 +- .../BetaAppLocalizationsUpdateTests.swift | 2 +- .../BetaReview/BetaReviewDetailGetTests.swift | 2 +- .../BetaReviewDetailUpdateTests.swift | 2 +- .../BetaReviewSubmissionsCreateTests.swift | 2 +- .../BetaReviewSubmissionsGetTests.swift | 2 +- .../BetaReviewSubmissionsListTests.swift | 2 +- .../Builds/BuildsAddBetaGroupTests.swift | 2 +- .../Commands/Builds/BuildsArchiveTests.swift | 2 +- .../Commands/Builds/BuildsListTests.swift | 2 +- .../Builds/BuildsNextNumberTests.swift | 2 +- .../Builds/BuildsRemoveBetaGroupTests.swift | 2 +- .../BuildsSetEncryptionComplianceTests.swift | 2 +- .../Builds/BuildsUpdateBetaNotesTests.swift | 2 +- .../Commands/Builds/BuildsUploadTests.swift | 2 +- .../Builds/BuildsUploadsDeleteTests.swift | 2 +- .../Builds/BuildsUploadsGetTests.swift | 2 +- .../Builds/BuildsUploadsListTests.swift | 2 +- .../BundleIDs/BundleIDsCreateTests.swift | 2 +- .../BundleIDs/BundleIDsDeleteTests.swift | 2 +- .../BundleIDs/BundleIDsListTests.swift | 2 +- .../CertificatesCreateTests.swift | 2 +- .../Certificates/CertificatesListTests.swift | 2 +- .../CertificatesRevokeTests.swift | 2 +- .../Commands/Devices/DevicesListTests.swift | 2 +- .../Devices/DevicesRegisterTests.swift | 2 +- ...xperimentTreatmentLocalizationsTests.swift | 2 +- .../ExperimentTreatmentsTests.swift | 2 +- .../Experiments/ExperimentsTests.swift | 2 +- .../GameCenter/GameCenterCommandTests.swift | 2 +- .../GameCenterModerationCommandTests.swift | 2 +- .../IAPAvailabilityCreateTests.swift | 2 +- .../IAPAvailabilityGetTests.swift | 2 +- .../Commands/IAP/IAPCreateTests.swift | 2 +- .../Commands/IAP/IAPDeleteTests.swift | 2 +- .../Commands/IAP/IAPListTests.swift | 2 +- .../IAP/IAPPricePointsListTests.swift | 2 +- .../Commands/IAP/IAPPricesSetTests.swift | 2 +- .../Commands/IAP/IAPSubmitTests.swift | 2 +- .../Commands/IAP/IAPUnsubmitTests.swift | 2 +- .../Commands/IAP/IAPUpdateTests.swift | 2 +- .../Commands/IAP/IAPVersionsListTests.swift | 2 +- .../IAPLocalizationsCreateTests.swift | 2 +- .../IAPLocalizationsDeleteTests.swift | 2 +- .../IAPLocalizationsListTests.swift | 2 +- .../IAPLocalizationsUpdateTests.swift | 2 +- .../IAPOfferCodeCustomCodesCreateTests.swift | 2 +- .../IAPOfferCodeCustomCodesListTests.swift | 2 +- .../IAPOfferCodeCustomCodesUpdateTests.swift | 2 +- .../IAPOfferCodeOneTimeCodesCreateTests.swift | 2 +- .../IAPOfferCodeOneTimeCodesListTests.swift | 2 +- .../IAPOfferCodeOneTimeCodesUpdateTests.swift | 2 +- .../IAPOfferCodeOneTimeCodesValuesTests.swift | 2 +- .../IAPOfferCodesCreateTests.swift | 2 +- .../IAPOfferCodesListTests.swift | 2 +- .../IAPOfferCodesPricesListTests.swift | 2 +- .../IAPOfferCodesUpdateTests.swift | 2 +- .../IAPReviewScreenshotTests.swift | 2 +- .../Commands/Init/InitCommandTests.swift | 2 +- .../IrisIAPSubmissionsCreateTests.swift | 2 +- .../IrisIAPSubmissionsDeleteTests.swift | 2 +- .../Commands/Iris/IrisAppsCreateTests.swift | 2 +- .../Commands/Iris/IrisAppsListTests.swift | 2 +- .../Commands/Iris/IrisStatusTests.swift | 6 +- .../IrisResolutionCenterGetTests.swift | 2 +- .../Performance/DiagnosticLogsListTests.swift | 2 +- .../Performance/DiagnosticsListTests.swift | 2 +- .../Performance/PerfMetricsListTests.swift | 2 +- .../Performance/PerfOverviewGetTests.swift | 2 +- .../Commands/Plugins/PluginsListTests.swift | 2 +- .../Commands/Plugins/PluginsMarketTests.swift | 2 +- .../Commands/Plugins/PluginsUpdateTests.swift | 2 +- .../Plugins/PluginsUpdatesTests.swift | 2 +- .../Profiles/ProfilesCreateTests.swift | 2 +- .../Profiles/ProfilesDeleteTests.swift | 2 +- .../Commands/Profiles/ProfilesListTests.swift | 2 +- .../PromotedPurchasesTests.swift | 2 +- .../Reports/FinanceReportsDownloadTests.swift | 2 +- .../Reports/SalesReportsDownloadTests.swift | 2 +- .../Reports/SalesReportsSummaryTests.swift | 2 +- .../ReviewSubmissionItemsListTests.swift | 2 +- .../ReviewSubmissionsBuildTests.swift | 2 +- .../ReviewSubmissionsGetTests.swift | 2 +- .../ReviewSubmissionsListTests.swift | 2 +- .../Reviews/ReviewResponsesCreateTests.swift | 2 +- .../Reviews/ReviewResponsesDeleteTests.swift | 2 +- .../Reviews/ReviewResponsesGetTests.swift | 2 +- .../Commands/Reviews/ReviewsGetTests.swift | 2 +- .../Commands/Reviews/ReviewsListTests.swift | 2 +- .../ScreenshotSetsCreateTests.swift | 2 +- .../ScreenshotSetsDeleteTests.swift | 2 +- .../ScreenshotSetsListTests.swift | 2 +- .../ScreenshotImportFilesTests.swift | 2 +- .../Screenshots/ScreenshotsDeleteTests.swift | 2 +- .../Screenshots/ScreenshotsImportTests.swift | 2 +- .../ScreenshotsImportToLibraryTests.swift | 2 +- .../Screenshots/ScreenshotsListTests.swift | 2 +- .../Screenshots/ScreenshotsUploadTests.swift | 2 +- .../Simulators/SimulatorsBootTests.swift | 2 +- .../Simulators/SimulatorsListTests.swift | 2 +- .../Simulators/SimulatorsShutdownTests.swift | 2 +- .../Skills/SkillUpdateCheckerTests.swift | 2 +- .../Commands/Skills/SkillsCheckTests.swift | 2 +- .../Commands/Skills/SkillsInstallTests.swift | 2 +- .../Skills/SkillsInstalledTests.swift | 2 +- .../Commands/Skills/SkillsListTests.swift | 2 +- .../Skills/SkillsUninstallTests.swift | 2 +- .../Commands/Skills/SkillsUpdateTests.swift | 2 +- .../SubscriptionGroupLocalizationsTests.swift | 2 +- .../SubscriptionGroupVersionsListTests.swift | 2 +- .../SubscriptionGroupsCreateTests.swift | 2 +- .../SubscriptionGroupsDeleteTests.swift | 2 +- .../SubscriptionGroupsListTests.swift | 2 +- .../SubscriptionGroupsUpdateTests.swift | 2 +- ...SubscriptionLocalizationsCreateTests.swift | 2 +- ...SubscriptionLocalizationsDeleteTests.swift | 2 +- .../SubscriptionLocalizationsListTests.swift | 2 +- ...SubscriptionLocalizationsUpdateTests.swift | 2 +- ...ptionOfferCodeCustomCodesCreateTests.swift | 2 +- ...riptionOfferCodeCustomCodesListTests.swift | 2 +- ...ptionOfferCodeCustomCodesUpdateTests.swift | 2 +- ...tionOfferCodeOneTimeCodesCreateTests.swift | 2 +- ...iptionOfferCodeOneTimeCodesListTests.swift | 2 +- ...tionOfferCodeOneTimeCodesUpdateTests.swift | 2 +- ...tionOfferCodeOneTimeCodesValuesTests.swift | 2 +- .../SubscriptionOfferCodesCreateTests.swift | 2 +- .../SubscriptionOfferCodesListTests.swift | 2 +- ...ubscriptionOfferCodesPricesListTests.swift | 2 +- .../SubscriptionOfferCodesUpdateTests.swift | 2 +- .../SubscriptionOffersCreateTests.swift | 2 +- .../SubscriptionOffersDeleteTests.swift | 2 +- .../SubscriptionOffersListTests.swift | 2 +- .../SubscriptionPromotionalOffersTests.swift | 2 +- .../SubscriptionReviewScreenshotTests.swift | 2 +- .../SubscriptionAvailabilityCreateTests.swift | 2 +- .../SubscriptionAvailabilityGetTests.swift | 2 +- .../SubscriptionPricePointsListTests.swift | 2 +- .../SubscriptionPricesSetTests.swift | 2 +- .../SubscriptionVersionsListTests.swift | 2 +- .../SubscriptionsCreateTests.swift | 2 +- .../SubscriptionsDeleteTests.swift | 2 +- .../SubscriptionsListTests.swift | 2 +- .../SubscriptionsSubmitTests.swift | 2 +- .../SubscriptionsUnsubmitTests.swift | 2 +- .../SubscriptionsUpdateTests.swift | 2 +- .../Territories/TerritoriesListTests.swift | 2 +- .../TestFlight/TestFlightCommandTests.swift | 2 +- .../Users/UserInvitationsCancelTests.swift | 2 +- .../Users/UserInvitationsInviteTests.swift | 2 +- .../Users/UserInvitationsListTests.swift | 2 +- .../Commands/Users/UsersListTests.swift | 2 +- .../Commands/Users/UsersRemoveTests.swift | 2 +- .../Commands/Users/UsersUpdateTests.swift | 2 +- .../VersionLocalizationsCreateTests.swift | 2 +- .../VersionLocalizationsListTests.swift | 2 +- .../VersionLocalizationsUpdateTests.swift | 2 +- .../VersionReviewDetailTests.swift | 2 +- .../VersionsCheckReadinessTests.swift | 2 +- .../Versions/VersionsCreateTests.swift | 2 +- .../Commands/Versions/VersionsListTests.swift | 2 +- .../Versions/VersionsSetBuildTests.swift | 2 +- .../Versions/VersionsSubmitTests.swift | 2 +- .../Versions/VersionsUpdateTests.swift | 2 +- .../Web/AppShotsControllerTests.swift | 2 +- .../Commands/Web/AppsControllerTests.swift | 2 +- .../Web/AssetLibraryControllerTests.swift | 2 +- .../Controllers/AgeRatingRoutesTests.swift | 3 +- .../Web/Controllers/AuthRoutesTests.swift | 3 +- ...ustomProductPagePlacementRoutesTests.swift | 3 +- .../ScreenshotDeleteRoutesTests.swift | 3 +- .../Web/GameCenterControllerTests.swift | 2 +- .../Commands/Web/RESTRoutesTests.swift | 2 +- .../Web/SubscriptionsControllerTests.swift | 2 +- .../WinBackOffers/WinBackOffersTests.swift | 2 +- .../XcodeCloud/XcodeCloudCommandTests.swift | 2 +- .../OutputFormatterTests.swift | 2 +- .../AppWall/AppWallEntryTests.swift | 2 +- .../AppWall/AppWallErrorTests.swift | 2 +- .../GitHubAppWallRepositoryTests.swift | 3 +- .../Apps/AffordancesTests.swift | 2 +- .../Apps/AppClips/AppClipTests.swift | 2 +- .../Internal}/SDKAppClipRepositoryTests.swift | 3 +- .../Apps/AppIconTests.swift | 2 +- .../AppInfos/AgeRatingDeclarationTests.swift | 2 +- .../Apps/AppInfos/AppCategoryTests.swift | 2 +- .../AppInfos/AppInfoLocalizationTests.swift | 2 +- .../Apps/AppInfos/AppInfoTests.swift | 2 +- ...KAgeRatingDeclarationRepositoryTests.swift | 7 +- .../SDKAppCategoryRepositoryTests.swift | 3 +- .../Internal}/SDKAppInfoRepositoryTests.swift | 3 +- .../Apps/AppRepositoryTests.swift | 2 +- .../Apps/AppTests.swift | 2 +- .../AssetLibrary/AppAssetLibraryTests.swift | 2 +- .../SDKLibraryImageRepositoryTests.swift | 3 +- .../Images/LibraryAssetStateTests.swift | 2 +- .../Images/LibraryImageTests.swift | 2 +- .../Import/ScreenshotImportExecuteTests.swift | 2 +- .../ScreenshotImportGroupResultTests.swift | 2 +- .../Import/ScreenshotImportPlanTests.swift | 2 +- .../SDKAssetLibraryRepositoryTests.swift | 5 +- .../Placements/AssetPlacementTests.swift | 2 +- .../SDKAssetPlacementRepositoryTests.swift | 3 +- .../RefData/AssetPlacementGroupTests.swift | 2 +- .../SDKLibraryVideoRepositoryTests.swift | 3 +- .../Videos/LibraryVideoTests.swift | 2 +- .../Availability/AppAvailabilityTests.swift | 2 +- .../AppTerritoryAvailabilityTests.swift | 2 +- .../SDKAppAvailabilityRepositoryTests.swift | 3 +- .../Builds/BetaBuildLocalizationTests.swift | 2 +- .../Apps/Builds/BuildTests.swift | 2 +- .../Apps/Builds/BuildUploadTests.swift | 2 +- ...BetaBuildLocalizationRepositoryTests.swift | 3 +- .../Internal}/SDKBuildRepositoryTests.swift | 5 +- .../SDKBuildUploadRepositoryTests.swift | 3 +- .../SDKBuildUploadRepositoryUploadTests.swift | 3 +- .../Apps/Builds/NextBuildNumberTests.swift | 2 +- .../XcodeBuild/ArchiveExportTests.swift | 2 +- .../ProcessXcodeBuildRunnerTests.swift | 3 +- .../AppStoreVersionExperimentTests.swift | 2 +- ...ExperimentTreatmentLocalizationTests.swift | 2 +- .../ExperimentTreatmentTests.swift | 2 +- .../SDKExperimentRepositoryTests.swift | 3 +- .../InAppPurchaseAvailabilityTests.swift | 2 +- ...pPurchaseAvailabilityRepositoryTests.swift | 3 +- .../InAppPurchasePricePointTests.swift | 2 +- .../InAppPurchasePriceScheduleTests.swift | 2 +- .../InAppPurchaseSubmissionTests.swift | 2 +- .../InAppPurchases/InAppPurchaseTests.swift | 2 +- ...pPurchaseLocalizationRepositoryTests.swift | 3 +- ...SDKInAppPurchasePriceRepositoryTests.swift | 7 +- .../SDKInAppPurchaseRepositoryTests.swift | 3 +- ...AppPurchaseSubmissionRepositoryTests.swift | 3 +- ...nAppPurchaseOfferCodeCustomCodeTests.swift | 2 +- ...PurchaseOfferCodeOneTimeUseCodeTests.swift | 2 +- .../InAppPurchaseOfferCodePriceTests.swift | 2 +- .../InAppPurchaseOfferCodeTests.swift | 2 +- ...nAppPurchaseOfferCodeRepositoryTests.swift | 3 +- .../InAppPurchaseReviewCodableTests.swift | 2 +- .../InAppPurchaseReviewScreenshotTests.swift | 2 +- ...DKInAppPurchaseReviewRepositoryTests.swift | 3 +- .../Internal}/SDKAppRepositoryTests.swift | 3 +- .../Performance/DiagnosticLogEntryTests.swift | 2 +- .../DiagnosticSignatureInfoTests.swift | 2 +- .../SDKDiagnosticsRepositoryTests.swift | 3 +- .../SDKPerfMetricsRepositoryTests.swift | 3 +- .../SDKPerfOverviewRepositoryTests.swift | 3 +- .../Performance/PerfPowerMetricTests.swift | 2 +- .../PerformanceOverviewTests.swift | 2 +- .../Apps/Pricing/AppPricingTests.swift | 2 +- .../Internal}/SDKPricingRepositoryTests.swift | 7 +- .../SDKProductVersionRepositoryTests.swift | 3 +- .../ProductVersions/ProductVersionTests.swift | 2 +- .../SDKPromotedPurchaseRepositoryTests.swift | 3 +- .../PromotedPurchaseCodableTests.swift | 2 +- .../PromotedPurchaseTests.swift | 2 +- .../Reviews/CustomerReviewResponseTests.swift | 2 +- .../Apps/Reviews/CustomerReviewTests.swift | 2 +- .../SDKCustomerReviewRepositoryTests.swift | 3 +- ...scriptionAvailabilityRepositoryTests.swift | 3 +- .../SubscriptionAvailabilityTests.swift | 2 +- ...tionGroupLocalizationRepositoryTests.swift | 3 +- .../SDKSubscriptionGroupRepositoryTests.swift | 3 +- ...scriptionLocalizationRepositoryTests.swift | 3 +- .../SDKSubscriptionPriceRepositoryTests.swift | 7 +- ...ptionPromotionalOfferRepositoryTests.swift | 3 +- .../SDKSubscriptionRepositoryTests.swift | 3 +- ...ubscriptionSubmissionRepositoryTests.swift | 3 +- .../SDKWinBackOfferRepositoryTests.swift | 3 +- ...tionIntroductoryOfferRepositoryTests.swift | 3 +- .../SubscriptionIntroductoryOfferTests.swift | 2 +- ...SubscriptionOfferCodeRepositoryTests.swift | 3 +- ...SubscriptionOfferCodeCustomCodeTests.swift | 2 +- ...criptionOfferCodeOneTimeUseCodeTests.swift | 2 +- .../SubscriptionOfferCodePriceTests.swift | 2 +- .../SubscriptionOfferCodeTests.swift | 2 +- ...SDKSubscriptionReviewRepositoryTests.swift | 3 +- ...scriptionReviewRepositoryUploadTests.swift | 3 +- .../SubscriptionPromotionalImageTests.swift | 2 +- .../SubscriptionReviewCodableTests.swift | 2 +- .../SubscriptionReviewScreenshotTests.swift | 2 +- ...riptionGroupLocalizationCodableTests.swift | 2 +- .../SubscriptionGroupLocalizationTests.swift | 2 +- .../SubscriptionPriceCodableTests.swift | 2 +- .../SubscriptionPricePointTests.swift | 2 +- .../SubscriptionPriceScheduleTests.swift | 2 +- ...criptionPromotionalOfferCodableTests.swift | 2 +- .../SubscriptionPromotionalOfferTests.swift | 2 +- .../SubscriptionSubmissionTests.swift | 2 +- .../Subscriptions/SubscriptionTests.swift | 2 +- .../WinBackOfferCodableTests.swift | 2 +- .../Subscriptions/WinBackOfferTests.swift | 2 +- .../TestFlight/BetaAppLocalizationTests.swift | 2 +- .../TestFlight/BetaAppReviewDetailTests.swift | 2 +- .../BetaAppReviewSubmissionTests.swift | 2 +- .../Apps/TestFlight/BetaGroupTests.swift | 2 +- .../Apps/TestFlight/BetaTesterTests.swift | 2 +- ...DKBetaAppLocalizationRepositoryTests.swift | 3 +- .../SDKBetaAppReviewRepositoryTests.swift | 3 +- .../SDKTestFlightRepositoryTests.swift | 5 +- .../Versions/AppStoreReviewDetailTests.swift | 2 +- .../Versions/AppStoreVersionStateTests.swift | 2 +- .../Apps/Versions/AppStoreVersionTests.swift | 2 +- .../SDKReviewDetailRepositoryTests.swift | 7 +- .../SDKVersionRepositoryCreateTests.swift | 3 +- .../Internal}/SDKVersionRepositoryTests.swift | 3 +- .../AppStoreVersionLocalizationTests.swift | 2 +- .../SDKLocalizationRepositoryTests.swift | 3 +- .../PreviewSets/AppPreviewSetTests.swift | 2 +- .../AppPreviews/AppPreviewTests.swift | 2 +- .../OpenAPIPreviewRepositoryTests.swift | 3 +- .../OpenAPIPreviewRepositoryUploadTests.swift | 3 +- .../AppScreenshotSetTests.swift | 2 +- .../SDKScreenshotRepositoryCreateTests.swift | 3 +- .../SDKScreenshotRepositoryTests.swift | 3 +- .../SDKScreenshotRepositoryUploadTests.swift | 3 +- .../ScreenshotDisplayTypeTests.swift | 2 +- .../ScreenshotRepositoryTests.swift | 2 +- .../Screenshots/AppScreenshotTests.swift | 2 +- .../VersionLocalizationRepositoryTests.swift | 2 +- .../Apps/Versions/VersionReadinessTests.swift | 2 +- .../Versions/VersionRepositoryTests.swift | 2 +- .../Auth/AccountEntryTests.swift | 2 +- .../Auth/AuthCredentialsTests.swift | 2 +- .../Auth/AuthStatusTests.swift | 2 +- .../CompositeAuthProviderTests.swift | 3 +- .../EnvironmentAuthProviderTests.swift | 3 +- .../Internal}/FileAuthProviderTests.swift | 3 +- .../FileAuthStorageMultiAccountTests.swift | 3 +- .../Auth/Internal}/FileAuthStorageTests.swift | 3 +- .../Auth/Iris/IrisAuthSummaryTests.swift | 2 +- .../Auth/Iris/IrisAuthTypesTests.swift | 2 +- .../CodeSigning/BundleIDTests.swift | 2 +- .../CodeSigning/CertificateTests.swift | 2 +- .../CodeSigning/DeviceTests.swift | 2 +- .../SDKBundleIDRepositoryTests.swift | 3 +- .../SDKCertificateRepositoryTests.swift | 3 +- .../Internal}/SDKDeviceRepositoryTests.swift | 3 +- .../Internal}/SDKProfileRepositoryTests.swift | 3 +- .../CodeSigning/ProfileTests.swift | 2 +- .../GameCenter/GameCenterTests.swift | 2 +- .../SDKGameCenterRepositoryTests.swift | 3 +- .../GameCenterModerationTests.swift | 2 +- ...KGameCenterModerationRepositoryTests.swift | 13 +- .../Iris/AppBundles/AppBundleTests.swift | 2 +- ...SDKInAppPurchaseStateRepositoryTests.swift | 3 +- ...AppPurchaseSubmissionRepositoryTests.swift | 3 +- .../IrisInAppPurchaseSubmissionTests.swift | 2 +- .../CompositeIrisCookieProviderTests.swift | 3 +- .../Auth/FileIrisSessionRepositoryTests.swift | 3 +- .../Internal}/Auth/IdmsaAPIClientTests.swift | 2 +- .../Internal}/Auth/OlympusClientTests.swift | 2 +- .../Auth/SRP/AppleHashcashTests.swift | 2 +- .../Auth/SRP/AppleSRPClientTests.swift | 2 +- .../StoredSRPIrisCookieProviderTests.swift | 3 +- .../Iris/Internal}/Auth/URLProtocolStub.swift | 0 .../Iris/Internal}/IrisAPIErrorTests.swift | 2 +- .../Iris/Internal}/IrisCookieErrorTests.swift | 2 +- .../IrisCreateAppDocumentTests.swift | 2 +- .../Internal}/IrisResponseDecodingTests.swift | 3 +- .../Iris/IrisSessionTests.swift | 2 +- .../Iris/IrisStatusTests.swift | 2 +- ...isSDKResolutionCenterRepositoryTests.swift | 3 +- .../ResolutionCenterDetailTests.swift | 2 +- .../Internal}/GitHubPluginSourceTests.swift | 3 +- .../Internal}/PluginSettingsStoreTests.swift | 0 .../Plugins/PluginSourceTests.swift | 2 +- .../Plugins/PluginTests.swift | 2 +- .../Plugins/PluginUpdateTests.swift | 2 +- .../FileProjectConfigStorageTests.swift | 3 +- .../Projects/ProjectConfigTests.swift | 2 +- .../Reports/AnalyticsReportTests.swift | 2 +- .../SDKAnalyticsReportRepositoryTests.swift | 3 +- .../Internal}/SDKReportRepositoryTests.swift | 3 +- .../Reports/ReportFilterTests.swift | 2 +- .../Screenshots/AppShotTemplateTests.swift | 2 +- .../Screenshots/AppShotsConfigTests.swift | 2 +- .../Screenshots/Gallery/AppShotTests.swift | 2 +- .../Gallery/GalleryApplyTests.swift | 2 +- .../Gallery/GalleryCodableTests.swift | 2 +- .../Gallery/GalleryComposeTests.swift | 2 +- .../Gallery/GalleryHTMLRendererTests.swift | 2 +- .../Gallery/GalleryPreviewOutputTests.swift | 2 +- .../Gallery/GalleryPreviewTests.swift | 2 +- .../GalleryTemplateRepositoryTests.swift | 2 +- .../Screenshots/Gallery/GalleryTests.swift | 2 +- .../Gallery/HTMLComposerTests.swift | 2 +- .../Gallery/ScreenLayoutTests.swift | 2 +- .../Gallery/TemplatePreviewPageTests.swift | 2 +- .../Gallery/TextSlotPreviewTests.swift | 2 +- ...regateGalleryTemplateRepositoryTests.swift | 3 +- .../AggregateTemplateRepositoryTests.swift | 3 +- .../AggregateThemeRepositoryTests.swift | 3 +- .../FileAppShotsConfigStorageTests.swift | 3 +- .../Screenshots/ScreenThemeTests.swift | 2 +- .../Screenshots/TemplateApplyTests.swift | 2 +- .../Screenshots/TemplateRenderTests.swift | 2 +- .../Screenshots/ThemeDesignApplierTests.swift | 2 +- .../Screenshots/ThemeDesignTests.swift | 2 +- .../Shared/AffordanceRegistryTests.swift | 2 +- .../Shared/AffordanceTests.swift | 2 +- .../Shared/ImageAssetTests.swift | 2 +- .../Shared/Internal}/ClientFactoryTests.swift | 3 +- .../UploadOperationsExecutorTests.swift | 2 +- .../Shared/OfferCodeEnvironmentTests.swift | 2 +- .../Shared/OfferCodePriceInputTests.swift | 2 +- .../Shared/PaginatedResponseTests.swift | 2 +- .../Shared/PresentableTests.swift | 2 +- .../SimctlSimulatorRepositoryTests.swift | 3 +- .../Simulators/SimulatorTests.swift | 2 +- .../FileSkillConfigStorageTests.swift | 3 +- .../ProcessSkillRepositoryTests.swift | 3 +- .../Skills/Internal}/StubShellRunner.swift | 2 +- .../Skills/SkillTests.swift | 2 +- .../SDKSubmissionRepositoryTests.swift | 13 +- .../Submissions/ReviewItemTargetTests.swift | 2 +- .../ReviewSubmissionItemTests.swift | 2 +- .../Submissions/ReviewSubmissionTests.swift | 2 +- .../Submissions/SubmissionPlannerTests.swift | 2 +- .../SDKTerritoryRepositoryTests.swift | 3 +- .../Territories/TerritoryTests.swift | 2 +- .../TestHelpers/MockRepositoryFactory.swift | 2 +- .../TestHelpers/SequencedStubAPIClient.swift | 2 +- .../TestHelpers/SequencedStubHTTPClient.swift | 2 +- .../TestHelpers/StubAPIClient.swift | 2 +- .../TestHelpers/StubHTTPClient.swift | 2 +- .../TestHelpers/UploadFixtures.swift | 0 .../Internal}/SDKUserRepositoryTests.swift | 3 +- .../Users/UserRoleTests.swift | 2 +- ...SDKXcodeCloudBuildRunRepositoryTests.swift | 3 +- .../SDKXcodeCloudProductRepositoryTests.swift | 3 +- ...SDKXcodeCloudWorkflowRepositoryTests.swift | 3 +- .../XcodeCloud/XcodeCloudBuildRunTests.swift | 2 +- .../XcodeCloud/XcodeCloudProductTests.swift | 2 +- .../XcodeCloud/XcodeCloudWorkflowTests.swift | 2 +- codecov.yml | 18 +-- docs/features/concept-folders/design.md | 139 ++++++++++++++++++ docs/library.md | 5 +- .../Sources/HelloPlugin/HelloPlugin.swift | 2 +- 1191 files changed, 1551 insertions(+), 1696 deletions(-) rename Sources/{Domain => ASCKit}/AppWall/AppWallApp.swift (100%) rename Sources/{Domain => ASCKit}/AppWall/AppWallError.swift (100%) rename Sources/{Domain => ASCKit}/AppWall/AppWallRepository.swift (100%) rename Sources/{Domain => ASCKit}/AppWall/AppWallSubmission.swift (100%) rename Sources/{Infrastructure/AppWall => ASCKit/AppWall/Internal}/GitHubAppWallRepository.swift (99%) rename Sources/{Domain => ASCKit}/Apps/App+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/App.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppClips/AppClip.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppClips/AppClipRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppClips/Experiences/AppClipDefaultExperience.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppClips/Experiences/Localizations/AppClipDefaultExperienceLocalization.swift (100%) rename Sources/{Infrastructure/Apps/AppClips => ASCKit/Apps/AppClips/Internal}/SDKAppClipRepository.swift (84%) rename Sources/{Domain => ASCKit}/Apps/AppInfos/AgeRatingDeclaration.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppInfos/AgeRatingDeclarationRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppInfos/AppCategory.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppInfos/AppInfo+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppInfos/AppInfo.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppInfos/AppInfoLocalization.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AppInfos/AppInfoRepository.swift (100%) rename Sources/{Infrastructure/Apps/AppInfos => ASCKit/Apps/AppInfos/Internal}/SDKAgeRatingDeclarationRepository.swift (90%) rename Sources/{Infrastructure/Apps/AppInfos => ASCKit/Apps/AppInfos/Internal}/SDKAppCategoryRepository.swift (88%) rename Sources/{Infrastructure/Apps/AppInfos => ASCKit/Apps/AppInfos/Internal}/SDKAppInfoRepository.swift (93%) rename Sources/{Domain => ASCKit}/Apps/AppRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/AppAssetLibrary.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/AssetLibrary+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/AssetLibraryRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/AssetLibraryTypes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/AssetProcessingWait.swift (100%) rename Sources/{Infrastructure/Apps/AssetLibrary/Images => ASCKit/Apps/AssetLibrary/Images/Internal}/SDKLibraryImageRepository.swift (99%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Images/LibraryImage.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Images/LibraryImageRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Import/ScreenshotImport+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Import/ScreenshotImportGroupResult.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift (100%) rename Sources/{Infrastructure/Apps/AssetLibrary => ASCKit/Apps/AssetLibrary/Internal}/AssetLibraryDTOs.swift (100%) rename Sources/{Infrastructure/Apps/AssetLibrary => ASCKit/Apps/AssetLibrary/Internal}/SDKAssetLibraryRepository.swift (95%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Placements/AssetPlacement.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift (100%) rename Sources/{Infrastructure/Apps/AssetLibrary/Placements => ASCKit/Apps/AssetLibrary/Placements/Internal}/AssetPlacementDTOs.swift (99%) rename Sources/{Infrastructure/Apps/AssetLibrary/Placements => ASCKit/Apps/AssetLibrary/Placements/Internal}/SDKAssetPlacementRepository.swift (99%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/RefData/AssetPlacementGroup.swift (100%) rename Sources/{Infrastructure/Apps/AssetLibrary/Videos => ASCKit/Apps/AssetLibrary/Videos/Internal}/SDKLibraryVideoRepository.swift (99%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Videos/LibraryVideo.swift (100%) rename Sources/{Domain => ASCKit}/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Availability/AppAvailability.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Availability/AppAvailabilityRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Availability/AppTerritoryAvailability.swift (100%) rename Sources/{Infrastructure/Apps/Availability => ASCKit/Apps/Availability/Internal}/SDKAppAvailabilityRepository.swift (93%) rename Sources/{Domain => ASCKit}/Apps/Builds/BetaBuildLocalization.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Builds/BetaBuildLocalizationRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Builds/Build.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Builds/BuildRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Builds/BuildUpload.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Builds/BuildUploadRepository.swift (100%) rename Sources/{Infrastructure/Apps/Builds => ASCKit/Apps/Builds/Internal}/OpenAPIBuildRepository.swift (93%) rename Sources/{Infrastructure/Apps/Builds => ASCKit/Apps/Builds/Internal}/SDKBetaBuildLocalizationRepository.swift (91%) rename Sources/{Infrastructure/Apps/Builds => ASCKit/Apps/Builds/Internal}/SDKBuildUploadRepository.swift (91%) rename Sources/{Domain => ASCKit}/Apps/Builds/NextBuildNumber.swift (100%) rename Sources/{Infrastructure/Apps/Builds/XcodeBuild => ASCKit/Apps/Builds/XcodeBuild/Internal}/ProcessXcodeBuildRunner.swift (99%) rename Sources/{Domain => ASCKit}/Apps/Builds/XcodeBuild/XcodeBuildRunner.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Experiments/AppStoreVersionExperiment+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Experiments/AppStoreVersionExperiment.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Experiments/ExperimentRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Experiments/ExperimentTreatment.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Experiments/ExperimentTreatmentLocalization.swift (100%) rename Sources/{Infrastructure/Apps/Experiments => ASCKit/Apps/Experiments/Internal}/SDKExperimentRepository.swift (88%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/Availability/InAppPurchaseAvailability.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift (100%) rename Sources/{Infrastructure/Apps/InAppPurchases/Availability => ASCKit/Apps/InAppPurchases/Availability/Internal}/SDKInAppPurchaseAvailabilityRepository.swift (87%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/InAppPurchase+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/InAppPurchase.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/InAppPurchasePricePoint.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/InAppPurchasePriceRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/InAppPurchasePriceSchedule.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/InAppPurchaseRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/InAppPurchaseSubmission.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift (100%) rename Sources/{Infrastructure/Apps/InAppPurchases => ASCKit/Apps/InAppPurchases/Internal}/SDKInAppPurchasePriceRepository.swift (86%) rename Sources/{Infrastructure/Apps/InAppPurchases => ASCKit/Apps/InAppPurchases/Internal}/SDKInAppPurchaseRepository.swift (90%) rename Sources/{Infrastructure/Apps/InAppPurchases => ASCKit/Apps/InAppPurchases/Internal}/SDKInAppPurchaseSubmissionRepository.swift (90%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/Localizations/InAppPurchaseLocalization.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift (100%) rename Sources/{Infrastructure/Apps/InAppPurchases/Localizations => ASCKit/Apps/InAppPurchases/Localizations/Internal}/SDKInAppPurchaseLocalizationRepository.swift (88%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCode.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCode.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCode.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePrice.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift (100%) rename Sources/{Infrastructure/Apps/InAppPurchases/OfferCodes => ASCKit/Apps/InAppPurchases/OfferCodes/Internal}/SDKInAppPurchaseOfferCodeRepository.swift (86%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshot.swift (100%) rename Sources/{Infrastructure/Apps/InAppPurchases/Review => ASCKit/Apps/InAppPurchases/Review/Internal}/SDKInAppPurchaseReviewRepository.swift (91%) rename Sources/{Infrastructure/Apps => ASCKit/Apps/Internal}/OpenAPIAppRepository.swift (85%) rename Sources/{Domain => ASCKit}/Apps/Performance/DiagnosticLogEntry.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Performance/DiagnosticSignatureInfo.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Performance/DiagnosticsRepository.swift (100%) rename Sources/{Infrastructure/Apps/Performance => ASCKit/Apps/Performance/Internal}/SDKDiagnosticsRepository.swift (99%) rename Sources/{Infrastructure/Apps/Performance => ASCKit/Apps/Performance/Internal}/SDKPerfMetricsRepository.swift (99%) rename Sources/{Infrastructure/Apps/Performance => ASCKit/Apps/Performance/Internal}/SDKPerfOverviewRepository.swift (96%) rename Sources/{Domain => ASCKit}/Apps/Performance/PerfMetricsRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Performance/PerfOverviewRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Performance/PerfPowerMetric.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Performance/Performance+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Performance/PerformanceOverview.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Pricing/AppPricePoint.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Pricing/AppPriceSchedule.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Pricing/AppPricing+RESTRoutes.swift (100%) rename Sources/{Infrastructure/Apps/Pricing => ASCKit/Apps/Pricing/Internal}/SDKPricingRepository.swift (90%) rename Sources/{Domain => ASCKit}/Apps/Pricing/PricingRepository.swift (100%) rename Sources/{Infrastructure/Apps/ProductVersions => ASCKit/Apps/ProductVersions/Internal}/SDKProductVersionRepository.swift (86%) rename Sources/{Domain => ASCKit}/Apps/ProductVersions/ProductVersion+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/ProductVersions/ProductVersion.swift (100%) rename Sources/{Domain => ASCKit}/Apps/ProductVersions/ProductVersionRepository.swift (100%) rename Sources/{Infrastructure/Apps/PromotedPurchases => ASCKit/Apps/PromotedPurchases/Internal}/SDKPromotedPurchaseRepository.swift (90%) rename Sources/{Domain => ASCKit}/Apps/PromotedPurchases/PromotedPurchase.swift (100%) rename Sources/{Domain => ASCKit}/Apps/PromotedPurchases/PromotedPurchaseRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Reviews/CustomerReview.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Reviews/CustomerReviewRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Reviews/CustomerReviewResponse.swift (100%) rename Sources/{Infrastructure/Apps/Reviews => ASCKit/Apps/Reviews/Internal}/SDKCustomerReviewRepository.swift (84%) rename Sources/{Infrastructure/Apps/Subscriptions/Availability => ASCKit/Apps/Subscriptions/Availability/Internal}/SDKSubscriptionAvailabilityRepository.swift (88%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Availability/SubscriptionAvailability.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift (100%) rename Sources/{Infrastructure/Apps/Subscriptions => ASCKit/Apps/Subscriptions/Internal}/SDKSubscriptionGroupRepository.swift (88%) rename Sources/{Infrastructure/Apps/Subscriptions => ASCKit/Apps/Subscriptions/Internal}/SDKSubscriptionPriceRepository.swift (86%) rename Sources/{Infrastructure/Apps/Subscriptions => ASCKit/Apps/Subscriptions/Internal}/SDKSubscriptionRepository.swift (90%) rename Sources/{Infrastructure/Apps/Subscriptions => ASCKit/Apps/Subscriptions/Internal}/SDKSubscriptionSubmissionRepository.swift (90%) rename Sources/{Infrastructure/Apps/Subscriptions/IntroductoryOffers => ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal}/SDKSubscriptionIntroductoryOfferRepository.swift (83%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffer.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift (100%) rename Sources/{Infrastructure/Apps/Subscriptions/Localizations => ASCKit/Apps/Subscriptions/Localizations/Internal}/SDKSubscriptionGroupLocalizationRepository.swift (86%) rename Sources/{Infrastructure/Apps/Subscriptions/Localizations => ASCKit/Apps/Subscriptions/Localizations/Internal}/SDKSubscriptionLocalizationRepository.swift (87%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Localizations/SubscriptionGroupLocalization.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Localizations/SubscriptionLocalization.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift (100%) rename Sources/{Infrastructure/Apps/Subscriptions/OfferCodes => ASCKit/Apps/Subscriptions/OfferCodes/Internal}/SDKSubscriptionOfferCodeRepository.swift (85%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCode.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCode.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCode.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePrice.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift (100%) rename Sources/{Infrastructure/Apps/Subscriptions/PromotionalOffers => ASCKit/Apps/Subscriptions/PromotionalOffers/Internal}/SDKSubscriptionPromotionalOfferRepository.swift (83%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffer.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferPrice.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift (100%) rename Sources/{Infrastructure/Apps/Subscriptions/Review => ASCKit/Apps/Subscriptions/Review/Internal}/SDKSubscriptionReviewRepository.swift (91%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Review/SubscriptionPromotionalImage.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Review/SubscriptionReviewScreenshot.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Subscription+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/Subscription.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionGroup.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionGroupRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionPrice.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionPricePoint.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionPriceRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionPriceSchedule.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionSubmission.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/SubscriptionSubmissionRepository.swift (100%) rename Sources/{Infrastructure/Apps/Subscriptions/WinBackOffers => ASCKit/Apps/Subscriptions/WinBackOffers/Internal}/SDKWinBackOfferRepository.swift (88%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/WinBackOffers/WinBackOffer.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/BetaAppLocalization.swift (100%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/BetaAppLocalizationRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/BetaAppReviewDetail.swift (100%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/BetaAppReviewRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/BetaAppReviewSubmission.swift (100%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/BetaGroup+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/BetaGroup.swift (100%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/BetaTester.swift (100%) rename Sources/{Infrastructure/Apps/TestFlight => ASCKit/Apps/TestFlight/Internal}/OpenAPITestFlightRepository.swift (89%) rename Sources/{Infrastructure/Apps/TestFlight => ASCKit/Apps/TestFlight/Internal}/SDKBetaAppLocalizationRepository.swift (89%) rename Sources/{Infrastructure/Apps/TestFlight => ASCKit/Apps/TestFlight/Internal}/SDKBetaAppReviewRepository.swift (85%) rename Sources/{Domain => ASCKit}/Apps/TestFlight/TestFlightRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/AppStoreReviewDetail.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/AppStoreVersion+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/AppStoreVersion.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/AppStoreVersionState.swift (100%) rename Sources/{Infrastructure/Apps/Versions => ASCKit/Apps/Versions/Internal}/SDKReviewDetailRepository.swift (90%) rename Sources/{Infrastructure/Apps/Versions => ASCKit/Apps/Versions/Internal}/SDKVersionRepository.swift (87%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/AppStoreVersionLocalization.swift (100%) rename Sources/{Infrastructure/Apps/Versions/Localizations => ASCKit/Apps/Versions/Localizations/Internal}/SDKLocalizationRepository.swift (91%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/PreviewSets/AppPreviewSet.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreview.swift (100%) rename Sources/{Infrastructure/Apps/Versions/Localizations/PreviewSets => ASCKit/Apps/Versions/Localizations/PreviewSets/Internal}/OpenAPIPreviewRepository.swift (90%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/PreviewSets/PreviewType.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift (100%) rename Sources/{Infrastructure/Apps/Versions/Localizations/ScreenshotSets => ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal}/OpenAPIScreenshotRepository.swift (91%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayType.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/ScreenshotSets/ScreenshotImport.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshot.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/Localizations/VersionLocalizationRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/ReviewDetailRepository.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/ReviewDetailUpdate.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/VersionReadiness.swift (100%) rename Sources/{Domain => ASCKit}/Apps/Versions/VersionRepository.swift (100%) rename Sources/{Domain => ASCKit}/Auth/AuthCredentials.swift (100%) rename Sources/{Domain => ASCKit}/Auth/AuthError.swift (100%) rename Sources/{Domain => ASCKit}/Auth/AuthProvider.swift (100%) rename Sources/{Domain => ASCKit}/Auth/AuthStatus.swift (100%) rename Sources/{Domain => ASCKit}/Auth/AuthStorage.swift (100%) rename Sources/{Domain => ASCKit}/Auth/ConnectAccount.swift (100%) rename Sources/{Domain => ASCKit}/Auth/CredentialSource.swift (100%) rename Sources/{Infrastructure/Auth => ASCKit/Auth/Internal}/CompositeAuthProvider.swift (97%) rename Sources/{Infrastructure/Auth => ASCKit/Auth/Internal}/EnvironmentAuthProvider.swift (99%) rename Sources/{Infrastructure/Auth => ASCKit/Auth/Internal}/FileAuthProvider.swift (96%) rename Sources/{Infrastructure/Auth => ASCKit/Auth/Internal}/FileAuthStorage.swift (99%) rename Sources/{Domain => ASCKit}/Auth/Iris/IrisAuthCredentials.swift (100%) rename Sources/{Domain => ASCKit}/Auth/Iris/IrisAuthError.swift (100%) rename Sources/{Domain => ASCKit}/Auth/Iris/IrisAuthRepository.swift (100%) rename Sources/{Domain => ASCKit}/Auth/Iris/IrisAuthSession.swift (100%) rename Sources/{Domain => ASCKit}/Auth/Iris/IrisAuthSummary.swift (100%) rename Sources/{Domain => ASCKit}/Auth/Iris/IrisSessionRepository.swift (100%) rename Sources/{Domain => ASCKit}/Auth/Iris/PendingTwoFactorState.swift (100%) rename Sources/{Domain => ASCKit}/Auth/Iris/TwoFactorChallenge.swift (100%) rename Sources/{Domain => ASCKit}/CodeSigning/BundleIDs/BundleID.swift (100%) rename Sources/{Domain => ASCKit}/CodeSigning/BundleIDs/BundleIDRepository.swift (100%) rename Sources/{Domain => ASCKit}/CodeSigning/Certificates/Certificate.swift (100%) rename Sources/{Domain => ASCKit}/CodeSigning/Certificates/CertificateRepository.swift (100%) rename Sources/{Domain => ASCKit}/CodeSigning/CodeSigning+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/CodeSigning/Devices/Device.swift (100%) rename Sources/{Domain => ASCKit}/CodeSigning/Devices/DeviceRepository.swift (100%) rename Sources/{Infrastructure/CodeSigning => ASCKit/CodeSigning/Internal}/SDKBundleIDRepository.swift (85%) rename Sources/{Infrastructure/CodeSigning => ASCKit/CodeSigning/Internal}/SDKCertificateRepository.swift (81%) rename Sources/{Infrastructure/CodeSigning => ASCKit/CodeSigning/Internal}/SDKDeviceRepository.swift (83%) rename Sources/{Infrastructure/CodeSigning => ASCKit/CodeSigning/Internal}/SDKProfileRepository.swift (90%) rename Sources/{Domain => ASCKit}/CodeSigning/Profiles/Profile.swift (100%) rename Sources/{Domain => ASCKit}/CodeSigning/Profiles/ProfileRepository.swift (100%) rename Sources/{Domain => ASCKit}/GameCenter/GameCenter+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/GameCenter/GameCenterAchievement.swift (100%) rename Sources/{Domain => ASCKit}/GameCenter/GameCenterDetail.swift (100%) rename Sources/{Domain => ASCKit}/GameCenter/GameCenterLeaderboard.swift (100%) rename Sources/{Domain => ASCKit}/GameCenter/GameCenterRepository.swift (100%) rename Sources/{Infrastructure/GameCenter => ASCKit/GameCenter/Internal}/SDKGameCenterRepository.swift (86%) rename Sources/{Domain => ASCKit}/GameCenter/Moderation/GameCenterModerationRepository.swift (100%) rename Sources/{Domain => ASCKit}/GameCenter/Moderation/GameCenterPlayer.swift (100%) rename Sources/{Domain => ASCKit}/GameCenter/Moderation/GameCenterScoreModeration.swift (100%) rename Sources/{Infrastructure/GameCenter/Moderation => ASCKit/GameCenter/Moderation/Internal}/SDKGameCenterModerationRepository.swift (91%) rename Sources/{Domain => ASCKit}/Iris/AppBundles/AppBundle.swift (100%) rename Sources/{Infrastructure/Iris/AppBundles => ASCKit/Iris/AppBundles/Internal}/IrisCreateAppDocument.swift (100%) rename Sources/{Infrastructure/Iris/AppBundles => ASCKit/Iris/AppBundles/Internal}/IrisSDKAppBundleRepository.swift (99%) rename Sources/{Domain => ASCKit}/Iris/AppBundles/IrisAppBundleRepository.swift (100%) rename Sources/{Infrastructure/Iris/InAppPurchases => ASCKit/Iris/InAppPurchases/Internal}/IrisSDKInAppPurchaseStateRepository.swift (99%) rename Sources/{Infrastructure/Iris/InAppPurchases => ASCKit/Iris/InAppPurchases/Internal}/IrisSDKInAppPurchaseSubmissionRepository.swift (99%) rename Sources/{Domain => ASCKit}/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift (100%) rename Sources/{Domain => ASCKit}/Iris/InAppPurchases/IrisInAppPurchaseSubmission.swift (100%) rename Sources/{Domain => ASCKit}/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift (100%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/Auth/CompositeIrisCookieProvider.swift (98%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/Auth/FileIrisSessionRepository.swift (99%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/Auth/IdmsaAPIClient.swift (99%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/Auth/IrisAuthSDKRepository.swift (98%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/Auth/OlympusClient.swift (100%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/Auth/SRP/AppleHashcash.swift (100%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/Auth/SRP/AppleSRPClient.swift (100%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/Auth/StoredSRPIrisCookieProvider.swift (98%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/BrowserIrisCookieProvider.swift (99%) rename Sources/{Infrastructure/Iris => ASCKit/Iris/Internal}/IrisClient.swift (99%) rename Sources/{Domain => ASCKit}/Iris/IrisCookieProvider.swift (100%) rename Sources/{Domain => ASCKit}/Iris/IrisSession.swift (100%) rename Sources/{Domain => ASCKit}/Iris/IrisStatus.swift (100%) rename Sources/{Infrastructure/Iris/ResolutionCenter => ASCKit/Iris/ResolutionCenter/Internal}/IrisSDKResolutionCenterRepository.swift (95%) rename Sources/{Domain => ASCKit}/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift (100%) rename Sources/{Domain => ASCKit}/Iris/ResolutionCenter/ResolutionCenterAttachment.swift (100%) rename Sources/{Domain => ASCKit}/Iris/ResolutionCenter/ResolutionCenterDetail+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Iris/ResolutionCenter/ResolutionCenterDetail.swift (100%) rename Sources/{Domain => ASCKit}/Iris/ResolutionCenter/ResolutionCenterMessage.swift (100%) rename Sources/{Domain => ASCKit}/Iris/ResolutionCenter/ReviewRejectionReason.swift (100%) rename Sources/{Infrastructure/Plugins => ASCKit/Plugins/Internal}/GitHubPluginSource.swift (99%) rename Sources/{Infrastructure/Plugins => ASCKit/Plugins/Internal}/PluginMarketRepository.swift (99%) rename Sources/{Domain => ASCKit}/Plugins/Plugin.swift (100%) rename Sources/{Domain => ASCKit}/Plugins/PluginRepository.swift (100%) rename Sources/{Domain => ASCKit}/Plugins/PluginSource.swift (100%) rename Sources/{Domain => ASCKit}/Plugins/PluginUpdate.swift (100%) rename Sources/{Infrastructure/Projects => ASCKit/Projects/Internal}/FileProjectConfigStorage.swift (98%) rename Sources/{Domain => ASCKit}/Projects/ProjectConfig.swift (100%) rename Sources/{Domain => ASCKit}/Projects/ProjectConfigStorage.swift (100%) rename Sources/{Domain => ASCKit}/Reports/Analytics/AnalyticsFilter.swift (100%) rename Sources/{Domain => ASCKit}/Reports/Analytics/AnalyticsReport.swift (100%) rename Sources/{Domain => ASCKit}/Reports/Analytics/AnalyticsReportInstance.swift (100%) rename Sources/{Domain => ASCKit}/Reports/Analytics/AnalyticsReportRepository.swift (100%) rename Sources/{Domain => ASCKit}/Reports/Analytics/AnalyticsReportRequest.swift (100%) rename Sources/{Domain => ASCKit}/Reports/Analytics/AnalyticsReportSegment.swift (100%) rename Sources/{Infrastructure/Reports/Analytics => ASCKit/Reports/Analytics/Internal}/SDKAnalyticsReportRepository.swift (84%) rename Sources/{Domain => ASCKit}/Reports/FinanceReportFilter.swift (100%) rename Sources/{Infrastructure/Reports => ASCKit/Reports/Internal}/SDKReportRepository.swift (99%) rename Sources/{Infrastructure/Reports => ASCKit/Reports/Internal}/TSVParser.swift (100%) rename Sources/{Domain => ASCKit}/Reports/ReportRepository.swift (100%) rename Sources/{Domain => ASCKit}/Reports/SalesReportFilter.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/AppShotTemplate.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/AppShotsConfig.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/AppShotsConfigStorage.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/AppShot.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/Gallery.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/GalleryHTMLRenderer.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/GalleryPalette.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/GalleryTemplate.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/GalleryTemplateRepository.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/HTMLComposer.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/Resources/keyframes.mustache (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/Resources/page-wrapper.mustache (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/Resources/preview-page.mustache (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/Resources/preview-screen.mustache (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/Resources/screen.mustache (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/Resources/theme-vars.mustache (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/Resources/wireframe.mustache (100%) rename Sources/{Domain => ASCKit}/Screenshots/Gallery/ScreenLayout.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/HTMLRenderer.swift (100%) rename Sources/{Infrastructure/ScreenshotPlans => ASCKit/Screenshots/Internal}/AggregateGalleryTemplateRepository.swift (98%) rename Sources/{Infrastructure/ScreenshotPlans => ASCKit/Screenshots/Internal}/AggregateTemplateRepository.swift (98%) rename Sources/{Infrastructure/ScreenshotPlans => ASCKit/Screenshots/Internal}/AggregateThemeRepository.swift (99%) rename Sources/{Infrastructure/ScreenshotPlans => ASCKit/Screenshots/Internal}/FileAppShotsConfigStorage.swift (98%) rename Sources/{Infrastructure/ScreenshotPlans => ASCKit/Screenshots/Internal}/WebKitHTMLRenderer.swift (99%) rename Sources/{Domain => ASCKit}/Screenshots/ScreenTheme.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/ScreenshotPlans+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/TemplateRepository.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/ThemeDesign.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/ThemeDesignApplier.swift (100%) rename Sources/{Domain => ASCKit}/Screenshots/ThemedPage.swift (100%) rename Sources/{Domain => ASCKit}/Shared/APIError.swift (100%) rename Sources/{Domain => ASCKit}/Shared/APIRoot.swift (100%) rename Sources/{Domain => ASCKit}/Shared/Affordance.swift (100%) rename Sources/{Domain => ASCKit}/Shared/AffordanceProviding.swift (100%) rename Sources/{Domain => ASCKit}/Shared/AffordanceRegistry.swift (100%) rename Sources/{Domain => ASCKit}/Shared/ImageAsset.swift (100%) rename Sources/{Infrastructure/Client => ASCKit/Shared/Internal}/APIClient.swift (100%) rename Sources/{Infrastructure/Client => ASCKit/Shared/Internal}/ClientFactory.swift (99%) rename Sources/{Infrastructure/Client => ASCKit/Shared/Internal}/DataExtensions.swift (100%) rename Sources/{Infrastructure/Shared => ASCKit/Shared/Internal}/HTTPPerforming.swift (100%) rename Sources/{Infrastructure/Shared => ASCKit/Shared/Internal}/SDKFilter.swift (100%) rename Sources/{Infrastructure/Shared => ASCKit/Shared/Internal}/UploadOperationsExecutor.swift (99%) rename Sources/{Domain => ASCKit}/Shared/OfferCodeEnvironment.swift (100%) rename Sources/{Domain => ASCKit}/Shared/OfferCodePriceInput.swift (100%) rename Sources/{Domain => ASCKit}/Shared/OutputFormat.swift (100%) rename Sources/{Domain => ASCKit}/Shared/PaginatedResponse.swift (100%) rename Sources/{Domain => ASCKit}/Shared/Presentable.swift (100%) rename Sources/{Domain => ASCKit}/Shared/RESTPathResolver.swift (100%) rename Sources/{Infrastructure/Simulators => ASCKit/Simulators/Internal}/SimctlSimulatorRepository.swift (99%) rename Sources/{Domain => ASCKit}/Simulators/Simulator.swift (100%) rename Sources/{Domain => ASCKit}/Simulators/SimulatorRepository.swift (100%) rename Sources/{Domain => ASCKit}/Simulators/SimulatorState.swift (100%) rename Sources/{Infrastructure/Skills => ASCKit/Skills/Internal}/FileSkillConfigStorage.swift (98%) rename Sources/{Infrastructure/Skills => ASCKit/Skills/Internal}/ProcessSkillRepository.swift (99%) rename Sources/{Infrastructure/Skills => ASCKit/Skills/Internal}/ShellRunner.swift (100%) rename Sources/{Domain => ASCKit}/Skills/Skill.swift (100%) rename Sources/{Domain => ASCKit}/Skills/SkillCheckResult.swift (100%) rename Sources/{Domain => ASCKit}/Skills/SkillConfig.swift (100%) rename Sources/{Domain => ASCKit}/Skills/SkillConfigStorage.swift (100%) rename Sources/{Domain => ASCKit}/Skills/SkillRepository.swift (100%) rename Sources/{Infrastructure/Submissions => ASCKit/Submissions/Internal}/OpenAPISubmissionRepository.swift (90%) rename Sources/{Domain => ASCKit}/Submissions/ReviewItemTarget.swift (100%) rename Sources/{Domain => ASCKit}/Submissions/ReviewSubmission+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/Submissions/ReviewSubmission.swift (100%) rename Sources/{Domain => ASCKit}/Submissions/ReviewSubmissionError.swift (100%) rename Sources/{Domain => ASCKit}/Submissions/ReviewSubmissionItem.swift (100%) rename Sources/{Domain => ASCKit}/Submissions/ReviewSubmissionItemState.swift (100%) rename Sources/{Domain => ASCKit}/Submissions/ReviewSubmissionState.swift (100%) rename Sources/{Domain => ASCKit}/Submissions/SubmissionPlan.swift (100%) rename Sources/{Domain => ASCKit}/Submissions/SubmissionRepository.swift (100%) rename Sources/{Infrastructure/Territories => ASCKit/Territories/Internal}/SDKTerritoryRepository.swift (78%) rename Sources/{Domain => ASCKit}/Territories/Territory.swift (100%) rename Sources/{Domain => ASCKit}/Territories/TerritoryRepository.swift (100%) rename Sources/{Infrastructure/Users => ASCKit/Users/Internal}/SDKUserRepository.swift (84%) rename Sources/{Domain => ASCKit}/Users/TeamMember.swift (100%) rename Sources/{Domain => ASCKit}/Users/UserInvitationRecord.swift (100%) rename Sources/{Domain => ASCKit}/Users/UserRepository.swift (100%) rename Sources/{Domain => ASCKit}/Users/UserRole.swift (100%) rename Sources/{Infrastructure => ASCKit}/Web/ASCWebServer.swift (99%) rename Sources/{Infrastructure => ASCKit}/Web/CORSMiddleware.swift (100%) rename Sources/{Infrastructure => ASCKit}/Web/SelfSignedCert.swift (100%) rename Sources/{Infrastructure/XcodeCloud => ASCKit/XcodeCloud/Internal}/SDKXcodeCloudBuildRunRepository.swift (99%) rename Sources/{Infrastructure/XcodeCloud => ASCKit/XcodeCloud/Internal}/SDKXcodeCloudProductRepository.swift (98%) rename Sources/{Infrastructure/XcodeCloud => ASCKit/XcodeCloud/Internal}/SDKXcodeCloudWorkflowRepository.swift (98%) rename Sources/{Domain => ASCKit}/XcodeCloud/XcodeCloud+RESTRoutes.swift (100%) rename Sources/{Domain => ASCKit}/XcodeCloud/XcodeCloudBuildRun.swift (100%) rename Sources/{Domain => ASCKit}/XcodeCloud/XcodeCloudBuildRunRepository.swift (100%) rename Sources/{Domain => ASCKit}/XcodeCloud/XcodeCloudProduct.swift (100%) rename Sources/{Domain => ASCKit}/XcodeCloud/XcodeCloudProductRepository.swift (100%) rename Sources/{Domain => ASCKit}/XcodeCloud/XcodeCloudWorkflow.swift (100%) rename Sources/{Domain => ASCKit}/XcodeCloud/XcodeCloudWorkflowRepository.swift (100%) rename Tests/{DomainTests => ASCKitTests}/AppWall/AppWallEntryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/AppWall/AppWallErrorTests.swift (98%) rename Tests/{InfrastructureTests/AppWall => ASCKitTests/AppWall/Internal}/GitHubAppWallRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AffordancesTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AppClips/AppClipTests.swift (99%) rename Tests/{InfrastructureTests/Apps/AppClips => ASCKitTests/Apps/AppClips/Internal}/SDKAppClipRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AppIconTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/AppInfos/AgeRatingDeclarationTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AppInfos/AppCategoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/AppInfos/AppInfoLocalizationTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/AppInfos/AppInfoTests.swift (99%) rename Tests/{InfrastructureTests/Apps/AppInfos => ASCKitTests/Apps/AppInfos/Internal}/SDKAgeRatingDeclarationRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/AppInfos => ASCKitTests/Apps/AppInfos/Internal}/SDKAppCategoryRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/AppInfos => ASCKitTests/Apps/AppInfos/Internal}/SDKAppInfoRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AppRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/AppTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/AppAssetLibraryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/AssetLibrary/Images => ASCKitTests/Apps/AssetLibrary/Images/Internal}/SDKLibraryImageRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/Images/LibraryAssetStateTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/Images/LibraryImageTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/Import/ScreenshotImportGroupResultTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/Import/ScreenshotImportPlanTests.swift (99%) rename Tests/{InfrastructureTests/Apps/AssetLibrary => ASCKitTests/Apps/AssetLibrary/Internal}/SDKAssetLibraryRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/Placements/AssetPlacementTests.swift (99%) rename Tests/{InfrastructureTests/Apps/AssetLibrary/Placements => ASCKitTests/Apps/AssetLibrary/Placements/Internal}/SDKAssetPlacementRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/RefData/AssetPlacementGroupTests.swift (99%) rename Tests/{InfrastructureTests/Apps/AssetLibrary/Videos => ASCKitTests/Apps/AssetLibrary/Videos/Internal}/SDKLibraryVideoRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/AssetLibrary/Videos/LibraryVideoTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Availability/AppAvailabilityTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Availability/AppTerritoryAvailabilityTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Availability => ASCKitTests/Apps/Availability/Internal}/SDKAppAvailabilityRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Builds/BetaBuildLocalizationTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Builds/BuildTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Builds/BuildUploadTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Builds => ASCKitTests/Apps/Builds/Internal}/SDKBetaBuildLocalizationRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Builds => ASCKitTests/Apps/Builds/Internal}/SDKBuildRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Builds => ASCKitTests/Apps/Builds/Internal}/SDKBuildUploadRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Builds => ASCKitTests/Apps/Builds/Internal}/SDKBuildUploadRepositoryUploadTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Builds/NextBuildNumberTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Builds/XcodeBuild/ArchiveExportTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Builds/XcodeBuild => ASCKitTests/Apps/Builds/XcodeBuild/Internal}/ProcessXcodeBuildRunnerTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Experiments/AppStoreVersionExperimentTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Experiments/ExperimentTreatmentLocalizationTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Experiments/ExperimentTreatmentTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Experiments => ASCKitTests/Apps/Experiments/Internal}/SDKExperimentRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityTests.swift (98%) rename Tests/{InfrastructureTests/Apps/InAppPurchases/Availability => ASCKitTests/Apps/InAppPurchases/Availability/Internal}/SDKInAppPurchaseAvailabilityRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/InAppPurchasePricePointTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/InAppPurchasePriceScheduleTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/InAppPurchaseSubmissionTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/InAppPurchaseTests.swift (99%) rename Tests/{InfrastructureTests/Apps/InAppPurchases => ASCKitTests/Apps/InAppPurchases/Internal}/SDKInAppPurchaseLocalizationRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/InAppPurchases => ASCKitTests/Apps/InAppPurchases/Internal}/SDKInAppPurchasePriceRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/InAppPurchases => ASCKitTests/Apps/InAppPurchases/Internal}/SDKInAppPurchaseRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/InAppPurchases => ASCKitTests/Apps/InAppPurchases/Internal}/SDKInAppPurchaseSubmissionRepositoryTests.swift (94%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCodeTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCodeTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePriceTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeTests.swift (99%) rename Tests/{InfrastructureTests/Apps/InAppPurchases/OfferCodes => ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal}/SDKInAppPurchaseOfferCodeRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/Review/InAppPurchaseReviewCodableTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshotTests.swift (99%) rename Tests/{InfrastructureTests/Apps/InAppPurchases/Review => ASCKitTests/Apps/InAppPurchases/Review/Internal}/SDKInAppPurchaseReviewRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps => ASCKitTests/Apps/Internal}/SDKAppRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Performance/DiagnosticLogEntryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Performance/DiagnosticSignatureInfoTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Performance => ASCKitTests/Apps/Performance/Internal}/SDKDiagnosticsRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Performance => ASCKitTests/Apps/Performance/Internal}/SDKPerfMetricsRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Performance => ASCKitTests/Apps/Performance/Internal}/SDKPerfOverviewRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Performance/PerfPowerMetricTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Performance/PerformanceOverviewTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Pricing/AppPricingTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Pricing => ASCKitTests/Apps/Pricing/Internal}/SDKPricingRepositoryTests.swift (95%) rename Tests/{InfrastructureTests/Apps/ProductVersions => ASCKitTests/Apps/ProductVersions/Internal}/SDKProductVersionRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/ProductVersions/ProductVersionTests.swift (99%) rename Tests/{InfrastructureTests/Apps/PromotedPurchases => ASCKitTests/Apps/PromotedPurchases/Internal}/SDKPromotedPurchaseRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/PromotedPurchases/PromotedPurchaseCodableTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/PromotedPurchases/PromotedPurchaseTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Reviews/CustomerReviewResponseTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Reviews/CustomerReviewTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Reviews => ASCKitTests/Apps/Reviews/Internal}/SDKCustomerReviewRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Subscriptions/Availability => ASCKitTests/Apps/Subscriptions/Availability/Internal}/SDKSubscriptionAvailabilityRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/Availability/SubscriptionAvailabilityTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Subscriptions => ASCKitTests/Apps/Subscriptions/Internal}/SDKSubscriptionGroupLocalizationRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Subscriptions => ASCKitTests/Apps/Subscriptions/Internal}/SDKSubscriptionGroupRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Subscriptions => ASCKitTests/Apps/Subscriptions/Internal}/SDKSubscriptionLocalizationRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Subscriptions => ASCKitTests/Apps/Subscriptions/Internal}/SDKSubscriptionPriceRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Subscriptions => ASCKitTests/Apps/Subscriptions/Internal}/SDKSubscriptionPromotionalOfferRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Subscriptions => ASCKitTests/Apps/Subscriptions/Internal}/SDKSubscriptionRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Subscriptions => ASCKitTests/Apps/Subscriptions/Internal}/SDKSubscriptionSubmissionRepositoryTests.swift (95%) rename Tests/{InfrastructureTests/Apps/Subscriptions => ASCKitTests/Apps/Subscriptions/Internal}/SDKWinBackOfferRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Subscriptions/IntroductoryOffers => ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal}/SDKSubscriptionIntroductoryOfferRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Subscriptions/OfferCodes => ASCKitTests/Apps/Subscriptions/OfferCodes/Internal}/SDKSubscriptionOfferCodeRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCodeTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCodeTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePriceTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Subscriptions/Review => ASCKitTests/Apps/Subscriptions/Review/Internal}/SDKSubscriptionReviewRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Subscriptions/Review => ASCKitTests/Apps/Subscriptions/Review/Internal}/SDKSubscriptionReviewRepositoryUploadTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/Review/SubscriptionPromotionalImageTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/Review/SubscriptionReviewCodableTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/Review/SubscriptionReviewScreenshotTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionGroupLocalizationCodableTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionGroupLocalizationTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionPriceCodableTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionPricePointTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionPriceScheduleTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionPromotionalOfferCodableTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionPromotionalOfferTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionSubmissionTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/SubscriptionTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/WinBackOfferCodableTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Subscriptions/WinBackOfferTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/TestFlight/BetaAppLocalizationTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/TestFlight/BetaAppReviewDetailTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/TestFlight/BetaAppReviewSubmissionTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/TestFlight/BetaGroupTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Apps/TestFlight/BetaTesterTests.swift (99%) rename Tests/{InfrastructureTests/Apps/TestFlight => ASCKitTests/Apps/TestFlight/Internal}/SDKBetaAppLocalizationRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/TestFlight => ASCKitTests/Apps/TestFlight/Internal}/SDKBetaAppReviewRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/TestFlight => ASCKitTests/Apps/TestFlight/Internal}/SDKTestFlightRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/AppStoreReviewDetailTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/AppStoreVersionStateTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/AppStoreVersionTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Versions => ASCKitTests/Apps/Versions/Internal}/SDKReviewDetailRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Versions => ASCKitTests/Apps/Versions/Internal}/SDKVersionRepositoryCreateTests.swift (97%) rename Tests/{InfrastructureTests/Apps/Versions => ASCKitTests/Apps/Versions/Internal}/SDKVersionRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/Localizations/AppStoreVersionLocalizationTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Versions/Localizations => ASCKitTests/Apps/Versions/Localizations/Internal}/SDKLocalizationRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/Localizations/PreviewSets/AppPreviewSetTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreviewTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Versions/Localizations/PreviewSets => ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal}/OpenAPIPreviewRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Versions/Localizations/PreviewSets => ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal}/OpenAPIPreviewRepositoryUploadTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift (99%) rename Tests/{InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets => ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal}/SDKScreenshotRepositoryCreateTests.swift (97%) rename Tests/{InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets => ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal}/SDKScreenshotRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets => ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal}/SDKScreenshotRepositoryUploadTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayTypeTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshotTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/VersionReadinessTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Apps/Versions/VersionRepositoryTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Auth/AccountEntryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Auth/AuthCredentialsTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Auth/AuthStatusTests.swift (99%) rename Tests/{InfrastructureTests/Auth => ASCKitTests/Auth/Internal}/CompositeAuthProviderTests.swift (96%) rename Tests/{InfrastructureTests/Auth => ASCKitTests/Auth/Internal}/EnvironmentAuthProviderTests.swift (98%) rename Tests/{InfrastructureTests/Auth => ASCKitTests/Auth/Internal}/FileAuthProviderTests.swift (97%) rename Tests/{InfrastructureTests/Auth => ASCKitTests/Auth/Internal}/FileAuthStorageMultiAccountTests.swift (99%) rename Tests/{InfrastructureTests/Auth => ASCKitTests/Auth/Internal}/FileAuthStorageTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Auth/Iris/IrisAuthSummaryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Auth/Iris/IrisAuthTypesTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/CodeSigning/BundleIDTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/CodeSigning/CertificateTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/CodeSigning/DeviceTests.swift (98%) rename Tests/{InfrastructureTests/CodeSigning => ASCKitTests/CodeSigning/Internal}/SDKBundleIDRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/CodeSigning => ASCKitTests/CodeSigning/Internal}/SDKCertificateRepositoryTests.swift (97%) rename Tests/{InfrastructureTests/CodeSigning => ASCKitTests/CodeSigning/Internal}/SDKDeviceRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/CodeSigning => ASCKitTests/CodeSigning/Internal}/SDKProfileRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/CodeSigning/ProfileTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/GameCenter/GameCenterTests.swift (99%) rename Tests/{InfrastructureTests/GameCenter => ASCKitTests/GameCenter/Internal}/SDKGameCenterRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/GameCenter/Moderation/GameCenterModerationTests.swift (99%) rename Tests/{InfrastructureTests/GameCenter/Moderation => ASCKitTests/GameCenter/Moderation/Internal}/SDKGameCenterModerationRepositoryTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Iris/AppBundles/AppBundleTests.swift (99%) rename Tests/{InfrastructureTests/Iris/InAppPurchases => ASCKitTests/Iris/InAppPurchases/Internal}/IrisSDKInAppPurchaseStateRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Iris/InAppPurchases => ASCKitTests/Iris/InAppPurchases/Internal}/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Iris/InAppPurchases/IrisInAppPurchaseSubmissionTests.swift (98%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/Auth/CompositeIrisCookieProviderTests.swift (98%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/Auth/FileIrisSessionRepositoryTests.swift (97%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/Auth/IdmsaAPIClientTests.swift (99%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/Auth/OlympusClientTests.swift (99%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/Auth/SRP/AppleHashcashTests.swift (98%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/Auth/SRP/AppleSRPClientTests.swift (99%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/Auth/StoredSRPIrisCookieProviderTests.swift (98%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/Auth/URLProtocolStub.swift (100%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/IrisAPIErrorTests.swift (96%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/IrisCookieErrorTests.swift (91%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/IrisCreateAppDocumentTests.swift (99%) rename Tests/{InfrastructureTests/Iris => ASCKitTests/Iris/Internal}/IrisResponseDecodingTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Iris/IrisSessionTests.swift (94%) rename Tests/{DomainTests => ASCKitTests}/Iris/IrisStatusTests.swift (97%) rename Tests/{InfrastructureTests/Iris/ResolutionCenter => ASCKitTests/Iris/ResolutionCenter/Internal}/IrisSDKResolutionCenterRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Iris/ResolutionCenter/ResolutionCenterDetailTests.swift (99%) rename Tests/{InfrastructureTests/Plugins => ASCKitTests/Plugins/Internal}/GitHubPluginSourceTests.swift (97%) rename Tests/{InfrastructureTests/Plugins => ASCKitTests/Plugins/Internal}/PluginSettingsStoreTests.swift (100%) rename Tests/{DomainTests => ASCKitTests}/Plugins/PluginSourceTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Plugins/PluginTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Plugins/PluginUpdateTests.swift (98%) rename Tests/{InfrastructureTests/Projects => ASCKitTests/Projects/Internal}/FileProjectConfigStorageTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Projects/ProjectConfigTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Reports/AnalyticsReportTests.swift (99%) rename Tests/{InfrastructureTests/Reports => ASCKitTests/Reports/Internal}/SDKAnalyticsReportRepositoryTests.swift (99%) rename Tests/{InfrastructureTests/Reports => ASCKitTests/Reports/Internal}/SDKReportRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Reports/ReportFilterTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/AppShotTemplateTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/AppShotsConfigTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/AppShotTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/GalleryApplyTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/GalleryCodableTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/GalleryComposeTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/GalleryHTMLRendererTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/GalleryPreviewOutputTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/GalleryPreviewTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/GalleryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/HTMLComposerTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/ScreenLayoutTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/TemplatePreviewPageTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/Gallery/TextSlotPreviewTests.swift (99%) rename Tests/{InfrastructureTests/ScreenshotPlans => ASCKitTests/Screenshots/Internal}/AggregateGalleryTemplateRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/ScreenshotPlans => ASCKitTests/Screenshots/Internal}/AggregateTemplateRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/ScreenshotPlans => ASCKitTests/Screenshots/Internal}/AggregateThemeRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/ScreenshotPlans => ASCKitTests/Screenshots/Internal}/FileAppShotsConfigStorageTests.swift (96%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/ScreenThemeTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/TemplateApplyTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/TemplateRenderTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/ThemeDesignApplierTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Screenshots/ThemeDesignTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Shared/AffordanceRegistryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Shared/AffordanceTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Shared/ImageAssetTests.swift (96%) rename Tests/{InfrastructureTests/Client => ASCKitTests/Shared/Internal}/ClientFactoryTests.swift (98%) rename Tests/{InfrastructureTests/Shared => ASCKitTests/Shared/Internal}/UploadOperationsExecutorTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Shared/OfferCodeEnvironmentTests.swift (95%) rename Tests/{DomainTests => ASCKitTests}/Shared/OfferCodePriceInputTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Shared/PaginatedResponseTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/Shared/PresentableTests.swift (99%) rename Tests/{InfrastructureTests/Simulators => ASCKitTests/Simulators/Internal}/SimctlSimulatorRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Simulators/SimulatorTests.swift (99%) rename Tests/{InfrastructureTests/Skills => ASCKitTests/Skills/Internal}/FileSkillConfigStorageTests.swift (96%) rename Tests/{InfrastructureTests/Skills => ASCKitTests/Skills/Internal}/ProcessSkillRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/Skills => ASCKitTests/Skills/Internal}/StubShellRunner.swift (93%) rename Tests/{DomainTests => ASCKitTests}/Skills/SkillTests.swift (99%) rename Tests/{InfrastructureTests/Submissions => ASCKitTests/Submissions/Internal}/SDKSubmissionRepositoryTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/Submissions/ReviewItemTargetTests.swift (96%) rename Tests/{DomainTests => ASCKitTests}/Submissions/ReviewSubmissionItemTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Submissions/ReviewSubmissionTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Submissions/SubmissionPlannerTests.swift (99%) rename Tests/{InfrastructureTests/Territories => ASCKitTests/Territories/Internal}/SDKTerritoryRepositoryTests.swift (96%) rename Tests/{DomainTests => ASCKitTests}/Territories/TerritoryTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/TestHelpers/MockRepositoryFactory.swift (99%) rename Tests/{InfrastructureTests => ASCKitTests}/TestHelpers/SequencedStubAPIClient.swift (95%) rename Tests/{InfrastructureTests => ASCKitTests}/TestHelpers/SequencedStubHTTPClient.swift (97%) rename Tests/{InfrastructureTests => ASCKitTests}/TestHelpers/StubAPIClient.swift (99%) rename Tests/{InfrastructureTests => ASCKitTests}/TestHelpers/StubHTTPClient.swift (92%) rename Tests/{InfrastructureTests => ASCKitTests}/TestHelpers/UploadFixtures.swift (100%) rename Tests/{InfrastructureTests/Users => ASCKitTests/Users/Internal}/SDKUserRepositoryTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/Users/UserRoleTests.swift (99%) rename Tests/{InfrastructureTests/XcodeCloud => ASCKitTests/XcodeCloud/Internal}/SDKXcodeCloudBuildRunRepositoryTests.swift (98%) rename Tests/{InfrastructureTests/XcodeCloud => ASCKitTests/XcodeCloud/Internal}/SDKXcodeCloudProductRepositoryTests.swift (97%) rename Tests/{InfrastructureTests/XcodeCloud => ASCKitTests/XcodeCloud/Internal}/SDKXcodeCloudWorkflowRepositoryTests.swift (97%) rename Tests/{DomainTests => ASCKitTests}/XcodeCloud/XcodeCloudBuildRunTests.swift (99%) rename Tests/{DomainTests => ASCKitTests}/XcodeCloud/XcodeCloudProductTests.swift (98%) rename Tests/{DomainTests => ASCKitTests}/XcodeCloud/XcodeCloudWorkflowTests.swift (99%) create mode 100644 docs/features/concept-folders/design.md diff --git a/CHANGELOG.md b/CHANGELOG.md index db3612b2..08a17cf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- **Breaking (library):** the `ASCKit` product is one module, `ASCKit`; replace `import Domain` and `import Infrastructure` with `import ASCKit`. The CLI is unchanged. → [design](docs/features/concept-folders/design.md) + --- ## [0.18.9] - 2026-11-08 diff --git a/Package.swift b/Package.swift index 0790a827..95be80c9 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ let package = Package( platforms: [.macOS(.v14)], products: [ .executable(name: "asc", targets: ["ASCCommand"]), - .library(name: "ASCKit", targets: ["Domain", "Infrastructure"]), + .library(name: "ASCKit", targets: ["ASCKit"]), .library(name: "ASCPlugin", targets: ["ASCPlugin"]), ], dependencies: [ @@ -30,32 +30,25 @@ let package = Package( ] ), .target( - name: "Domain", + name: "ASCKit", dependencies: [ + "ASCPlugin", .product(name: "Mockable", package: "Mockable"), .product(name: "Mustache", package: "swift-mustache"), - ], - resources: [.copy("Screenshots/Gallery/Resources")], - swiftSettings: [.define("MOCKING")] - ), - .target( - name: "Infrastructure", - dependencies: [ - "Domain", - "ASCPlugin", .product(name: "AppStoreConnect-Swift-SDK", package: "appstoreconnect-swift-sdk"), .product(name: "SweetCookieKit", package: "sweetcookiekit"), .product(name: "Hummingbird", package: "hummingbird"), .product(name: "HummingbirdTLS", package: "hummingbird"), .product(name: "HummingbirdWebSocket", package: "hummingbird-websocket"), .product(name: "SRP", package: "swift-srp"), - ] + ], + resources: [.copy("Screenshots/Gallery/Resources")], + swiftSettings: [.define("MOCKING")] ), .executableTarget( name: "ASCCommand", dependencies: [ - "Domain", - "Infrastructure", + "ASCKit", "ASCPlugin", .product(name: "ArgumentParser", package: "swift-argument-parser"), .product(name: "TauTUI", package: "TauTUI"), @@ -63,18 +56,9 @@ let package = Package( resources: [.copy("Resources/mockups")] ), .testTarget( - name: "DomainTests", - dependencies: [ - "Domain", - .product(name: "Mockable", package: "Mockable"), - ], - swiftSettings: [.define("MOCKING")] - ), - .testTarget( - name: "InfrastructureTests", + name: "ASCKitTests", dependencies: [ - "Infrastructure", - "Domain", + "ASCKit", .product(name: "Mockable", package: "Mockable"), ], swiftSettings: [.define("MOCKING")] @@ -83,7 +67,7 @@ let package = Package( name: "ASCCommandTests", dependencies: [ "ASCCommand", - "Domain", + "ASCKit", .product(name: "Mockable", package: "Mockable"), .product(name: "HummingbirdTesting", package: "hummingbird"), .product(name: "HummingbirdWebSocket", package: "hummingbird-websocket"), diff --git a/Sources/ASCCommand/ClientProvider.swift b/Sources/ASCCommand/ClientProvider.swift index 2c3b2997..531d0780 100644 --- a/Sources/ASCCommand/ClientProvider.swift +++ b/Sources/ASCCommand/ClientProvider.swift @@ -1,6 +1,5 @@ -import Domain +import ASCKit import Foundation -import Infrastructure struct ClientProvider { static func makeAppRepository() throws -> any AppRepository { diff --git a/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift b/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift index 789815de..0df6b8df 100644 --- a/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift +++ b/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AgeRatingCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift index 3d284224..47bd8902 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AnalyticsReportsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift index 08811a45..739b134c 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AnalyticsReportsInstancesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift index 62b07944..3ff56f2f 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AnalyticsReportsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift index f6109eb6..ca83d0a5 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AnalyticsReportsReportsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift index ecd695e4..67e1c51a 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AnalyticsReportsRequest: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift index c2c8729b..a1c0e4e3 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AnalyticsReportsSegmentsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift b/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift index e2c753ff..a875cc4a 100644 --- a/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift +++ b/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppCategoriesCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift index cae35429..4ab8aa6d 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppClipExperienceLocalizationsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift index 92bad6b7..8fc3c857 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppClipExperienceLocalizationsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift index 11c99bdd..fbfcff2a 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppClipExperienceLocalizationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift index 011e4719..3d26ae73 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppClipExperiencesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift index e2cf8ebc..560d53fb 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppClipExperiencesDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift index e711340d..eb376219 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppClipExperiencesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift b/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift index f3555bbc..53e1fe3d 100644 --- a/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift +++ b/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppClipsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift b/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift index 29fa4736..ec37c8b0 100644 --- a/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift +++ b/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppInfoLocalizationsCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift b/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift index 47505863..f9344c8b 100644 --- a/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift +++ b/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppInfosCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift b/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift index ce1a22cf..bffbc7b1 100644 --- a/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift +++ b/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct AppPreviewSetsCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift b/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift index c47f3190..27368ba8 100644 --- a/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift +++ b/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct AppPreviewsCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsCommand.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsCommand.swift index a54cb38e..bcbe9cd4 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsCommand.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppShotsCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsConfig.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsConfig.swift index 8841ed63..0f6c9aea 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsConfig.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsConfig.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct AppShotsConfig: AsyncParsableCommand { static let configuration = CommandConfiguration( @@ -29,7 +28,7 @@ struct AppShotsConfig: AsyncParsableCommand { } if let key = geminiApiKey, !key.isEmpty { - let config = Domain.AppShotsConfig(geminiApiKey: key) + let config = ASCKit.AppShotsConfig(geminiApiKey: key) try storage.save(config) let masked = String(key.prefix(8)) + "..." + String(key.suffix(4)) return "Gemini API key saved to ~/.asc/app-shots-config.json (\(masked))" diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsExport.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsExport.swift index eb414916..71bc8b3d 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsExport.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsExport.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct AppShotsExport: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift index 3c7012ff..d205b177 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct AppShotsGalleryTemplatesCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsGenerate.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsGenerate.swift index 9c9116db..e3e8886a 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsGenerate.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsGenerate.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct AppShotsGenerate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift index 85ab8ae6..a2d88d38 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct AppShotsTemplatesCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift index 2783f83c..409d3ca1 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct AppShotsThemesCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsUtils.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsUtils.swift index 09c3ec10..6022c195 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsUtils.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsUtils.swift @@ -1,6 +1,6 @@ import ArgumentParser import CoreGraphics -import Domain +import ASCKit import Foundation import ImageIO diff --git a/Sources/ASCCommand/Commands/AppWall/AppWallSubmit.swift b/Sources/ASCCommand/Commands/AppWall/AppWallSubmit.swift index 85598ceb..6491b5ea 100644 --- a/Sources/ASCCommand/Commands/AppWall/AppWallSubmit.swift +++ b/Sources/ASCCommand/Commands/AppWall/AppWallSubmit.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct AppWallSubmit: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Apps/AppsList.swift b/Sources/ASCCommand/Commands/Apps/AppsList.swift index cf6f5ac9..712607d3 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsList.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift b/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift index 3729bad5..b49c32a1 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppsPricePointsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift b/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift index 64b44f71..d5a43977 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppsPricesSet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift b/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift index 7e45f618..80933c49 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift index bba65520..8100feb1 100644 --- a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AppAvailabilityCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift index 1e616ba2..59023faa 100644 --- a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift @@ -1,6 +1,6 @@ import Foundation import ArgumentParser -import Domain +import ASCKit struct AppAvailabilityGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift index 08a511bb..9ee18d77 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct AssetImagesCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift index d6923e13..98836752 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit extension AssetPlacementType: ExpressibleByArgument {} extension LibraryAssetState: ExpressibleByArgument {} diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift index 270afb1f..73c7d085 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct AssetPlacementsCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift index a4c71e4e..7fc08e2d 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct AssetVideosCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Auth/AuthCommand.swift b/Sources/ASCCommand/Commands/Auth/AuthCommand.swift index 24852f03..828986cd 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthCommand.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthCommand.swift @@ -1,6 +1,5 @@ import ArgumentParser -import Domain -import Infrastructure +import ASCKit struct AuthCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Auth/AuthList.swift b/Sources/ASCCommand/Commands/Auth/AuthList.swift index c92a3943..a48732f0 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthList.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthList.swift @@ -1,6 +1,5 @@ import ArgumentParser -import Domain -import Infrastructure +import ASCKit struct AuthList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Auth/AuthLogin.swift b/Sources/ASCCommand/Commands/Auth/AuthLogin.swift index 7f1c63d1..307e13dc 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthLogin.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthLogin.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct AuthLogin: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Auth/AuthLogout.swift b/Sources/ASCCommand/Commands/Auth/AuthLogout.swift index 74e521e6..fc56d69a 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthLogout.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthLogout.swift @@ -1,6 +1,5 @@ import ArgumentParser -import Domain -import Infrastructure +import ASCKit struct AuthLogout: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Auth/AuthUpdate.swift b/Sources/ASCCommand/Commands/Auth/AuthUpdate.swift index 6ad28c6d..dcf9daf5 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthUpdate.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthUpdate.swift @@ -1,6 +1,5 @@ import ArgumentParser -import Domain -import Infrastructure +import ASCKit struct AuthUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Auth/AuthUse.swift b/Sources/ASCCommand/Commands/Auth/AuthUse.swift index 97c09af9..b1c4dfd8 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthUse.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthUse.swift @@ -1,6 +1,5 @@ import ArgumentParser -import Domain -import Infrastructure +import ASCKit struct AuthUse: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift index 3dce4bad..8481708a 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaAppLocalizationsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift index 7bffc92a..2162131f 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaAppLocalizationsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift index 07032cb0..11de68b9 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaAppLocalizationsGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift index f7b20c63..5259cc6a 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaAppLocalizationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift index 766ebd9e..89002b60 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaAppLocalizationsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift index 34235c97..647f46c9 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaReviewDetailGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift index d0c768be..fe5b7574 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaReviewDetailUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( @@ -42,7 +42,7 @@ struct BetaReviewDetailUpdate: AsyncParsableCommand { } func execute(repo: any BetaAppReviewRepository) async throws -> String { - let update = Domain.BetaAppReviewDetailUpdate( + let update = ASCKit.BetaAppReviewDetailUpdate( contactFirstName: contactFirstName, contactLastName: contactLastName, contactPhone: contactPhone, diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift index f64003f9..1f1f62db 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaReviewSubmissionsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift index 8c252b51..9637cfcf 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaReviewSubmissionsGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift index 9594e4e0..22002c43 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BetaReviewSubmissionsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift b/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift index c6d7125f..32e88b12 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsAddBetaGroup: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift b/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift index 43681698..c30e034c 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct BuildsArchive: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsList.swift b/Sources/ASCCommand/Commands/Builds/BuildsList.swift index ebc74864..015d5f21 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsList.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift b/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift index 256e8b80..5b3c42f1 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsNextNumber: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift b/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift index f8bdaa16..58192ebc 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsRemoveBetaGroup: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift b/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift index 42e5787c..f610c471 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsSetEncryptionCompliance: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift b/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift index 159cb887..c0a0145c 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsUpdateBetaNotes: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift b/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift index c6477ffd..8fe67264 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct BuildsUpload: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift index 5ddebcad..e480fd02 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsUploadsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift index 511ce3e2..ee8117a0 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsUploadsGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift index 23a8e880..23464f54 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BuildsUploadsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift index af9938d5..bcb71487 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BundleIDsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift index b1731eac..53df1d4a 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BundleIDsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift index a6c3b7a6..88f94743 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct BundleIDsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift index 70a906de..9c4908ce 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct CertificatesCreate: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift index 062fed87..01b01589 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct CertificatesList: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift index 31331757..dce7e140 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct CertificatesRevoke: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Devices/DevicesList.swift b/Sources/ASCCommand/Commands/Devices/DevicesList.swift index b4cb3b98..92b3a364 100644 --- a/Sources/ASCCommand/Commands/Devices/DevicesList.swift +++ b/Sources/ASCCommand/Commands/Devices/DevicesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct DevicesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift b/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift index 6eaa65d6..f7e380c9 100644 --- a/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift +++ b/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct DevicesRegister: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift index 864bf08b..0088dd49 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentTreatmentLocalizationsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift index 581dda40..e6a1c079 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentTreatmentLocalizationsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift index 5b2f811c..35e84b78 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentTreatmentLocalizationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift index 75ab37d0..71a47135 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentTreatmentsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift index efa2d5c8..403a2a04 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentTreatmentsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift index 90b3a52e..e39f2458 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentTreatmentsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift index 0f77130f..346da740 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentTreatmentsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift index 7f89996e..5d9e4faa 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift index b3925755..bbbba8dd 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift index ee874734..41fad093 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentsGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift index f51c4f8a..dcd28eb8 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift index c797bad0..0fe823c2 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentsStart: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift index 0773ff4b..59596f0e 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentsStop: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift index 357dce8d..f462291d 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ExperimentsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift b/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift index f5c178d0..21c9e372 100644 --- a/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift +++ b/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit // MARK: - Parent Command diff --git a/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift b/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift index bd2a6999..97d637a0 100644 --- a/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift +++ b/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit // MARK: - Score moderations diff --git a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift index 652f52a8..e17aa1e4 100644 --- a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPAvailabilityCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift index 15b97be5..4181fa8e 100644 --- a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPAvailabilityGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPCreate.swift b/Sources/ASCCommand/Commands/IAP/IAPCreate.swift index b2fc5e1e..d528a5d6 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPCreate.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPDelete.swift b/Sources/ASCCommand/Commands/IAP/IAPDelete.swift index 7565756a..448f09e7 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPDelete.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPList.swift b/Sources/ASCCommand/Commands/IAP/IAPList.swift index a70332a5..d93ae9e8 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift b/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift index 259214f4..02874deb 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPPricePointsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift b/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift index f32b08cc..42c9cf7b 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPPricesSet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift b/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift index ba709fd5..03e3a020 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPSubmit: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift b/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift index 86bd979a..a6f0d269 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPUnsubmit: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift b/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift index a4823095..4989d987 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift b/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift index 66035cb0..764ba9a4 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPVersionsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift b/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift index 3eae82b9..8ad5aacd 100644 --- a/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift +++ b/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPEqualizationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift index 22dc2f06..5a3d444d 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPImagesDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift index c7b0e6f2..e74006cb 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPImagesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift index 2ce7ad52..8c46a8da 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct IAPImagesUpload: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift index 8a09cbf7..c5a54112 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPLocalizationsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift index 3eced9c8..bf1d8db6 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPLocalizationsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift index 37879e65..12dd6ee6 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPLocalizationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift index 9a7ae0c6..c4f59e64 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPLocalizationsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift index fa1a9f23..d579b54b 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodeCustomCodesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift index 1bd3aac5..7ab74073 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodeCustomCodesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift index aa40804e..89e44883 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodeCustomCodesUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift index 21b253d5..b1b752b6 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit extension OfferCodeEnvironment: ExpressibleByArgument { public init?(argument: String) { diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift index 6f8ce2c9..503d2848 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodeOneTimeCodesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift index 0ef493a6..3d11201e 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodeOneTimeCodesUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift index 92220a99..a5a2e6d5 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodeOneTimeCodesValues: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift index 0b2445ac..b1932b14 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift index 5c07acee..36b30481 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift index 3fec25b9..801a9e95 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodesPricesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift index 80e0bcc9..48af2c55 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPOfferCodesUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift b/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift index 28020917..e19fea02 100644 --- a/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift +++ b/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPPriceScheduleGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift index 41c4adb4..e0c20362 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPReviewScreenshotDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift index 4d842830..9a1aa19f 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IAPReviewScreenshotGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift index 8fee8732..be6b84fa 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct IAPReviewScreenshotUpload: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Init/InitCommand.swift b/Sources/ASCCommand/Commands/Init/InitCommand.swift index 87abf9fb..9a5240d5 100644 --- a/Sources/ASCCommand/Commands/Init/InitCommand.swift +++ b/Sources/ASCCommand/Commands/Init/InitCommand.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct InitCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift index 1506f779..e705a104 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct IrisAuthLogin: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift index c166aff5..fa8e452a 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct IrisAuthLogout: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift index 96e277a5..9a19d101 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct IrisAuthVerifyCode: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift index ce53d5d8..3dd3ad80 100644 --- a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit /// `asc iris iap-submissions create --iap-id ` — submits an IAP via the iris /// private API. The default `--with-next-version` (i.e. `submitWithNextAppStoreVersion: true`) diff --git a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift index 3697a320..f78cda31 100644 --- a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift +++ b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit /// `asc iris iap-submissions delete --submission-id ` — removes an iris-queued /// IAP submission. Iris-queued submissions can only round-trip through the iris diff --git a/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift b/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift index 404e9951..41865a76 100644 --- a/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift +++ b/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IrisAppsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift b/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift index ebf19bda..bb06ee14 100644 --- a/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift +++ b/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IrisAppsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Iris/IrisStatus.swift b/Sources/ASCCommand/Commands/Iris/IrisStatus.swift index 06912f71..68448d3f 100644 --- a/Sources/ASCCommand/Commands/Iris/IrisStatus.swift +++ b/Sources/ASCCommand/Commands/Iris/IrisStatus.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct IrisStatus: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift b/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift index 9a428a92..171625bd 100644 --- a/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift +++ b/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation /// `asc iris resolution-center get --submission-id ` — reads App Review's diff --git a/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift b/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift index f505567c..8f6fa34f 100644 --- a/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct DiagnosticLogsCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift b/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift index c24c4310..2ec66f0c 100644 --- a/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct DiagnosticsCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift b/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift index 8860baf4..c2a68dcc 100644 --- a/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct PerfMetricsCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift b/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift index a4b34360..a13c3fe3 100644 --- a/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct PerfOverviewCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsInstall.swift b/Sources/ASCCommand/Commands/Plugins/PluginsInstall.swift index e8e720f4..00f24d2c 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsInstall.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsInstall.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PluginsInstall: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsList.swift b/Sources/ASCCommand/Commands/Plugins/PluginsList.swift index 5e523f8a..ca5663db 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsList.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PluginsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsMarket.swift b/Sources/ASCCommand/Commands/Plugins/PluginsMarket.swift index 1c1b766c..3463a029 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsMarket.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsMarket.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PluginsMarket: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsUninstall.swift b/Sources/ASCCommand/Commands/Plugins/PluginsUninstall.swift index ed9161be..b3072234 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsUninstall.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsUninstall.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PluginsUninstall: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsUpdate.swift b/Sources/ASCCommand/Commands/Plugins/PluginsUpdate.swift index 03abdea4..93984814 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsUpdate.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PluginsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsUpdates.swift b/Sources/ASCCommand/Commands/Plugins/PluginsUpdates.swift index 4de6eedd..a4d8aa7c 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsUpdates.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsUpdates.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PluginsUpdates: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift index 68a53411..ac17f210 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ProfilesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift index 84615839..2e65537c 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ProfilesDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift index d0feaad0..7168cb60 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ProfilesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift index 3f7f23b8..334c360d 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PromotedPurchasesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift index 7fc998cf..ddcc7c1b 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PromotedPurchasesDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift index 27a1ac63..8a2453c3 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PromotedPurchasesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift index 0eec33f1..c531f309 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct PromotedPurchasesUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift b/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift index a549a49d..47984a35 100644 --- a/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift +++ b/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift @@ -1,6 +1,5 @@ import ArgumentParser -import Domain -import Infrastructure +import ASCKit struct FinanceReportsDownload: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift b/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift index 89722498..d1ee089d 100644 --- a/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift +++ b/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift @@ -1,6 +1,5 @@ import ArgumentParser -import Domain -import Infrastructure +import ASCKit struct SalesReportsDownload: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift b/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift index 6888e2a9..4fe5fa0b 100644 --- a/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift +++ b/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift @@ -1,7 +1,6 @@ import ArgumentParser -import Domain +import ASCKit import Foundation -import Infrastructure struct SalesReportsSummary: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reports/VendorNumberResolver.swift b/Sources/ASCCommand/Commands/Reports/VendorNumberResolver.swift index f0316f78..eb6075d3 100644 --- a/Sources/ASCCommand/Commands/Reports/VendorNumberResolver.swift +++ b/Sources/ASCCommand/Commands/Reports/VendorNumberResolver.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit enum VendorNumberResolver { static func resolve(explicit: String?, storage: any AuthStorage) throws -> String { diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift index 5c413b0f..0c10b602 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewSubmissionItemsAdd: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift index e697ef4d..1c7dc168 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewSubmissionItemsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift index 273229b4..1c88551d 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewSubmissionItemsRemove: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift index 7f7274d7..381bf35b 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewSubmissionsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift index 82eef503..c2270fb2 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewSubmissionsGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift index 8065b65f..1fa86c13 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct ReviewSubmissionsList: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift index 43863926..cec5a855 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewSubmissionsSubmit: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift index baf50504..9f69b085 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewResponsesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift index 57abc7f3..c523a9d0 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewResponsesDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift index ef6d7664..6777b0a4 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewResponsesGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift b/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift index 87707637..a0072370 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewsGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift b/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift index dad94d78..59accf88 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ReviewsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift index 604e97b8..7546d7d7 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ScreenshotSetsCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift index 56596463..d474b58b 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ScreenshotSetsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift index a81211b8..79cc8c64 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ScreenshotSetsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotImportFiles.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotImportFiles.swift index 11db1413..5e357903 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotImportFiles.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotImportFiles.swift @@ -1,6 +1,6 @@ import ArgumentParser import CryptoKit -import Domain +import ASCKit import Foundation import ImageIO diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift index e799d292..1dd0f856 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ScreenshotsCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift index 250d69c1..06190109 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct ScreenshotsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift index 5d5e2279..0ec12128 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation extension ExistingScreenshotsPolicy: ExpressibleByArgument {} diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift index ab7583b5..3d7ac9e8 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct ScreenshotsUpload: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Shared/OfferCodePriceParser.swift b/Sources/ASCCommand/Commands/Shared/OfferCodePriceParser.swift index 830e116f..70419c82 100644 --- a/Sources/ASCCommand/Commands/Shared/OfferCodePriceParser.swift +++ b/Sources/ASCCommand/Commands/Shared/OfferCodePriceParser.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit /// Parses CLI `--price =` and `--free-territory ` /// flags into the domain `OfferCodePriceInput` list. diff --git a/Sources/ASCCommand/Commands/Simulators/SimulatorsBoot.swift b/Sources/ASCCommand/Commands/Simulators/SimulatorsBoot.swift index a0e1293e..6207cd17 100644 --- a/Sources/ASCCommand/Commands/Simulators/SimulatorsBoot.swift +++ b/Sources/ASCCommand/Commands/Simulators/SimulatorsBoot.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SimulatorsBoot: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Simulators/SimulatorsList.swift b/Sources/ASCCommand/Commands/Simulators/SimulatorsList.swift index d0d07e97..d94c7d63 100644 --- a/Sources/ASCCommand/Commands/Simulators/SimulatorsList.swift +++ b/Sources/ASCCommand/Commands/Simulators/SimulatorsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SimulatorsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Simulators/SimulatorsShutdown.swift b/Sources/ASCCommand/Commands/Simulators/SimulatorsShutdown.swift index 3618b566..760743d4 100644 --- a/Sources/ASCCommand/Commands/Simulators/SimulatorsShutdown.swift +++ b/Sources/ASCCommand/Commands/Simulators/SimulatorsShutdown.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SimulatorsShutdown: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Skills/SkillUpdateChecker.swift b/Sources/ASCCommand/Commands/Skills/SkillUpdateChecker.swift index 36aa15cc..4badcc62 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillUpdateChecker.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillUpdateChecker.swift @@ -1,4 +1,4 @@ -import Domain +import ASCKit import Foundation /// Non-blocking auto-update checker called on every `asc` command. diff --git a/Sources/ASCCommand/Commands/Skills/SkillsCheck.swift b/Sources/ASCCommand/Commands/Skills/SkillsCheck.swift index f4cd197c..217accc3 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsCheck.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsCheck.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct SkillsCheck: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Skills/SkillsInstall.swift b/Sources/ASCCommand/Commands/Skills/SkillsInstall.swift index 4ef71286..caa87363 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsInstall.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsInstall.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SkillsInstall: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Skills/SkillsInstalled.swift b/Sources/ASCCommand/Commands/Skills/SkillsInstalled.swift index c3c06312..91a23c0d 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsInstalled.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsInstalled.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct SkillsInstalled: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Skills/SkillsList.swift b/Sources/ASCCommand/Commands/Skills/SkillsList.swift index 75a34f7f..3e8d5907 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsList.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SkillsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Skills/SkillsUninstall.swift b/Sources/ASCCommand/Commands/Skills/SkillsUninstall.swift index 5a915c21..1ac05ba5 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsUninstall.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsUninstall.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct SkillsUninstall: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Skills/SkillsUpdate.swift b/Sources/ASCCommand/Commands/Skills/SkillsUpdate.swift index dafef13c..0420bf46 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsUpdate.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SkillsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift index 5a5557b0..af144c5a 100644 --- a/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionEqualizationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift index c11d8ae9..4df0f986 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupLocalizationsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift index 9fdedc10..4fcfc0c0 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupLocalizationsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift index 35b08534..e66fc1f9 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupLocalizationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift index 27d765ac..78122687 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupLocalizationsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift index 4996ff73..5e7ea110 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupVersionsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift index 904b4f8b..8c076b29 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift index 15ea730c..5da749a6 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift index cfb161b2..28e6553b 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift index 8464489d..6cd7aa23 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionGroupsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift index 73c80faf..a73b9669 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionImagesDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift index c7538711..c57c2d38 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionImagesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift index fccdc315..c40c5364 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct SubscriptionImagesUpload: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift index e10d0c47..b4c504da 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionLocalizationsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift index 627a4503..00182753 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionLocalizationsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift index 5183e66f..8c7da946 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionLocalizationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift index b43884e5..75e1fd8f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionLocalizationsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift index d78c3cdf..819844a8 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodeCustomCodesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift index eebff9d4..3bef1272 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodeCustomCodesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift index 9558a148..790970aa 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodeCustomCodesUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift index 07719805..37b0eaae 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodeOneTimeCodesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift index 8b0e474b..bfdbcc9e 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodeOneTimeCodesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift index 0b5a6e26..ae57b2b4 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodeOneTimeCodesUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift index c916a27d..930d23cf 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodeOneTimeCodesValues: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift index 202a9fca..1e4446bc 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodesCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift index 6c73d2f7..b6c25f1d 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift index 44c355b5..0e816cd8 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodesPricesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift index d81e335a..640343ba 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOfferCodesUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift index 6b65b3d0..56de892d 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOffersCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift index 89ab79f5..86b4926d 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOffersDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift index 6501d55f..3431672f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionOffersList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift b/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift index 15e077ca..44413a7f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionPriceScheduleGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift index 955cb56f..e7e66b93 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct SubscriptionPromotionalOffersCreate: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift index 2a7c2c78..ed42e06e 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionPromotionalOffersDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift index 0d2c9880..6d425915 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionPromotionalOffersList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift index c59dff7d..a1c86865 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionPromotionalOffersPricesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift index 0eb10d9c..f6469565 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionReviewScreenshotDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift index d5cf8257..dc0da55f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionReviewScreenshotGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift index eedbad25..1808eee6 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct SubscriptionReviewScreenshotUpload: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift index 0700387c..d22f19f7 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionAvailabilityCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift index f4ceded0..e578904e 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionAvailabilityGet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift index 649d9711..7fa946ff 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionPricePointsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift index 6a173a58..418368be 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionPricesSet: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift index 627ecf02..5f6b4301 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionPricesSetBatch: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift index 4ec98088..1fd9d37a 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionVersionsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift index d3970036..b1a1cdcf 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift index fa248c87..b1be83f8 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionsDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift index 519d538c..935185eb 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift index 9d38ab49..e8a203b4 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionsSubmit: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift index 3e393b59..f7b6abd8 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct SubscriptionsUnsubmit: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift index 4252b072..1dbee4e5 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit extension SubscriptionPeriod: ExpressibleByArgument {} extension SubscriptionMultiSeatStatus: ExpressibleByArgument {} diff --git a/Sources/ASCCommand/Commands/TUI/TUIApp.swift b/Sources/ASCCommand/Commands/TUI/TUIApp.swift index b0082496..0b1bfea3 100644 --- a/Sources/ASCCommand/Commands/TUI/TUIApp.swift +++ b/Sources/ASCCommand/Commands/TUI/TUIApp.swift @@ -1,7 +1,6 @@ import Foundation import TauTUI -import Domain -import Infrastructure +import ASCKit @MainActor final class TUIApp { diff --git a/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift b/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift index e36d693c..9e1f6281 100644 --- a/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift +++ b/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct TerritoriesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift b/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift index 3ee48832..bf550d2a 100644 --- a/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift +++ b/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct TestFlightCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift index 0e83603b..a0780d8a 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct UserInvitationsCancel: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift index bdcc35be..2fd2a5ef 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct UserInvitationsInvite: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift index e754bf46..97f64c9d 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct UserInvitationsList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Users/UsersList.swift b/Sources/ASCCommand/Commands/Users/UsersList.swift index 821a80f3..13f1e8af 100644 --- a/Sources/ASCCommand/Commands/Users/UsersList.swift +++ b/Sources/ASCCommand/Commands/Users/UsersList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct UsersList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Users/UsersRemove.swift b/Sources/ASCCommand/Commands/Users/UsersRemove.swift index 40055290..963a3af5 100644 --- a/Sources/ASCCommand/Commands/Users/UsersRemove.swift +++ b/Sources/ASCCommand/Commands/Users/UsersRemove.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct UsersRemove: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Users/UsersUpdate.swift b/Sources/ASCCommand/Commands/Users/UsersUpdate.swift index dba6e941..99586232 100644 --- a/Sources/ASCCommand/Commands/Users/UsersUpdate.swift +++ b/Sources/ASCCommand/Commands/Users/UsersUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct UsersUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift index b1ad308a..a59ebc88 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionLocalizationsCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift index 8234d9a6..9fde0ec5 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionLocalizationsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift index 078e6360..94bc83d6 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionLocalizationsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift b/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift index 92b16c76..79436c7e 100644 --- a/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift +++ b/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionReviewDetailCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift b/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift index eab603d9..bf4dbfc5 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionsCheckReadiness: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift b/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift index dbef9b41..145d26de 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionsCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift b/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift index ee458f3c..201dfb8d 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionsCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift b/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift index d68dc7b1..ac3eab01 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionsSetBuild: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift index bf403a70..62db8fdb 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionsSubmit: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift b/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift index 58efd66e..c421935d 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct VersionsUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift index c79ae4da..dc3bc158 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `AgeRatingDeclaration` resources. struct AgeRatingController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift index 3d5ac0a6..b92c9fb6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift @@ -1,8 +1,7 @@ import Foundation -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `GET /apps/:appId/availability` — the app's availability (`data: []` when never set up). /// `POST /apps/:appId/availability` — set it up. Body keys match the CLI flags: diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift index e7fa377f..5560b1bc 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `AppCategory` resources. struct AppCategoriesController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift index e655535e..1baacdc4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Returns the String value for a JSON key, or nil if missing/null. /// Use this for PATCH bodies where an absent key means "don't change". diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift index 2d64d234..49b4b0c6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift @@ -1,8 +1,7 @@ import Foundation -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// App pricing (mirrors `IAPPricePointsController` / `IAPPricesController`): /// `GET /apps/:appId/price-points?territory=USA` and `POST /apps/:appId/prices/set` diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift index c639f623..0e1fb2fc 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift @@ -1,9 +1,8 @@ import ArgumentParser -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket import ASCPlugin -import Infrastructure import Foundation /// /api/v1/app-shots — Screenshot template, theme, export, and AI generation. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift index 7f92c927..4f63bfd5 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `App` resources. struct AppsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift index f2eaa155..f7ec7ebe 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes for the App Asset Library: the library, its images, placement groups and placements. /// diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AuthController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AuthController.swift index c842a340..6d655cc8 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AuthController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AuthController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that manage saved App Store Connect API key credentials. /// diff --git a/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift index 4bbd5a6c..038dc5db 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `BetaAppLocalization` resources. struct BetaAppLocalizationsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift index 88d902ce..7e227c99 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `Build` resources (both fleet and per-app listings). struct BuildsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift b/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift index f5a427b8..58af6aaa 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift @@ -2,8 +2,7 @@ import Foundation import Hummingbird import HummingbirdWebSocket import ASCPlugin -import Domain -import Infrastructure +import ASCKit /// /api/v1/certificates, bundle-ids, devices, profiles — Code signing routes. struct CodeSigningController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift index c5b8ed50..d56bad33 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `CustomerReview` resources. struct CustomerReviewsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift index 09d5cd30..b7562711 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift @@ -1,8 +1,7 @@ import Foundation -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `GET /builds/:buildId/diagnostics?diagnostic-type=…` — a build's diagnostic signatures; /// `GET /diagnostics/:signatureId/logs` — the logs behind one signature. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift index 45c0bd3c..a8895e9d 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes for product page optimization tests (`AppStoreVersionExperiment`), /// their treatments and treatment localizations. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift b/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift index e580f3d4..0197a514 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes for Game Center: the app's Game Center detail, its achievements and leaderboards, /// and moderation of leaderboard scores and players. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift index 32ac2e4b..76e7fdb4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return the per-territory availability of an in-app purchase. struct IAPAvailabilityController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift index 29378c30..3ed9407a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `InAppPurchase` resources. struct IAPController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift index 2d9e5820..8dda8a05 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return Apple's auto-equalized territory prices for an IAP price point. struct IAPEqualizationsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift index e4ce7837..eda48c00 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// ASC's IAP localization field constraints. Public so future controllers and validators /// can stay in sync with the iOS app's `LocaleCard` limits (`limit: 30` / `limit: 45`). diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift index 502ea3c1..e7126be8 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `InAppPurchaseOfferCodeOneTimeUseCode` resources. /// diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift index 1be656e7..9732dbcd 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `InAppPurchaseOfferCode` resources. struct IAPOfferCodesController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift index 470f1aca..52296638 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `InAppPurchasePricePoint` resources. struct IAPPricePointsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift index 2a442b95..8e2f1052 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return the manual price schedule for an in-app purchase. struct IAPPriceScheduleController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift index dbc9a327..5d97799b 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes for setting (or changing) the manual base price of an IAP. Calling with a new /// `baseTerritory` is how the iOS app implements "Change Base Territory" — ASC replaces diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift index 62c60a87..7010cf4e 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return IAP review screenshot + promotional images. struct IAPReviewController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift index 0f3b4d0e..ac92bad4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `POST /iap/:iapId/submit` — submits an IAP for App Store review. /// `DELETE /iap-submissions/:submissionId` — unsubmits (withdraws from review). diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift index 51c22072..4eccbf28 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `POST /api/v1/iris/iap/:iapId/submissions` — submits an IAP via the iris private API, /// the only path that accepts `submitWithNextAppStoreVersion`. Body: diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift index 1f6107b4..1ca59c0e 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `GET /api/v1/iris/review-submissions/:submissionId/resolution-center` — /// App Review's Resolution Center messages and rejection reasons for a review diff --git a/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift index c546aacd..5d861ad7 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return per-territory prices attached to IAP and subscription offer codes. struct OfferCodePricesController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift index 38a112b0..552dab76 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift @@ -1,8 +1,7 @@ import Foundation -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `GET /apps/:appId/perf-metrics` and `GET /builds/:buildId/perf-metrics` — power and /// performance metrics. The `metric-type` query param matches the CLI flag `--metric-type`. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift index 4a042b3b..f8959bef 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift @@ -1,8 +1,7 @@ import Foundation -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `GET /apps/:appId/perf-overview?device-type=…` — the app's Xcode Organizer overview. /// The query param matches the CLI flag `--device-type`. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PluginsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PluginsController.swift index 22d75ef4..2091bb20 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PluginsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PluginsController.swift @@ -1,9 +1,8 @@ import ASCPlugin -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// /api/v1/plugins — Plugin routes. /// diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift index ea1686d1..154659c1 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Review versions of in-app purchases, subscriptions and subscription groups. /// A submittable version is sent to review by adding it to a review submission. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift index fc318812..db70d4b0 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `PromotedPurchase` resources (App Store product page promoted slots). struct PromotedPurchasesController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift index d89e6938..2a875bdb 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift @@ -2,8 +2,7 @@ import Foundation import Hummingbird import HummingbirdWebSocket import ASCPlugin -import Domain -import Infrastructure +import ASCKit /// /api/v1/apps/{appId}/review-submissions — App Store review submissions. /// diff --git a/Sources/ASCCommand/Commands/Web/Controllers/RootController.swift b/Sources/ASCCommand/Commands/Web/Controllers/RootController.swift index f0c6ae39..691fe128 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/RootController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/RootController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import ASCPlugin -import Infrastructure /// GET /api/v1 — HATEOAS entry point listing all available resources. struct RootController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift index f2d12e77..a7694c58 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift @@ -1,9 +1,8 @@ import ArgumentParser -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `POST /api/v1/versions/:versionId/screenshots/import?to-library=true` — the body is the /// export ZIP. Query params match the CLI flags (`existing`, `dry-run`, repeated diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift index 2c0c8a26..818b7984 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `AppScreenshotSet` resources. struct ScreenshotSetsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift index a570c7b4..4fdec0a4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `AppScreenshot` resources. struct ScreenshotsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SimulatorsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SimulatorsController.swift index c504d865..5dc6cf8f 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SimulatorsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SimulatorsController.swift @@ -1,7 +1,7 @@ import Hummingbird import HummingbirdWebSocket import ASCPlugin -import Domain +import ASCKit /// /api/v1/simulators — Simulator routes. struct SimulatorsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift index 2bb2abfb..457fcf1c 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return the per-territory availability of a subscription. struct SubscriptionAvailabilityController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift index 00963b39..5dc25e5a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return Apple's auto-equalized territory prices for a subscription price point. struct SubscriptionEqualizationsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift index 7da5c8a7..05032d8f 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `SubscriptionGroupLocalization` resources. struct SubscriptionGroupLocalizationsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift index c67550e3..ec8aaeba 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `SubscriptionGroup` resources. struct SubscriptionGroupsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift index fc97e4a3..0854f765 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `SubscriptionIntroductoryOffer` resources. struct SubscriptionIntroductoryOffersController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift index f62149f1..72c0cfae 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `SubscriptionLocalization` resources. struct SubscriptionLocalizationsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift index fbb9a34c..a158b7aa 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `SubscriptionOfferCodeOneTimeUseCode` resources. /// diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift index 39ec97a0..b240465d 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `SubscriptionOfferCode` resources. struct SubscriptionOfferCodesController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift index 94cd2ae3..151b294f 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `SubscriptionPricePoint` resources. struct SubscriptionPricePointsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift index 2eafcf18..d46d0f02 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return the per-territory price schedule for a subscription. struct SubscriptionPriceScheduleController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift index 4f5a8779..ffeff1e0 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes for batch-setting per-territory prices on a subscription. struct SubscriptionPricesController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift index d9d75787..457928de 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `SubscriptionPromotionalOffer` resources and their per-territory prices. struct SubscriptionPromotionalOffersController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift index bb1cf8dc..3baff3fb 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return the subscription review screenshot and promotional images. struct SubscriptionReviewController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift index c1b902cf..7ac587d6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `POST /subscriptions/:subscriptionId/submit` — submits a subscription for review. /// `DELETE /subscription-submissions/:submissionId` — unsubmits. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift index 520b5435..9a346430 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `Subscription` resources nested under a subscription group. struct SubscriptionsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift index 7ef42a42..f0509d58 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift @@ -1,7 +1,7 @@ import Hummingbird import HummingbirdWebSocket import ASCPlugin -import Domain +import ASCKit /// /api/v1/territories — Territory routes. struct TerritoriesController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift b/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift index fce54b7e..b8071ba7 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return TestFlight `BetaGroup` resources. struct TestFlightController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift index 3f913a76..183273c6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `AppStoreVersionLocalization` resources. struct VersionLocalizationsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift index eacfa064..0016cc3e 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// `POST /api/v1/versions/:versionId/submit` — submits an app version for review. /// `?with-products=true` also sends every ready in-app purchase and subscription diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift index ed187695..23cfd7ac 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift @@ -1,8 +1,7 @@ -import Domain +import ASCKit import Foundation import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `AppStoreVersion` resources. struct VersionsController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift index f3e187f7..9baf0039 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift @@ -1,7 +1,6 @@ -import Domain +import ASCKit import Hummingbird import HummingbirdWebSocket -import Infrastructure /// Routes that return `WinBackOffer` resources and their per-territory prices. struct WinBackOffersController: Sendable { diff --git a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift index 15251749..80112950 100644 --- a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift +++ b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift @@ -1,6 +1,5 @@ -import Domain +import ASCKit import Hummingbird -import Infrastructure import ASCPlugin import Foundation diff --git a/Sources/ASCCommand/Commands/Web/WebCommand.swift b/Sources/ASCCommand/Commands/Web/WebCommand.swift index 321460b8..0824c959 100644 --- a/Sources/ASCCommand/Commands/Web/WebCommand.swift +++ b/Sources/ASCCommand/Commands/Web/WebCommand.swift @@ -1,7 +1,6 @@ import ArgumentParser import Foundation -import Domain -import Infrastructure +import ASCKit import ASCPlugin struct WebServerCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift index 8ff27058..367bf709 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct WinBackOffersCreate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift index 2f20d5ac..26e6fb6a 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct WinBackOffersDelete: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift index ea73ed44..856973f1 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct WinBackOffersList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift index 98e40f37..942680a7 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct WinBackOffersPricesList: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift index 4b83abec..cd542e18 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct WinBackOffersUpdate: AsyncParsableCommand { static let configuration = CommandConfiguration( diff --git a/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift b/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift index e8f6caea..4cc56a55 100644 --- a/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift +++ b/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit import Foundation struct XcodeCloudCommand: AsyncParsableCommand { diff --git a/Sources/ASCCommand/GlobalOptions.swift b/Sources/ASCCommand/GlobalOptions.swift index bb5d81ab..1228782e 100644 --- a/Sources/ASCCommand/GlobalOptions.swift +++ b/Sources/ASCCommand/GlobalOptions.swift @@ -1,5 +1,5 @@ import ArgumentParser -import Domain +import ASCKit struct GlobalOptions: ParsableArguments { @Option(name: .long, help: "Output format: json, table, markdown") diff --git a/Sources/ASCCommand/OutputFormatter.swift b/Sources/ASCCommand/OutputFormatter.swift index c4a40363..ae3bf24d 100644 --- a/Sources/ASCCommand/OutputFormatter.swift +++ b/Sources/ASCCommand/OutputFormatter.swift @@ -1,4 +1,4 @@ -import Domain +import ASCKit import Foundation // MARK: - Agent-first encoding helpers diff --git a/Sources/Domain/AppWall/AppWallApp.swift b/Sources/ASCKit/AppWall/AppWallApp.swift similarity index 100% rename from Sources/Domain/AppWall/AppWallApp.swift rename to Sources/ASCKit/AppWall/AppWallApp.swift diff --git a/Sources/Domain/AppWall/AppWallError.swift b/Sources/ASCKit/AppWall/AppWallError.swift similarity index 100% rename from Sources/Domain/AppWall/AppWallError.swift rename to Sources/ASCKit/AppWall/AppWallError.swift diff --git a/Sources/Domain/AppWall/AppWallRepository.swift b/Sources/ASCKit/AppWall/AppWallRepository.swift similarity index 100% rename from Sources/Domain/AppWall/AppWallRepository.swift rename to Sources/ASCKit/AppWall/AppWallRepository.swift diff --git a/Sources/Domain/AppWall/AppWallSubmission.swift b/Sources/ASCKit/AppWall/AppWallSubmission.swift similarity index 100% rename from Sources/Domain/AppWall/AppWallSubmission.swift rename to Sources/ASCKit/AppWall/AppWallSubmission.swift diff --git a/Sources/Infrastructure/AppWall/GitHubAppWallRepository.swift b/Sources/ASCKit/AppWall/Internal/GitHubAppWallRepository.swift similarity index 99% rename from Sources/Infrastructure/AppWall/GitHubAppWallRepository.swift rename to Sources/ASCKit/AppWall/Internal/GitHubAppWallRepository.swift index f9b7df6d..a211d81d 100644 --- a/Sources/Infrastructure/AppWall/GitHubAppWallRepository.swift +++ b/Sources/ASCKit/AppWall/Internal/GitHubAppWallRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation public struct GitHubAppWallRepository: AppWallRepository { diff --git a/Sources/Domain/Apps/App+RESTRoutes.swift b/Sources/ASCKit/Apps/App+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/App+RESTRoutes.swift rename to Sources/ASCKit/Apps/App+RESTRoutes.swift diff --git a/Sources/Domain/Apps/App.swift b/Sources/ASCKit/Apps/App.swift similarity index 100% rename from Sources/Domain/Apps/App.swift rename to Sources/ASCKit/Apps/App.swift diff --git a/Sources/Domain/Apps/AppClips/AppClip.swift b/Sources/ASCKit/Apps/AppClips/AppClip.swift similarity index 100% rename from Sources/Domain/Apps/AppClips/AppClip.swift rename to Sources/ASCKit/Apps/AppClips/AppClip.swift diff --git a/Sources/Domain/Apps/AppClips/AppClipRepository.swift b/Sources/ASCKit/Apps/AppClips/AppClipRepository.swift similarity index 100% rename from Sources/Domain/Apps/AppClips/AppClipRepository.swift rename to Sources/ASCKit/Apps/AppClips/AppClipRepository.swift diff --git a/Sources/Domain/Apps/AppClips/Experiences/AppClipDefaultExperience.swift b/Sources/ASCKit/Apps/AppClips/Experiences/AppClipDefaultExperience.swift similarity index 100% rename from Sources/Domain/Apps/AppClips/Experiences/AppClipDefaultExperience.swift rename to Sources/ASCKit/Apps/AppClips/Experiences/AppClipDefaultExperience.swift diff --git a/Sources/Domain/Apps/AppClips/Experiences/Localizations/AppClipDefaultExperienceLocalization.swift b/Sources/ASCKit/Apps/AppClips/Experiences/Localizations/AppClipDefaultExperienceLocalization.swift similarity index 100% rename from Sources/Domain/Apps/AppClips/Experiences/Localizations/AppClipDefaultExperienceLocalization.swift rename to Sources/ASCKit/Apps/AppClips/Experiences/Localizations/AppClipDefaultExperienceLocalization.swift diff --git a/Sources/Infrastructure/Apps/AppClips/SDKAppClipRepository.swift b/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift similarity index 84% rename from Sources/Infrastructure/Apps/AppClips/SDKAppClipRepository.swift rename to Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift index 35491acb..553a1d34 100644 --- a/Sources/Infrastructure/Apps/AppClips/SDKAppClipRepository.swift +++ b/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { private let client: any APIClient @@ -8,19 +7,19 @@ public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { self.client = client } - public func listAppClips(appId: String) async throws -> [Domain.AppClip] { + public func listAppClips(appId: String) async throws -> [ASCKit.AppClip] { let request = APIEndpoint.v1.apps.id(appId).appClips.get() let response = try await client.request(request) return response.data.map { mapAppClip($0, appId: appId) } } - public func listExperiences(appClipId: String) async throws -> [Domain.AppClipDefaultExperience] { + public func listExperiences(appClipId: String) async throws -> [ASCKit.AppClipDefaultExperience] { let request = APIEndpoint.v1.appClips.id(appClipId).appClipDefaultExperiences.get() let response = try await client.request(request) return response.data.map { mapExperience($0, appClipId: appClipId) } } - public func createExperience(appClipId: String, action: Domain.AppClipAction?) async throws -> Domain.AppClipDefaultExperience { + public func createExperience(appClipId: String, action: ASCKit.AppClipAction?) async throws -> ASCKit.AppClipDefaultExperience { let sdkAction = action.map { mapActionToSDK($0) } let body = AppClipDefaultExperienceCreateRequest( data: .init( @@ -37,13 +36,13 @@ public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { try await client.request(APIEndpoint.v1.appClipDefaultExperiences.id(id).delete) } - public func listLocalizations(experienceId: String) async throws -> [Domain.AppClipDefaultExperienceLocalization] { + public func listLocalizations(experienceId: String) async throws -> [ASCKit.AppClipDefaultExperienceLocalization] { let request = APIEndpoint.v1.appClipDefaultExperiences.id(experienceId).appClipDefaultExperienceLocalizations.get() let response = try await client.request(request) return response.data.map { mapLocalization($0, experienceId: experienceId) } } - public func createLocalization(experienceId: String, locale: String, subtitle: String?) async throws -> Domain.AppClipDefaultExperienceLocalization { + public func createLocalization(experienceId: String, locale: String, subtitle: String?) async throws -> ASCKit.AppClipDefaultExperienceLocalization { let body = AppClipDefaultExperienceLocalizationCreateRequest( data: .init( type: .appClipDefaultExperienceLocalizations, @@ -64,8 +63,8 @@ public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { private func mapAppClip( _ sdkClip: AppStoreConnect_Swift_SDK.AppClip, appId: String - ) -> Domain.AppClip { - Domain.AppClip( + ) -> ASCKit.AppClip { + ASCKit.AppClip( id: sdkClip.id, appId: appId, bundleId: sdkClip.attributes?.bundleID @@ -75,8 +74,8 @@ public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { private func mapExperience( _ sdkExp: AppStoreConnect_Swift_SDK.AppClipDefaultExperience, appClipId: String - ) -> Domain.AppClipDefaultExperience { - Domain.AppClipDefaultExperience( + ) -> ASCKit.AppClipDefaultExperience { + ASCKit.AppClipDefaultExperience( id: sdkExp.id, appClipId: appClipId, action: sdkExp.attributes?.action.map { mapActionFromSDK($0) } @@ -86,8 +85,8 @@ public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { private func mapLocalization( _ sdkLoc: AppStoreConnect_Swift_SDK.AppClipDefaultExperienceLocalization, experienceId: String - ) -> Domain.AppClipDefaultExperienceLocalization { - Domain.AppClipDefaultExperienceLocalization( + ) -> ASCKit.AppClipDefaultExperienceLocalization { + ASCKit.AppClipDefaultExperienceLocalization( id: sdkLoc.id, experienceId: experienceId, locale: sdkLoc.attributes?.locale ?? "", @@ -95,7 +94,7 @@ public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { ) } - private func mapActionFromSDK(_ sdkAction: AppStoreConnect_Swift_SDK.AppClipAction) -> Domain.AppClipAction { + private func mapActionFromSDK(_ sdkAction: AppStoreConnect_Swift_SDK.AppClipAction) -> ASCKit.AppClipAction { switch sdkAction { case .open: return .open case .view: return .view @@ -103,7 +102,7 @@ public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { } } - private func mapActionToSDK(_ action: Domain.AppClipAction) -> AppStoreConnect_Swift_SDK.AppClipAction { + private func mapActionToSDK(_ action: ASCKit.AppClipAction) -> AppStoreConnect_Swift_SDK.AppClipAction { switch action { case .open: return .open case .view: return .view diff --git a/Sources/Domain/Apps/AppInfos/AgeRatingDeclaration.swift b/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclaration.swift similarity index 100% rename from Sources/Domain/Apps/AppInfos/AgeRatingDeclaration.swift rename to Sources/ASCKit/Apps/AppInfos/AgeRatingDeclaration.swift diff --git a/Sources/Domain/Apps/AppInfos/AgeRatingDeclarationRepository.swift b/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarationRepository.swift similarity index 100% rename from Sources/Domain/Apps/AppInfos/AgeRatingDeclarationRepository.swift rename to Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarationRepository.swift diff --git a/Sources/Domain/Apps/AppInfos/AppCategory.swift b/Sources/ASCKit/Apps/AppInfos/AppCategory.swift similarity index 100% rename from Sources/Domain/Apps/AppInfos/AppCategory.swift rename to Sources/ASCKit/Apps/AppInfos/AppCategory.swift diff --git a/Sources/Domain/Apps/AppInfos/AppInfo+RESTRoutes.swift b/Sources/ASCKit/Apps/AppInfos/AppInfo+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/AppInfos/AppInfo+RESTRoutes.swift rename to Sources/ASCKit/Apps/AppInfos/AppInfo+RESTRoutes.swift diff --git a/Sources/Domain/Apps/AppInfos/AppInfo.swift b/Sources/ASCKit/Apps/AppInfos/AppInfo.swift similarity index 100% rename from Sources/Domain/Apps/AppInfos/AppInfo.swift rename to Sources/ASCKit/Apps/AppInfos/AppInfo.swift diff --git a/Sources/Domain/Apps/AppInfos/AppInfoLocalization.swift b/Sources/ASCKit/Apps/AppInfos/AppInfoLocalization.swift similarity index 100% rename from Sources/Domain/Apps/AppInfos/AppInfoLocalization.swift rename to Sources/ASCKit/Apps/AppInfos/AppInfoLocalization.swift diff --git a/Sources/Domain/Apps/AppInfos/AppInfoRepository.swift b/Sources/ASCKit/Apps/AppInfos/AppInfoRepository.swift similarity index 100% rename from Sources/Domain/Apps/AppInfos/AppInfoRepository.swift rename to Sources/ASCKit/Apps/AppInfos/AppInfoRepository.swift diff --git a/Sources/Infrastructure/Apps/AppInfos/SDKAgeRatingDeclarationRepository.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/AppInfos/SDKAgeRatingDeclarationRepository.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift index a7abc4f0..b40a1c3e 100644 --- a/Sources/Infrastructure/Apps/AppInfos/SDKAgeRatingDeclarationRepository.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKAgeRatingDeclarationRepository: AgeRatingDeclarationRepository, @unchecked Sendable { @@ -9,13 +8,13 @@ public struct SDKAgeRatingDeclarationRepository: AgeRatingDeclarationRepository, self.client = client } - public func getDeclaration(appInfoId: String) async throws -> Domain.AgeRatingDeclaration { + public func getDeclaration(appInfoId: String) async throws -> ASCKit.AgeRatingDeclaration { let request = APIEndpoint.v1.appInfos.id(appInfoId).ageRatingDeclaration.get() let response = try await client.request(request) return mapDeclaration(response.data, appInfoId: appInfoId) } - public func updateDeclaration(id: String, update: Domain.AgeRatingDeclarationUpdate) async throws -> Domain.AgeRatingDeclaration { + public func updateDeclaration(id: String, update: ASCKit.AgeRatingDeclarationUpdate) async throws -> ASCKit.AgeRatingDeclaration { let body = AgeRatingDeclarationUpdateRequest( data: .init( type: .ageRatingDeclarations, @@ -33,9 +32,9 @@ public struct SDKAgeRatingDeclarationRepository: AgeRatingDeclarationRepository, private func mapDeclaration( _ sdk: AppStoreConnect_Swift_SDK.AgeRatingDeclaration, appInfoId: String - ) -> Domain.AgeRatingDeclaration { + ) -> ASCKit.AgeRatingDeclaration { let a = sdk.attributes - return Domain.AgeRatingDeclaration( + return ASCKit.AgeRatingDeclaration( id: sdk.id, appInfoId: appInfoId, isAdvertising: a?.isAdvertising, @@ -62,21 +61,21 @@ public struct SDKAgeRatingDeclarationRepository: AgeRatingDeclarationRepository, violenceCartoonOrFantasy: mapIntensity(a?.violenceCartoonOrFantasy), violenceRealisticProlongedGraphicOrSadistic: mapIntensity(a?.violenceRealisticProlongedGraphicOrSadistic), violenceRealistic: mapIntensity(a?.violenceRealistic), - kidsAgeBand: a?.kidsAgeBand.flatMap { Domain.KidsAgeBand(rawValue: $0.rawValue) }, - ageRatingOverride: a?.ageRatingOverrideV2.flatMap { Domain.AgeRatingOverride(rawValue: $0.rawValue) }, - koreaAgeRatingOverride: a?.koreaAgeRatingOverride.flatMap { Domain.KoreaAgeRatingOverride(rawValue: $0.rawValue) }, + kidsAgeBand: a?.kidsAgeBand.flatMap { ASCKit.KidsAgeBand(rawValue: $0.rawValue) }, + ageRatingOverride: a?.ageRatingOverrideV2.flatMap { ASCKit.AgeRatingOverride(rawValue: $0.rawValue) }, + koreaAgeRatingOverride: a?.koreaAgeRatingOverride.flatMap { ASCKit.KoreaAgeRatingOverride(rawValue: $0.rawValue) }, gracRatingClassificationNumber: a?.gracRatingClassificationNumber, developerAgeRatingInfoUrl: a?.developerAgeRatingInfoURL?.absoluteString ) } - private func mapIntensity(_ value: T?) -> Domain.ContentIntensity? where T.RawValue == String { + private func mapIntensity(_ value: T?) -> ASCKit.ContentIntensity? where T.RawValue == String { guard let value else { return nil } - return Domain.ContentIntensity(rawValue: value.rawValue) + return ASCKit.ContentIntensity(rawValue: value.rawValue) } private func mapUpdateAttributes( - _ update: Domain.AgeRatingDeclarationUpdate + _ update: ASCKit.AgeRatingDeclarationUpdate ) -> AgeRatingDeclarationUpdateRequest.Data.Attributes { .init( isAdvertising: update.isAdvertising, diff --git a/Sources/Infrastructure/Apps/AppInfos/SDKAppCategoryRepository.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift similarity index 88% rename from Sources/Infrastructure/Apps/AppInfos/SDKAppCategoryRepository.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift index 6042ea31..2382553d 100644 --- a/Sources/Infrastructure/Apps/AppInfos/SDKAppCategoryRepository.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKAppCategoryRepository: AppCategoryRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKAppCategoryRepository: AppCategoryRepository, @unchecked Sendab self.client = client } - public func listCategories(platform: String?) async throws -> [Domain.AppCategory] { + public func listCategories(platform: String?) async throws -> [ASCKit.AppCategory] { let filterPlatforms: [APIEndpoint.V1.AppCategories.GetParameters.FilterPlatforms]? if let platform { filterPlatforms = APIEndpoint.V1.AppCategories.GetParameters.FilterPlatforms(rawValue: platform).map { [$0] } ?? [] @@ -26,7 +25,7 @@ public struct SDKAppCategoryRepository: AppCategoryRepository, @unchecked Sendab return topLevel + subcategories } - public func getCategory(id: String) async throws -> Domain.AppCategory { + public func getCategory(id: String) async throws -> ASCKit.AppCategory { let request = APIEndpoint.v1.appCategories.id(id).get() let response = try await client.request(request) return mapCategory(response.data) @@ -34,9 +33,9 @@ public struct SDKAppCategoryRepository: AppCategoryRepository, @unchecked Sendab // MARK: - Mapper - private func mapCategory(_ sdkCategory: AppStoreConnect_Swift_SDK.AppCategory) -> Domain.AppCategory { + private func mapCategory(_ sdkCategory: AppStoreConnect_Swift_SDK.AppCategory) -> ASCKit.AppCategory { let platforms = sdkCategory.attributes?.platforms?.map { $0.rawValue } ?? [] let parentId = sdkCategory.relationships?.parent?.data?.id - return Domain.AppCategory(id: sdkCategory.id, platforms: platforms, parentId: parentId) + return ASCKit.AppCategory(id: sdkCategory.id, platforms: platforms, parentId: parentId) } } diff --git a/Sources/Infrastructure/Apps/AppInfos/SDKAppInfoRepository.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift similarity index 93% rename from Sources/Infrastructure/Apps/AppInfos/SDKAppInfoRepository.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift index 11ce080b..2117245a 100644 --- a/Sources/Infrastructure/Apps/AppInfos/SDKAppInfoRepository.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { self.client = client } - public func listAppInfos(appId: String) async throws -> [Domain.AppInfo] { + public func listAppInfos(appId: String) async throws -> [ASCKit.AppInfo] { // `fields[appInfos]` alone returns only relationship `links`, not `data.id`. // `include=...` forces ASC to populate `data` so we can read the category ids. let request = APIEndpoint.v1.apps.id(appId).appInfos.get( @@ -29,13 +28,13 @@ public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { return response.data.map { mapAppInfo($0, appId: appId) } } - public func listLocalizations(appInfoId: String) async throws -> [Domain.AppInfoLocalization] { + public func listLocalizations(appInfoId: String) async throws -> [ASCKit.AppInfoLocalization] { let request = APIEndpoint.v1.appInfos.id(appInfoId).appInfoLocalizations.get() let response = try await client.request(request) return response.data.map { mapLocalization($0, appInfoId: appInfoId) } } - public func createLocalization(appInfoId: String, locale: String, name: String) async throws -> Domain.AppInfoLocalization { + public func createLocalization(appInfoId: String, locale: String, name: String) async throws -> ASCKit.AppInfoLocalization { let body = AppInfoLocalizationCreateRequest( data: .init( type: .appInfoLocalizations, @@ -47,7 +46,7 @@ public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { return mapLocalization(response.data, appInfoId: appInfoId) } - public func updateLocalization(id: String, name: String?, subtitle: String?, privacyPolicyUrl: String?, privacyChoicesUrl: String?, privacyPolicyText: String?) async throws -> Domain.AppInfoLocalization { + public func updateLocalization(id: String, name: String?, subtitle: String?, privacyPolicyUrl: String?, privacyChoicesUrl: String?, privacyPolicyText: String?) async throws -> ASCKit.AppInfoLocalization { let body = AppInfoLocalizationUpdateRequest( data: .init( type: .appInfoLocalizations, @@ -72,7 +71,7 @@ public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { secondaryCategoryId: String?, secondarySubcategoryOneId: String?, secondarySubcategoryTwoId: String? - ) async throws -> Domain.AppInfo { + ) async throws -> ASCKit.AppInfo { let relationships = AppInfoUpdateRequest.Data.Relationships( primaryCategory: primaryCategoryId.map { .init(data: .init(type: .appCategories, id: $0)) }, primarySubcategoryOne: primarySubcategoryOneId.map { .init(data: .init(type: .appCategories, id: $0)) }, @@ -92,8 +91,8 @@ public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { private func mapAppInfo( _ sdkInfo: AppStoreConnect_Swift_SDK.AppInfo, appId: String - ) -> Domain.AppInfo { - Domain.AppInfo( + ) -> ASCKit.AppInfo { + ASCKit.AppInfo( id: sdkInfo.id, appId: appId, appStoreState: sdkInfo.attributes?.appStoreState?.rawValue, @@ -111,8 +110,8 @@ public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { private func mapLocalization( _ sdkLoc: AppStoreConnect_Swift_SDK.AppInfoLocalization, appInfoId: String - ) -> Domain.AppInfoLocalization { - Domain.AppInfoLocalization( + ) -> ASCKit.AppInfoLocalization { + ASCKit.AppInfoLocalization( id: sdkLoc.id, appInfoId: appInfoId, locale: sdkLoc.attributes?.locale ?? "", diff --git a/Sources/Domain/Apps/AppRepository.swift b/Sources/ASCKit/Apps/AppRepository.swift similarity index 100% rename from Sources/Domain/Apps/AppRepository.swift rename to Sources/ASCKit/Apps/AppRepository.swift diff --git a/Sources/Domain/Apps/AssetLibrary/AppAssetLibrary.swift b/Sources/ASCKit/Apps/AssetLibrary/AppAssetLibrary.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/AppAssetLibrary.swift rename to Sources/ASCKit/Apps/AssetLibrary/AppAssetLibrary.swift diff --git a/Sources/Domain/Apps/AssetLibrary/AssetLibrary+RESTRoutes.swift b/Sources/ASCKit/Apps/AssetLibrary/AssetLibrary+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/AssetLibrary+RESTRoutes.swift rename to Sources/ASCKit/Apps/AssetLibrary/AssetLibrary+RESTRoutes.swift diff --git a/Sources/Domain/Apps/AssetLibrary/AssetLibraryRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/AssetLibraryRepository.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/AssetLibraryRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/AssetLibraryRepository.swift diff --git a/Sources/Domain/Apps/AssetLibrary/AssetLibraryTypes.swift b/Sources/ASCKit/Apps/AssetLibrary/AssetLibraryTypes.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/AssetLibraryTypes.swift rename to Sources/ASCKit/Apps/AssetLibrary/AssetLibraryTypes.swift diff --git a/Sources/Domain/Apps/AssetLibrary/AssetProcessingWait.swift b/Sources/ASCKit/Apps/AssetLibrary/AssetProcessingWait.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/AssetProcessingWait.swift rename to Sources/ASCKit/Apps/AssetLibrary/AssetProcessingWait.swift diff --git a/Sources/Infrastructure/Apps/AssetLibrary/Images/SDKLibraryImageRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift similarity index 99% rename from Sources/Infrastructure/Apps/AssetLibrary/Images/SDKLibraryImageRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift index 625b9d36..2d25f56d 100644 --- a/Sources/Infrastructure/Apps/AssetLibrary/Images/SDKLibraryImageRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKLibraryImageRepository: LibraryImageRepository, @unchecked Sendable { diff --git a/Sources/Domain/Apps/AssetLibrary/Images/LibraryImage.swift b/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImage.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Images/LibraryImage.swift rename to Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImage.swift diff --git a/Sources/Domain/Apps/AssetLibrary/Images/LibraryImageRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImageRepository.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Images/LibraryImageRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImageRepository.swift diff --git a/Sources/Domain/Apps/AssetLibrary/Import/ScreenshotImport+RESTRoutes.swift b/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImport+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Import/ScreenshotImport+RESTRoutes.swift rename to Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImport+RESTRoutes.swift diff --git a/Sources/Domain/Apps/AssetLibrary/Import/ScreenshotImportGroupResult.swift b/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportGroupResult.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Import/ScreenshotImportGroupResult.swift rename to Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportGroupResult.swift diff --git a/Sources/Domain/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift b/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift rename to Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift diff --git a/Sources/Infrastructure/Apps/AssetLibrary/AssetLibraryDTOs.swift b/Sources/ASCKit/Apps/AssetLibrary/Internal/AssetLibraryDTOs.swift similarity index 100% rename from Sources/Infrastructure/Apps/AssetLibrary/AssetLibraryDTOs.swift rename to Sources/ASCKit/Apps/AssetLibrary/Internal/AssetLibraryDTOs.swift diff --git a/Sources/Infrastructure/Apps/AssetLibrary/SDKAssetLibraryRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift similarity index 95% rename from Sources/Infrastructure/Apps/AssetLibrary/SDKAssetLibraryRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift index 8272c170..bcc09963 100644 --- a/Sources/Infrastructure/Apps/AssetLibrary/SDKAssetLibraryRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKAssetLibraryRepository: AssetLibraryRepository, @unchecked Sendable { @@ -9,9 +8,9 @@ public struct SDKAssetLibraryRepository: AssetLibraryRepository, @unchecked Send self.client = client } - public func getAssetLibrary(appId: String) async throws -> Domain.AppAssetLibrary { + public func getAssetLibrary(appId: String) async throws -> ASCKit.AppAssetLibrary { let response = try await client.request(APIEndpoint.v1.apps.id(appId).assetLibrary.get()) - return Domain.AppAssetLibrary(id: response.data.id, appId: appId) + return ASCKit.AppAssetLibrary(id: response.data.id, appId: appId) } public func listPlacementGroups(placementType: AssetPlacementType?, feature: String?) async throws -> [AssetPlacementGroup] { diff --git a/Sources/Domain/Apps/AssetLibrary/Placements/AssetPlacement.swift b/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacement.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Placements/AssetPlacement.swift rename to Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacement.swift diff --git a/Sources/Domain/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift diff --git a/Sources/Infrastructure/Apps/AssetLibrary/Placements/AssetPlacementDTOs.swift b/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/AssetPlacementDTOs.swift similarity index 99% rename from Sources/Infrastructure/Apps/AssetLibrary/Placements/AssetPlacementDTOs.swift rename to Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/AssetPlacementDTOs.swift index d9b2018f..721e6550 100644 --- a/Sources/Infrastructure/Apps/AssetLibrary/Placements/AssetPlacementDTOs.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/AssetPlacementDTOs.swift @@ -1,4 +1,3 @@ -import Domain import Foundation // MARK: - Responses (see AssetLibraryDTOs.swift for why asc decodes its own types) diff --git a/Sources/Infrastructure/Apps/AssetLibrary/Placements/SDKAssetPlacementRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift similarity index 99% rename from Sources/Infrastructure/Apps/AssetLibrary/Placements/SDKAssetPlacementRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift index 3ace294d..54b44d0d 100644 --- a/Sources/Infrastructure/Apps/AssetLibrary/Placements/SDKAssetPlacementRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKAssetPlacementRepository: AssetPlacementRepository, @unchecked Sendable { diff --git a/Sources/Domain/Apps/AssetLibrary/RefData/AssetPlacementGroup.swift b/Sources/ASCKit/Apps/AssetLibrary/RefData/AssetPlacementGroup.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/RefData/AssetPlacementGroup.swift rename to Sources/ASCKit/Apps/AssetLibrary/RefData/AssetPlacementGroup.swift diff --git a/Sources/Infrastructure/Apps/AssetLibrary/Videos/SDKLibraryVideoRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift similarity index 99% rename from Sources/Infrastructure/Apps/AssetLibrary/Videos/SDKLibraryVideoRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift index 14c46bdd..ebfeb464 100644 --- a/Sources/Infrastructure/Apps/AssetLibrary/Videos/SDKLibraryVideoRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKLibraryVideoRepository: LibraryVideoRepository, @unchecked Sendable { diff --git a/Sources/Domain/Apps/AssetLibrary/Videos/LibraryVideo.swift b/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideo.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Videos/LibraryVideo.swift rename to Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideo.swift diff --git a/Sources/Domain/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift similarity index 100% rename from Sources/Domain/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift diff --git a/Sources/Domain/Apps/Availability/AppAvailability.swift b/Sources/ASCKit/Apps/Availability/AppAvailability.swift similarity index 100% rename from Sources/Domain/Apps/Availability/AppAvailability.swift rename to Sources/ASCKit/Apps/Availability/AppAvailability.swift diff --git a/Sources/Domain/Apps/Availability/AppAvailabilityRepository.swift b/Sources/ASCKit/Apps/Availability/AppAvailabilityRepository.swift similarity index 100% rename from Sources/Domain/Apps/Availability/AppAvailabilityRepository.swift rename to Sources/ASCKit/Apps/Availability/AppAvailabilityRepository.swift diff --git a/Sources/Domain/Apps/Availability/AppTerritoryAvailability.swift b/Sources/ASCKit/Apps/Availability/AppTerritoryAvailability.swift similarity index 100% rename from Sources/Domain/Apps/Availability/AppTerritoryAvailability.swift rename to Sources/ASCKit/Apps/Availability/AppTerritoryAvailability.swift diff --git a/Sources/Infrastructure/Apps/Availability/SDKAppAvailabilityRepository.swift b/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift similarity index 93% rename from Sources/Infrastructure/Apps/Availability/SDKAppAvailabilityRepository.swift rename to Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift index 9ca7bed1..6fc45449 100644 --- a/Sources/Infrastructure/Apps/Availability/SDKAppAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKAppAvailabilityRepository: AppAvailabilityRepository, @unchecked Sendable { private let client: any APIClient @@ -17,7 +16,7 @@ public struct SDKAppAvailabilityRepository: AppAvailabilityRepository, @unchecke /// The territory code (e.g. `USA`) only appears via the territory relationship — /// `TerritoryAvailability.id` itself is an opaque base64 blob — so include the /// relationship and read its `data.id`. - public func getAppAvailability(appId: String) async throws -> Domain.AppAvailability? { + public func getAppAvailability(appId: String) async throws -> ASCKit.AppAvailability? { let parentRequest = APIEndpoint.v1.apps.id(appId).appAvailabilityV2.get(parameters: .init( fieldsAppAvailabilities: [.availableInNewTerritories] )) @@ -37,7 +36,7 @@ public struct SDKAppAvailabilityRepository: AppAvailabilityRepository, @unchecke let territoriesResponse = try await client.request(territoriesRequest) let territories = territoriesResponse.data.compactMap { mapTerritoryAvailability($0) } - return Domain.AppAvailability( + return ASCKit.AppAvailability( id: availabilityId, appId: appId, isAvailableInNewTerritories: parent.data.attributes?.isAvailableInNewTerritories ?? false, @@ -49,7 +48,7 @@ public struct SDKAppAvailabilityRepository: AppAvailabilityRepository, @unchecke appId: String, isAvailableInNewTerritories: Bool, territoryIds: [String] - ) async throws -> Domain.AppAvailability { + ) async throws -> ASCKit.AppAvailability { // Each territory is an inline-created territoryAvailability, correlated by a `${...}` local id. let localIds = territoryIds.map { "${ta-\($0)}" } let body = AppAvailabilityV2CreateRequest( @@ -80,12 +79,12 @@ public struct SDKAppAvailabilityRepository: AppAvailabilityRepository, @unchecke private func mapTerritoryAvailability( _ sdk: AppStoreConnect_Swift_SDK.TerritoryAvailability - ) -> Domain.AppTerritoryAvailability? { + ) -> ASCKit.AppTerritoryAvailability? { guard let territoryId = sdk.relationships?.territory?.data?.id else { return nil } let contentStatuses = (sdk.attributes?.contentStatuses ?? []).compactMap { sdkStatus in - Domain.ContentStatus(rawValue: sdkStatus.rawValue) + ASCKit.ContentStatus(rawValue: sdkStatus.rawValue) } - return Domain.AppTerritoryAvailability( + return ASCKit.AppTerritoryAvailability( id: sdk.id, territoryId: territoryId, isAvailable: sdk.attributes?.isAvailable ?? false, diff --git a/Sources/Domain/Apps/Builds/BetaBuildLocalization.swift b/Sources/ASCKit/Apps/Builds/BetaBuildLocalization.swift similarity index 100% rename from Sources/Domain/Apps/Builds/BetaBuildLocalization.swift rename to Sources/ASCKit/Apps/Builds/BetaBuildLocalization.swift diff --git a/Sources/Domain/Apps/Builds/BetaBuildLocalizationRepository.swift b/Sources/ASCKit/Apps/Builds/BetaBuildLocalizationRepository.swift similarity index 100% rename from Sources/Domain/Apps/Builds/BetaBuildLocalizationRepository.swift rename to Sources/ASCKit/Apps/Builds/BetaBuildLocalizationRepository.swift diff --git a/Sources/Domain/Apps/Builds/Build.swift b/Sources/ASCKit/Apps/Builds/Build.swift similarity index 100% rename from Sources/Domain/Apps/Builds/Build.swift rename to Sources/ASCKit/Apps/Builds/Build.swift diff --git a/Sources/Domain/Apps/Builds/BuildRepository.swift b/Sources/ASCKit/Apps/Builds/BuildRepository.swift similarity index 100% rename from Sources/Domain/Apps/Builds/BuildRepository.swift rename to Sources/ASCKit/Apps/Builds/BuildRepository.swift diff --git a/Sources/Domain/Apps/Builds/BuildUpload.swift b/Sources/ASCKit/Apps/Builds/BuildUpload.swift similarity index 100% rename from Sources/Domain/Apps/Builds/BuildUpload.swift rename to Sources/ASCKit/Apps/Builds/BuildUpload.swift diff --git a/Sources/Domain/Apps/Builds/BuildUploadRepository.swift b/Sources/ASCKit/Apps/Builds/BuildUploadRepository.swift similarity index 100% rename from Sources/Domain/Apps/Builds/BuildUploadRepository.swift rename to Sources/ASCKit/Apps/Builds/BuildUploadRepository.swift diff --git a/Sources/Infrastructure/Apps/Builds/OpenAPIBuildRepository.swift b/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift similarity index 93% rename from Sources/Infrastructure/Apps/Builds/OpenAPIBuildRepository.swift rename to Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift index 48fd40ee..8f2adc0c 100644 --- a/Sources/Infrastructure/Apps/Builds/OpenAPIBuildRepository.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKBuildRepository: BuildRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKBuildRepository: BuildRepository, @unchecked Sendable { self.client = client } - public func listBuilds(appId: String?, platform: BuildUploadPlatform?, version: String?, limit: Int?) async throws -> PaginatedResponse { + public func listBuilds(appId: String?, platform: BuildUploadPlatform?, version: String?, limit: Int?) async throws -> PaginatedResponse { var filterApp: [String]? if let appId { filterApp = [appId] @@ -51,7 +50,7 @@ public struct SDKBuildRepository: BuildRepository, @unchecked Sendable { return PaginatedResponse(data: builds, nextCursor: nextCursor) } - public func getBuild(id: String) async throws -> Domain.Build { + public func getBuild(id: String) async throws -> ASCKit.Build { let request = APIEndpoint.v1.builds.id(id).get() let response = try await client.request(request) return mapBuild(response.data) @@ -71,7 +70,7 @@ public struct SDKBuildRepository: BuildRepository, @unchecked Sendable { try await client.request(APIEndpoint.v1.builds.id(buildId).relationships.betaGroups.delete(body)) } - public func updateBuildEncryptionCompliance(buildId: String, usesNonExemptEncryption: Bool) async throws -> Domain.Build { + public func updateBuildEncryptionCompliance(buildId: String, usesNonExemptEncryption: Bool) async throws -> ASCKit.Build { let body = BuildUpdateRequest( data: .init( type: .builds, @@ -83,12 +82,12 @@ public struct SDKBuildRepository: BuildRepository, @unchecked Sendable { return mapBuild(response.data) } - private func mapBuild(_ sdkBuild: AppStoreConnect_Swift_SDK.Build, preReleaseVersion: PrereleaseVersion? = nil) -> Domain.Build { + private func mapBuild(_ sdkBuild: AppStoreConnect_Swift_SDK.Build, preReleaseVersion: PrereleaseVersion? = nil) -> ASCKit.Build { let buildString = sdkBuild.attributes?.version let marketingVersion = preReleaseVersion?.attributes?.version let platform = preReleaseVersion?.attributes?.platform.flatMap { mapPlatform($0) } - return Domain.Build( + return ASCKit.Build( id: sdkBuild.id, version: marketingVersion ?? buildString ?? "", uploadedDate: sdkBuild.attributes?.uploadedDate, @@ -110,7 +109,7 @@ public struct SDKBuildRepository: BuildRepository, @unchecked Sendable { } } - private func mapProcessingState(_ state: AppStoreConnect_Swift_SDK.Build.Attributes.ProcessingState?) -> Domain.Build.ProcessingState { + private func mapProcessingState(_ state: AppStoreConnect_Swift_SDK.Build.Attributes.ProcessingState?) -> ASCKit.Build.ProcessingState { guard let state else { return .processing } switch state { case .processing: return .processing diff --git a/Sources/Infrastructure/Apps/Builds/SDKBetaBuildLocalizationRepository.swift b/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift similarity index 91% rename from Sources/Infrastructure/Apps/Builds/SDKBetaBuildLocalizationRepository.swift rename to Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift index f9c0d633..89741ff3 100644 --- a/Sources/Infrastructure/Apps/Builds/SDKBetaBuildLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKBetaBuildLocalizationRepository: BetaBuildLocalizationRepository, @unchecked Sendable { private let client: any APIClient @@ -8,13 +7,13 @@ public struct SDKBetaBuildLocalizationRepository: BetaBuildLocalizationRepositor self.client = client } - public func listBetaBuildLocalizations(buildId: String) async throws -> [Domain.BetaBuildLocalization] { + public func listBetaBuildLocalizations(buildId: String) async throws -> [ASCKit.BetaBuildLocalization] { let request = APIEndpoint.v1.builds.id(buildId).betaBuildLocalizations.get() let response = try await client.request(request) return response.data.map { mapLocalization($0, buildId: buildId) } } - public func upsertBetaBuildLocalization(buildId: String, locale: String, whatsNew: String) async throws -> Domain.BetaBuildLocalization { + public func upsertBetaBuildLocalization(buildId: String, locale: String, whatsNew: String) async throws -> ASCKit.BetaBuildLocalization { // Check for existing localization for this build + locale let existing = try await listBetaBuildLocalizations(buildId: buildId) @@ -50,8 +49,8 @@ public struct SDKBetaBuildLocalizationRepository: BetaBuildLocalizationRepositor private func mapLocalization( _ sdk: AppStoreConnect_Swift_SDK.BetaBuildLocalization, buildId: String - ) -> Domain.BetaBuildLocalization { - Domain.BetaBuildLocalization( + ) -> ASCKit.BetaBuildLocalization { + ASCKit.BetaBuildLocalization( id: sdk.id, buildId: buildId, locale: sdk.attributes?.locale ?? "", diff --git a/Sources/Infrastructure/Apps/Builds/SDKBuildUploadRepository.swift b/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift similarity index 91% rename from Sources/Infrastructure/Apps/Builds/SDKBuildUploadRepository.swift rename to Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift index 7959d30a..7a274264 100644 --- a/Sources/Infrastructure/Apps/Builds/SDKBuildUploadRepository.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendable { @@ -15,11 +14,11 @@ public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendab appId: String, version: String, buildNumber: String, - platform: Domain.BuildUploadPlatform, + platform: ASCKit.BuildUploadPlatform, fileURL: URL - ) async throws -> Domain.BuildUpload { + ) async throws -> ASCKit.BuildUpload { guard let sdkPlatform = AppStoreConnect_Swift_SDK.Platform(rawValue: platform.rawValue) else { - throw Domain.APIError.unknown("Unsupported platform: \(platform.rawValue)") + throw ASCKit.APIError.unknown("Unsupported platform: \(platform.rawValue)") } // Step 1: Create upload session @@ -84,7 +83,7 @@ public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendab return mapBuildUpload(finalResponse.data, appId: appId) } - public func listBuildUploads(appId: String) async throws -> [Domain.BuildUpload] { + public func listBuildUploads(appId: String) async throws -> [ASCKit.BuildUpload] { let pages = try await client.requestAllPages( APIEndpoint.v1.apps.id(appId).buildUploads.get(parameters: .init(limit: 200)), nextCursor: { $0.meta?.paging.nextCursor } @@ -92,7 +91,7 @@ public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendab return pages.flatMap(\.data).map { mapBuildUpload($0, appId: appId) } } - public func getBuildUpload(id: String) async throws -> Domain.BuildUpload { + public func getBuildUpload(id: String) async throws -> ASCKit.BuildUpload { let request = APIEndpoint.v1.buildUploads.id(id).get() let response = try await client.request(request) // appId is not available in a single-resource GET — inject empty string @@ -107,9 +106,9 @@ public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendab private func mapBuildUpload( _ sdk: AppStoreConnect_Swift_SDK.BuildUpload, appId: String - ) -> Domain.BuildUpload { + ) -> ASCKit.BuildUpload { let sdkState = sdk.attributes?.state - return Domain.BuildUpload( + return ASCKit.BuildUpload( id: sdk.id, appId: appId, version: sdk.attributes?.cfBundleShortVersionString ?? "", @@ -124,14 +123,14 @@ public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendab ) } - private func mapStateDetails(_ details: [AppStoreConnect_Swift_SDK.StateDetail]?) -> [Domain.BuildUploadStateDetail] { + private func mapStateDetails(_ details: [AppStoreConnect_Swift_SDK.StateDetail]?) -> [ASCKit.BuildUploadStateDetail] { (details ?? []).compactMap { detail in guard let code = detail.code, let desc = detail.description else { return nil } - return Domain.BuildUploadStateDetail(code: code, description: desc) + return ASCKit.BuildUploadStateDetail(code: code, description: desc) } } - private func mapState(_ sdkState: AppStoreConnect_Swift_SDK.BuildUploadState?) -> Domain.BuildUploadState { + private func mapState(_ sdkState: AppStoreConnect_Swift_SDK.BuildUploadState?) -> ASCKit.BuildUploadState { guard let sdkState else { return .awaitingUpload } switch sdkState { case .awaitingUpload: return .awaitingUpload @@ -141,7 +140,7 @@ public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendab } } - private func mapPlatform(_ sdk: AppStoreConnect_Swift_SDK.Platform?) -> Domain.BuildUploadPlatform { + private func mapPlatform(_ sdk: AppStoreConnect_Swift_SDK.Platform?) -> ASCKit.BuildUploadPlatform { guard let sdk else { return .iOS } switch sdk { case .macOs: return .macOS diff --git a/Sources/Domain/Apps/Builds/NextBuildNumber.swift b/Sources/ASCKit/Apps/Builds/NextBuildNumber.swift similarity index 100% rename from Sources/Domain/Apps/Builds/NextBuildNumber.swift rename to Sources/ASCKit/Apps/Builds/NextBuildNumber.swift diff --git a/Sources/Infrastructure/Apps/Builds/XcodeBuild/ProcessXcodeBuildRunner.swift b/Sources/ASCKit/Apps/Builds/XcodeBuild/Internal/ProcessXcodeBuildRunner.swift similarity index 99% rename from Sources/Infrastructure/Apps/Builds/XcodeBuild/ProcessXcodeBuildRunner.swift rename to Sources/ASCKit/Apps/Builds/XcodeBuild/Internal/ProcessXcodeBuildRunner.swift index dce4d1f8..82124b4a 100644 --- a/Sources/Infrastructure/Apps/Builds/XcodeBuild/ProcessXcodeBuildRunner.swift +++ b/Sources/ASCKit/Apps/Builds/XcodeBuild/Internal/ProcessXcodeBuildRunner.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Error thrown when xcodebuild fails. diff --git a/Sources/Domain/Apps/Builds/XcodeBuild/XcodeBuildRunner.swift b/Sources/ASCKit/Apps/Builds/XcodeBuild/XcodeBuildRunner.swift similarity index 100% rename from Sources/Domain/Apps/Builds/XcodeBuild/XcodeBuildRunner.swift rename to Sources/ASCKit/Apps/Builds/XcodeBuild/XcodeBuildRunner.swift diff --git a/Sources/Domain/Apps/Experiments/AppStoreVersionExperiment+RESTRoutes.swift b/Sources/ASCKit/Apps/Experiments/AppStoreVersionExperiment+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/Experiments/AppStoreVersionExperiment+RESTRoutes.swift rename to Sources/ASCKit/Apps/Experiments/AppStoreVersionExperiment+RESTRoutes.swift diff --git a/Sources/Domain/Apps/Experiments/AppStoreVersionExperiment.swift b/Sources/ASCKit/Apps/Experiments/AppStoreVersionExperiment.swift similarity index 100% rename from Sources/Domain/Apps/Experiments/AppStoreVersionExperiment.swift rename to Sources/ASCKit/Apps/Experiments/AppStoreVersionExperiment.swift diff --git a/Sources/Domain/Apps/Experiments/ExperimentRepository.swift b/Sources/ASCKit/Apps/Experiments/ExperimentRepository.swift similarity index 100% rename from Sources/Domain/Apps/Experiments/ExperimentRepository.swift rename to Sources/ASCKit/Apps/Experiments/ExperimentRepository.swift diff --git a/Sources/Domain/Apps/Experiments/ExperimentTreatment.swift b/Sources/ASCKit/Apps/Experiments/ExperimentTreatment.swift similarity index 100% rename from Sources/Domain/Apps/Experiments/ExperimentTreatment.swift rename to Sources/ASCKit/Apps/Experiments/ExperimentTreatment.swift diff --git a/Sources/Domain/Apps/Experiments/ExperimentTreatmentLocalization.swift b/Sources/ASCKit/Apps/Experiments/ExperimentTreatmentLocalization.swift similarity index 100% rename from Sources/Domain/Apps/Experiments/ExperimentTreatmentLocalization.swift rename to Sources/ASCKit/Apps/Experiments/ExperimentTreatmentLocalization.swift diff --git a/Sources/Infrastructure/Apps/Experiments/SDKExperimentRepository.swift b/Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift similarity index 88% rename from Sources/Infrastructure/Apps/Experiments/SDKExperimentRepository.swift rename to Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift index 177cb580..fb1ae744 100644 --- a/Sources/Infrastructure/Apps/Experiments/SDKExperimentRepository.swift +++ b/Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation /// Adapts the App Store Connect "product page optimization" endpoints @@ -15,9 +14,9 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable public func listExperiments( appId: String, - state: Domain.AppStoreVersionExperimentState?, + state: ASCKit.AppStoreVersionExperimentState?, limit: Int? - ) async throws -> PaginatedResponse { + ) async throws -> PaginatedResponse { let filterState = state.flatMap { APIEndpoint.V1.Apps.WithID.AppStoreVersionExperimentsV2.GetParameters.FilterState(rawValue: $0.rawValue) } @@ -29,7 +28,7 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable return PaginatedResponse(data: experiments, nextCursor: response.links.next) } - public func getExperiment(experimentId: String) async throws -> Domain.AppStoreVersionExperiment { + public func getExperiment(experimentId: String) async throws -> ASCKit.AppStoreVersionExperiment { // Apple omits `relationships.app` unless it is explicitly included; without it // the model's appId (and every `--app-id` affordance) would be empty. let request = APIEndpoint.v2.appStoreVersionExperiments.id(experimentId).get(parameters: .init(include: [.app])) @@ -40,11 +39,11 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable public func createExperiment( appId: String, name: String, - platform: Domain.AppStorePlatform, + platform: ASCKit.AppStorePlatform, trafficProportion: Int - ) async throws -> Domain.AppStoreVersionExperiment { + ) async throws -> ASCKit.AppStoreVersionExperiment { guard let sdkPlatform = AppStoreConnect_Swift_SDK.Platform(rawValue: platform.rawValue) else { - throw Domain.APIError.unknown("Unsupported platform for create: \(platform.rawValue)") + throw ASCKit.APIError.unknown("Unsupported platform for create: \(platform.rawValue)") } let body = AppStoreVersionExperimentV2CreateRequest(data: .init( type: .appStoreVersionExperiments, @@ -60,7 +59,7 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable name: String?, trafficProportion: Int?, isStarted: Bool? - ) async throws -> Domain.AppStoreVersionExperiment { + ) async throws -> ASCKit.AppStoreVersionExperiment { let body = AppStoreVersionExperimentV2UpdateRequest(data: .init( type: .appStoreVersionExperiments, id: experimentId, @@ -77,7 +76,7 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable // MARK: - Treatments - public func listTreatments(experimentId: String, limit: Int?) async throws -> PaginatedResponse { + public func listTreatments(experimentId: String, limit: Int?) async throws -> PaginatedResponse { let request = APIEndpoint.v2.appStoreVersionExperiments.id(experimentId) .appStoreVersionExperimentTreatments.get(parameters: .init(limit: limit)) let response = try await client.request(request) @@ -85,7 +84,7 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable return PaginatedResponse(data: treatments, nextCursor: response.links.next) } - public func createTreatment(experimentId: String, name: String, appIconName: String?) async throws -> Domain.ExperimentTreatment { + public func createTreatment(experimentId: String, name: String, appIconName: String?) async throws -> ASCKit.ExperimentTreatment { let body = AppStoreVersionExperimentTreatmentCreateRequest(data: .init( type: .appStoreVersionExperimentTreatments, attributes: .init(name: name, appIconName: appIconName), @@ -97,7 +96,7 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable return mapTreatment(response.data, experimentId: experimentId) } - public func updateTreatment(treatmentId: String, name: String?, appIconName: String?) async throws -> Domain.ExperimentTreatment { + public func updateTreatment(treatmentId: String, name: String?, appIconName: String?) async throws -> ASCKit.ExperimentTreatment { let body = AppStoreVersionExperimentTreatmentUpdateRequest(data: .init( type: .appStoreVersionExperimentTreatments, id: treatmentId, @@ -121,14 +120,14 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable // MARK: - Treatment localizations - public func listTreatmentLocalizations(treatmentId: String, limit: Int?) async throws -> [Domain.ExperimentTreatmentLocalization] { + public func listTreatmentLocalizations(treatmentId: String, limit: Int?) async throws -> [ASCKit.ExperimentTreatmentLocalization] { let request = APIEndpoint.v1.appStoreVersionExperimentTreatments.id(treatmentId) .appStoreVersionExperimentTreatmentLocalizations.get(parameters: .init(limit: limit)) let response = try await client.request(request) return response.data.map { mapLocalization($0, treatmentId: treatmentId) } } - public func createTreatmentLocalization(treatmentId: String, locale: String) async throws -> Domain.ExperimentTreatmentLocalization { + public func createTreatmentLocalization(treatmentId: String, locale: String) async throws -> ASCKit.ExperimentTreatmentLocalization { let body = AppStoreVersionExperimentTreatmentLocalizationCreateRequest(data: .init( type: .appStoreVersionExperimentTreatmentLocalizations, attributes: .init(locale: locale), @@ -149,10 +148,10 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable private func mapExperiment( _ sdk: AppStoreConnect_Swift_SDK.AppStoreVersionExperimentV2, appId: String - ) -> Domain.AppStoreVersionExperiment { - let platform = sdk.attributes?.platform.flatMap { Domain.AppStorePlatform(rawValue: $0.rawValue) } ?? .iOS - let state = sdk.attributes?.state.flatMap { Domain.AppStoreVersionExperimentState(rawValue: $0.rawValue) } ?? .prepareForSubmission - return Domain.AppStoreVersionExperiment( + ) -> ASCKit.AppStoreVersionExperiment { + let platform = sdk.attributes?.platform.flatMap { ASCKit.AppStorePlatform(rawValue: $0.rawValue) } ?? .iOS + let state = sdk.attributes?.state.flatMap { ASCKit.AppStoreVersionExperimentState(rawValue: $0.rawValue) } ?? .prepareForSubmission + return ASCKit.AppStoreVersionExperiment( id: sdk.id, appId: appId, name: sdk.attributes?.name ?? "", @@ -169,8 +168,8 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable private func mapTreatment( _ sdk: AppStoreConnect_Swift_SDK.AppStoreVersionExperimentTreatment, experimentId: String - ) -> Domain.ExperimentTreatment { - Domain.ExperimentTreatment( + ) -> ASCKit.ExperimentTreatment { + ASCKit.ExperimentTreatment( id: sdk.id, experimentId: experimentId, name: sdk.attributes?.name ?? "", @@ -182,8 +181,8 @@ public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable private func mapLocalization( _ sdk: AppStoreConnect_Swift_SDK.AppStoreVersionExperimentTreatmentLocalization, treatmentId: String - ) -> Domain.ExperimentTreatmentLocalization { - Domain.ExperimentTreatmentLocalization( + ) -> ASCKit.ExperimentTreatmentLocalization { + ASCKit.ExperimentTreatmentLocalization( id: sdk.id, treatmentId: treatmentId, locale: sdk.attributes?.locale ?? "" diff --git a/Sources/Domain/Apps/InAppPurchases/Availability/InAppPurchaseAvailability.swift b/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailability.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/Availability/InAppPurchaseAvailability.swift rename to Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailability.swift diff --git a/Sources/Domain/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift diff --git a/Sources/Infrastructure/Apps/InAppPurchases/Availability/SDKInAppPurchaseAvailabilityRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift similarity index 87% rename from Sources/Infrastructure/Apps/InAppPurchases/Availability/SDKInAppPurchaseAvailabilityRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift index 555492a9..9066676f 100644 --- a/Sources/Infrastructure/Apps/InAppPurchases/Availability/SDKInAppPurchaseAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKInAppPurchaseAvailabilityRepository: InAppPurchaseAvailabilityRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKInAppPurchaseAvailabilityRepository: InAppPurchaseAvailabilityR self.client = client } - public func getAvailability(iapId: String) async throws -> Domain.InAppPurchaseAvailability? { + public func getAvailability(iapId: String) async throws -> ASCKit.InAppPurchaseAvailability? { // Two parallel calls — `include=availableTerritories` on the parent endpoint truncates // the relationship to ~10 entries. Fetching `/availableTerritories?limit=200` returns // the full territory list (Apple's max is 175 today). @@ -29,9 +28,9 @@ public struct SDKInAppPurchaseAvailabilityRepository: InAppPurchaseAvailabilityR let (avail, terr) = try await (availResponse, terrResponse) let territories = terr.data.map { t in - Domain.Territory(id: t.id, currency: t.attributes?.currency) + ASCKit.Territory(id: t.id, currency: t.attributes?.currency) } - return Domain.InAppPurchaseAvailability( + return ASCKit.InAppPurchaseAvailability( id: avail.data.id, iapId: iapId, isAvailableInNewTerritories: avail.data.attributes?.isAvailableInNewTerritories ?? false, @@ -46,7 +45,7 @@ public struct SDKInAppPurchaseAvailabilityRepository: InAppPurchaseAvailabilityR iapId: String, isAvailableInNewTerritories: Bool, territoryIds: [String] - ) async throws -> Domain.InAppPurchaseAvailability { + ) async throws -> ASCKit.InAppPurchaseAvailability { let body = InAppPurchaseAvailabilityCreateRequest(data: .init( type: .inAppPurchaseAvailabilities, attributes: .init(isAvailableInNewTerritories: isAvailableInNewTerritories), @@ -63,15 +62,15 @@ public struct SDKInAppPurchaseAvailabilityRepository: InAppPurchaseAvailabilityR _ sdk: AppStoreConnect_Swift_SDK.InAppPurchaseAvailability, included: [AppStoreConnect_Swift_SDK.Territory]?, iapId: String - ) -> Domain.InAppPurchaseAvailability { + ) -> ASCKit.InAppPurchaseAvailability { let territoryIds = sdk.relationships?.availableTerritories?.data?.map(\.id) ?? [] let includedMap = Dictionary( uniqueKeysWithValues: (included ?? []).map { ($0.id, $0) } ) let territories = territoryIds.map { id in - Domain.Territory(id: id, currency: includedMap[id]?.attributes?.currency) + ASCKit.Territory(id: id, currency: includedMap[id]?.attributes?.currency) } - return Domain.InAppPurchaseAvailability( + return ASCKit.InAppPurchaseAvailability( id: sdk.id, iapId: iapId, isAvailableInNewTerritories: sdk.attributes?.isAvailableInNewTerritories ?? false, diff --git a/Sources/Domain/Apps/InAppPurchases/InAppPurchase+RESTRoutes.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchase+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/InAppPurchase+RESTRoutes.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchase+RESTRoutes.swift diff --git a/Sources/Domain/Apps/InAppPurchases/InAppPurchase.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchase.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/InAppPurchase.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchase.swift diff --git a/Sources/Domain/Apps/InAppPurchases/InAppPurchasePricePoint.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePricePoint.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/InAppPurchasePricePoint.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePricePoint.swift diff --git a/Sources/Domain/Apps/InAppPurchases/InAppPurchasePriceRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceRepository.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/InAppPurchasePriceRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceRepository.swift diff --git a/Sources/Domain/Apps/InAppPurchases/InAppPurchasePriceSchedule.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceSchedule.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/InAppPurchasePriceSchedule.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceSchedule.swift diff --git a/Sources/Domain/Apps/InAppPurchases/InAppPurchaseRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseRepository.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/InAppPurchaseRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseRepository.swift diff --git a/Sources/Domain/Apps/InAppPurchases/InAppPurchaseSubmission.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmission.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/InAppPurchaseSubmission.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmission.swift diff --git a/Sources/Domain/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift diff --git a/Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchasePriceRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift similarity index 86% rename from Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchasePriceRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift index 432d2e00..609e4fd4 100644 --- a/Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchasePriceRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un self.client = client } - public func getPriceSchedule(iapId: String) async throws -> Domain.InAppPurchasePriceSchedule? { + public func getPriceSchedule(iapId: String) async throws -> ASCKit.InAppPurchasePriceSchedule? { // Step 1: schedule + base territory. let schedule: AppStoreConnect_Swift_SDK.InAppPurchasePriceScheduleResponse do { @@ -44,18 +43,18 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un let manualData = manualPages.flatMap(\.data) // Index included territories + price points for lookup. - var territoriesById: [String: Domain.Territory] = [:] + var territoriesById: [String: ASCKit.Territory] = [:] var pricePointsById: [String: AppStoreConnect_Swift_SDK.InAppPurchasePricePoint] = [:] for item in manualPages.flatMap({ $0.included ?? [] }) { switch item { case .territory(let t): - territoriesById[t.id] = Domain.Territory(id: t.id, currency: t.attributes?.currency) + territoriesById[t.id] = ASCKit.Territory(id: t.id, currency: t.attributes?.currency) case .inAppPurchasePricePoint(let pp): pricePointsById[pp.id] = pp } } - let manualPrices: [Domain.TerritoryPrice] = manualData.compactMap { price in + let manualPrices: [ASCKit.TerritoryPrice] = manualData.compactMap { price in guard let territoryId = price.relationships?.territory?.data?.id, let territory = territoriesById[territoryId], @@ -64,24 +63,24 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un let customerPrice = pricePoint.attributes?.customerPrice, let proceeds = pricePoint.attributes?.proceeds else { return nil } - return Domain.TerritoryPrice(territory: territory, customerPrice: customerPrice, proceeds: proceeds) + return ASCKit.TerritoryPrice(territory: territory, customerPrice: customerPrice, proceeds: proceeds) } // Step 3: equalizations — fetch the full ~175-territory list using the manual price's // price point. If there are no manual prices we have nothing to equalize from. let manualPricePointId = manualData.first?.relationships?.inAppPurchasePricePoint?.data?.id - var equalizedPrices: [Domain.TerritoryPrice] = [] + var equalizedPrices: [ASCKit.TerritoryPrice] = [] if let pricePointId = manualPricePointId { equalizedPrices = (try? await fetchEqualizedTerritoryPrices(pricePointId: pricePointId)) ?? [] } // Merge: manual entries override equalized entries for the same territory. - var byTerritory: [String: Domain.TerritoryPrice] = [:] + var byTerritory: [String: ASCKit.TerritoryPrice] = [:] for entry in equalizedPrices { byTerritory[entry.territory.id] = entry } for entry in manualPrices { byTerritory[entry.territory.id] = entry } let merged = byTerritory.values.sorted { $0.territory.id < $1.territory.id } - return Domain.InAppPurchasePriceSchedule( + return ASCKit.InAppPurchasePriceSchedule( id: scheduleId, iapId: iapId, baseTerritory: baseTerritory, @@ -89,7 +88,7 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un ) } - private func fetchEqualizedTerritoryPrices(pricePointId: String) async throws -> [Domain.TerritoryPrice] { + private func fetchEqualizedTerritoryPrices(pricePointId: String) async throws -> [ASCKit.TerritoryPrice] { let response = try await client.request( APIEndpoint.v1.inAppPurchasePricePoints.id(pricePointId).equalizations.get(parameters: .init( fieldsInAppPurchasePricePoints: [.customerPrice, .proceeds, .territory], @@ -99,9 +98,9 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un )) ) - var territoriesById: [String: Domain.Territory] = [:] + var territoriesById: [String: ASCKit.Territory] = [:] for t in response.included ?? [] { - territoriesById[t.id] = Domain.Territory(id: t.id, currency: t.attributes?.currency) + territoriesById[t.id] = ASCKit.Territory(id: t.id, currency: t.attributes?.currency) } return response.data.compactMap { pp in @@ -110,12 +109,12 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un let customerPrice = pp.attributes?.customerPrice, let proceeds = pp.attributes?.proceeds else { return nil } - let territory = territoriesById[territoryId] ?? Domain.Territory(id: territoryId, currency: nil) - return Domain.TerritoryPrice(territory: territory, customerPrice: customerPrice, proceeds: proceeds) + let territory = territoriesById[territoryId] ?? ASCKit.Territory(id: territoryId, currency: nil) + return ASCKit.TerritoryPrice(territory: territory, customerPrice: customerPrice, proceeds: proceeds) } } - public func listEqualizations(pricePointId: String, limit: Int?) async throws -> [Domain.InAppPurchasePricePoint] { + public func listEqualizations(pricePointId: String, limit: Int?) async throws -> [ASCKit.InAppPurchasePricePoint] { let request = APIEndpoint.v1.inAppPurchasePricePoints.id(pricePointId).equalizations.get( parameters: .init( fieldsInAppPurchasePricePoints: [.customerPrice, .proceeds, .territory], @@ -133,14 +132,14 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un private func extractTerritory( id: String, included: [AppStoreConnect_Swift_SDK.InAppPurchasePriceScheduleResponse.IncludedItem]? - ) -> Domain.Territory? { + ) -> ASCKit.Territory? { for item in included ?? [] { if case let .territory(t) = item, t.id == id { - return Domain.Territory(id: t.id, currency: t.attributes?.currency) + return ASCKit.Territory(id: t.id, currency: t.attributes?.currency) } } // Fall back to id-only territory if the include didn't return it. - return Domain.Territory(id: id, currency: nil) + return ASCKit.Territory(id: id, currency: nil) } public func listPricePoints( @@ -148,7 +147,7 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un territory: String?, limit: Int?, cursor: String? - ) async throws -> Domain.PaginatedResponse { + ) async throws -> ASCKit.PaginatedResponse { var request = APIEndpoint.v2.inAppPurchases.id(iapId).pricePoints.get( parameters: .init( filterTerritory: territory.map { [$0] }, @@ -163,21 +162,21 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un request.query = query } let response = try await client.request(request) - return Domain.PaginatedResponse( + return ASCKit.PaginatedResponse( data: response.data.map { mapPricePoint($0, iapId: iapId) }, nextCursor: response.meta?.paging.nextCursor, totalCount: response.meta?.paging.total ) } - public func setPriceSchedule(iapId: String, baseTerritory: String, pricePointId: String) async throws -> Domain.InAppPurchasePriceSchedule { + public func setPriceSchedule(iapId: String, baseTerritory: String, pricePointId: String) async throws -> ASCKit.InAppPurchasePriceSchedule { let body = Self.makePriceScheduleCreateRequest( iapId: iapId, baseTerritory: baseTerritory, pricePointId: pricePointId ) let response = try await client.request(APIEndpoint.v1.inAppPurchasePriceSchedules.post(body)) - return Domain.InAppPurchasePriceSchedule(id: response.data.id, iapId: iapId) + return ASCKit.InAppPurchasePriceSchedule(id: response.data.id, iapId: iapId) } /// Mirrors the iOS app's price-schedule POST shape. ASC requires the inline manual price @@ -211,8 +210,8 @@ public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @un ) } - private func mapPricePoint(_ sdk: AppStoreConnect_Swift_SDK.InAppPurchasePricePoint, iapId: String) -> Domain.InAppPurchasePricePoint { - Domain.InAppPurchasePricePoint( + private func mapPricePoint(_ sdk: AppStoreConnect_Swift_SDK.InAppPurchasePricePoint, iapId: String) -> ASCKit.InAppPurchasePricePoint { + ASCKit.InAppPurchasePricePoint( id: sdk.id, iapId: iapId, territory: sdk.relationships?.territory?.data?.id, diff --git a/Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchaseRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchaseRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift index 1880795e..f6911df1 100644 --- a/Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchaseRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Sendable { private let client: any APIClient @@ -18,7 +17,7 @@ public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Se self.irisFlagsProvider = irisFlagsProvider } - public func listInAppPurchases(appId: String, limit: Int?) async throws -> PaginatedResponse { + public func listInAppPurchases(appId: String, limit: Int?) async throws -> PaginatedResponse { let request = APIEndpoint.v1.apps.id(appId).inAppPurchasesV2.get(parameters: .init( limit: limit )) @@ -34,7 +33,7 @@ public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Se return mapped.hasBeenApproved } let irisFlags = await irisFlagsProvider?(appId) ?? [:] - let purchases = response.data.map { sdkIAP -> Domain.InAppPurchase in + let purchases = response.data.map { sdkIAP -> ASCKit.InAppPurchase in let state = mapState(sdkIAP.attributes?.state) let isFirstTime = !hasShippedIAP && !state.hasBeenApproved let submitWithNextVersion = irisFlags[sdkIAP.id] ?? false @@ -51,8 +50,8 @@ public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Se appId: String, referenceName: String, productId: String, - type: Domain.InAppPurchaseType - ) async throws -> Domain.InAppPurchase { + type: ASCKit.InAppPurchaseType + ) async throws -> ASCKit.InAppPurchase { guard let sdkType = mapToSDKType(type) else { throw APIError.unknown("Unsupported IAP type: \(type.rawValue)") } @@ -76,7 +75,7 @@ public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Se referenceName: String?, reviewNote: String?, isFamilySharable: Bool? - ) async throws -> Domain.InAppPurchase { + ) async throws -> ASCKit.InAppPurchase { let body = InAppPurchaseV2UpdateRequest(data: .init( type: .inAppPurchases, id: iapId, @@ -101,8 +100,8 @@ public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Se appId: String, isFirstTimeSubmission: Bool = false, submitWithNextAppStoreVersion: Bool = false - ) -> Domain.InAppPurchase { - Domain.InAppPurchase( + ) -> ASCKit.InAppPurchase { + ASCKit.InAppPurchase( id: sdk.id, appId: appId, referenceName: sdk.attributes?.name ?? "", @@ -115,7 +114,7 @@ public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Se ) } - private func mapFromSDKType(_ sdkType: AppStoreConnect_Swift_SDK.InAppPurchaseType?) -> Domain.InAppPurchaseType? { + private func mapFromSDKType(_ sdkType: AppStoreConnect_Swift_SDK.InAppPurchaseType?) -> ASCKit.InAppPurchaseType? { guard let sdkType else { return nil } switch sdkType { case .consumable: return .consumable @@ -124,7 +123,7 @@ public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Se } } - private func mapToSDKType(_ type: Domain.InAppPurchaseType) -> AppStoreConnect_Swift_SDK.InAppPurchaseType? { + private func mapToSDKType(_ type: ASCKit.InAppPurchaseType) -> AppStoreConnect_Swift_SDK.InAppPurchaseType? { switch type { case .consumable: return .consumable case .nonConsumable: return .nonConsumable @@ -133,8 +132,8 @@ public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Se } } - private func mapState(_ sdkState: AppStoreConnect_Swift_SDK.InAppPurchaseState?) -> Domain.InAppPurchaseState { + private func mapState(_ sdkState: AppStoreConnect_Swift_SDK.InAppPurchaseState?) -> ASCKit.InAppPurchaseState { guard let sdkState else { return .missingMetadata } - return Domain.InAppPurchaseState(rawValue: sdkState.rawValue) ?? .missingMetadata + return ASCKit.InAppPurchaseState(rawValue: sdkState.rawValue) ?? .missingMetadata } } diff --git a/Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchaseSubmissionRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift index 8013de3c..4f348d2b 100644 --- a/Sources/Infrastructure/Apps/InAppPurchases/SDKInAppPurchaseSubmissionRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKInAppPurchaseSubmissionRepository: InAppPurchaseSubmissionRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKInAppPurchaseSubmissionRepository: InAppPurchaseSubmissionRepos self.client = client } - public func submitInAppPurchase(iapId: String) async throws -> Domain.InAppPurchaseSubmission { + public func submitInAppPurchase(iapId: String) async throws -> ASCKit.InAppPurchaseSubmission { let body = InAppPurchaseSubmissionCreateRequest(data: .init( type: .inAppPurchaseSubmissions, relationships: .init( @@ -16,7 +15,7 @@ public struct SDKInAppPurchaseSubmissionRepository: InAppPurchaseSubmissionRepos ) )) let response = try await client.request(APIEndpoint.v1.inAppPurchaseSubmissions.post(body)) - return Domain.InAppPurchaseSubmission(id: response.data.id, iapId: iapId) + return ASCKit.InAppPurchaseSubmission(id: response.data.id, iapId: iapId) } public func deleteSubmission(submissionId: String) async throws { diff --git a/Sources/Domain/Apps/InAppPurchases/Localizations/InAppPurchaseLocalization.swift b/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalization.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/Localizations/InAppPurchaseLocalization.swift rename to Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalization.swift diff --git a/Sources/Domain/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift diff --git a/Sources/Infrastructure/Apps/InAppPurchases/Localizations/SDKInAppPurchaseLocalizationRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift similarity index 88% rename from Sources/Infrastructure/Apps/InAppPurchases/Localizations/SDKInAppPurchaseLocalizationRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift index 0f6d003d..0d472495 100644 --- a/Sources/Infrastructure/Apps/InAppPurchases/Localizations/SDKInAppPurchaseLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKInAppPurchaseLocalizationRepository: InAppPurchaseLocalizationRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKInAppPurchaseLocalizationRepository: InAppPurchaseLocalizationR self.client = client } - public func listLocalizations(iapId: String) async throws -> [Domain.InAppPurchaseLocalization] { + public func listLocalizations(iapId: String) async throws -> [ASCKit.InAppPurchaseLocalization] { let request = APIEndpoint.v2.inAppPurchases.id(iapId).inAppPurchaseLocalizations.get() let response = try await client.request(request) return response.data.map { mapLocalization($0, iapId: iapId) } @@ -19,7 +18,7 @@ public struct SDKInAppPurchaseLocalizationRepository: InAppPurchaseLocalizationR locale: String, name: String, description: String? - ) async throws -> Domain.InAppPurchaseLocalization { + ) async throws -> ASCKit.InAppPurchaseLocalization { let body = InAppPurchaseLocalizationCreateRequest(data: .init( type: .inAppPurchaseLocalizations, attributes: .init(name: name, locale: locale, description: description), @@ -35,7 +34,7 @@ public struct SDKInAppPurchaseLocalizationRepository: InAppPurchaseLocalizationR localizationId: String, name: String?, description: String? - ) async throws -> Domain.InAppPurchaseLocalization { + ) async throws -> ASCKit.InAppPurchaseLocalization { let body = InAppPurchaseLocalizationUpdateRequest(data: .init( type: .inAppPurchaseLocalizations, id: localizationId, @@ -56,8 +55,8 @@ public struct SDKInAppPurchaseLocalizationRepository: InAppPurchaseLocalizationR private func mapLocalization( _ sdk: AppStoreConnect_Swift_SDK.InAppPurchaseLocalization, iapId: String - ) -> Domain.InAppPurchaseLocalization { - Domain.InAppPurchaseLocalization( + ) -> ASCKit.InAppPurchaseLocalization { + ASCKit.InAppPurchaseLocalization( id: sdk.id, iapId: iapId, locale: sdk.attributes?.locale ?? "", @@ -69,8 +68,8 @@ public struct SDKInAppPurchaseLocalizationRepository: InAppPurchaseLocalizationR private func mapState( _ sdkState: AppStoreConnect_Swift_SDK.InAppPurchaseLocalization.Attributes.State? - ) -> Domain.InAppPurchaseLocalizationState? { + ) -> ASCKit.InAppPurchaseLocalizationState? { guard let sdkState else { return nil } - return Domain.InAppPurchaseLocalizationState(rawValue: sdkState.rawValue) + return ASCKit.InAppPurchaseLocalizationState(rawValue: sdkState.rawValue) } } diff --git a/Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCode.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCode.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCode.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCode.swift diff --git a/Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCode.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCode.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCode.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCode.swift diff --git a/Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCode.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCode.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCode.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCode.swift diff --git a/Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePrice.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePrice.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePrice.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePrice.swift diff --git a/Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift diff --git a/Sources/Infrastructure/Apps/InAppPurchases/OfferCodes/SDKInAppPurchaseOfferCodeRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift similarity index 86% rename from Sources/Infrastructure/Apps/InAppPurchases/OfferCodes/SDKInAppPurchaseOfferCodeRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift index 47b084be..ee4d06a9 100644 --- a/Sources/Infrastructure/Apps/InAppPurchases/OfferCodes/SDKInAppPurchaseOfferCodeRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift @@ -1,6 +1,5 @@ import Foundation @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeRepository, @unchecked Sendable { private let client: any APIClient @@ -11,7 +10,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit // MARK: - Offer Codes - public func listOfferCodes(iapId: String) async throws -> [Domain.InAppPurchaseOfferCode] { + public func listOfferCodes(iapId: String) async throws -> [ASCKit.InAppPurchaseOfferCode] { let request = APIEndpoint.v2.inAppPurchases.id(iapId).offerCodes.get() let response = try await client.request(request) return response.data.map { mapOfferCode($0, iapId: iapId) } @@ -20,9 +19,9 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit public func createOfferCode( iapId: String, name: String, - customerEligibilities: [Domain.IAPCustomerEligibility], - prices: [Domain.OfferCodePriceInput] - ) async throws -> Domain.InAppPurchaseOfferCode { + customerEligibilities: [ASCKit.IAPCustomerEligibility], + prices: [ASCKit.OfferCodePriceInput] + ) async throws -> ASCKit.InAppPurchaseOfferCode { let sdkEligibilities = customerEligibilities.compactMap { InAppPurchaseOfferCodeCreateRequest.Data.Attributes.CustomerEligibility(rawValue: $0.rawValue) } @@ -30,7 +29,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit // Each price needs a placeholder id that correlates between `included[]` and // `relationships.prices.data` — ASC reads the placeholders and replaces them with // generated server-side ids. Mirrors the iOS app's offer-code create payload. - let pricesPayload: [(localId: String, input: Domain.OfferCodePriceInput)] = prices.enumerated().map { + let pricesPayload: [(localId: String, input: ASCKit.OfferCodePriceInput)] = prices.enumerated().map { (localId: "${local-price-\($0.offset + 1)}", input: $0.element) } let pricesRelationship = pricesPayload.map { @@ -69,7 +68,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit return mapOfferCode(response.data, iapId: iapId) } - public func updateOfferCode(offerCodeId: String, isActive: Bool) async throws -> Domain.InAppPurchaseOfferCode { + public func updateOfferCode(offerCodeId: String, isActive: Bool) async throws -> ASCKit.InAppPurchaseOfferCode { let body = InAppPurchaseOfferCodeUpdateRequest( data: .init( type: .inAppPurchaseOfferCodes, @@ -83,7 +82,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit // MARK: - Prices - public func listPrices(offerCodeId: String) async throws -> [Domain.InAppPurchaseOfferCodePrice] { + public func listPrices(offerCodeId: String) async throws -> [ASCKit.InAppPurchaseOfferCodePrice] { // One price per territory — follow every page to get all 175. `include` makes Apple // return each price's territory and price point linkage, which the mapper reads. let pages = try await client.requestAllPages( @@ -95,7 +94,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit // MARK: - Custom Codes - public func listCustomCodes(offerCodeId: String) async throws -> [Domain.InAppPurchaseOfferCodeCustomCode] { + public func listCustomCodes(offerCodeId: String) async throws -> [ASCKit.InAppPurchaseOfferCodeCustomCode] { let request = APIEndpoint.v1.inAppPurchaseOfferCodes.id(offerCodeId).customCodes.get() let response = try await client.request(request) return response.data.map { mapCustomCode($0, offerCodeId: offerCodeId) } @@ -106,7 +105,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit customCode: String, numberOfCodes: Int, expirationDate: String? - ) async throws -> Domain.InAppPurchaseOfferCodeCustomCode { + ) async throws -> ASCKit.InAppPurchaseOfferCodeCustomCode { let body = InAppPurchaseOfferCodeCustomCodeCreateRequest( data: .init( type: .inAppPurchaseOfferCodeCustomCodes, @@ -124,7 +123,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit return mapCustomCode(response.data, offerCodeId: offerCodeId) } - public func updateCustomCode(customCodeId: String, isActive: Bool) async throws -> Domain.InAppPurchaseOfferCodeCustomCode { + public func updateCustomCode(customCodeId: String, isActive: Bool) async throws -> ASCKit.InAppPurchaseOfferCodeCustomCode { let body = InAppPurchaseOfferCodeCustomCodeUpdateRequest( data: .init( type: .inAppPurchaseOfferCodeCustomCodes, @@ -138,7 +137,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit // MARK: - One-Time Use Codes - public func listOneTimeUseCodes(offerCodeId: String) async throws -> [Domain.InAppPurchaseOfferCodeOneTimeUseCode] { + public func listOneTimeUseCodes(offerCodeId: String) async throws -> [ASCKit.InAppPurchaseOfferCodeOneTimeUseCode] { let request = APIEndpoint.v1.inAppPurchaseOfferCodes.id(offerCodeId).oneTimeUseCodes.get() let response = try await client.request(request) return response.data.map { mapOneTimeUseCode($0, offerCodeId: offerCodeId) } @@ -148,8 +147,8 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit offerCodeId: String, numberOfCodes: Int, expirationDate: String, - environment: Domain.OfferCodeEnvironment - ) async throws -> Domain.InAppPurchaseOfferCodeOneTimeUseCode { + environment: ASCKit.OfferCodeEnvironment + ) async throws -> ASCKit.InAppPurchaseOfferCodeOneTimeUseCode { let sdkEnv = AppStoreConnect_Swift_SDK.OfferCodeEnvironment(rawValue: environment.rawValue) let body = InAppPurchaseOfferCodeOneTimeUseCodeCreateRequest( data: .init( @@ -168,7 +167,7 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit return mapOneTimeUseCode(response.data, offerCodeId: offerCodeId) } - public func updateOneTimeUseCode(oneTimeCodeId: String, isActive: Bool) async throws -> Domain.InAppPurchaseOfferCodeOneTimeUseCode { + public func updateOneTimeUseCode(oneTimeCodeId: String, isActive: Bool) async throws -> ASCKit.InAppPurchaseOfferCodeOneTimeUseCode { let body = InAppPurchaseOfferCodeOneTimeUseCodeUpdateRequest( data: .init( type: .inAppPurchaseOfferCodeOneTimeUseCodes, @@ -190,12 +189,12 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit private func mapOfferCode( _ sdk: AppStoreConnect_Swift_SDK.InAppPurchaseOfferCode, iapId: String - ) -> Domain.InAppPurchaseOfferCode { - let customerEligibilities = (sdk.attributes?.customerEligibilities ?? []).compactMap { sdkEligibility -> Domain.IAPCustomerEligibility? in - Domain.IAPCustomerEligibility(rawValue: sdkEligibility.rawValue) + ) -> ASCKit.InAppPurchaseOfferCode { + let customerEligibilities = (sdk.attributes?.customerEligibilities ?? []).compactMap { sdkEligibility -> ASCKit.IAPCustomerEligibility? in + ASCKit.IAPCustomerEligibility(rawValue: sdkEligibility.rawValue) } - return Domain.InAppPurchaseOfferCode( + return ASCKit.InAppPurchaseOfferCode( id: sdk.id, iapId: iapId, name: sdk.attributes?.name ?? "", @@ -210,10 +209,10 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit private func mapCustomCode( _ sdk: AppStoreConnect_Swift_SDK.InAppPurchaseOfferCodeCustomCode, offerCodeId: String - ) -> Domain.InAppPurchaseOfferCodeCustomCode { + ) -> ASCKit.InAppPurchaseOfferCodeCustomCode { let createdDateString: String? = sdk.attributes?.createdDate.map { ISO8601DateFormatter().string(from: $0) } - return Domain.InAppPurchaseOfferCodeCustomCode( + return ASCKit.InAppPurchaseOfferCodeCustomCode( id: sdk.id, offerCodeId: offerCodeId, customCode: sdk.attributes?.customCode ?? "", @@ -227,8 +226,8 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit private func mapPrice( _ sdk: AppStoreConnect_Swift_SDK.InAppPurchaseOfferPrice, offerCodeId: String - ) -> Domain.InAppPurchaseOfferCodePrice { - Domain.InAppPurchaseOfferCodePrice( + ) -> ASCKit.InAppPurchaseOfferCodePrice { + ASCKit.InAppPurchaseOfferCodePrice( id: sdk.id, offerCodeId: offerCodeId, territory: sdk.relationships?.territory?.data?.id, @@ -239,13 +238,13 @@ public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeReposit private func mapOneTimeUseCode( _ sdk: AppStoreConnect_Swift_SDK.InAppPurchaseOfferCodeOneTimeUseCode, offerCodeId: String - ) -> Domain.InAppPurchaseOfferCodeOneTimeUseCode { + ) -> ASCKit.InAppPurchaseOfferCodeOneTimeUseCode { let createdDateString: String? = sdk.attributes?.createdDate.map { ISO8601DateFormatter().string(from: $0) } - let environment: Domain.OfferCodeEnvironment? = sdk.attributes?.environment.flatMap { - Domain.OfferCodeEnvironment(rawValue: $0.rawValue) + let environment: ASCKit.OfferCodeEnvironment? = sdk.attributes?.environment.flatMap { + ASCKit.OfferCodeEnvironment(rawValue: $0.rawValue) } - return Domain.InAppPurchaseOfferCodeOneTimeUseCode( + return ASCKit.InAppPurchaseOfferCodeOneTimeUseCode( id: sdk.id, offerCodeId: offerCodeId, numberOfCodes: sdk.attributes?.numberOfCodes ?? 0, diff --git a/Sources/Domain/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift diff --git a/Sources/Domain/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshot.swift b/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshot.swift similarity index 100% rename from Sources/Domain/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshot.swift rename to Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshot.swift diff --git a/Sources/Infrastructure/Apps/InAppPurchases/Review/SDKInAppPurchaseReviewRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift similarity index 91% rename from Sources/Infrastructure/Apps/InAppPurchases/Review/SDKInAppPurchaseReviewRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift index 09a7aa6f..eb5fd9e0 100644 --- a/Sources/Infrastructure/Apps/InAppPurchases/Review/SDKInAppPurchaseReviewRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @unchecked Sendable { @@ -23,7 +22,7 @@ public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @ // MARK: - Review Screenshot - public func getReviewScreenshot(iapId: String) async throws -> Domain.InAppPurchaseReviewScreenshot? { + public func getReviewScreenshot(iapId: String) async throws -> ASCKit.InAppPurchaseReviewScreenshot? { do { let response = try await client.request( APIEndpoint.v2.inAppPurchases.id(iapId).appStoreReviewScreenshot.get() @@ -38,7 +37,7 @@ public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @ public func uploadReviewScreenshot( iapId: String, fileURL: URL - ) async throws -> Domain.InAppPurchaseReviewScreenshot { + ) async throws -> ASCKit.InAppPurchaseReviewScreenshot { let fileData = try Data(contentsOf: fileURL) let fileName = fileURL.lastPathComponent logUploadStep("iap-review-screenshot reserve fileName=\(fileName) bytes=\(fileData.count) iapId=\(iapId)") @@ -88,13 +87,13 @@ public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @ // MARK: - Promotional Images - public func listImages(iapId: String) async throws -> [Domain.InAppPurchasePromotionalImage] { + public func listImages(iapId: String) async throws -> [ASCKit.InAppPurchasePromotionalImage] { let request = APIEndpoint.v2.inAppPurchases.id(iapId).images.get() let response = try await client.request(request) return response.data.map { mapImage($0, iapId: iapId) } } - public func uploadImage(iapId: String, fileURL: URL) async throws -> Domain.InAppPurchasePromotionalImage { + public func uploadImage(iapId: String, fileURL: URL) async throws -> ASCKit.InAppPurchasePromotionalImage { let fileData = try Data(contentsOf: fileURL) let fileName = fileURL.lastPathComponent logUploadStep("iap-image reserve fileName=\(fileName) bytes=\(fileData.count) iapId=\(iapId)") @@ -136,8 +135,8 @@ public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @ /// Re-fetches the screenshot until ASC reports `assetDeliveryState == COMPLETE` /// (imageAsset URL populated). Stops on `FAILED`. Falls back to whatever the latest /// fetch returned if processing exceeds `pollMaxAttempts × pollDelayNanos`. - private func pollReviewScreenshotReady(screenshotId: String, iapId: String) async throws -> Domain.InAppPurchaseReviewScreenshot { - var latest: Domain.InAppPurchaseReviewScreenshot? + private func pollReviewScreenshotReady(screenshotId: String, iapId: String) async throws -> ASCKit.InAppPurchaseReviewScreenshot { + var latest: ASCKit.InAppPurchaseReviewScreenshot? for attempt in 1...pollMaxAttempts { let response = try await client.request( APIEndpoint.v1.inAppPurchaseAppStoreReviewScreenshots.id(screenshotId).get() @@ -164,8 +163,8 @@ public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @ /// Re-fetches the image until state is one of `PREPARE_FOR_SUBMISSION / /// WAITING_FOR_REVIEW / APPROVED` (imageAsset URL populated). Stops on `FAILED`/`REJECTED`. - private func pollImageReady(imageId: String, iapId: String) async throws -> Domain.InAppPurchasePromotionalImage { - var latest: Domain.InAppPurchasePromotionalImage? + private func pollImageReady(imageId: String, iapId: String) async throws -> ASCKit.InAppPurchasePromotionalImage { + var latest: ASCKit.InAppPurchasePromotionalImage? for attempt in 1...pollMaxAttempts { let response = try await client.request( APIEndpoint.v1.inAppPurchaseImages.id(imageId).get() @@ -197,10 +196,10 @@ public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @ private func mapReviewScreenshot( _ sdk: AppStoreConnect_Swift_SDK.InAppPurchaseAppStoreReviewScreenshot, iapId: String - ) -> Domain.InAppPurchaseReviewScreenshot { + ) -> ASCKit.InAppPurchaseReviewScreenshot { let stateRaw = sdk.attributes?.assetDeliveryState?.state?.rawValue - let state = stateRaw.flatMap { Domain.InAppPurchaseReviewScreenshot.AssetState(rawValue: $0) } - return Domain.InAppPurchaseReviewScreenshot( + let state = stateRaw.flatMap { ASCKit.InAppPurchaseReviewScreenshot.AssetState(rawValue: $0) } + return ASCKit.InAppPurchaseReviewScreenshot( id: sdk.id, iapId: iapId, fileName: sdk.attributes?.fileName ?? "", @@ -213,10 +212,10 @@ public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @ private func mapImage( _ sdk: AppStoreConnect_Swift_SDK.InAppPurchaseImage, iapId: String - ) -> Domain.InAppPurchasePromotionalImage { + ) -> ASCKit.InAppPurchasePromotionalImage { let stateRaw = sdk.attributes?.state?.rawValue - let state = stateRaw.flatMap { Domain.InAppPurchasePromotionalImage.ImageState(rawValue: $0) } - return Domain.InAppPurchasePromotionalImage( + let state = stateRaw.flatMap { ASCKit.InAppPurchasePromotionalImage.ImageState(rawValue: $0) } + return ASCKit.InAppPurchasePromotionalImage( id: sdk.id, iapId: iapId, fileName: sdk.attributes?.fileName ?? "", @@ -226,11 +225,11 @@ public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @ ) } - private func mapImageAsset(_ sdk: AppStoreConnect_Swift_SDK.ImageAsset?) -> Domain.ImageAsset? { + private func mapImageAsset(_ sdk: AppStoreConnect_Swift_SDK.ImageAsset?) -> ASCKit.ImageAsset? { guard let templateUrl = sdk?.templateURL, !templateUrl.isEmpty, let width = sdk?.width, width > 0, let height = sdk?.height, height > 0 else { return nil } - return Domain.ImageAsset(templateUrl: templateUrl, width: width, height: height) + return ASCKit.ImageAsset(templateUrl: templateUrl, width: width, height: height) } } diff --git a/Sources/Infrastructure/Apps/OpenAPIAppRepository.swift b/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift similarity index 85% rename from Sources/Infrastructure/Apps/OpenAPIAppRepository.swift rename to Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift index 9cc15a04..33d7f7dd 100644 --- a/Sources/Infrastructure/Apps/OpenAPIAppRepository.swift +++ b/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKAppRepository: AppRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKAppRepository: AppRepository, @unchecked Sendable { self.client = client } - public func listApps(limit: Int?) async throws -> PaginatedResponse { + public func listApps(limit: Int?) async throws -> PaginatedResponse { let request = APIEndpoint.v1.apps.get(parameters: .init( limit: limit )) @@ -18,13 +17,13 @@ public struct SDKAppRepository: AppRepository, @unchecked Sendable { return PaginatedResponse(data: apps, nextCursor: nextCursor) } - public func getApp(id: String) async throws -> Domain.App { + public func getApp(id: String) async throws -> ASCKit.App { let request = APIEndpoint.v1.apps.id(id).get() let response = try await client.request(request) return mapApp(response.data) } - public func fetchAppIcon(appId: String) async throws -> Domain.ImageAsset? { + public func fetchAppIcon(appId: String) async throws -> ASCKit.ImageAsset? { let request = APIEndpoint.v1.apps.id(appId).appStoreVersions.get( parameters: .init( fieldsBuilds: [.iconAssetToken], @@ -48,12 +47,12 @@ public struct SDKAppRepository: AppRepository, @unchecked Sendable { let width = token.width, let height = token.height else { continue } - return Domain.ImageAsset(templateUrl: templateURL, width: width, height: height) + return ASCKit.ImageAsset(templateUrl: templateURL, width: width, height: height) } return nil } - public func updateContentRights(appId: String, declaration: Domain.ContentRightsDeclaration?) async throws -> Domain.App { + public func updateContentRights(appId: String, declaration: ASCKit.ContentRightsDeclaration?) async throws -> ASCKit.App { let sdkDeclaration = declaration.map { AppUpdateRequest.Data.Attributes.ContentRightsDeclaration(rawValue: $0.rawValue) } ?? nil let body = AppUpdateRequest( data: .init( @@ -66,12 +65,12 @@ public struct SDKAppRepository: AppRepository, @unchecked Sendable { return mapApp(response.data) } - private func mapApp(_ sdkApp: AppStoreConnect_Swift_SDK.App) -> Domain.App { - let rights: Domain.ContentRightsDeclaration? = { + private func mapApp(_ sdkApp: AppStoreConnect_Swift_SDK.App) -> ASCKit.App { + let rights: ASCKit.ContentRightsDeclaration? = { guard let raw = sdkApp.attributes?.contentRightsDeclaration?.rawValue else { return nil } - return Domain.ContentRightsDeclaration(rawValue: raw) + return ASCKit.ContentRightsDeclaration(rawValue: raw) }() - return Domain.App( + return ASCKit.App( id: sdkApp.id, name: sdkApp.attributes?.name ?? "", bundleId: sdkApp.attributes?.bundleID ?? "", diff --git a/Sources/Domain/Apps/Performance/DiagnosticLogEntry.swift b/Sources/ASCKit/Apps/Performance/DiagnosticLogEntry.swift similarity index 100% rename from Sources/Domain/Apps/Performance/DiagnosticLogEntry.swift rename to Sources/ASCKit/Apps/Performance/DiagnosticLogEntry.swift diff --git a/Sources/Domain/Apps/Performance/DiagnosticSignatureInfo.swift b/Sources/ASCKit/Apps/Performance/DiagnosticSignatureInfo.swift similarity index 100% rename from Sources/Domain/Apps/Performance/DiagnosticSignatureInfo.swift rename to Sources/ASCKit/Apps/Performance/DiagnosticSignatureInfo.swift diff --git a/Sources/Domain/Apps/Performance/DiagnosticsRepository.swift b/Sources/ASCKit/Apps/Performance/DiagnosticsRepository.swift similarity index 100% rename from Sources/Domain/Apps/Performance/DiagnosticsRepository.swift rename to Sources/ASCKit/Apps/Performance/DiagnosticsRepository.swift diff --git a/Sources/Infrastructure/Apps/Performance/SDKDiagnosticsRepository.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift similarity index 99% rename from Sources/Infrastructure/Apps/Performance/SDKDiagnosticsRepository.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift index 180f63da..d8a8ffff 100644 --- a/Sources/Infrastructure/Apps/Performance/SDKDiagnosticsRepository.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKDiagnosticsRepository: DiagnosticsRepository, @unchecked Sendable { private let client: any APIClient diff --git a/Sources/Infrastructure/Apps/Performance/SDKPerfMetricsRepository.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift similarity index 99% rename from Sources/Infrastructure/Apps/Performance/SDKPerfMetricsRepository.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift index cc9259fb..af0e2eec 100644 --- a/Sources/Infrastructure/Apps/Performance/SDKPerfMetricsRepository.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKPerfMetricsRepository: PerfMetricsRepository, @unchecked Sendable { private let client: any APIClient diff --git a/Sources/Infrastructure/Apps/Performance/SDKPerfOverviewRepository.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift similarity index 96% rename from Sources/Infrastructure/Apps/Performance/SDKPerfOverviewRepository.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift index 5d9f0b2f..fcb92c30 100644 --- a/Sources/Infrastructure/Apps/Performance/SDKPerfOverviewRepository.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKPerfOverviewRepository: PerfOverviewRepository, @unchecked Sendable { @@ -9,7 +8,7 @@ public struct SDKPerfOverviewRepository: PerfOverviewRepository, @unchecked Send self.client = client } - public func getOverview(appId: String, deviceType: String?) async throws -> Domain.PerformanceOverview { + public func getOverview(appId: String, deviceType: String?) async throws -> ASCKit.PerformanceOverview { // The endpoint returns `application/vnd.apple.xcode-overview+json` as raw Data. let request = APIEndpoint.v1.apps.id(appId).performanceOverviews.get( filterDeviceType: deviceType.map { [$0] } @@ -19,8 +18,8 @@ public struct SDKPerfOverviewRepository: PerfOverviewRepository, @unchecked Send return mapOverview(overview, appId: appId, deviceType: deviceType) } - private func mapOverview(_ overview: XcodeOverview, appId: String, deviceType: String?) -> Domain.PerformanceOverview { - Domain.PerformanceOverview( + private func mapOverview(_ overview: XcodeOverview, appId: String, deviceType: String?) -> ASCKit.PerformanceOverview { + ASCKit.PerformanceOverview( appId: appId, deviceType: deviceType, platform: overview.appMetadata?.platform, diff --git a/Sources/Domain/Apps/Performance/PerfMetricsRepository.swift b/Sources/ASCKit/Apps/Performance/PerfMetricsRepository.swift similarity index 100% rename from Sources/Domain/Apps/Performance/PerfMetricsRepository.swift rename to Sources/ASCKit/Apps/Performance/PerfMetricsRepository.swift diff --git a/Sources/Domain/Apps/Performance/PerfOverviewRepository.swift b/Sources/ASCKit/Apps/Performance/PerfOverviewRepository.swift similarity index 100% rename from Sources/Domain/Apps/Performance/PerfOverviewRepository.swift rename to Sources/ASCKit/Apps/Performance/PerfOverviewRepository.swift diff --git a/Sources/Domain/Apps/Performance/PerfPowerMetric.swift b/Sources/ASCKit/Apps/Performance/PerfPowerMetric.swift similarity index 100% rename from Sources/Domain/Apps/Performance/PerfPowerMetric.swift rename to Sources/ASCKit/Apps/Performance/PerfPowerMetric.swift diff --git a/Sources/Domain/Apps/Performance/Performance+RESTRoutes.swift b/Sources/ASCKit/Apps/Performance/Performance+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/Performance/Performance+RESTRoutes.swift rename to Sources/ASCKit/Apps/Performance/Performance+RESTRoutes.swift diff --git a/Sources/Domain/Apps/Performance/PerformanceOverview.swift b/Sources/ASCKit/Apps/Performance/PerformanceOverview.swift similarity index 100% rename from Sources/Domain/Apps/Performance/PerformanceOverview.swift rename to Sources/ASCKit/Apps/Performance/PerformanceOverview.swift diff --git a/Sources/Domain/Apps/Pricing/AppPricePoint.swift b/Sources/ASCKit/Apps/Pricing/AppPricePoint.swift similarity index 100% rename from Sources/Domain/Apps/Pricing/AppPricePoint.swift rename to Sources/ASCKit/Apps/Pricing/AppPricePoint.swift diff --git a/Sources/Domain/Apps/Pricing/AppPriceSchedule.swift b/Sources/ASCKit/Apps/Pricing/AppPriceSchedule.swift similarity index 100% rename from Sources/Domain/Apps/Pricing/AppPriceSchedule.swift rename to Sources/ASCKit/Apps/Pricing/AppPriceSchedule.swift diff --git a/Sources/Domain/Apps/Pricing/AppPricing+RESTRoutes.swift b/Sources/ASCKit/Apps/Pricing/AppPricing+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/Pricing/AppPricing+RESTRoutes.swift rename to Sources/ASCKit/Apps/Pricing/AppPricing+RESTRoutes.swift diff --git a/Sources/Infrastructure/Apps/Pricing/SDKPricingRepository.swift b/Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/Pricing/SDKPricingRepository.swift rename to Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift index 3c1ac3ab..42eb497e 100644 --- a/Sources/Infrastructure/Apps/Pricing/SDKPricingRepository.swift +++ b/Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKPricingRepository: PricingRepository, @unchecked Sendable { private let client: any APIClient @@ -18,7 +17,7 @@ public struct SDKPricingRepository: PricingRepository, @unchecked Sendable { } } - public func listPricePoints(appId: String, territory: String) async throws -> [Domain.AppPricePoint] { + public func listPricePoints(appId: String, territory: String) async throws -> [ASCKit.AppPricePoint] { let pages = try await client.requestAllPages( APIEndpoint.v1.apps.id(appId).appPricePoints.get(parameters: .init( filterTerritory: [territory], @@ -29,12 +28,12 @@ public struct SDKPricingRepository: PricingRepository, @unchecked Sendable { ) // Filtered to one territory, so every point belongs to it. return pages.flatMap(\.data).map { - Domain.AppPricePoint(id: $0.id, appId: appId, territory: territory, + ASCKit.AppPricePoint(id: $0.id, appId: appId, territory: territory, customerPrice: $0.attributes?.customerPrice, proceeds: $0.attributes?.proceeds) } } - public func setPriceSchedule(appId: String, baseTerritory: String, pricePointId: String) async throws -> Domain.AppPriceSchedule { + public func setPriceSchedule(appId: String, baseTerritory: String, pricePointId: String) async throws -> ASCKit.AppPriceSchedule { // One inline manual price, correlated by a `${...}` local id (same shape as IAP price schedules). let localId = "${local-app-price-1}" let body = AppPriceScheduleCreateRequest( @@ -55,6 +54,6 @@ public struct SDKPricingRepository: PricingRepository, @unchecked Sendable { ] ) let response = try await client.request(APIEndpoint.v1.appPriceSchedules.post(body)) - return Domain.AppPriceSchedule(id: response.data.id, appId: appId, baseTerritory: baseTerritory) + return ASCKit.AppPriceSchedule(id: response.data.id, appId: appId, baseTerritory: baseTerritory) } } diff --git a/Sources/Domain/Apps/Pricing/PricingRepository.swift b/Sources/ASCKit/Apps/Pricing/PricingRepository.swift similarity index 100% rename from Sources/Domain/Apps/Pricing/PricingRepository.swift rename to Sources/ASCKit/Apps/Pricing/PricingRepository.swift diff --git a/Sources/Infrastructure/Apps/ProductVersions/SDKProductVersionRepository.swift b/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift similarity index 86% rename from Sources/Infrastructure/Apps/ProductVersions/SDKProductVersionRepository.swift rename to Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift index 7ac62fee..bf287dce 100644 --- a/Sources/Infrastructure/Apps/ProductVersions/SDKProductVersionRepository.swift +++ b/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKProductVersionRepository: ProductVersionRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKProductVersionRepository: ProductVersionRepository, @unchecked self.client = client } - public func listInAppPurchaseVersions(iapId: String) async throws -> [Domain.ProductVersion] { + public func listInAppPurchaseVersions(iapId: String) async throws -> [ASCKit.ProductVersion] { let pages = try await client.requestAllPages( APIEndpoint.v2.inAppPurchases.id(iapId).versions.get(parameters: .init(limit: 200)), nextCursor: { $0.meta?.paging.nextCursor } @@ -19,7 +18,7 @@ public struct SDKProductVersionRepository: ProductVersionRepository, @unchecked } } - public func listSubscriptionVersions(subscriptionId: String) async throws -> [Domain.ProductVersion] { + public func listSubscriptionVersions(subscriptionId: String) async throws -> [ASCKit.ProductVersion] { let pages = try await client.requestAllPages( APIEndpoint.v1.subscriptions.id(subscriptionId).versions.get(parameters: .init(limit: 200)), nextCursor: { $0.meta?.paging.nextCursor } @@ -30,7 +29,7 @@ public struct SDKProductVersionRepository: ProductVersionRepository, @unchecked } } - public func listSubscriptionGroupVersions(groupId: String) async throws -> [Domain.ProductVersion] { + public func listSubscriptionGroupVersions(groupId: String) async throws -> [ASCKit.ProductVersion] { let pages = try await client.requestAllPages( APIEndpoint.v1.subscriptionGroups.id(groupId).versions.get(parameters: .init(limit: 200)), nextCursor: { $0.meta?.paging.nextCursor } @@ -43,11 +42,11 @@ public struct SDKProductVersionRepository: ProductVersionRepository, @unchecked /// The three SDK version types share the same attributes and state values. private func map( - id: String, productId: String, kind: Domain.ProductVersionKind, version: Int?, state: String? - ) -> Domain.ProductVersion { - Domain.ProductVersion( + id: String, productId: String, kind: ASCKit.ProductVersionKind, version: Int?, state: String? + ) -> ASCKit.ProductVersion { + ASCKit.ProductVersion( id: id, productId: productId, kind: kind, version: version, - state: state.flatMap(Domain.ProductVersionState.init(rawValue:)) ?? .prepareForSubmission + state: state.flatMap(ASCKit.ProductVersionState.init(rawValue:)) ?? .prepareForSubmission ) } } diff --git a/Sources/Domain/Apps/ProductVersions/ProductVersion+RESTRoutes.swift b/Sources/ASCKit/Apps/ProductVersions/ProductVersion+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/ProductVersions/ProductVersion+RESTRoutes.swift rename to Sources/ASCKit/Apps/ProductVersions/ProductVersion+RESTRoutes.swift diff --git a/Sources/Domain/Apps/ProductVersions/ProductVersion.swift b/Sources/ASCKit/Apps/ProductVersions/ProductVersion.swift similarity index 100% rename from Sources/Domain/Apps/ProductVersions/ProductVersion.swift rename to Sources/ASCKit/Apps/ProductVersions/ProductVersion.swift diff --git a/Sources/Domain/Apps/ProductVersions/ProductVersionRepository.swift b/Sources/ASCKit/Apps/ProductVersions/ProductVersionRepository.swift similarity index 100% rename from Sources/Domain/Apps/ProductVersions/ProductVersionRepository.swift rename to Sources/ASCKit/Apps/ProductVersions/ProductVersionRepository.swift diff --git a/Sources/Infrastructure/Apps/PromotedPurchases/SDKPromotedPurchaseRepository.swift b/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/PromotedPurchases/SDKPromotedPurchaseRepository.swift rename to Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift index 35ed84a9..fc18c2c2 100644 --- a/Sources/Infrastructure/Apps/PromotedPurchases/SDKPromotedPurchaseRepository.swift +++ b/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKPromotedPurchaseRepository: PromotedPurchaseRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKPromotedPurchaseRepository: PromotedPurchaseRepository, @unchec self.client = client } - public func listPromotedPurchases(appId: String, limit: Int?) async throws -> PaginatedResponse { + public func listPromotedPurchases(appId: String, limit: Int?) async throws -> PaginatedResponse { let request = APIEndpoint.v1.apps.id(appId).promotedPurchases.get(parameters: .init(limit: limit)) let response = try await client.request(request) let purchases = response.data.map { mapPurchase($0, appId: appId) } @@ -21,7 +20,7 @@ public struct SDKPromotedPurchaseRepository: PromotedPurchaseRepository, @unchec isEnabled: Bool?, inAppPurchaseId: String?, subscriptionId: String? - ) async throws -> Domain.PromotedPurchase { + ) async throws -> ASCKit.PromotedPurchase { let iapRel = inAppPurchaseId.map { PromotedPurchaseCreateRequest.Data.Relationships.InAppPurchaseV2(data: .init(type: .inAppPurchases, id: $0)) } @@ -45,7 +44,7 @@ public struct SDKPromotedPurchaseRepository: PromotedPurchaseRepository, @unchec promotedId: String, isVisibleForAllUsers: Bool?, isEnabled: Bool? - ) async throws -> Domain.PromotedPurchase { + ) async throws -> ASCKit.PromotedPurchase { let body = PromotedPurchaseUpdateRequest(data: .init( type: .promotedPurchases, id: promotedId, @@ -63,10 +62,10 @@ public struct SDKPromotedPurchaseRepository: PromotedPurchaseRepository, @unchec private func mapPurchase( _ sdk: AppStoreConnect_Swift_SDK.PromotedPurchase, appId: String - ) -> Domain.PromotedPurchase { + ) -> ASCKit.PromotedPurchase { let stateRaw = sdk.attributes?.state?.rawValue - let state = stateRaw.flatMap { Domain.PromotedPurchaseState(rawValue: $0) } - return Domain.PromotedPurchase( + let state = stateRaw.flatMap { ASCKit.PromotedPurchaseState(rawValue: $0) } + return ASCKit.PromotedPurchase( id: sdk.id, appId: appId, isVisibleForAllUsers: sdk.attributes?.isVisibleForAllUsers ?? false, diff --git a/Sources/Domain/Apps/PromotedPurchases/PromotedPurchase.swift b/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchase.swift similarity index 100% rename from Sources/Domain/Apps/PromotedPurchases/PromotedPurchase.swift rename to Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchase.swift diff --git a/Sources/Domain/Apps/PromotedPurchases/PromotedPurchaseRepository.swift b/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchaseRepository.swift similarity index 100% rename from Sources/Domain/Apps/PromotedPurchases/PromotedPurchaseRepository.swift rename to Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchaseRepository.swift diff --git a/Sources/Domain/Apps/Reviews/CustomerReview.swift b/Sources/ASCKit/Apps/Reviews/CustomerReview.swift similarity index 100% rename from Sources/Domain/Apps/Reviews/CustomerReview.swift rename to Sources/ASCKit/Apps/Reviews/CustomerReview.swift diff --git a/Sources/Domain/Apps/Reviews/CustomerReviewRepository.swift b/Sources/ASCKit/Apps/Reviews/CustomerReviewRepository.swift similarity index 100% rename from Sources/Domain/Apps/Reviews/CustomerReviewRepository.swift rename to Sources/ASCKit/Apps/Reviews/CustomerReviewRepository.swift diff --git a/Sources/Domain/Apps/Reviews/CustomerReviewResponse.swift b/Sources/ASCKit/Apps/Reviews/CustomerReviewResponse.swift similarity index 100% rename from Sources/Domain/Apps/Reviews/CustomerReviewResponse.swift rename to Sources/ASCKit/Apps/Reviews/CustomerReviewResponse.swift diff --git a/Sources/Infrastructure/Apps/Reviews/SDKCustomerReviewRepository.swift b/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift similarity index 84% rename from Sources/Infrastructure/Apps/Reviews/SDKCustomerReviewRepository.swift rename to Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift index 63025a66..7c6a7e3a 100644 --- a/Sources/Infrastructure/Apps/Reviews/SDKCustomerReviewRepository.swift +++ b/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKCustomerReviewRepository: CustomerReviewRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKCustomerReviewRepository: CustomerReviewRepository, @unchecked self.client = client } - public func listReviews(appId: String) async throws -> [Domain.CustomerReview] { + public func listReviews(appId: String) async throws -> [ASCKit.CustomerReview] { let pages = try await client.requestAllPages( APIEndpoint.v1.apps.id(appId).customerReviews.get( parameters: .init(sort: [.minuscreatedDate], limit: 200) @@ -18,19 +17,19 @@ public struct SDKCustomerReviewRepository: CustomerReviewRepository, @unchecked return pages.flatMap(\.data).map { mapReview($0, appId: appId) } } - public func getReview(reviewId: String) async throws -> Domain.CustomerReview { + public func getReview(reviewId: String) async throws -> ASCKit.CustomerReview { let request = APIEndpoint.v1.customerReviews.id(reviewId).get() let response = try await client.request(request) return mapReview(response.data, appId: "") } - public func getResponse(reviewId: String) async throws -> Domain.CustomerReviewResponse { + public func getResponse(reviewId: String) async throws -> ASCKit.CustomerReviewResponse { let request = APIEndpoint.v1.customerReviews.id(reviewId).response.get() let response = try await client.request(request) return mapResponse(response.data, reviewId: reviewId) } - public func createResponse(reviewId: String, responseBody: String) async throws -> Domain.CustomerReviewResponse { + public func createResponse(reviewId: String, responseBody: String) async throws -> ASCKit.CustomerReviewResponse { let body = CustomerReviewResponseV1CreateRequest( data: .init( type: .customerReviewResponses, @@ -51,8 +50,8 @@ public struct SDKCustomerReviewRepository: CustomerReviewRepository, @unchecked private func mapReview( _ sdkReview: AppStoreConnect_Swift_SDK.CustomerReview, appId: String - ) -> Domain.CustomerReview { - Domain.CustomerReview( + ) -> ASCKit.CustomerReview { + ASCKit.CustomerReview( id: sdkReview.id, appId: appId, rating: sdkReview.attributes?.rating ?? 0, @@ -67,8 +66,8 @@ public struct SDKCustomerReviewRepository: CustomerReviewRepository, @unchecked private func mapResponse( _ sdkResponse: AppStoreConnect_Swift_SDK.CustomerReviewResponseV1, reviewId: String - ) -> Domain.CustomerReviewResponse { - Domain.CustomerReviewResponse( + ) -> ASCKit.CustomerReviewResponse { + ASCKit.CustomerReviewResponse( id: sdkResponse.id, reviewId: reviewId, responseBody: sdkResponse.attributes?.responseBody ?? "", @@ -77,7 +76,7 @@ public struct SDKCustomerReviewRepository: CustomerReviewRepository, @unchecked ) } - private func mapState(_ sdkState: AppStoreConnect_Swift_SDK.CustomerReviewResponseV1.Attributes.State?) -> Domain.ReviewResponseState { + private func mapState(_ sdkState: AppStoreConnect_Swift_SDK.CustomerReviewResponseV1.Attributes.State?) -> ASCKit.ReviewResponseState { switch sdkState { case .published: return .published case .pendingPublish: return .pendingPublish diff --git a/Sources/Infrastructure/Apps/Subscriptions/Availability/SDKSubscriptionAvailabilityRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift similarity index 88% rename from Sources/Infrastructure/Apps/Subscriptions/Availability/SDKSubscriptionAvailabilityRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift index d3a290ea..4a33786c 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/Availability/SDKSubscriptionAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionAvailabilityRepository: SubscriptionAvailabilityRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKSubscriptionAvailabilityRepository: SubscriptionAvailabilityRep self.client = client } - public func getAvailability(subscriptionId: String) async throws -> Domain.SubscriptionAvailability? { + public func getAvailability(subscriptionId: String) async throws -> ASCKit.SubscriptionAvailability? { // Two parallel calls — see SDKInAppPurchaseAvailabilityRepository for rationale. // 404 → nil (no availability configured yet on a fresh subscription). do { @@ -24,9 +23,9 @@ public struct SDKSubscriptionAvailabilityRepository: SubscriptionAvailabilityRep let (avail, terr) = try await (availResponse, terrResponse) let territories = terr.data.map { t in - Domain.Territory(id: t.id, currency: t.attributes?.currency) + ASCKit.Territory(id: t.id, currency: t.attributes?.currency) } - return Domain.SubscriptionAvailability( + return ASCKit.SubscriptionAvailability( id: avail.data.id, subscriptionId: subscriptionId, isAvailableInNewTerritories: avail.data.attributes?.isAvailableInNewTerritories ?? false, @@ -41,7 +40,7 @@ public struct SDKSubscriptionAvailabilityRepository: SubscriptionAvailabilityRep subscriptionId: String, isAvailableInNewTerritories: Bool, territoryIds: [String] - ) async throws -> Domain.SubscriptionAvailability { + ) async throws -> ASCKit.SubscriptionAvailability { let body = SubscriptionAvailabilityCreateRequest(data: .init( type: .subscriptionAvailabilities, attributes: .init(isAvailableInNewTerritories: isAvailableInNewTerritories), @@ -58,15 +57,15 @@ public struct SDKSubscriptionAvailabilityRepository: SubscriptionAvailabilityRep _ sdk: AppStoreConnect_Swift_SDK.SubscriptionAvailability, included: [AppStoreConnect_Swift_SDK.Territory]?, subscriptionId: String - ) -> Domain.SubscriptionAvailability { + ) -> ASCKit.SubscriptionAvailability { let territoryIds = sdk.relationships?.availableTerritories?.data?.map(\.id) ?? [] let includedMap = Dictionary( uniqueKeysWithValues: (included ?? []).map { ($0.id, $0) } ) let territories = territoryIds.map { id in - Domain.Territory(id: id, currency: includedMap[id]?.attributes?.currency) + ASCKit.Territory(id: id, currency: includedMap[id]?.attributes?.currency) } - return Domain.SubscriptionAvailability( + return ASCKit.SubscriptionAvailability( id: sdk.id, subscriptionId: subscriptionId, isAvailableInNewTerritories: sdk.attributes?.isAvailableInNewTerritories ?? false, diff --git a/Sources/Domain/Apps/Subscriptions/Availability/SubscriptionAvailability.swift b/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailability.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Availability/SubscriptionAvailability.swift rename to Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailability.swift diff --git a/Sources/Domain/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift diff --git a/Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionGroupRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift similarity index 88% rename from Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionGroupRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift index a1f5503e..591b52c4 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionGroupRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionGroupRepository: SubscriptionGroupRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKSubscriptionGroupRepository: SubscriptionGroupRepository, @unch self.client = client } - public func listSubscriptionGroups(appId: String, limit: Int?) async throws -> PaginatedResponse { + public func listSubscriptionGroups(appId: String, limit: Int?) async throws -> PaginatedResponse { let request = APIEndpoint.v1.apps.id(appId).subscriptionGroups.get(parameters: .init( limit: limit )) @@ -17,7 +16,7 @@ public struct SDKSubscriptionGroupRepository: SubscriptionGroupRepository, @unch return PaginatedResponse(data: groups, nextCursor: response.links.next) } - public func createSubscriptionGroup(appId: String, referenceName: String) async throws -> Domain.SubscriptionGroup { + public func createSubscriptionGroup(appId: String, referenceName: String) async throws -> ASCKit.SubscriptionGroup { let body = SubscriptionGroupCreateRequest(data: .init( type: .subscriptionGroups, attributes: .init(referenceName: referenceName), @@ -32,7 +31,7 @@ public struct SDKSubscriptionGroupRepository: SubscriptionGroupRepository, @unch public func updateSubscriptionGroup( groupId: String, referenceName: String - ) async throws -> Domain.SubscriptionGroup { + ) async throws -> ASCKit.SubscriptionGroup { let body = SubscriptionGroupUpdateRequest(data: .init( type: .subscriptionGroups, id: groupId, @@ -47,8 +46,8 @@ public struct SDKSubscriptionGroupRepository: SubscriptionGroupRepository, @unch _ = try await client.request(APIEndpoint.v1.subscriptionGroups.id(groupId).delete) } - private func mapGroup(_ sdk: AppStoreConnect_Swift_SDK.SubscriptionGroup, appId: String) -> Domain.SubscriptionGroup { - Domain.SubscriptionGroup( + private func mapGroup(_ sdk: AppStoreConnect_Swift_SDK.SubscriptionGroup, appId: String) -> ASCKit.SubscriptionGroup { + ASCKit.SubscriptionGroup( id: sdk.id, appId: appId, referenceName: sdk.attributes?.referenceName ?? "" diff --git a/Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionPriceRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift similarity index 86% rename from Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionPriceRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift index f43a9b37..055afa0c 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionPriceRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unchecked Sendable { private let client: any APIClient @@ -13,7 +12,7 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch territory: String?, limit: Int?, cursor: String? - ) async throws -> Domain.PaginatedResponse { + ) async throws -> ASCKit.PaginatedResponse { var request = APIEndpoint.v1.subscriptions.id(subscriptionId).pricePoints.get( parameters: .init( filterTerritory: territory.map { [$0] }, @@ -27,7 +26,7 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch request.query = query } let response = try await client.request(request) - return Domain.PaginatedResponse( + return ASCKit.PaginatedResponse( data: response.data.map { mapPricePoint($0, subscriptionId: subscriptionId) }, nextCursor: response.meta?.paging.nextCursor, totalCount: response.meta?.paging.total @@ -40,7 +39,7 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch pricePointId: String, startDate: String?, preserveCurrentPrice: Bool? - ) async throws -> Domain.SubscriptionPrice { + ) async throws -> ASCKit.SubscriptionPrice { let body = SubscriptionPriceCreateRequest(data: .init( type: .subscriptionPrices, attributes: .init(startDate: startDate, isPreserveCurrentPrice: preserveCurrentPrice), @@ -51,13 +50,13 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch ) )) let response = try await client.request(APIEndpoint.v1.subscriptionPrices.post(body)) - return Domain.SubscriptionPrice(id: response.data.id, subscriptionId: subscriptionId) + return ASCKit.SubscriptionPrice(id: response.data.id, subscriptionId: subscriptionId) } public func setPrices( subscriptionId: String, - prices: [Domain.SubscriptionPriceInput] - ) async throws -> Domain.SubscriptionPriceSchedule { + prices: [ASCKit.SubscriptionPriceInput] + ) async throws -> ASCKit.SubscriptionPriceSchedule { // One PATCH with every price inlined — a single request instead of one POST per // territory, and Apple applies it all-or-nothing. let localIds = prices.indices.map { "${price-\($0)}" } @@ -82,10 +81,10 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch _ = try await client.request(APIEndpoint.v1.subscriptions.id(subscriptionId).patch(body)) // Re-read the schedule so the caller gets the post-write state. return try await getPriceSchedule(subscriptionId: subscriptionId) - ?? Domain.SubscriptionPriceSchedule(id: subscriptionId, subscriptionId: subscriptionId) + ?? ASCKit.SubscriptionPriceSchedule(id: subscriptionId, subscriptionId: subscriptionId) } - public func listEqualizations(pricePointId: String, limit: Int?) async throws -> [Domain.SubscriptionPricePoint] { + public func listEqualizations(pricePointId: String, limit: Int?) async throws -> [ASCKit.SubscriptionPricePoint] { let request = APIEndpoint.v1.subscriptionPricePoints.id(pricePointId).equalizations.get( parameters: .init( fieldsSubscriptionPricePoints: [.customerPrice, .proceeds, .proceedsYear2, .territory], @@ -100,7 +99,7 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch return response.data.map { mapPricePoint($0, subscriptionId: "") } } - public func getPriceSchedule(subscriptionId: String) async throws -> Domain.SubscriptionPriceSchedule? { + public func getPriceSchedule(subscriptionId: String) async throws -> ASCKit.SubscriptionPriceSchedule? { // Step 1: GET /v1/subscriptions/{id}/prices?include=territory,subscriptionPricePoint, // following every page — a subscription can have a manual price in all 175 territories. let pages = try await client.requestAllPages( @@ -119,18 +118,18 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch // No prices set → no schedule yet. guard !pricesData.isEmpty else { return nil } - var territoriesById: [String: Domain.Territory] = [:] + var territoriesById: [String: ASCKit.Territory] = [:] var pricePointsById: [String: AppStoreConnect_Swift_SDK.SubscriptionPricePoint] = [:] for item in pricesIncluded { switch item { case .territory(let t): - territoriesById[t.id] = Domain.Territory(id: t.id, currency: t.attributes?.currency) + territoriesById[t.id] = ASCKit.Territory(id: t.id, currency: t.attributes?.currency) case .subscriptionPricePoint(let pp): pricePointsById[pp.id] = pp } } - let manualPrices: [Domain.TerritoryPrice] = pricesData.compactMap { price in + let manualPrices: [ASCKit.TerritoryPrice] = pricesData.compactMap { price in guard let territoryId = price.relationships?.territory?.data?.id, let territory = territoriesById[territoryId], @@ -139,30 +138,30 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch let customerPrice = pricePoint.attributes?.customerPrice, let proceeds = pricePoint.attributes?.proceeds else { return nil } - return Domain.TerritoryPrice(territory: territory, customerPrice: customerPrice, proceeds: proceeds) + return ASCKit.TerritoryPrice(territory: territory, customerPrice: customerPrice, proceeds: proceeds) } // Step 2: equalize using the first manual price's price point. let firstPricePointId = pricesData.first?.relationships?.subscriptionPricePoint?.data?.id - var equalized: [Domain.TerritoryPrice] = [] + var equalized: [ASCKit.TerritoryPrice] = [] if let pricePointId = firstPricePointId { equalized = (try? await fetchEqualizedTerritoryPrices(pricePointId: pricePointId)) ?? [] } // Merge: manual entries override equalized for the same territory. - var byTerritory: [String: Domain.TerritoryPrice] = [:] + var byTerritory: [String: ASCKit.TerritoryPrice] = [:] for entry in equalized { byTerritory[entry.territory.id] = entry } for entry in manualPrices { byTerritory[entry.territory.id] = entry } let merged = byTerritory.values.sorted { $0.territory.id < $1.territory.id } - return Domain.SubscriptionPriceSchedule( + return ASCKit.SubscriptionPriceSchedule( id: subscriptionId, subscriptionId: subscriptionId, territoryPrices: merged ) } - private func fetchEqualizedTerritoryPrices(pricePointId: String) async throws -> [Domain.TerritoryPrice] { + private func fetchEqualizedTerritoryPrices(pricePointId: String) async throws -> [ASCKit.TerritoryPrice] { let response = try await client.request( APIEndpoint.v1.subscriptionPricePoints.id(pricePointId).equalizations.get(parameters: .init( fieldsSubscriptionPricePoints: [.customerPrice, .proceeds, .proceedsYear2, .territory], @@ -172,9 +171,9 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch )) ) - var territoriesById: [String: Domain.Territory] = [:] + var territoriesById: [String: ASCKit.Territory] = [:] for t in response.included ?? [] { - territoriesById[t.id] = Domain.Territory(id: t.id, currency: t.attributes?.currency) + territoriesById[t.id] = ASCKit.Territory(id: t.id, currency: t.attributes?.currency) } return response.data.compactMap { pp in @@ -183,16 +182,16 @@ public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unch let customerPrice = pp.attributes?.customerPrice, let proceeds = pp.attributes?.proceeds else { return nil } - let territory = territoriesById[territoryId] ?? Domain.Territory(id: territoryId, currency: nil) - return Domain.TerritoryPrice(territory: territory, customerPrice: customerPrice, proceeds: proceeds) + let territory = territoriesById[territoryId] ?? ASCKit.Territory(id: territoryId, currency: nil) + return ASCKit.TerritoryPrice(territory: territory, customerPrice: customerPrice, proceeds: proceeds) } } private func mapPricePoint( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionPricePoint, subscriptionId: String - ) -> Domain.SubscriptionPricePoint { - Domain.SubscriptionPricePoint( + ) -> ASCKit.SubscriptionPricePoint { + ASCKit.SubscriptionPricePoint( id: sdk.id, subscriptionId: subscriptionId, territory: sdk.relationships?.territory?.data?.id, diff --git a/Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift index fe2f2da2..e12e3c66 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionRepository: SubscriptionRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKSubscriptionRepository: SubscriptionRepository, @unchecked Send self.client = client } - public func listSubscriptions(groupId: String, limit: Int?) async throws -> PaginatedResponse { + public func listSubscriptions(groupId: String, limit: Int?) async throws -> PaginatedResponse { let request = APIEndpoint.v1.subscriptionGroups.id(groupId).subscriptions.get(parameters: .init( limit: limit )) @@ -21,10 +20,10 @@ public struct SDKSubscriptionRepository: SubscriptionRepository, @unchecked Send groupId: String, name: String, productId: String, - period: Domain.SubscriptionPeriod, + period: ASCKit.SubscriptionPeriod, isFamilySharable: Bool, groupLevel: Int? - ) async throws -> Domain.Subscription { + ) async throws -> ASCKit.Subscription { let sdkPeriod = SubscriptionCreateRequest.Data.Attributes.SubscriptionPeriod(rawValue: period.rawValue) let body = SubscriptionCreateRequest(data: .init( type: .subscriptions, @@ -48,11 +47,11 @@ public struct SDKSubscriptionRepository: SubscriptionRepository, @unchecked Send name: String?, isFamilySharable: Bool?, groupLevel: Int?, - subscriptionPeriod: Domain.SubscriptionPeriod?, + subscriptionPeriod: ASCKit.SubscriptionPeriod?, reviewNote: String?, multiSeatStatus: SubscriptionMultiSeatStatus?, marketSettings: [SubscriptionMarketSetting]? - ) async throws -> Domain.Subscription { + ) async throws -> ASCKit.Subscription { let sdkPeriod = subscriptionPeriod.flatMap { SubscriptionUpdateRequest.Data.Attributes.SubscriptionPeriod(rawValue: $0.rawValue) } @@ -81,12 +80,12 @@ public struct SDKSubscriptionRepository: SubscriptionRepository, @unchecked Send _ = try await client.request(APIEndpoint.v1.subscriptions.id(subscriptionId).delete) } - private func mapSubscription(_ sdk: AppStoreConnect_Swift_SDK.Subscription, groupId: String) -> Domain.Subscription { + private func mapSubscription(_ sdk: AppStoreConnect_Swift_SDK.Subscription, groupId: String) -> ASCKit.Subscription { let periodRaw = sdk.attributes?.subscriptionPeriod?.rawValue ?? SubscriptionPeriod.oneMonth.rawValue - let period = Domain.SubscriptionPeriod(rawValue: periodRaw) ?? .oneMonth + let period = ASCKit.SubscriptionPeriod(rawValue: periodRaw) ?? .oneMonth let stateRaw = sdk.attributes?.state?.rawValue ?? SubscriptionState.missingMetadata.rawValue - let state = Domain.SubscriptionState(rawValue: stateRaw) ?? .missingMetadata - return Domain.Subscription( + let state = ASCKit.SubscriptionState(rawValue: stateRaw) ?? .missingMetadata + return ASCKit.Subscription( id: sdk.id, groupId: groupId, name: sdk.attributes?.name ?? "", diff --git a/Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionSubmissionRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionSubmissionRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift index 051acfed..67728f8d 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/SDKSubscriptionSubmissionRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionSubmissionRepository: SubscriptionSubmissionRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKSubscriptionSubmissionRepository: SubscriptionSubmissionReposit self.client = client } - public func submitSubscription(subscriptionId: String) async throws -> Domain.SubscriptionSubmission { + public func submitSubscription(subscriptionId: String) async throws -> ASCKit.SubscriptionSubmission { let body = SubscriptionSubmissionCreateRequest(data: .init( type: .subscriptionSubmissions, relationships: .init( @@ -16,7 +15,7 @@ public struct SDKSubscriptionSubmissionRepository: SubscriptionSubmissionReposit ) )) let response = try await client.request(APIEndpoint.v1.subscriptionSubmissions.post(body)) - return Domain.SubscriptionSubmission(id: response.data.id, subscriptionId: subscriptionId) + return ASCKit.SubscriptionSubmission(id: response.data.id, subscriptionId: subscriptionId) } public func deleteSubmission(submissionId: String) async throws { diff --git a/Sources/Infrastructure/Apps/Subscriptions/IntroductoryOffers/SDKSubscriptionIntroductoryOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift similarity index 83% rename from Sources/Infrastructure/Apps/Subscriptions/IntroductoryOffers/SDKSubscriptionIntroductoryOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift index 09bc8818..6f28309b 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/IntroductoryOffers/SDKSubscriptionIntroductoryOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionIntroductoryOfferRepository: SubscriptionIntroductoryOfferRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKSubscriptionIntroductoryOfferRepository: SubscriptionIntroducto self.client = client } - public func listIntroductoryOffers(subscriptionId: String) async throws -> [Domain.SubscriptionIntroductoryOffer] { + public func listIntroductoryOffers(subscriptionId: String) async throws -> [ASCKit.SubscriptionIntroductoryOffer] { let request = APIEndpoint.v1.subscriptions.id(subscriptionId).introductoryOffers.get() let response = try await client.request(request) return response.data.map { mapOffer($0, subscriptionId: subscriptionId) } @@ -16,14 +15,14 @@ public struct SDKSubscriptionIntroductoryOfferRepository: SubscriptionIntroducto public func createIntroductoryOffer( subscriptionId: String, - duration: Domain.SubscriptionOfferDuration, - offerMode: Domain.SubscriptionOfferMode, + duration: ASCKit.SubscriptionOfferDuration, + offerMode: ASCKit.SubscriptionOfferMode, numberOfPeriods: Int, startDate: String?, endDate: String?, territory: String?, pricePointId: String? - ) async throws -> Domain.SubscriptionIntroductoryOffer { + ) async throws -> ASCKit.SubscriptionIntroductoryOffer { let sdkDuration = AppStoreConnect_Swift_SDK.SubscriptionOfferDuration(rawValue: duration.rawValue) ?? .oneMonth let sdkMode = AppStoreConnect_Swift_SDK.SubscriptionOfferMode(rawValue: offerMode.rawValue) ?? .freeTrial @@ -60,14 +59,14 @@ public struct SDKSubscriptionIntroductoryOfferRepository: SubscriptionIntroducto private func mapOffer( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionIntroductoryOffer, subscriptionId: String - ) -> Domain.SubscriptionIntroductoryOffer { - let durationRaw = sdk.attributes?.duration?.rawValue ?? Domain.SubscriptionOfferDuration.oneMonth.rawValue - let duration = Domain.SubscriptionOfferDuration(rawValue: durationRaw) ?? .oneMonth - let modeRaw = sdk.attributes?.offerMode?.rawValue ?? Domain.SubscriptionOfferMode.freeTrial.rawValue - let offerMode = Domain.SubscriptionOfferMode(rawValue: modeRaw) ?? .freeTrial + ) -> ASCKit.SubscriptionIntroductoryOffer { + let durationRaw = sdk.attributes?.duration?.rawValue ?? ASCKit.SubscriptionOfferDuration.oneMonth.rawValue + let duration = ASCKit.SubscriptionOfferDuration(rawValue: durationRaw) ?? .oneMonth + let modeRaw = sdk.attributes?.offerMode?.rawValue ?? ASCKit.SubscriptionOfferMode.freeTrial.rawValue + let offerMode = ASCKit.SubscriptionOfferMode(rawValue: modeRaw) ?? .freeTrial let territory = sdk.relationships?.territory?.data?.id - return Domain.SubscriptionIntroductoryOffer( + return ASCKit.SubscriptionIntroductoryOffer( id: sdk.id, subscriptionId: subscriptionId, duration: duration, diff --git a/Sources/Domain/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffer.swift b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffer.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffer.swift rename to Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffer.swift diff --git a/Sources/Domain/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift diff --git a/Sources/Infrastructure/Apps/Subscriptions/Localizations/SDKSubscriptionGroupLocalizationRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift similarity index 86% rename from Sources/Infrastructure/Apps/Subscriptions/Localizations/SDKSubscriptionGroupLocalizationRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift index 803ecf21..d948093d 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/Localizations/SDKSubscriptionGroupLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionGroupLocalizationRepository: SubscriptionGroupLocalizationRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKSubscriptionGroupLocalizationRepository: SubscriptionGroupLocal self.client = client } - public func listLocalizations(groupId: String) async throws -> [Domain.SubscriptionGroupLocalization] { + public func listLocalizations(groupId: String) async throws -> [ASCKit.SubscriptionGroupLocalization] { let request = APIEndpoint.v1.subscriptionGroups.id(groupId).subscriptionGroupLocalizations.get() let response = try await client.request(request) return response.data.map { mapLocalization($0, groupId: groupId) } @@ -19,7 +18,7 @@ public struct SDKSubscriptionGroupLocalizationRepository: SubscriptionGroupLocal locale: String, name: String, customAppName: String? - ) async throws -> Domain.SubscriptionGroupLocalization { + ) async throws -> ASCKit.SubscriptionGroupLocalization { let body = SubscriptionGroupLocalizationCreateRequest(data: .init( type: .subscriptionGroupLocalizations, attributes: .init(name: name, customAppName: customAppName, locale: locale), @@ -35,7 +34,7 @@ public struct SDKSubscriptionGroupLocalizationRepository: SubscriptionGroupLocal localizationId: String, name: String?, customAppName: String? - ) async throws -> Domain.SubscriptionGroupLocalization { + ) async throws -> ASCKit.SubscriptionGroupLocalization { let body = SubscriptionGroupLocalizationUpdateRequest(data: .init( type: .subscriptionGroupLocalizations, id: localizationId, @@ -52,8 +51,8 @@ public struct SDKSubscriptionGroupLocalizationRepository: SubscriptionGroupLocal private func mapLocalization( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionGroupLocalization, groupId: String - ) -> Domain.SubscriptionGroupLocalization { - Domain.SubscriptionGroupLocalization( + ) -> ASCKit.SubscriptionGroupLocalization { + ASCKit.SubscriptionGroupLocalization( id: sdk.id, groupId: groupId, locale: sdk.attributes?.locale ?? "", @@ -65,8 +64,8 @@ public struct SDKSubscriptionGroupLocalizationRepository: SubscriptionGroupLocal private func mapState( _ sdkState: AppStoreConnect_Swift_SDK.SubscriptionGroupLocalization.Attributes.State? - ) -> Domain.SubscriptionGroupLocalizationState? { + ) -> ASCKit.SubscriptionGroupLocalizationState? { guard let sdkState else { return nil } - return Domain.SubscriptionGroupLocalizationState(rawValue: sdkState.rawValue) + return ASCKit.SubscriptionGroupLocalizationState(rawValue: sdkState.rawValue) } } diff --git a/Sources/Infrastructure/Apps/Subscriptions/Localizations/SDKSubscriptionLocalizationRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift similarity index 87% rename from Sources/Infrastructure/Apps/Subscriptions/Localizations/SDKSubscriptionLocalizationRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift index 7eac10ca..8923fa7a 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/Localizations/SDKSubscriptionLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionLocalizationRepository: SubscriptionLocalizationRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKSubscriptionLocalizationRepository: SubscriptionLocalizationRep self.client = client } - public func listLocalizations(subscriptionId: String) async throws -> [Domain.SubscriptionLocalization] { + public func listLocalizations(subscriptionId: String) async throws -> [ASCKit.SubscriptionLocalization] { let request = APIEndpoint.v1.subscriptions.id(subscriptionId).subscriptionLocalizations.get() let response = try await client.request(request) return response.data.map { mapLocalization($0, subscriptionId: subscriptionId) } @@ -19,7 +18,7 @@ public struct SDKSubscriptionLocalizationRepository: SubscriptionLocalizationRep locale: String, name: String, description: String? - ) async throws -> Domain.SubscriptionLocalization { + ) async throws -> ASCKit.SubscriptionLocalization { let body = SubscriptionLocalizationCreateRequest(data: .init( type: .subscriptionLocalizations, attributes: .init(name: name, locale: locale, description: description), @@ -35,7 +34,7 @@ public struct SDKSubscriptionLocalizationRepository: SubscriptionLocalizationRep localizationId: String, name: String?, description: String? - ) async throws -> Domain.SubscriptionLocalization { + ) async throws -> ASCKit.SubscriptionLocalization { let body = SubscriptionLocalizationUpdateRequest(data: .init( type: .subscriptionLocalizations, id: localizationId, @@ -54,8 +53,8 @@ public struct SDKSubscriptionLocalizationRepository: SubscriptionLocalizationRep private func mapLocalization( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionLocalization, subscriptionId: String - ) -> Domain.SubscriptionLocalization { - Domain.SubscriptionLocalization( + ) -> ASCKit.SubscriptionLocalization { + ASCKit.SubscriptionLocalization( id: sdk.id, subscriptionId: subscriptionId, locale: sdk.attributes?.locale ?? "", @@ -67,8 +66,8 @@ public struct SDKSubscriptionLocalizationRepository: SubscriptionLocalizationRep private func mapState( _ sdkState: AppStoreConnect_Swift_SDK.SubscriptionLocalization.Attributes.State? - ) -> Domain.SubscriptionLocalizationState? { + ) -> ASCKit.SubscriptionLocalizationState? { guard let sdkState else { return nil } - return Domain.SubscriptionLocalizationState(rawValue: sdkState.rawValue) + return ASCKit.SubscriptionLocalizationState(rawValue: sdkState.rawValue) } } diff --git a/Sources/Domain/Apps/Subscriptions/Localizations/SubscriptionGroupLocalization.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalization.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Localizations/SubscriptionGroupLocalization.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalization.swift diff --git a/Sources/Domain/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift diff --git a/Sources/Domain/Apps/Subscriptions/Localizations/SubscriptionLocalization.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalization.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Localizations/SubscriptionLocalization.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalization.swift diff --git a/Sources/Domain/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift diff --git a/Sources/Infrastructure/Apps/Subscriptions/OfferCodes/SDKSubscriptionOfferCodeRepository.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift similarity index 85% rename from Sources/Infrastructure/Apps/Subscriptions/OfferCodes/SDKSubscriptionOfferCodeRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift index e25567dc..fc44ed93 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/OfferCodes/SDKSubscriptionOfferCodeRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift @@ -1,6 +1,5 @@ import Foundation @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepository, @unchecked Sendable { private let client: any APIClient @@ -11,7 +10,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor // MARK: - Offer Codes - public func listOfferCodes(subscriptionId: String) async throws -> [Domain.SubscriptionOfferCode] { + public func listOfferCodes(subscriptionId: String) async throws -> [ASCKit.SubscriptionOfferCode] { let request = APIEndpoint.v1.subscriptions.id(subscriptionId).offerCodes.get() let response = try await client.request(request) return response.data.map { mapOfferCode($0, subscriptionId: subscriptionId) } @@ -20,14 +19,14 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor public func createOfferCode( subscriptionId: String, name: String, - customerEligibilities: [Domain.SubscriptionCustomerEligibility], - offerEligibility: Domain.SubscriptionOfferEligibility, - duration: Domain.SubscriptionOfferDuration, - offerMode: Domain.SubscriptionOfferMode, + customerEligibilities: [ASCKit.SubscriptionCustomerEligibility], + offerEligibility: ASCKit.SubscriptionOfferEligibility, + duration: ASCKit.SubscriptionOfferDuration, + offerMode: ASCKit.SubscriptionOfferMode, numberOfPeriods: Int, isAutoRenewEnabled: Bool, - prices: [Domain.OfferCodePriceInput] - ) async throws -> Domain.SubscriptionOfferCode { + prices: [ASCKit.OfferCodePriceInput] + ) async throws -> ASCKit.SubscriptionOfferCode { let sdkEligibilities = customerEligibilities.compactMap { AppStoreConnect_Swift_SDK.SubscriptionCustomerEligibility(rawValue: mapCustomerEligibilityToSDK($0)) } @@ -38,7 +37,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor // Same `${local-price-N}` placeholder pattern as IAP — ties `included[]` items // back to the parent's `relationships.prices.data` references. - let pricesPayload: [(localId: String, input: Domain.OfferCodePriceInput)] = prices.enumerated().map { + let pricesPayload: [(localId: String, input: ASCKit.OfferCodePriceInput)] = prices.enumerated().map { (localId: "${local-price-\($0.offset + 1)}", input: $0.element) } let pricesRelationship = pricesPayload.map { @@ -82,7 +81,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor return mapOfferCode(response.data, subscriptionId: subscriptionId) } - public func updateOfferCode(offerCodeId: String, isActive: Bool) async throws -> Domain.SubscriptionOfferCode { + public func updateOfferCode(offerCodeId: String, isActive: Bool) async throws -> ASCKit.SubscriptionOfferCode { let body = SubscriptionOfferCodeUpdateRequest( data: .init( type: .subscriptionOfferCodes, @@ -96,7 +95,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor // MARK: - Custom Codes - public func listCustomCodes(offerCodeId: String) async throws -> [Domain.SubscriptionOfferCodeCustomCode] { + public func listCustomCodes(offerCodeId: String) async throws -> [ASCKit.SubscriptionOfferCodeCustomCode] { let request = APIEndpoint.v1.subscriptionOfferCodes.id(offerCodeId).customCodes.get() let response = try await client.request(request) return response.data.map { mapCustomCode($0, offerCodeId: offerCodeId) } @@ -107,7 +106,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor customCode: String, numberOfCodes: Int, expirationDate: String? - ) async throws -> Domain.SubscriptionOfferCodeCustomCode { + ) async throws -> ASCKit.SubscriptionOfferCodeCustomCode { let body = SubscriptionOfferCodeCustomCodeCreateRequest( data: .init( type: .subscriptionOfferCodeCustomCodes, @@ -125,7 +124,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor return mapCustomCode(response.data, offerCodeId: offerCodeId) } - public func updateCustomCode(customCodeId: String, isActive: Bool) async throws -> Domain.SubscriptionOfferCodeCustomCode { + public func updateCustomCode(customCodeId: String, isActive: Bool) async throws -> ASCKit.SubscriptionOfferCodeCustomCode { let body = SubscriptionOfferCodeCustomCodeUpdateRequest( data: .init( type: .subscriptionOfferCodeCustomCodes, @@ -139,7 +138,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor // MARK: - One-Time Use Codes - public func listOneTimeUseCodes(offerCodeId: String) async throws -> [Domain.SubscriptionOfferCodeOneTimeUseCode] { + public func listOneTimeUseCodes(offerCodeId: String) async throws -> [ASCKit.SubscriptionOfferCodeOneTimeUseCode] { let request = APIEndpoint.v1.subscriptionOfferCodes.id(offerCodeId).oneTimeUseCodes.get() let response = try await client.request(request) return response.data.map { mapOneTimeUseCode($0, offerCodeId: offerCodeId) } @@ -149,8 +148,8 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor offerCodeId: String, numberOfCodes: Int, expirationDate: String, - environment: Domain.OfferCodeEnvironment - ) async throws -> Domain.SubscriptionOfferCodeOneTimeUseCode { + environment: ASCKit.OfferCodeEnvironment + ) async throws -> ASCKit.SubscriptionOfferCodeOneTimeUseCode { let sdkEnv = AppStoreConnect_Swift_SDK.OfferCodeEnvironment(rawValue: environment.rawValue) let body = SubscriptionOfferCodeOneTimeUseCodeCreateRequest( data: .init( @@ -169,7 +168,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor return mapOneTimeUseCode(response.data, offerCodeId: offerCodeId) } - public func updateOneTimeUseCode(oneTimeCodeId: String, isActive: Bool) async throws -> Domain.SubscriptionOfferCodeOneTimeUseCode { + public func updateOneTimeUseCode(oneTimeCodeId: String, isActive: Bool) async throws -> ASCKit.SubscriptionOfferCodeOneTimeUseCode { let body = SubscriptionOfferCodeOneTimeUseCodeUpdateRequest( data: .init( type: .subscriptionOfferCodeOneTimeUseCodes, @@ -188,7 +187,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor // MARK: - Prices - public func listPrices(offerCodeId: String) async throws -> [Domain.SubscriptionOfferCodePrice] { + public func listPrices(offerCodeId: String) async throws -> [ASCKit.SubscriptionOfferCodePrice] { // One price per territory — follow every page to get all 175. `include` makes Apple // return each price's territory and price point linkage, which the mapper reads. let pages = try await client.requestAllPages( @@ -201,8 +200,8 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor private func mapPrice( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionOfferCodePrice, offerCodeId: String - ) -> Domain.SubscriptionOfferCodePrice { - Domain.SubscriptionOfferCodePrice( + ) -> ASCKit.SubscriptionOfferCodePrice { + ASCKit.SubscriptionOfferCodePrice( id: sdk.id, offerCodeId: offerCodeId, territory: sdk.relationships?.territory?.data?.id, @@ -215,17 +214,17 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor private func mapOfferCode( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionOfferCode, subscriptionId: String - ) -> Domain.SubscriptionOfferCode { - let customerEligibilities = (sdk.attributes?.customerEligibilities ?? []).compactMap { sdkEligibility -> Domain.SubscriptionCustomerEligibility? in + ) -> ASCKit.SubscriptionOfferCode { + let customerEligibilities = (sdk.attributes?.customerEligibilities ?? []).compactMap { sdkEligibility -> ASCKit.SubscriptionCustomerEligibility? in mapCustomerEligibilityToDomain(sdkEligibility) } let offerEligibility = sdk.attributes?.offerEligibility.flatMap { mapOfferEligibilityToDomain($0) } ?? .stackable - let durationRaw = sdk.attributes?.duration?.rawValue ?? Domain.SubscriptionOfferDuration.oneMonth.rawValue - let duration = Domain.SubscriptionOfferDuration(rawValue: durationRaw) ?? .oneMonth - let modeRaw = sdk.attributes?.offerMode?.rawValue ?? Domain.SubscriptionOfferMode.freeTrial.rawValue - let offerMode = Domain.SubscriptionOfferMode(rawValue: modeRaw) ?? .freeTrial + let durationRaw = sdk.attributes?.duration?.rawValue ?? ASCKit.SubscriptionOfferDuration.oneMonth.rawValue + let duration = ASCKit.SubscriptionOfferDuration(rawValue: durationRaw) ?? .oneMonth + let modeRaw = sdk.attributes?.offerMode?.rawValue ?? ASCKit.SubscriptionOfferMode.freeTrial.rawValue + let offerMode = ASCKit.SubscriptionOfferMode(rawValue: modeRaw) ?? .freeTrial - return Domain.SubscriptionOfferCode( + return ASCKit.SubscriptionOfferCode( id: sdk.id, subscriptionId: subscriptionId, name: sdk.attributes?.name ?? "", @@ -244,10 +243,10 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor private func mapCustomCode( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionOfferCodeCustomCode, offerCodeId: String - ) -> Domain.SubscriptionOfferCodeCustomCode { + ) -> ASCKit.SubscriptionOfferCodeCustomCode { let createdDateString: String? = sdk.attributes?.createdDate.map { ISO8601DateFormatter().string(from: $0) } - return Domain.SubscriptionOfferCodeCustomCode( + return ASCKit.SubscriptionOfferCodeCustomCode( id: sdk.id, offerCodeId: offerCodeId, customCode: sdk.attributes?.customCode ?? "", @@ -261,13 +260,13 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor private func mapOneTimeUseCode( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionOfferCodeOneTimeUseCode, offerCodeId: String - ) -> Domain.SubscriptionOfferCodeOneTimeUseCode { + ) -> ASCKit.SubscriptionOfferCodeOneTimeUseCode { let createdDateString: String? = sdk.attributes?.createdDate.map { ISO8601DateFormatter().string(from: $0) } - let environment: Domain.OfferCodeEnvironment? = sdk.attributes?.environment.flatMap { - Domain.OfferCodeEnvironment(rawValue: $0.rawValue) + let environment: ASCKit.OfferCodeEnvironment? = sdk.attributes?.environment.flatMap { + ASCKit.OfferCodeEnvironment(rawValue: $0.rawValue) } - return Domain.SubscriptionOfferCodeOneTimeUseCode( + return ASCKit.SubscriptionOfferCodeOneTimeUseCode( id: sdk.id, offerCodeId: offerCodeId, numberOfCodes: sdk.attributes?.numberOfCodes ?? 0, @@ -283,7 +282,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor /// Maps domain customer eligibility to SDK raw value /// Domain: NEW, LAPSED, WIN_BACK, PAID_SUBSCRIBER /// SDK: NEW, EXISTING, EXPIRED - private func mapCustomerEligibilityToSDK(_ domain: Domain.SubscriptionCustomerEligibility) -> String { + private func mapCustomerEligibilityToSDK(_ domain: ASCKit.SubscriptionCustomerEligibility) -> String { switch domain { case .new: return "NEW" case .lapsed: return "EXPIRED" @@ -293,7 +292,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor } /// Maps SDK customer eligibility to domain - private func mapCustomerEligibilityToDomain(_ sdk: AppStoreConnect_Swift_SDK.SubscriptionCustomerEligibility) -> Domain.SubscriptionCustomerEligibility? { + private func mapCustomerEligibilityToDomain(_ sdk: AppStoreConnect_Swift_SDK.SubscriptionCustomerEligibility) -> ASCKit.SubscriptionCustomerEligibility? { switch sdk { case .new: return .new case .existing: return .paidSubscriber @@ -304,7 +303,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor /// Maps domain offer eligibility to SDK raw value /// Domain: STACKABLE, INTRODUCTORY, SUBSCRIPTION_OFFER /// SDK: STACK_WITH_INTRO_OFFERS, REPLACE_INTRO_OFFERS - private func mapOfferEligibilityToSDK(_ domain: Domain.SubscriptionOfferEligibility) -> String { + private func mapOfferEligibilityToSDK(_ domain: ASCKit.SubscriptionOfferEligibility) -> String { switch domain { case .stackable: return "STACK_WITH_INTRO_OFFERS" case .introductory: return "REPLACE_INTRO_OFFERS" @@ -313,7 +312,7 @@ public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepositor } /// Maps SDK offer eligibility to domain - private func mapOfferEligibilityToDomain(_ sdk: AppStoreConnect_Swift_SDK.SubscriptionOfferEligibility) -> Domain.SubscriptionOfferEligibility { + private func mapOfferEligibilityToDomain(_ sdk: AppStoreConnect_Swift_SDK.SubscriptionOfferEligibility) -> ASCKit.SubscriptionOfferEligibility { switch sdk { case .stackWithIntroOffers: return .stackable case .replaceIntroOffers: return .introductory diff --git a/Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCode.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCode.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCode.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCode.swift diff --git a/Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCode.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCode.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCode.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCode.swift diff --git a/Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCode.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCode.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCode.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCode.swift diff --git a/Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePrice.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePrice.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePrice.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePrice.swift diff --git a/Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift diff --git a/Sources/Infrastructure/Apps/Subscriptions/PromotionalOffers/SDKSubscriptionPromotionalOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift similarity index 83% rename from Sources/Infrastructure/Apps/Subscriptions/PromotionalOffers/SDKSubscriptionPromotionalOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift index db6c6f66..48750260 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/PromotionalOffers/SDKSubscriptionPromotionalOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKSubscriptionPromotionalOfferRepository: SubscriptionPromotionalOfferRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKSubscriptionPromotionalOfferRepository: SubscriptionPromotional self.client = client } - public func listPromotionalOffers(subscriptionId: String) async throws -> [Domain.SubscriptionPromotionalOffer] { + public func listPromotionalOffers(subscriptionId: String) async throws -> [ASCKit.SubscriptionPromotionalOffer] { let request = APIEndpoint.v1.subscriptions.id(subscriptionId).promotionalOffers.get() let response = try await client.request(request) return response.data.map { mapOffer($0, subscriptionId: subscriptionId) } @@ -18,11 +17,11 @@ public struct SDKSubscriptionPromotionalOfferRepository: SubscriptionPromotional subscriptionId: String, name: String, offerCode: String, - duration: Domain.SubscriptionOfferDuration, - offerMode: Domain.SubscriptionOfferMode, + duration: ASCKit.SubscriptionOfferDuration, + offerMode: ASCKit.SubscriptionOfferMode, numberOfPeriods: Int, - prices: [Domain.PromotionalOfferPriceInput] - ) async throws -> Domain.SubscriptionPromotionalOffer { + prices: [ASCKit.PromotionalOfferPriceInput] + ) async throws -> ASCKit.SubscriptionPromotionalOffer { let sdkDuration = AppStoreConnect_Swift_SDK.SubscriptionOfferDuration(rawValue: duration.rawValue) ?? .oneMonth let sdkMode = AppStoreConnect_Swift_SDK.SubscriptionOfferMode(rawValue: offerMode.rawValue) ?? .freeTrial @@ -68,7 +67,7 @@ public struct SDKSubscriptionPromotionalOfferRepository: SubscriptionPromotional _ = try await client.request(APIEndpoint.v1.subscriptionPromotionalOffers.id(offerId).delete) } - public func listPrices(offerId: String) async throws -> [Domain.SubscriptionPromotionalOfferPrice] { + public func listPrices(offerId: String) async throws -> [ASCKit.SubscriptionPromotionalOfferPrice] { // One price per territory — follow every page to get all 175. `include` makes Apple // return each price's territory and price point linkage, which the mapper reads. let pages = try await client.requestAllPages( @@ -81,13 +80,13 @@ public struct SDKSubscriptionPromotionalOfferRepository: SubscriptionPromotional private func mapOffer( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionPromotionalOffer, subscriptionId: String - ) -> Domain.SubscriptionPromotionalOffer { - let durationRaw = sdk.attributes?.duration?.rawValue ?? Domain.SubscriptionOfferDuration.oneMonth.rawValue - let duration = Domain.SubscriptionOfferDuration(rawValue: durationRaw) ?? .oneMonth - let modeRaw = sdk.attributes?.offerMode?.rawValue ?? Domain.SubscriptionOfferMode.freeTrial.rawValue - let mode = Domain.SubscriptionOfferMode(rawValue: modeRaw) ?? .freeTrial + ) -> ASCKit.SubscriptionPromotionalOffer { + let durationRaw = sdk.attributes?.duration?.rawValue ?? ASCKit.SubscriptionOfferDuration.oneMonth.rawValue + let duration = ASCKit.SubscriptionOfferDuration(rawValue: durationRaw) ?? .oneMonth + let modeRaw = sdk.attributes?.offerMode?.rawValue ?? ASCKit.SubscriptionOfferMode.freeTrial.rawValue + let mode = ASCKit.SubscriptionOfferMode(rawValue: modeRaw) ?? .freeTrial - return Domain.SubscriptionPromotionalOffer( + return ASCKit.SubscriptionPromotionalOffer( id: sdk.id, subscriptionId: subscriptionId, name: sdk.attributes?.name ?? "", @@ -101,8 +100,8 @@ public struct SDKSubscriptionPromotionalOfferRepository: SubscriptionPromotional private func mapPrice( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionPromotionalOfferPrice, offerId: String - ) -> Domain.SubscriptionPromotionalOfferPrice { - Domain.SubscriptionPromotionalOfferPrice( + ) -> ASCKit.SubscriptionPromotionalOfferPrice { + ASCKit.SubscriptionPromotionalOfferPrice( id: sdk.id, offerId: offerId, territory: sdk.relationships?.territory?.data?.id, diff --git a/Sources/Domain/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffer.swift b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffer.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffer.swift rename to Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffer.swift diff --git a/Sources/Domain/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferPrice.swift b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferPrice.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferPrice.swift rename to Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferPrice.swift diff --git a/Sources/Domain/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift diff --git a/Sources/Infrastructure/Apps/Subscriptions/Review/SDKSubscriptionReviewRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift similarity index 91% rename from Sources/Infrastructure/Apps/Subscriptions/Review/SDKSubscriptionReviewRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift index 2b51312e..d2ac535c 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/Review/SDKSubscriptionReviewRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @unchecked Sendable { @@ -22,7 +21,7 @@ public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @un self.pollMaxAttempts = pollMaxAttempts } - public func getReviewScreenshot(subscriptionId: String) async throws -> Domain.SubscriptionReviewScreenshot? { + public func getReviewScreenshot(subscriptionId: String) async throws -> ASCKit.SubscriptionReviewScreenshot? { do { let response = try await client.request( APIEndpoint.v1.subscriptions.id(subscriptionId).appStoreReviewScreenshot.get() @@ -36,7 +35,7 @@ public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @un public func uploadReviewScreenshot( subscriptionId: String, fileURL: URL - ) async throws -> Domain.SubscriptionReviewScreenshot { + ) async throws -> ASCKit.SubscriptionReviewScreenshot { let fileData = try Data(contentsOf: fileURL) let fileName = fileURL.lastPathComponent logUploadStep("subscription-review-screenshot reserve fileName=\(fileName) bytes=\(fileData.count) subscriptionId=\(subscriptionId)") @@ -83,13 +82,13 @@ public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @un // MARK: - Promotional Images - public func listImages(subscriptionId: String) async throws -> [Domain.SubscriptionPromotionalImage] { + public func listImages(subscriptionId: String) async throws -> [ASCKit.SubscriptionPromotionalImage] { let request = APIEndpoint.v1.subscriptions.id(subscriptionId).images.get() let response = try await client.request(request) return response.data.map { mapImage($0, subscriptionId: subscriptionId) } } - public func uploadImage(subscriptionId: String, fileURL: URL) async throws -> Domain.SubscriptionPromotionalImage { + public func uploadImage(subscriptionId: String, fileURL: URL) async throws -> ASCKit.SubscriptionPromotionalImage { let fileData = try Data(contentsOf: fileURL) let fileName = fileURL.lastPathComponent logUploadStep("subscription-image reserve fileName=\(fileName) bytes=\(fileData.count) subscriptionId=\(subscriptionId)") @@ -135,8 +134,8 @@ public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @un /// Re-fetches the screenshot until ASC reports `assetDeliveryState == COMPLETE` /// (imageAsset URL populated). Stops on `FAILED`. Falls back to whatever the latest /// fetch returned if processing exceeds `pollMaxAttempts × pollDelayNanos`. - private func pollReviewScreenshotReady(screenshotId: String, subscriptionId: String) async throws -> Domain.SubscriptionReviewScreenshot { - var latest: Domain.SubscriptionReviewScreenshot? + private func pollReviewScreenshotReady(screenshotId: String, subscriptionId: String) async throws -> ASCKit.SubscriptionReviewScreenshot { + var latest: ASCKit.SubscriptionReviewScreenshot? for attempt in 1...pollMaxAttempts { let response = try await client.request( APIEndpoint.v1.subscriptionAppStoreReviewScreenshots.id(screenshotId).get() @@ -163,8 +162,8 @@ public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @un /// Re-fetches the image until state is one of `PREPARE_FOR_SUBMISSION / /// WAITING_FOR_REVIEW / APPROVED` (imageAsset URL populated). Stops on `FAILED`/`REJECTED`. - private func pollImageReady(imageId: String, subscriptionId: String) async throws -> Domain.SubscriptionPromotionalImage { - var latest: Domain.SubscriptionPromotionalImage? + private func pollImageReady(imageId: String, subscriptionId: String) async throws -> ASCKit.SubscriptionPromotionalImage { + var latest: ASCKit.SubscriptionPromotionalImage? for attempt in 1...pollMaxAttempts { let response = try await client.request( APIEndpoint.v1.subscriptionImages.id(imageId).get() @@ -190,10 +189,10 @@ public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @un private func mapImage( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionImage, subscriptionId: String - ) -> Domain.SubscriptionPromotionalImage { + ) -> ASCKit.SubscriptionPromotionalImage { let stateRaw = sdk.attributes?.state?.rawValue - let state = stateRaw.flatMap { Domain.SubscriptionPromotionalImage.ImageState(rawValue: $0) } - return Domain.SubscriptionPromotionalImage( + let state = stateRaw.flatMap { ASCKit.SubscriptionPromotionalImage.ImageState(rawValue: $0) } + return ASCKit.SubscriptionPromotionalImage( id: sdk.id, subscriptionId: subscriptionId, fileName: sdk.attributes?.fileName ?? "", @@ -206,10 +205,10 @@ public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @un private func mapReviewScreenshot( _ sdk: AppStoreConnect_Swift_SDK.SubscriptionAppStoreReviewScreenshot, subscriptionId: String - ) -> Domain.SubscriptionReviewScreenshot { + ) -> ASCKit.SubscriptionReviewScreenshot { let stateRaw = sdk.attributes?.assetDeliveryState?.state?.rawValue - let state = stateRaw.flatMap { Domain.SubscriptionReviewScreenshot.AssetState(rawValue: $0) } - return Domain.SubscriptionReviewScreenshot( + let state = stateRaw.flatMap { ASCKit.SubscriptionReviewScreenshot.AssetState(rawValue: $0) } + return ASCKit.SubscriptionReviewScreenshot( id: sdk.id, subscriptionId: subscriptionId, fileName: sdk.attributes?.fileName ?? "", @@ -219,11 +218,11 @@ public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @un ) } - private func mapImageAsset(_ sdk: AppStoreConnect_Swift_SDK.ImageAsset?) -> Domain.ImageAsset? { + private func mapImageAsset(_ sdk: AppStoreConnect_Swift_SDK.ImageAsset?) -> ASCKit.ImageAsset? { guard let templateUrl = sdk?.templateURL, !templateUrl.isEmpty, let width = sdk?.width, width > 0, let height = sdk?.height, height > 0 else { return nil } - return Domain.ImageAsset(templateUrl: templateUrl, width: width, height: height) + return ASCKit.ImageAsset(templateUrl: templateUrl, width: width, height: height) } } diff --git a/Sources/Domain/Apps/Subscriptions/Review/SubscriptionPromotionalImage.swift b/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionPromotionalImage.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Review/SubscriptionPromotionalImage.swift rename to Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionPromotionalImage.swift diff --git a/Sources/Domain/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift diff --git a/Sources/Domain/Apps/Subscriptions/Review/SubscriptionReviewScreenshot.swift b/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewScreenshot.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Review/SubscriptionReviewScreenshot.swift rename to Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewScreenshot.swift diff --git a/Sources/Domain/Apps/Subscriptions/Subscription+RESTRoutes.swift b/Sources/ASCKit/Apps/Subscriptions/Subscription+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Subscription+RESTRoutes.swift rename to Sources/ASCKit/Apps/Subscriptions/Subscription+RESTRoutes.swift diff --git a/Sources/Domain/Apps/Subscriptions/Subscription.swift b/Sources/ASCKit/Apps/Subscriptions/Subscription.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/Subscription.swift rename to Sources/ASCKit/Apps/Subscriptions/Subscription.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionGroup.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroup.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionGroup.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionGroup.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionGroupRepository.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroupRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionGroupRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionGroupRepository.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionPrice.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionPrice.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionPrice.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionPrice.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionPricePoint.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionPricePoint.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionPricePoint.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionPricePoint.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionPriceRepository.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionPriceRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceRepository.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionPriceSchedule.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceSchedule.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionPriceSchedule.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceSchedule.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionRepository.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionRepository.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionSubmission.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmission.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionSubmission.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmission.swift diff --git a/Sources/Domain/Apps/Subscriptions/SubscriptionSubmissionRepository.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissionRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/SubscriptionSubmissionRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissionRepository.swift diff --git a/Sources/Infrastructure/Apps/Subscriptions/WinBackOffers/SDKWinBackOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift similarity index 88% rename from Sources/Infrastructure/Apps/Subscriptions/WinBackOffers/SDKWinBackOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift index 62d64256..78b9bc9c 100644 --- a/Sources/Infrastructure/Apps/Subscriptions/WinBackOffers/SDKWinBackOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Sendable { @@ -9,7 +8,7 @@ public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Send self.client = client } - public func listWinBackOffers(subscriptionId: String) async throws -> [Domain.WinBackOffer] { + public func listWinBackOffers(subscriptionId: String) async throws -> [ASCKit.WinBackOffer] { let request = APIEndpoint.v1.subscriptions.id(subscriptionId).winBackOffers.get() let response = try await client.request(request) return response.data.map { mapOffer($0, subscriptionId: subscriptionId) } @@ -19,8 +18,8 @@ public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Send subscriptionId: String, referenceName: String, offerId: String, - duration: Domain.SubscriptionOfferDuration, - offerMode: Domain.SubscriptionOfferMode, + duration: ASCKit.SubscriptionOfferDuration, + offerMode: ASCKit.SubscriptionOfferMode, periodCount: Int, paidSubscriptionDurationInMonths: Int, timeSinceLastSubscribedMin: Int, @@ -28,10 +27,10 @@ public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Send waitBetweenOffersInMonths: Int?, startDate: String, endDate: String?, - priority: Domain.WinBackOfferPriority, - promotionIntent: Domain.WinBackOfferPromotionIntent?, - prices: [Domain.WinBackOfferPriceInput] - ) async throws -> Domain.WinBackOffer { + priority: ASCKit.WinBackOfferPriority, + promotionIntent: ASCKit.WinBackOfferPromotionIntent?, + prices: [ASCKit.WinBackOfferPriceInput] + ) async throws -> ASCKit.WinBackOffer { // The generated SDK's `WinBackOfferPriceInlineCreate` lacks territory + pricePoint // relationships, so we build the body by hand. ASC web uses 1-based ${newPromoOfferPrice-N} // local IDs in the included[] array. @@ -118,13 +117,13 @@ public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Send offerId: String, startDate: String?, endDate: String?, - priority: Domain.WinBackOfferPriority?, - promotionIntent: Domain.WinBackOfferPromotionIntent?, + priority: ASCKit.WinBackOfferPriority?, + promotionIntent: ASCKit.WinBackOfferPromotionIntent?, paidSubscriptionDurationInMonths: Int?, timeSinceLastSubscribedMin: Int?, timeSinceLastSubscribedMax: Int?, waitBetweenOffersInMonths: Int? - ) async throws -> Domain.WinBackOffer { + ) async throws -> ASCKit.WinBackOffer { let timeRange: AppStoreConnect_Swift_SDK.IntegerRange? = { guard let timeSinceLastSubscribedMin, let timeSinceLastSubscribedMax else { return nil } return AppStoreConnect_Swift_SDK.IntegerRange( @@ -157,7 +156,7 @@ public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Send _ = try await client.request(APIEndpoint.v1.winBackOffers.id(offerId).delete) } - public func listPrices(offerId: String) async throws -> [Domain.WinBackOfferPrice] { + public func listPrices(offerId: String) async throws -> [ASCKit.WinBackOfferPrice] { // One price per territory — follow every page to get all 175. `include` makes Apple // return each price's territory and price point linkage, which the mapper reads. let pages = try await client.requestAllPages( @@ -170,16 +169,16 @@ public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Send private func mapOffer( _ sdk: AppStoreConnect_Swift_SDK.WinBackOffer, subscriptionId: String - ) -> Domain.WinBackOffer { - let durationRaw = sdk.attributes?.duration?.rawValue ?? Domain.SubscriptionOfferDuration.oneMonth.rawValue - let duration = Domain.SubscriptionOfferDuration(rawValue: durationRaw) ?? .oneMonth - let modeRaw = sdk.attributes?.offerMode?.rawValue ?? Domain.SubscriptionOfferMode.payAsYouGo.rawValue - let mode = Domain.SubscriptionOfferMode(rawValue: modeRaw) ?? .payAsYouGo - let priorityRaw = sdk.attributes?.priority?.rawValue ?? Domain.WinBackOfferPriority.normal.rawValue - let priority = Domain.WinBackOfferPriority(rawValue: priorityRaw) ?? .normal - let promo = sdk.attributes?.promotionIntent.flatMap { Domain.WinBackOfferPromotionIntent(rawValue: $0.rawValue) } - - return Domain.WinBackOffer( + ) -> ASCKit.WinBackOffer { + let durationRaw = sdk.attributes?.duration?.rawValue ?? ASCKit.SubscriptionOfferDuration.oneMonth.rawValue + let duration = ASCKit.SubscriptionOfferDuration(rawValue: durationRaw) ?? .oneMonth + let modeRaw = sdk.attributes?.offerMode?.rawValue ?? ASCKit.SubscriptionOfferMode.payAsYouGo.rawValue + let mode = ASCKit.SubscriptionOfferMode(rawValue: modeRaw) ?? .payAsYouGo + let priorityRaw = sdk.attributes?.priority?.rawValue ?? ASCKit.WinBackOfferPriority.normal.rawValue + let priority = ASCKit.WinBackOfferPriority(rawValue: priorityRaw) ?? .normal + let promo = sdk.attributes?.promotionIntent.flatMap { ASCKit.WinBackOfferPromotionIntent(rawValue: $0.rawValue) } + + return ASCKit.WinBackOffer( id: sdk.id, subscriptionId: subscriptionId, referenceName: sdk.attributes?.referenceName ?? "", @@ -201,8 +200,8 @@ public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Send private func mapPrice( _ sdk: AppStoreConnect_Swift_SDK.WinBackOfferPrice, offerId: String - ) -> Domain.WinBackOfferPrice { - Domain.WinBackOfferPrice( + ) -> ASCKit.WinBackOfferPrice { + ASCKit.WinBackOfferPrice( id: sdk.id, offerId: offerId, territory: sdk.relationships?.territory?.data?.id, diff --git a/Sources/Domain/Apps/Subscriptions/WinBackOffers/WinBackOffer.swift b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOffer.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/WinBackOffers/WinBackOffer.swift rename to Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOffer.swift diff --git a/Sources/Domain/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift similarity index 100% rename from Sources/Domain/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift diff --git a/Sources/Domain/Apps/TestFlight/BetaAppLocalization.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppLocalization.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/BetaAppLocalization.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppLocalization.swift diff --git a/Sources/Domain/Apps/TestFlight/BetaAppLocalizationRepository.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizationRepository.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/BetaAppLocalizationRepository.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppLocalizationRepository.swift diff --git a/Sources/Domain/Apps/TestFlight/BetaAppReviewDetail.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppReviewDetail.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/BetaAppReviewDetail.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppReviewDetail.swift diff --git a/Sources/Domain/Apps/TestFlight/BetaAppReviewRepository.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppReviewRepository.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/BetaAppReviewRepository.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppReviewRepository.swift diff --git a/Sources/Domain/Apps/TestFlight/BetaAppReviewSubmission.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppReviewSubmission.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/BetaAppReviewSubmission.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppReviewSubmission.swift diff --git a/Sources/Domain/Apps/TestFlight/BetaGroup+RESTRoutes.swift b/Sources/ASCKit/Apps/TestFlight/BetaGroup+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/BetaGroup+RESTRoutes.swift rename to Sources/ASCKit/Apps/TestFlight/BetaGroup+RESTRoutes.swift diff --git a/Sources/Domain/Apps/TestFlight/BetaGroup.swift b/Sources/ASCKit/Apps/TestFlight/BetaGroup.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/BetaGroup.swift rename to Sources/ASCKit/Apps/TestFlight/BetaGroup.swift diff --git a/Sources/Domain/Apps/TestFlight/BetaTester.swift b/Sources/ASCKit/Apps/TestFlight/BetaTester.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/BetaTester.swift rename to Sources/ASCKit/Apps/TestFlight/BetaTester.swift diff --git a/Sources/Infrastructure/Apps/TestFlight/OpenAPITestFlightRepository.swift b/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift similarity index 89% rename from Sources/Infrastructure/Apps/TestFlight/OpenAPITestFlightRepository.swift rename to Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift index 2d841976..22c5a182 100644 --- a/Sources/Infrastructure/Apps/TestFlight/OpenAPITestFlightRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable self.client = client } - public func listBetaGroups(appId: String?, limit: Int?) async throws -> PaginatedResponse { + public func listBetaGroups(appId: String?, limit: Int?) async throws -> PaginatedResponse { var filterApp: [String]? if let appId { filterApp = [appId] @@ -30,7 +29,7 @@ public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable isInternalGroup: Bool, publicLinkEnabled: Bool?, feedbackEnabled: Bool? - ) async throws -> Domain.BetaGroup { + ) async throws -> ASCKit.BetaGroup { let body = BetaGroupCreateRequest(data: .init( type: .betaGroups, attributes: .init( @@ -47,7 +46,7 @@ public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable return mapBetaGroup(response.data, appIdHint: appId) } - public func listBetaTesters(groupId: String, limit: Int?) async throws -> PaginatedResponse { + public func listBetaTesters(groupId: String, limit: Int?) async throws -> PaginatedResponse { let request = APIEndpoint.v1.betaTesters.get(parameters: .init( filterBetaGroups: [groupId], limit: limit @@ -58,7 +57,7 @@ public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable return PaginatedResponse(data: testers, nextCursor: nextCursor) } - public func addBetaTester(groupId: String, email: String, firstName: String?, lastName: String?) async throws -> Domain.BetaTester { + public func addBetaTester(groupId: String, email: String, firstName: String?, lastName: String?) async throws -> ASCKit.BetaTester { let body = BetaTesterCreateRequest(data: .init( type: .betaTesters, attributes: .init(firstName: firstName, lastName: lastName, email: email), @@ -77,9 +76,9 @@ public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable try await client.request(APIEndpoint.v1.betaGroups.id(groupId).relationships.betaTesters.delete(body)) } - private func mapBetaGroup(_ sdkGroup: AppStoreConnect_Swift_SDK.BetaGroup, appIdHint: String?) -> Domain.BetaGroup { + private func mapBetaGroup(_ sdkGroup: AppStoreConnect_Swift_SDK.BetaGroup, appIdHint: String?) -> ASCKit.BetaGroup { let appId = appIdHint ?? sdkGroup.relationships?.app?.data?.id ?? "" - return Domain.BetaGroup( + return ASCKit.BetaGroup( id: sdkGroup.id, appId: appId, name: sdkGroup.attributes?.name ?? "", @@ -89,8 +88,8 @@ public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable ) } - private func mapBetaTester(_ sdkTester: AppStoreConnect_Swift_SDK.BetaTester, groupId: String) -> Domain.BetaTester { - Domain.BetaTester( + private func mapBetaTester(_ sdkTester: AppStoreConnect_Swift_SDK.BetaTester, groupId: String) -> ASCKit.BetaTester { + ASCKit.BetaTester( id: sdkTester.id, groupId: groupId, firstName: sdkTester.attributes?.firstName, @@ -100,7 +99,7 @@ public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable ) } - private func mapInviteType(_ type: AppStoreConnect_Swift_SDK.BetaInviteType?) -> Domain.BetaTester.InviteType? { + private func mapInviteType(_ type: AppStoreConnect_Swift_SDK.BetaInviteType?) -> ASCKit.BetaTester.InviteType? { guard let type else { return nil } switch type { case .email: return .email diff --git a/Sources/Infrastructure/Apps/TestFlight/SDKBetaAppLocalizationRepository.swift b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift similarity index 89% rename from Sources/Infrastructure/Apps/TestFlight/SDKBetaAppLocalizationRepository.swift rename to Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift index 5d6ccdeb..f7aa86c6 100644 --- a/Sources/Infrastructure/Apps/TestFlight/SDKBetaAppLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKBetaAppLocalizationRepository: BetaAppLocalizationRepository, @unchecked Sendable { private let client: any APIClient @@ -8,14 +7,14 @@ public struct SDKBetaAppLocalizationRepository: BetaAppLocalizationRepository, @ self.client = client } - public func listBetaAppLocalizations(appId: String) async throws -> [Domain.BetaAppLocalization] { + public func listBetaAppLocalizations(appId: String) async throws -> [ASCKit.BetaAppLocalization] { let response = try await client.request( APIEndpoint.v1.apps.id(appId).betaAppLocalizations.get() ) return response.data.map { map($0, fallbackAppId: appId) } } - public func getBetaAppLocalization(localizationId: String) async throws -> Domain.BetaAppLocalization { + public func getBetaAppLocalization(localizationId: String) async throws -> ASCKit.BetaAppLocalization { let response = try await client.request( APIEndpoint.v1.betaAppLocalizations.id(localizationId).get() ) @@ -25,8 +24,8 @@ public struct SDKBetaAppLocalizationRepository: BetaAppLocalizationRepository, @ public func createBetaAppLocalization( appId: String, locale: String, - update: Domain.BetaAppLocalizationUpdate - ) async throws -> Domain.BetaAppLocalization { + update: ASCKit.BetaAppLocalizationUpdate + ) async throws -> ASCKit.BetaAppLocalization { let body = BetaAppLocalizationCreateRequest( data: .init( type: .betaAppLocalizations, @@ -51,8 +50,8 @@ public struct SDKBetaAppLocalizationRepository: BetaAppLocalizationRepository, @ public func updateBetaAppLocalization( localizationId: String, - update: Domain.BetaAppLocalizationUpdate - ) async throws -> Domain.BetaAppLocalization { + update: ASCKit.BetaAppLocalizationUpdate + ) async throws -> ASCKit.BetaAppLocalization { let body = BetaAppLocalizationUpdateRequest( data: .init( type: .betaAppLocalizations, @@ -81,9 +80,9 @@ public struct SDKBetaAppLocalizationRepository: BetaAppLocalizationRepository, @ private func map( _ sdk: AppStoreConnect_Swift_SDK.BetaAppLocalization, fallbackAppId: String - ) -> Domain.BetaAppLocalization { + ) -> ASCKit.BetaAppLocalization { let appId = sdk.relationships?.app?.data?.id ?? fallbackAppId - return Domain.BetaAppLocalization( + return ASCKit.BetaAppLocalization( id: sdk.id, appId: appId, locale: sdk.attributes?.locale ?? "", diff --git a/Sources/Infrastructure/Apps/TestFlight/SDKBetaAppReviewRepository.swift b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift similarity index 85% rename from Sources/Infrastructure/Apps/TestFlight/SDKBetaAppReviewRepository.swift rename to Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift index f24f446d..1ee9352f 100644 --- a/Sources/Infrastructure/Apps/TestFlight/SDKBetaAppReviewRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Se self.client = client } - public func listSubmissions(buildId: String) async throws -> [Domain.BetaAppReviewSubmission] { + public func listSubmissions(buildId: String) async throws -> [ASCKit.BetaAppReviewSubmission] { let request = APIEndpoint.v1.betaAppReviewSubmissions.get(parameters: .init( filterBuild: [buildId] )) @@ -16,7 +15,7 @@ public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Se return response.data.map { mapSubmission($0, buildId: buildId) } } - public func createSubmission(buildId: String) async throws -> Domain.BetaAppReviewSubmission { + public func createSubmission(buildId: String) async throws -> ASCKit.BetaAppReviewSubmission { let body = BetaAppReviewSubmissionCreateRequest(data: .init( type: .betaAppReviewSubmissions, relationships: .init(build: .init(data: .init(type: .builds, id: buildId))) @@ -25,25 +24,25 @@ public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Se return mapSubmission(response.data, buildId: buildId) } - public func getSubmission(id: String) async throws -> Domain.BetaAppReviewSubmission { + public func getSubmission(id: String) async throws -> ASCKit.BetaAppReviewSubmission { let request = APIEndpoint.v1.betaAppReviewSubmissions.id(id).get() let response = try await client.request(request) let buildId = response.data.relationships?.build?.data?.id ?? "" return mapSubmission(response.data, buildId: buildId) } - public func getDetail(appId: String) async throws -> Domain.BetaAppReviewDetail { + public func getDetail(appId: String) async throws -> ASCKit.BetaAppReviewDetail { let request = APIEndpoint.v1.betaAppReviewDetails.get(parameters: .init( filterApp: [appId] )) let response = try await client.request(request) guard let detail = response.data.first else { - throw Domain.APIError.notFound("No beta app review detail found for app \(appId)") + throw ASCKit.APIError.notFound("No beta app review detail found for app \(appId)") } return mapDetail(detail, appId: appId) } - public func updateDetail(id: String, update: Domain.BetaAppReviewDetailUpdate) async throws -> Domain.BetaAppReviewDetail { + public func updateDetail(id: String, update: ASCKit.BetaAppReviewDetailUpdate) async throws -> ASCKit.BetaAppReviewDetail { let body = BetaAppReviewDetailUpdateRequest(data: .init( type: .betaAppReviewDetails, id: id, @@ -65,8 +64,8 @@ public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Se // MARK: - Mappers - private func mapSubmission(_ sdk: AppStoreConnect_Swift_SDK.BetaAppReviewSubmission, buildId: String) -> Domain.BetaAppReviewSubmission { - Domain.BetaAppReviewSubmission( + private func mapSubmission(_ sdk: AppStoreConnect_Swift_SDK.BetaAppReviewSubmission, buildId: String) -> ASCKit.BetaAppReviewSubmission { + ASCKit.BetaAppReviewSubmission( id: sdk.id, buildId: buildId, state: mapState(sdk.attributes?.betaReviewState), @@ -74,7 +73,7 @@ public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Se ) } - private func mapState(_ state: AppStoreConnect_Swift_SDK.BetaReviewState?) -> Domain.BetaReviewState { + private func mapState(_ state: AppStoreConnect_Swift_SDK.BetaReviewState?) -> ASCKit.BetaReviewState { guard let state else { return .waitingForReview } switch state { case .waitingForReview: return .waitingForReview @@ -84,8 +83,8 @@ public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Se } } - private func mapDetail(_ sdk: AppStoreConnect_Swift_SDK.BetaAppReviewDetail, appId: String) -> Domain.BetaAppReviewDetail { - Domain.BetaAppReviewDetail( + private func mapDetail(_ sdk: AppStoreConnect_Swift_SDK.BetaAppReviewDetail, appId: String) -> ASCKit.BetaAppReviewDetail { + ASCKit.BetaAppReviewDetail( id: sdk.id, appId: appId, contactFirstName: sdk.attributes?.contactFirstName, diff --git a/Sources/Domain/Apps/TestFlight/TestFlightRepository.swift b/Sources/ASCKit/Apps/TestFlight/TestFlightRepository.swift similarity index 100% rename from Sources/Domain/Apps/TestFlight/TestFlightRepository.swift rename to Sources/ASCKit/Apps/TestFlight/TestFlightRepository.swift diff --git a/Sources/Domain/Apps/Versions/AppStoreReviewDetail.swift b/Sources/ASCKit/Apps/Versions/AppStoreReviewDetail.swift similarity index 100% rename from Sources/Domain/Apps/Versions/AppStoreReviewDetail.swift rename to Sources/ASCKit/Apps/Versions/AppStoreReviewDetail.swift diff --git a/Sources/Domain/Apps/Versions/AppStoreVersion+RESTRoutes.swift b/Sources/ASCKit/Apps/Versions/AppStoreVersion+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Apps/Versions/AppStoreVersion+RESTRoutes.swift rename to Sources/ASCKit/Apps/Versions/AppStoreVersion+RESTRoutes.swift diff --git a/Sources/Domain/Apps/Versions/AppStoreVersion.swift b/Sources/ASCKit/Apps/Versions/AppStoreVersion.swift similarity index 100% rename from Sources/Domain/Apps/Versions/AppStoreVersion.swift rename to Sources/ASCKit/Apps/Versions/AppStoreVersion.swift diff --git a/Sources/Domain/Apps/Versions/AppStoreVersionState.swift b/Sources/ASCKit/Apps/Versions/AppStoreVersionState.swift similarity index 100% rename from Sources/Domain/Apps/Versions/AppStoreVersionState.swift rename to Sources/ASCKit/Apps/Versions/AppStoreVersionState.swift diff --git a/Sources/Infrastructure/Apps/Versions/SDKReviewDetailRepository.swift b/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/Versions/SDKReviewDetailRepository.swift rename to Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift index 626e8a31..b116c6aa 100644 --- a/Sources/Infrastructure/Apps/Versions/SDKReviewDetailRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKReviewDetailRepository: ReviewDetailRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKReviewDetailRepository: ReviewDetailRepository, @unchecked Send self.client = client } - public func getReviewDetail(versionId: String) async throws -> Domain.AppStoreReviewDetail { + public func getReviewDetail(versionId: String) async throws -> ASCKit.AppStoreReviewDetail { let request = APIEndpoint.v1.appStoreVersions.id(versionId).appStoreReviewDetail.get() do { let response = try await client.request(request) @@ -16,11 +15,11 @@ public struct SDKReviewDetailRepository: ReviewDetailRepository, @unchecked Send } catch { // The API returns {"data": null} when review information has never been submitted. // Treat as empty — reviewContactCheck will surface this as a SHOULD FIX warning. - return Domain.AppStoreReviewDetail(id: "", versionId: versionId) + return ASCKit.AppStoreReviewDetail(id: "", versionId: versionId) } } - public func upsertReviewDetail(versionId: String, update: Domain.ReviewDetailUpdate) async throws -> Domain.AppStoreReviewDetail { + public func upsertReviewDetail(versionId: String, update: ASCKit.ReviewDetailUpdate) async throws -> ASCKit.AppStoreReviewDetail { let existing = try await getReviewDetail(versionId: versionId) let attributes = makeAttributes(from: update) if existing.id.isEmpty { @@ -55,7 +54,7 @@ public struct SDKReviewDetailRepository: ReviewDetailRepository, @unchecked Send } } - private func makeAttributes(from update: Domain.ReviewDetailUpdate) -> AppStoreReviewDetailCreateRequest.Data.Attributes { + private func makeAttributes(from update: ASCKit.ReviewDetailUpdate) -> AppStoreReviewDetailCreateRequest.Data.Attributes { AppStoreReviewDetailCreateRequest.Data.Attributes( contactFirstName: update.contactFirstName, contactLastName: update.contactLastName, @@ -71,8 +70,8 @@ public struct SDKReviewDetailRepository: ReviewDetailRepository, @unchecked Send private func mapReviewDetail( _ sdk: AppStoreConnect_Swift_SDK.AppStoreReviewDetail, versionId: String - ) -> Domain.AppStoreReviewDetail { - Domain.AppStoreReviewDetail( + ) -> ASCKit.AppStoreReviewDetail { + ASCKit.AppStoreReviewDetail( id: sdk.id, versionId: versionId, contactFirstName: sdk.attributes?.contactFirstName, diff --git a/Sources/Infrastructure/Apps/Versions/SDKVersionRepository.swift b/Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift similarity index 87% rename from Sources/Infrastructure/Apps/Versions/SDKVersionRepository.swift rename to Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift index aeee8e52..c5e31531 100644 --- a/Sources/Infrastructure/Apps/Versions/SDKVersionRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { @@ -9,7 +8,7 @@ public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { self.client = client } - public func listVersions(appId: String) async throws -> [Domain.AppStoreVersion] { + public func listVersions(appId: String) async throws -> [ASCKit.AppStoreVersion] { let pages = try await client.requestAllPages( APIEndpoint.v1.apps.id(appId).appStoreVersions.get(parameters: .init(limit: 200)), nextCursor: { $0.meta?.paging.nextCursor } @@ -17,7 +16,7 @@ public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { return pages.flatMap(\.data).compactMap { mapVersion($0, appId: appId) } } - public func getVersion(id: String) async throws -> Domain.AppStoreVersion { + public func getVersion(id: String) async throws -> ASCKit.AppStoreVersion { let request = APIEndpoint.v1.appStoreVersions.id(id).get( parameters: .init(include: [.app, .build]) ) @@ -25,14 +24,14 @@ public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { let appId = response.data.relationships?.app?.data?.id ?? "" let buildId = response.data.relationships?.build?.data?.id guard let version = mapVersion(response.data, appId: appId, buildId: buildId) else { - throw Domain.APIError.unknown("Failed to map version \(id)") + throw ASCKit.APIError.unknown("Failed to map version \(id)") } return version } - public func createVersion(appId: String, versionString: String, platform: Domain.AppStorePlatform) async throws -> Domain.AppStoreVersion { + public func createVersion(appId: String, versionString: String, platform: ASCKit.AppStorePlatform) async throws -> ASCKit.AppStoreVersion { guard let sdkPlatform = AppStoreConnect_Swift_SDK.Platform(rawValue: platform.rawValue) else { - throw Domain.APIError.unknown("Unsupported platform for create: \(platform.rawValue)") + throw ASCKit.APIError.unknown("Unsupported platform for create: \(platform.rawValue)") } let body = AppStoreVersionCreateRequest( data: .init( @@ -43,7 +42,7 @@ public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { ) let response = try await client.request(APIEndpoint.v1.appStoreVersions.post(body)) guard let version = mapVersion(response.data, appId: appId) else { - throw Domain.APIError.unknown("Failed to map created version") + throw ASCKit.APIError.unknown("Failed to map created version") } return version } @@ -54,7 +53,7 @@ public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { copyright: String?, releaseType: String?, earliestReleaseDate: String? - ) async throws -> Domain.AppStoreVersion { + ) async throws -> ASCKit.AppStoreVersion { // Only send the fields the caller actually wants to change. Apple's // SDK uses `encodeIfPresent`, so nil keys never reach the wire and // unchanged attributes are preserved server-side. @@ -77,7 +76,7 @@ public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { let response = try await client.request(APIEndpoint.v1.appStoreVersions.id(id).patch(body)) let appId = response.data.relationships?.app?.data?.id ?? "" guard let version = mapVersion(response.data, appId: appId) else { - throw Domain.APIError.unknown("Failed to map updated version \(id)") + throw ASCKit.APIError.unknown("Failed to map updated version \(id)") } return version } @@ -99,11 +98,11 @@ public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { _ sdkVersion: AppStoreConnect_Swift_SDK.AppStoreVersion, appId: String, buildId: String? = nil - ) -> Domain.AppStoreVersion? { - guard let platform = Domain.AppStorePlatform( + ) -> ASCKit.AppStoreVersion? { + guard let platform = ASCKit.AppStorePlatform( rawValue: sdkVersion.attributes?.platform?.rawValue ?? "" ) else { return nil } - let state = Domain.AppStoreVersionState( + let state = ASCKit.AppStoreVersionState( rawValue: sdkVersion.attributes?.appStoreState?.rawValue ?? "" ) ?? .prepareForSubmission // Hoist the three editable attributes onto the Domain so the web @@ -113,7 +112,7 @@ public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { let isoFormatter = ISO8601DateFormatter() let earliestReleaseDate: String? = sdkVersion.attributes?.earliestReleaseDate .map { isoFormatter.string(from: $0) } - return Domain.AppStoreVersion( + return ASCKit.AppStoreVersion( id: sdkVersion.id, appId: appId, versionString: sdkVersion.attributes?.versionString ?? "", diff --git a/Sources/Domain/Apps/Versions/Localizations/AppStoreVersionLocalization.swift b/Sources/ASCKit/Apps/Versions/Localizations/AppStoreVersionLocalization.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/AppStoreVersionLocalization.swift rename to Sources/ASCKit/Apps/Versions/Localizations/AppStoreVersionLocalization.swift diff --git a/Sources/Infrastructure/Apps/Versions/Localizations/SDKLocalizationRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift similarity index 91% rename from Sources/Infrastructure/Apps/Versions/Localizations/SDKLocalizationRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift index 1779c967..d77d7ebb 100644 --- a/Sources/Infrastructure/Apps/Versions/Localizations/SDKLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKLocalizationRepository: VersionLocalizationRepository, @unchecked Sendable { @@ -9,13 +8,13 @@ public struct SDKLocalizationRepository: VersionLocalizationRepository, @uncheck self.client = client } - public func listLocalizations(versionId: String) async throws -> [Domain.AppStoreVersionLocalization] { + public func listLocalizations(versionId: String) async throws -> [ASCKit.AppStoreVersionLocalization] { let request = APIEndpoint.v1.appStoreVersions.id(versionId).appStoreVersionLocalizations.get() let response = try await client.request(request) return response.data.map { mapLocalization($0, versionId: versionId) } } - public func createLocalization(versionId: String, locale: String) async throws -> Domain.AppStoreVersionLocalization { + public func createLocalization(versionId: String, locale: String) async throws -> ASCKit.AppStoreVersionLocalization { let body = AppStoreVersionLocalizationCreateRequest( data: .init( type: .appStoreVersionLocalizations, @@ -35,7 +34,7 @@ public struct SDKLocalizationRepository: VersionLocalizationRepository, @uncheck marketingUrl: String?, supportUrl: String?, promotionalText: String? - ) async throws -> Domain.AppStoreVersionLocalization { + ) async throws -> ASCKit.AppStoreVersionLocalization { let body = AppStoreVersionLocalizationUpdateRequest( data: .init( type: .appStoreVersionLocalizations, @@ -59,8 +58,8 @@ public struct SDKLocalizationRepository: VersionLocalizationRepository, @uncheck private func mapLocalization( _ sdkLoc: AppStoreConnect_Swift_SDK.AppStoreVersionLocalization, versionId: String - ) -> Domain.AppStoreVersionLocalization { - Domain.AppStoreVersionLocalization( + ) -> ASCKit.AppStoreVersionLocalization { + ASCKit.AppStoreVersionLocalization( id: sdkLoc.id, versionId: versionId, locale: sdkLoc.attributes?.locale ?? "", diff --git a/Sources/Domain/Apps/Versions/Localizations/PreviewSets/AppPreviewSet.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviewSet.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/PreviewSets/AppPreviewSet.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviewSet.swift diff --git a/Sources/Domain/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreview.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreview.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreview.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreview.swift diff --git a/Sources/Infrastructure/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift similarity index 90% rename from Sources/Infrastructure/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift index 7afe7b27..4cc76a48 100644 --- a/Sources/Infrastructure/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { @@ -11,7 +10,7 @@ public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { self.uploader = uploader } - public func listPreviewSets(localizationId: String) async throws -> [Domain.AppPreviewSet] { + public func listPreviewSets(localizationId: String) async throws -> [ASCKit.AppPreviewSet] { let request = APIEndpoint.v1.appStoreVersionLocalizations.id(localizationId).appPreviewSets.get( parameters: .init(include: [.appPreviews]) ) @@ -19,9 +18,9 @@ public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { return response.data.map { mapPreviewSet($0, localizationId: localizationId) } } - public func createPreviewSet(localizationId: String, previewType: Domain.PreviewType) async throws -> Domain.AppPreviewSet { + public func createPreviewSet(localizationId: String, previewType: ASCKit.PreviewType) async throws -> ASCKit.AppPreviewSet { guard let sdkPreviewType = AppStoreConnect_Swift_SDK.PreviewType(rawValue: previewType.rawValue) else { - throw Domain.APIError.unknown("Unsupported preview type: \(previewType.rawValue)") + throw ASCKit.APIError.unknown("Unsupported preview type: \(previewType.rawValue)") } let body = AppPreviewSetCreateRequest( data: .init( @@ -38,13 +37,13 @@ public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { return mapPreviewSet(response.data, localizationId: localizationId) } - public func listPreviews(setId: String) async throws -> [Domain.AppPreview] { + public func listPreviews(setId: String) async throws -> [ASCKit.AppPreview] { let request = APIEndpoint.v1.appPreviewSets.id(setId).appPreviews.get() let response = try await client.request(request) return response.data.map { mapPreview($0, setId: setId) } } - public func uploadPreview(setId: String, fileURL: URL, previewFrameTimeCode: String?) async throws -> Domain.AppPreview { + public func uploadPreview(setId: String, fileURL: URL, previewFrameTimeCode: String?) async throws -> ASCKit.AppPreview { let fileData = try Data(contentsOf: fileURL) let fileName = fileURL.lastPathComponent let fileSize = fileData.count @@ -90,10 +89,10 @@ public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { private func mapPreviewSet( _ sdkSet: AppStoreConnect_Swift_SDK.AppPreviewSet, localizationId: String - ) -> Domain.AppPreviewSet { - let previewType = Domain.PreviewType(rawValue: sdkSet.attributes?.previewType?.rawValue ?? "") ?? .iphone67 + ) -> ASCKit.AppPreviewSet { + let previewType = ASCKit.PreviewType(rawValue: sdkSet.attributes?.previewType?.rawValue ?? "") ?? .iphone67 let count = sdkSet.relationships?.appPreviews?.data?.count ?? 0 - return Domain.AppPreviewSet( + return ASCKit.AppPreviewSet( id: sdkSet.id, localizationId: localizationId, previewType: previewType, @@ -104,10 +103,10 @@ public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { private func mapPreview( _ sdkPreview: AppStoreConnect_Swift_SDK.AppPreview, setId: String - ) -> Domain.AppPreview { + ) -> ASCKit.AppPreview { let assetState = mapAssetState(sdkPreview.attributes?.assetDeliveryState?.state) let videoState = mapVideoState(sdkPreview.attributes?.videoDeliveryState?.state) - return Domain.AppPreview( + return ASCKit.AppPreview( id: sdkPreview.id, setId: setId, fileName: sdkPreview.attributes?.fileName ?? "", @@ -122,7 +121,7 @@ public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { private func mapAssetState( _ state: AppStoreConnect_Swift_SDK.AppMediaAssetState.State? - ) -> Domain.AppPreview.AssetDeliveryState? { + ) -> ASCKit.AppPreview.AssetDeliveryState? { guard let state else { return nil } switch state { case .awaitingUpload: return .awaitingUpload @@ -134,7 +133,7 @@ public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { private func mapVideoState( _ state: AppStoreConnect_Swift_SDK.AppMediaVideoState.State? - ) -> Domain.AppPreview.VideoDeliveryState? { + ) -> ASCKit.AppPreview.VideoDeliveryState? { guard let state else { return nil } switch state { case .awaitingUpload: return .awaitingUpload diff --git a/Sources/Domain/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift diff --git a/Sources/Domain/Apps/Versions/Localizations/PreviewSets/PreviewType.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewType.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/PreviewSets/PreviewType.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewType.swift diff --git a/Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift rename to Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift diff --git a/Sources/Infrastructure/Apps/Versions/Localizations/ScreenshotSets/OpenAPIScreenshotRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift similarity index 91% rename from Sources/Infrastructure/Apps/Versions/Localizations/ScreenshotSets/OpenAPIScreenshotRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift index d90a29bb..4431e625 100644 --- a/Sources/Infrastructure/Apps/Versions/Localizations/ScreenshotSets/OpenAPIScreenshotRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable { @@ -11,7 +10,7 @@ public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable self.uploader = uploader } - public func listScreenshotSets(localizationId: String) async throws -> [Domain.AppScreenshotSet] { + public func listScreenshotSets(localizationId: String) async throws -> [ASCKit.AppScreenshotSet] { let request = APIEndpoint.v1.appStoreVersionLocalizations.id(localizationId).appScreenshotSets.get( parameters: .init(include: [.appScreenshots]) ) @@ -19,15 +18,15 @@ public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable return response.data.map { mapScreenshotSet($0, localizationId: localizationId) } } - public func listScreenshots(setId: String) async throws -> [Domain.AppScreenshot] { + public func listScreenshots(setId: String) async throws -> [ASCKit.AppScreenshot] { let request = APIEndpoint.v1.appScreenshotSets.id(setId).appScreenshots.get() let response = try await client.request(request) return response.data.map { mapScreenshot($0, setId: setId) } } - public func createScreenshotSet(localizationId: String, displayType: Domain.ScreenshotDisplayType) async throws -> Domain.AppScreenshotSet { + public func createScreenshotSet(localizationId: String, displayType: ASCKit.ScreenshotDisplayType) async throws -> ASCKit.AppScreenshotSet { guard let sdkDisplayType = AppStoreConnect_Swift_SDK.ScreenshotDisplayType(rawValue: displayType.rawValue) else { - throw Domain.APIError.unknown("Unsupported display type: \(displayType.rawValue)") + throw ASCKit.APIError.unknown("Unsupported display type: \(displayType.rawValue)") } let body = AppScreenshotSetCreateRequest( data: .init( @@ -42,7 +41,7 @@ public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable return mapScreenshotSet(response.data, localizationId: localizationId) } - public func uploadScreenshot(setId: String, fileURL: URL) async throws -> Domain.AppScreenshot { + public func uploadScreenshot(setId: String, fileURL: URL) async throws -> ASCKit.AppScreenshot { let fileData = try Data(contentsOf: fileURL) let fileName = fileURL.lastPathComponent let fileSize = fileData.count @@ -86,12 +85,12 @@ public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable private func mapScreenshotSet( _ sdkSet: AppStoreConnect_Swift_SDK.AppScreenshotSet, localizationId: String - ) -> Domain.AppScreenshotSet { - let displayType = Domain.ScreenshotDisplayType( + ) -> ASCKit.AppScreenshotSet { + let displayType = ASCKit.ScreenshotDisplayType( rawValue: sdkSet.attributes?.screenshotDisplayType?.rawValue ?? "" ) ?? .iphone67 let count = sdkSet.relationships?.appScreenshots?.data?.count ?? 0 - return Domain.AppScreenshotSet( + return ASCKit.AppScreenshotSet( id: sdkSet.id, localizationId: localizationId, screenshotDisplayType: displayType, @@ -103,9 +102,9 @@ public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable private func mapScreenshot( _ sdkScreenshot: AppStoreConnect_Swift_SDK.AppScreenshot, setId: String - ) -> Domain.AppScreenshot { + ) -> ASCKit.AppScreenshot { let state = mapAssetState(sdkScreenshot.attributes?.assetDeliveryState?.state) - return Domain.AppScreenshot( + return ASCKit.AppScreenshot( id: sdkScreenshot.id, setId: setId, fileName: sdkScreenshot.attributes?.fileName ?? "", @@ -119,7 +118,7 @@ public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable private func mapAssetState( _ state: AppStoreConnect_Swift_SDK.AppMediaAssetState.State? - ) -> Domain.AppScreenshot.AssetDeliveryState? { + ) -> ASCKit.AppScreenshot.AssetDeliveryState? { guard let state else { return nil } switch state { case .awaitingUpload: return .awaitingUpload diff --git a/Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayType.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayType.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayType.swift rename to Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayType.swift diff --git a/Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/ScreenshotImport.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotImport.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/ScreenshotImport.swift rename to Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotImport.swift diff --git a/Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift diff --git a/Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshot.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshot.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshot.swift rename to Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshot.swift diff --git a/Sources/Domain/Apps/Versions/Localizations/VersionLocalizationRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizationRepository.swift similarity index 100% rename from Sources/Domain/Apps/Versions/Localizations/VersionLocalizationRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizationRepository.swift diff --git a/Sources/Domain/Apps/Versions/ReviewDetailRepository.swift b/Sources/ASCKit/Apps/Versions/ReviewDetailRepository.swift similarity index 100% rename from Sources/Domain/Apps/Versions/ReviewDetailRepository.swift rename to Sources/ASCKit/Apps/Versions/ReviewDetailRepository.swift diff --git a/Sources/Domain/Apps/Versions/ReviewDetailUpdate.swift b/Sources/ASCKit/Apps/Versions/ReviewDetailUpdate.swift similarity index 100% rename from Sources/Domain/Apps/Versions/ReviewDetailUpdate.swift rename to Sources/ASCKit/Apps/Versions/ReviewDetailUpdate.swift diff --git a/Sources/Domain/Apps/Versions/VersionReadiness.swift b/Sources/ASCKit/Apps/Versions/VersionReadiness.swift similarity index 100% rename from Sources/Domain/Apps/Versions/VersionReadiness.swift rename to Sources/ASCKit/Apps/Versions/VersionReadiness.swift diff --git a/Sources/Domain/Apps/Versions/VersionRepository.swift b/Sources/ASCKit/Apps/Versions/VersionRepository.swift similarity index 100% rename from Sources/Domain/Apps/Versions/VersionRepository.swift rename to Sources/ASCKit/Apps/Versions/VersionRepository.swift diff --git a/Sources/Domain/Auth/AuthCredentials.swift b/Sources/ASCKit/Auth/AuthCredentials.swift similarity index 100% rename from Sources/Domain/Auth/AuthCredentials.swift rename to Sources/ASCKit/Auth/AuthCredentials.swift diff --git a/Sources/Domain/Auth/AuthError.swift b/Sources/ASCKit/Auth/AuthError.swift similarity index 100% rename from Sources/Domain/Auth/AuthError.swift rename to Sources/ASCKit/Auth/AuthError.swift diff --git a/Sources/Domain/Auth/AuthProvider.swift b/Sources/ASCKit/Auth/AuthProvider.swift similarity index 100% rename from Sources/Domain/Auth/AuthProvider.swift rename to Sources/ASCKit/Auth/AuthProvider.swift diff --git a/Sources/Domain/Auth/AuthStatus.swift b/Sources/ASCKit/Auth/AuthStatus.swift similarity index 100% rename from Sources/Domain/Auth/AuthStatus.swift rename to Sources/ASCKit/Auth/AuthStatus.swift diff --git a/Sources/Domain/Auth/AuthStorage.swift b/Sources/ASCKit/Auth/AuthStorage.swift similarity index 100% rename from Sources/Domain/Auth/AuthStorage.swift rename to Sources/ASCKit/Auth/AuthStorage.swift diff --git a/Sources/Domain/Auth/ConnectAccount.swift b/Sources/ASCKit/Auth/ConnectAccount.swift similarity index 100% rename from Sources/Domain/Auth/ConnectAccount.swift rename to Sources/ASCKit/Auth/ConnectAccount.swift diff --git a/Sources/Domain/Auth/CredentialSource.swift b/Sources/ASCKit/Auth/CredentialSource.swift similarity index 100% rename from Sources/Domain/Auth/CredentialSource.swift rename to Sources/ASCKit/Auth/CredentialSource.swift diff --git a/Sources/Infrastructure/Auth/CompositeAuthProvider.swift b/Sources/ASCKit/Auth/Internal/CompositeAuthProvider.swift similarity index 97% rename from Sources/Infrastructure/Auth/CompositeAuthProvider.swift rename to Sources/ASCKit/Auth/Internal/CompositeAuthProvider.swift index c870ed7d..531626e6 100644 --- a/Sources/Infrastructure/Auth/CompositeAuthProvider.swift +++ b/Sources/ASCKit/Auth/Internal/CompositeAuthProvider.swift @@ -1,4 +1,3 @@ -import Domain public struct CompositeAuthProvider: AuthProvider { private let fileProvider: any AuthProvider diff --git a/Sources/Infrastructure/Auth/EnvironmentAuthProvider.swift b/Sources/ASCKit/Auth/Internal/EnvironmentAuthProvider.swift similarity index 99% rename from Sources/Infrastructure/Auth/EnvironmentAuthProvider.swift rename to Sources/ASCKit/Auth/Internal/EnvironmentAuthProvider.swift index 86d626ea..09afbb15 100644 --- a/Sources/Infrastructure/Auth/EnvironmentAuthProvider.swift +++ b/Sources/ASCKit/Auth/Internal/EnvironmentAuthProvider.swift @@ -1,5 +1,4 @@ import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct EnvironmentAuthProvider: AuthProvider { diff --git a/Sources/Infrastructure/Auth/FileAuthProvider.swift b/Sources/ASCKit/Auth/Internal/FileAuthProvider.swift similarity index 96% rename from Sources/Infrastructure/Auth/FileAuthProvider.swift rename to Sources/ASCKit/Auth/Internal/FileAuthProvider.swift index 093b8d9d..993776ca 100644 --- a/Sources/Infrastructure/Auth/FileAuthProvider.swift +++ b/Sources/ASCKit/Auth/Internal/FileAuthProvider.swift @@ -1,4 +1,3 @@ -import Domain public struct FileAuthProvider: AuthProvider { private let storage: any AuthStorage diff --git a/Sources/Infrastructure/Auth/FileAuthStorage.swift b/Sources/ASCKit/Auth/Internal/FileAuthStorage.swift similarity index 99% rename from Sources/Infrastructure/Auth/FileAuthStorage.swift rename to Sources/ASCKit/Auth/Internal/FileAuthStorage.swift index b10edfeb..d8a0552f 100644 --- a/Sources/Infrastructure/Auth/FileAuthStorage.swift +++ b/Sources/ASCKit/Auth/Internal/FileAuthStorage.swift @@ -1,4 +1,3 @@ -import Domain import Foundation public struct FileAuthStorage: AuthStorage { diff --git a/Sources/Domain/Auth/Iris/IrisAuthCredentials.swift b/Sources/ASCKit/Auth/Iris/IrisAuthCredentials.swift similarity index 100% rename from Sources/Domain/Auth/Iris/IrisAuthCredentials.swift rename to Sources/ASCKit/Auth/Iris/IrisAuthCredentials.swift diff --git a/Sources/Domain/Auth/Iris/IrisAuthError.swift b/Sources/ASCKit/Auth/Iris/IrisAuthError.swift similarity index 100% rename from Sources/Domain/Auth/Iris/IrisAuthError.swift rename to Sources/ASCKit/Auth/Iris/IrisAuthError.swift diff --git a/Sources/Domain/Auth/Iris/IrisAuthRepository.swift b/Sources/ASCKit/Auth/Iris/IrisAuthRepository.swift similarity index 100% rename from Sources/Domain/Auth/Iris/IrisAuthRepository.swift rename to Sources/ASCKit/Auth/Iris/IrisAuthRepository.swift diff --git a/Sources/Domain/Auth/Iris/IrisAuthSession.swift b/Sources/ASCKit/Auth/Iris/IrisAuthSession.swift similarity index 100% rename from Sources/Domain/Auth/Iris/IrisAuthSession.swift rename to Sources/ASCKit/Auth/Iris/IrisAuthSession.swift diff --git a/Sources/Domain/Auth/Iris/IrisAuthSummary.swift b/Sources/ASCKit/Auth/Iris/IrisAuthSummary.swift similarity index 100% rename from Sources/Domain/Auth/Iris/IrisAuthSummary.swift rename to Sources/ASCKit/Auth/Iris/IrisAuthSummary.swift diff --git a/Sources/Domain/Auth/Iris/IrisSessionRepository.swift b/Sources/ASCKit/Auth/Iris/IrisSessionRepository.swift similarity index 100% rename from Sources/Domain/Auth/Iris/IrisSessionRepository.swift rename to Sources/ASCKit/Auth/Iris/IrisSessionRepository.swift diff --git a/Sources/Domain/Auth/Iris/PendingTwoFactorState.swift b/Sources/ASCKit/Auth/Iris/PendingTwoFactorState.swift similarity index 100% rename from Sources/Domain/Auth/Iris/PendingTwoFactorState.swift rename to Sources/ASCKit/Auth/Iris/PendingTwoFactorState.swift diff --git a/Sources/Domain/Auth/Iris/TwoFactorChallenge.swift b/Sources/ASCKit/Auth/Iris/TwoFactorChallenge.swift similarity index 100% rename from Sources/Domain/Auth/Iris/TwoFactorChallenge.swift rename to Sources/ASCKit/Auth/Iris/TwoFactorChallenge.swift diff --git a/Sources/Domain/CodeSigning/BundleIDs/BundleID.swift b/Sources/ASCKit/CodeSigning/BundleIDs/BundleID.swift similarity index 100% rename from Sources/Domain/CodeSigning/BundleIDs/BundleID.swift rename to Sources/ASCKit/CodeSigning/BundleIDs/BundleID.swift diff --git a/Sources/Domain/CodeSigning/BundleIDs/BundleIDRepository.swift b/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDRepository.swift similarity index 100% rename from Sources/Domain/CodeSigning/BundleIDs/BundleIDRepository.swift rename to Sources/ASCKit/CodeSigning/BundleIDs/BundleIDRepository.swift diff --git a/Sources/Domain/CodeSigning/Certificates/Certificate.swift b/Sources/ASCKit/CodeSigning/Certificates/Certificate.swift similarity index 100% rename from Sources/Domain/CodeSigning/Certificates/Certificate.swift rename to Sources/ASCKit/CodeSigning/Certificates/Certificate.swift diff --git a/Sources/Domain/CodeSigning/Certificates/CertificateRepository.swift b/Sources/ASCKit/CodeSigning/Certificates/CertificateRepository.swift similarity index 100% rename from Sources/Domain/CodeSigning/Certificates/CertificateRepository.swift rename to Sources/ASCKit/CodeSigning/Certificates/CertificateRepository.swift diff --git a/Sources/Domain/CodeSigning/CodeSigning+RESTRoutes.swift b/Sources/ASCKit/CodeSigning/CodeSigning+RESTRoutes.swift similarity index 100% rename from Sources/Domain/CodeSigning/CodeSigning+RESTRoutes.swift rename to Sources/ASCKit/CodeSigning/CodeSigning+RESTRoutes.swift diff --git a/Sources/Domain/CodeSigning/Devices/Device.swift b/Sources/ASCKit/CodeSigning/Devices/Device.swift similarity index 100% rename from Sources/Domain/CodeSigning/Devices/Device.swift rename to Sources/ASCKit/CodeSigning/Devices/Device.swift diff --git a/Sources/Domain/CodeSigning/Devices/DeviceRepository.swift b/Sources/ASCKit/CodeSigning/Devices/DeviceRepository.swift similarity index 100% rename from Sources/Domain/CodeSigning/Devices/DeviceRepository.swift rename to Sources/ASCKit/CodeSigning/Devices/DeviceRepository.swift diff --git a/Sources/Infrastructure/CodeSigning/SDKBundleIDRepository.swift b/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift similarity index 85% rename from Sources/Infrastructure/CodeSigning/SDKBundleIDRepository.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift index b848f8b9..2f666abc 100644 --- a/Sources/Infrastructure/CodeSigning/SDKBundleIDRepository.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKBundleIDRepository: BundleIDRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKBundleIDRepository: BundleIDRepository, @unchecked Sendable { self.client = client } - public func listBundleIDs(platform: Domain.BundleIDPlatform?, identifier: String?) async throws -> [Domain.BundleID] { + public func listBundleIDs(platform: ASCKit.BundleIDPlatform?, identifier: String?) async throws -> [ASCKit.BundleID] { let filterPlatform = platform.flatMap { APIEndpoint.V1.BundleIDs.GetParameters.FilterPlatform(rawValue: $0.rawValue) } @@ -23,7 +22,7 @@ public struct SDKBundleIDRepository: BundleIDRepository, @unchecked Sendable { return pages.flatMap(\.data).map(mapBundleID) } - public func createBundleID(name: String, identifier: String, platform: Domain.BundleIDPlatform) async throws -> Domain.BundleID { + public func createBundleID(name: String, identifier: String, platform: ASCKit.BundleIDPlatform) async throws -> ASCKit.BundleID { guard let sdkPlatform = AppStoreConnect_Swift_SDK.BundleIDPlatform(rawValue: platform.rawValue) else { throw APIError.unknown("Unsupported platform: \(platform.rawValue)") } @@ -41,11 +40,11 @@ public struct SDKBundleIDRepository: BundleIDRepository, @unchecked Sendable { // MARK: - Mapper - private func mapBundleID(_ sdkBundleID: AppStoreConnect_Swift_SDK.BundleID) -> Domain.BundleID { + private func mapBundleID(_ sdkBundleID: AppStoreConnect_Swift_SDK.BundleID) -> ASCKit.BundleID { let platform = sdkBundleID.attributes?.platform.flatMap { - Domain.BundleIDPlatform(rawValue: $0.rawValue) + ASCKit.BundleIDPlatform(rawValue: $0.rawValue) } ?? .universal - return Domain.BundleID( + return ASCKit.BundleID( id: sdkBundleID.id, name: sdkBundleID.attributes?.name ?? "", identifier: sdkBundleID.attributes?.identifier ?? "", diff --git a/Sources/Infrastructure/CodeSigning/SDKCertificateRepository.swift b/Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift similarity index 81% rename from Sources/Infrastructure/CodeSigning/SDKCertificateRepository.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift index d0e95d13..81c685f0 100644 --- a/Sources/Infrastructure/CodeSigning/SDKCertificateRepository.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKCertificateRepository: CertificateRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKCertificateRepository: CertificateRepository, @unchecked Sendab self.client = client } - public func listCertificates(certificateType: Domain.CertificateType?, limit: Int?) async throws -> [Domain.Certificate] { + public func listCertificates(certificateType: ASCKit.CertificateType?, limit: Int?) async throws -> [ASCKit.Certificate] { let filterType = certificateType.flatMap { APIEndpoint.V1.Certificates.GetParameters.FilterCertificateType(rawValue: $0.rawValue) } @@ -20,7 +19,7 @@ public struct SDKCertificateRepository: CertificateRepository, @unchecked Sendab return response.data.map(mapCertificate) } - public func createCertificate(certificateType: Domain.CertificateType, csrContent: String) async throws -> Domain.Certificate { + public func createCertificate(certificateType: ASCKit.CertificateType, csrContent: String) async throws -> ASCKit.Certificate { guard let sdkType = AppStoreConnect_Swift_SDK.CertificateType(rawValue: certificateType.rawValue) else { throw APIError.unknown("Unsupported certificate type: \(certificateType.rawValue)") } @@ -38,14 +37,14 @@ public struct SDKCertificateRepository: CertificateRepository, @unchecked Sendab // MARK: - Mapper - private func mapCertificate(_ sdkCert: AppStoreConnect_Swift_SDK.Certificate) -> Domain.Certificate { + private func mapCertificate(_ sdkCert: AppStoreConnect_Swift_SDK.Certificate) -> ASCKit.Certificate { let certType = sdkCert.attributes?.certificateType.flatMap { - Domain.CertificateType(rawValue: $0.rawValue) + ASCKit.CertificateType(rawValue: $0.rawValue) } ?? .distribution let platform = sdkCert.attributes?.platform.flatMap { - Domain.BundleIDPlatform(rawValue: $0.rawValue) + ASCKit.BundleIDPlatform(rawValue: $0.rawValue) } - return Domain.Certificate( + return ASCKit.Certificate( id: sdkCert.id, name: sdkCert.attributes?.name ?? "", certificateType: certType, diff --git a/Sources/Infrastructure/CodeSigning/SDKDeviceRepository.swift b/Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift similarity index 83% rename from Sources/Infrastructure/CodeSigning/SDKDeviceRepository.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift index 936d37da..5af1044a 100644 --- a/Sources/Infrastructure/CodeSigning/SDKDeviceRepository.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKDeviceRepository: DeviceRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKDeviceRepository: DeviceRepository, @unchecked Sendable { self.client = client } - public func listDevices(platform: Domain.BundleIDPlatform?) async throws -> [Domain.Device] { + public func listDevices(platform: ASCKit.BundleIDPlatform?) async throws -> [ASCKit.Device] { let filterPlatform = platform.flatMap { APIEndpoint.V1.Devices.GetParameters.FilterPlatform(rawValue: $0.rawValue) } @@ -22,7 +21,7 @@ public struct SDKDeviceRepository: DeviceRepository, @unchecked Sendable { return pages.flatMap(\.data).map(mapDevice) } - public func registerDevice(name: String, udid: String, platform: Domain.BundleIDPlatform) async throws -> Domain.Device { + public func registerDevice(name: String, udid: String, platform: ASCKit.BundleIDPlatform) async throws -> ASCKit.Device { guard let sdkPlatform = AppStoreConnect_Swift_SDK.BundleIDPlatform(rawValue: platform.rawValue) else { throw APIError.unknown("Unsupported platform: \(platform.rawValue)") } @@ -36,17 +35,17 @@ public struct SDKDeviceRepository: DeviceRepository, @unchecked Sendable { // MARK: - Mapper - private func mapDevice(_ sdkDevice: AppStoreConnect_Swift_SDK.Device) -> Domain.Device { + private func mapDevice(_ sdkDevice: AppStoreConnect_Swift_SDK.Device) -> ASCKit.Device { let deviceClass = sdkDevice.attributes?.deviceClass.flatMap { - Domain.DeviceClass(rawValue: $0.rawValue) + ASCKit.DeviceClass(rawValue: $0.rawValue) } ?? .iPhone let platform = sdkDevice.attributes?.platform.flatMap { - Domain.BundleIDPlatform(rawValue: $0.rawValue) + ASCKit.BundleIDPlatform(rawValue: $0.rawValue) } ?? .iOS let status = sdkDevice.attributes?.status.flatMap { - Domain.DeviceStatus(rawValue: $0.rawValue) + ASCKit.DeviceStatus(rawValue: $0.rawValue) } ?? .enabled - return Domain.Device( + return ASCKit.Device( id: sdkDevice.id, name: sdkDevice.attributes?.name ?? "", udid: sdkDevice.attributes?.udid ?? "", diff --git a/Sources/Infrastructure/CodeSigning/SDKProfileRepository.swift b/Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift similarity index 90% rename from Sources/Infrastructure/CodeSigning/SDKProfileRepository.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift index 3edaa72d..c9783b83 100644 --- a/Sources/Infrastructure/CodeSigning/SDKProfileRepository.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKProfileRepository: ProfileRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct SDKProfileRepository: ProfileRepository, @unchecked Sendable { self.client = client } - public func listProfiles(bundleIdId: String?, profileType: Domain.ProfileType?) async throws -> [Domain.Profile] { + public func listProfiles(bundleIdId: String?, profileType: ASCKit.ProfileType?) async throws -> [ASCKit.Profile] { if let bundleIdId { // Use the bundle ID relationship endpoint for server-side filtering let pages = try await client.requestAllPages( @@ -38,11 +37,11 @@ public struct SDKProfileRepository: ProfileRepository, @unchecked Sendable { public func createProfile( name: String, - profileType: Domain.ProfileType, + profileType: ASCKit.ProfileType, bundleIdId: String, certificateIds: [String], deviceIds: [String] - ) async throws -> Domain.Profile { + ) async throws -> ASCKit.Profile { guard let sdkProfileType = ProfileCreateRequest.Data.Attributes.ProfileType(rawValue: profileType.rawValue) else { throw APIError.unknown("Unsupported profile type: \(profileType.rawValue)") } @@ -71,14 +70,14 @@ public struct SDKProfileRepository: ProfileRepository, @unchecked Sendable { private func mapProfile( _ sdkProfile: AppStoreConnect_Swift_SDK.Profile, bundleIdId: String - ) -> Domain.Profile { + ) -> ASCKit.Profile { let profileType = sdkProfile.attributes?.profileType.flatMap { - Domain.ProfileType(rawValue: $0.rawValue) + ASCKit.ProfileType(rawValue: $0.rawValue) } ?? .iosAppStore let profileState = sdkProfile.attributes?.profileState.flatMap { - Domain.ProfileState(rawValue: $0.rawValue) + ASCKit.ProfileState(rawValue: $0.rawValue) } ?? .active - return Domain.Profile( + return ASCKit.Profile( id: sdkProfile.id, name: sdkProfile.attributes?.name ?? "", profileType: profileType, diff --git a/Sources/Domain/CodeSigning/Profiles/Profile.swift b/Sources/ASCKit/CodeSigning/Profiles/Profile.swift similarity index 100% rename from Sources/Domain/CodeSigning/Profiles/Profile.swift rename to Sources/ASCKit/CodeSigning/Profiles/Profile.swift diff --git a/Sources/Domain/CodeSigning/Profiles/ProfileRepository.swift b/Sources/ASCKit/CodeSigning/Profiles/ProfileRepository.swift similarity index 100% rename from Sources/Domain/CodeSigning/Profiles/ProfileRepository.swift rename to Sources/ASCKit/CodeSigning/Profiles/ProfileRepository.swift diff --git a/Sources/Domain/GameCenter/GameCenter+RESTRoutes.swift b/Sources/ASCKit/GameCenter/GameCenter+RESTRoutes.swift similarity index 100% rename from Sources/Domain/GameCenter/GameCenter+RESTRoutes.swift rename to Sources/ASCKit/GameCenter/GameCenter+RESTRoutes.swift diff --git a/Sources/Domain/GameCenter/GameCenterAchievement.swift b/Sources/ASCKit/GameCenter/GameCenterAchievement.swift similarity index 100% rename from Sources/Domain/GameCenter/GameCenterAchievement.swift rename to Sources/ASCKit/GameCenter/GameCenterAchievement.swift diff --git a/Sources/Domain/GameCenter/GameCenterDetail.swift b/Sources/ASCKit/GameCenter/GameCenterDetail.swift similarity index 100% rename from Sources/Domain/GameCenter/GameCenterDetail.swift rename to Sources/ASCKit/GameCenter/GameCenterDetail.swift diff --git a/Sources/Domain/GameCenter/GameCenterLeaderboard.swift b/Sources/ASCKit/GameCenter/GameCenterLeaderboard.swift similarity index 100% rename from Sources/Domain/GameCenter/GameCenterLeaderboard.swift rename to Sources/ASCKit/GameCenter/GameCenterLeaderboard.swift diff --git a/Sources/Domain/GameCenter/GameCenterRepository.swift b/Sources/ASCKit/GameCenter/GameCenterRepository.swift similarity index 100% rename from Sources/Domain/GameCenter/GameCenterRepository.swift rename to Sources/ASCKit/GameCenter/GameCenterRepository.swift diff --git a/Sources/Infrastructure/GameCenter/SDKGameCenterRepository.swift b/Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift similarity index 86% rename from Sources/Infrastructure/GameCenter/SDKGameCenterRepository.swift rename to Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift index 9b3e5e0f..de9fa1bb 100644 --- a/Sources/Infrastructure/GameCenter/SDKGameCenterRepository.swift +++ b/Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable { private let client: any APIClient @@ -10,7 +9,7 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable // MARK: - Detail - public func getDetail(appId: String) async throws -> Domain.GameCenterDetail { + public func getDetail(appId: String) async throws -> ASCKit.GameCenterDetail { let request = APIEndpoint.v1.apps.id(appId).gameCenterDetail.get() let response = try await client.request(request) return mapDetail(response.data, appId: appId) @@ -18,7 +17,7 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable // MARK: - Achievements - public func listAchievements(gameCenterDetailId: String) async throws -> [Domain.GameCenterAchievement] { + public func listAchievements(gameCenterDetailId: String) async throws -> [ASCKit.GameCenterAchievement] { let request = APIEndpoint.v1.gameCenterDetails.id(gameCenterDetailId).gameCenterAchievements.get() let response = try await client.request(request) return response.data.map { mapAchievement($0, gameCenterDetailId: gameCenterDetailId) } @@ -31,7 +30,7 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable points: Int, isShowBeforeEarned: Bool, isRepeatable: Bool - ) async throws -> Domain.GameCenterAchievement { + ) async throws -> ASCKit.GameCenterAchievement { let body = GameCenterAchievementCreateRequest(data: .init( type: .gameCenterAchievements, attributes: .init( @@ -55,7 +54,7 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable // MARK: - Leaderboards - public func listLeaderboards(gameCenterDetailId: String) async throws -> [Domain.GameCenterLeaderboard] { + public func listLeaderboards(gameCenterDetailId: String) async throws -> [ASCKit.GameCenterLeaderboard] { let request = APIEndpoint.v1.gameCenterDetails.id(gameCenterDetailId).gameCenterLeaderboards.get() let response = try await client.request(request) return response.data.map { mapLeaderboard($0, gameCenterDetailId: gameCenterDetailId) } @@ -65,9 +64,9 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable gameCenterDetailId: String, referenceName: String, vendorIdentifier: String, - scoreSortType: Domain.ScoreSortType, - submissionType: Domain.LeaderboardSubmissionType - ) async throws -> Domain.GameCenterLeaderboard { + scoreSortType: ASCKit.ScoreSortType, + submissionType: ASCKit.LeaderboardSubmissionType + ) async throws -> ASCKit.GameCenterLeaderboard { let body = GameCenterLeaderboardCreateRequest(data: .init( type: .gameCenterLeaderboards, attributes: .init( @@ -91,8 +90,8 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable // MARK: - Mappers - private func mapDetail(_ sdk: AppStoreConnect_Swift_SDK.GameCenterDetail, appId: String) -> Domain.GameCenterDetail { - Domain.GameCenterDetail( + private func mapDetail(_ sdk: AppStoreConnect_Swift_SDK.GameCenterDetail, appId: String) -> ASCKit.GameCenterDetail { + ASCKit.GameCenterDetail( id: sdk.id, appId: appId, isArcadeEnabled: sdk.attributes?.isArcadeEnabled ?? false @@ -102,8 +101,8 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable private func mapAchievement( _ sdk: AppStoreConnect_Swift_SDK.GameCenterAchievement, gameCenterDetailId: String - ) -> Domain.GameCenterAchievement { - Domain.GameCenterAchievement( + ) -> ASCKit.GameCenterAchievement { + ASCKit.GameCenterAchievement( id: sdk.id, gameCenterDetailId: gameCenterDetailId, referenceName: sdk.attributes?.referenceName ?? "", @@ -118,8 +117,8 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable private func mapLeaderboard( _ sdk: AppStoreConnect_Swift_SDK.GameCenterLeaderboard, gameCenterDetailId: String - ) -> Domain.GameCenterLeaderboard { - Domain.GameCenterLeaderboard( + ) -> ASCKit.GameCenterLeaderboard { + ASCKit.GameCenterLeaderboard( id: sdk.id, gameCenterDetailId: gameCenterDetailId, referenceName: sdk.attributes?.referenceName ?? "", @@ -130,28 +129,28 @@ public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable ) } - private func mapScoreSortTypeForCreate(_ type: Domain.ScoreSortType) -> AppStoreConnect_Swift_SDK.GameCenterLeaderboardCreateRequest.Data.Attributes.ScoreSortType { + private func mapScoreSortTypeForCreate(_ type: ASCKit.ScoreSortType) -> AppStoreConnect_Swift_SDK.GameCenterLeaderboardCreateRequest.Data.Attributes.ScoreSortType { switch type { case .asc: return .asc case .desc: return .desc } } - private func mapScoreSortTypeFromSDK(_ type: AppStoreConnect_Swift_SDK.GameCenterLeaderboard.Attributes.ScoreSortType?) -> Domain.ScoreSortType { + private func mapScoreSortTypeFromSDK(_ type: AppStoreConnect_Swift_SDK.GameCenterLeaderboard.Attributes.ScoreSortType?) -> ASCKit.ScoreSortType { switch type { case .asc: return .asc case .desc, .none: return .desc } } - private func mapSubmissionTypeForCreate(_ type: Domain.LeaderboardSubmissionType) -> AppStoreConnect_Swift_SDK.GameCenterLeaderboardCreateRequest.Data.Attributes.SubmissionType { + private func mapSubmissionTypeForCreate(_ type: ASCKit.LeaderboardSubmissionType) -> AppStoreConnect_Swift_SDK.GameCenterLeaderboardCreateRequest.Data.Attributes.SubmissionType { switch type { case .bestScore: return .bestScore case .mostRecentScore: return .mostRecentScore } } - private func mapSubmissionTypeFromSDK(_ type: AppStoreConnect_Swift_SDK.GameCenterLeaderboard.Attributes.SubmissionType?) -> Domain.LeaderboardSubmissionType { + private func mapSubmissionTypeFromSDK(_ type: AppStoreConnect_Swift_SDK.GameCenterLeaderboard.Attributes.SubmissionType?) -> ASCKit.LeaderboardSubmissionType { switch type { case .bestScore, .none: return .bestScore case .mostRecentScore: return .mostRecentScore diff --git a/Sources/Domain/GameCenter/Moderation/GameCenterModerationRepository.swift b/Sources/ASCKit/GameCenter/Moderation/GameCenterModerationRepository.swift similarity index 100% rename from Sources/Domain/GameCenter/Moderation/GameCenterModerationRepository.swift rename to Sources/ASCKit/GameCenter/Moderation/GameCenterModerationRepository.swift diff --git a/Sources/Domain/GameCenter/Moderation/GameCenterPlayer.swift b/Sources/ASCKit/GameCenter/Moderation/GameCenterPlayer.swift similarity index 100% rename from Sources/Domain/GameCenter/Moderation/GameCenterPlayer.swift rename to Sources/ASCKit/GameCenter/Moderation/GameCenterPlayer.swift diff --git a/Sources/Domain/GameCenter/Moderation/GameCenterScoreModeration.swift b/Sources/ASCKit/GameCenter/Moderation/GameCenterScoreModeration.swift similarity index 100% rename from Sources/Domain/GameCenter/Moderation/GameCenterScoreModeration.swift rename to Sources/ASCKit/GameCenter/Moderation/GameCenterScoreModeration.swift diff --git a/Sources/Infrastructure/GameCenter/Moderation/SDKGameCenterModerationRepository.swift b/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift similarity index 91% rename from Sources/Infrastructure/GameCenter/Moderation/SDKGameCenterModerationRepository.swift rename to Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift index b45fbb54..5621d4a0 100644 --- a/Sources/Infrastructure/GameCenter/Moderation/SDKGameCenterModerationRepository.swift +++ b/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, @unchecked Sendable { @@ -11,7 +10,7 @@ public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, // MARK: - Score moderations - public func listScoreModerations(leaderboardId: String, blockedOnly: Bool) async throws -> [Domain.GameCenterScoreModeration] { + public func listScoreModerations(leaderboardId: String, blockedOnly: Bool) async throws -> [ASCKit.GameCenterScoreModeration] { let pages = try await client.requestAllPages( APIEndpoint.v2.gameCenterLeaderboards.id(leaderboardId).gameCenterScoreModerations.get( parameters: .init(isExistsBlocked: blockedOnly ? true : nil, limit: 200, include: [.player]) @@ -25,7 +24,7 @@ public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, return pages.flatMap(\.data).map { mapScore($0, leaderboardId: leaderboardId, players: players) } } - public func updateScoreModeration(id: String, isBlocked: Bool) async throws -> Domain.GameCenterScoreModeration { + public func updateScoreModeration(id: String, isBlocked: Bool) async throws -> ASCKit.GameCenterScoreModeration { let body = GameCenterScoreModerationUpdateRequest(data: .init( type: .gameCenterScoreModerations, id: id, attributes: .init(isBlocked: isBlocked) )) @@ -39,7 +38,7 @@ public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, // MARK: - Players - public func listBlockedPlayers(gameCenterDetailId: String) async throws -> [Domain.GameCenterPlayer] { + public func listBlockedPlayers(gameCenterDetailId: String) async throws -> [ASCKit.GameCenterPlayer] { let pages = try await client.requestAllPages( APIEndpoint.v1.gameCenterDetails.id(gameCenterDetailId).blockedPlayers.get(limit: 200), nextCursor: { $0.meta?.paging.nextCursor } @@ -48,7 +47,7 @@ public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, return pages.flatMap(\.data).map { mapPlayer($0, gameCenterDetailId: gameCenterDetailId, defaultBlocked: true) } } - public func updatePlayer(id: String, isBlocked: Bool) async throws -> Domain.GameCenterPlayer { + public func updatePlayer(id: String, isBlocked: Bool) async throws -> ASCKit.GameCenterPlayer { let body = GameCenterDetailPlayerUpdateRequest(data: .init( type: .gameCenterDetailPlayers, id: id, attributes: .init(isBlocked: isBlocked) )) @@ -63,10 +62,10 @@ public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, leaderboardId: String?, players: [String: AppStoreConnect_Swift_SDK.GameCenterDetailPlayer], defaultBlocked: Bool = false - ) -> Domain.GameCenterScoreModeration { + ) -> ASCKit.GameCenterScoreModeration { let playerId = sdk.relationships?.player?.data?.id let player = playerId.flatMap { players[$0] } - return Domain.GameCenterScoreModeration( + return ASCKit.GameCenterScoreModeration( id: sdk.id, leaderboardId: leaderboardId, rank: sdk.attributes?.rank, @@ -86,8 +85,8 @@ public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, _ sdk: AppStoreConnect_Swift_SDK.GameCenterDetailPlayer, gameCenterDetailId: String?, defaultBlocked: Bool - ) -> Domain.GameCenterPlayer { - Domain.GameCenterPlayer( + ) -> ASCKit.GameCenterPlayer { + ASCKit.GameCenterPlayer( id: sdk.id, gameCenterDetailId: gameCenterDetailId, nickname: sdk.attributes?.nickname, diff --git a/Sources/Domain/Iris/AppBundles/AppBundle.swift b/Sources/ASCKit/Iris/AppBundles/AppBundle.swift similarity index 100% rename from Sources/Domain/Iris/AppBundles/AppBundle.swift rename to Sources/ASCKit/Iris/AppBundles/AppBundle.swift diff --git a/Sources/Infrastructure/Iris/AppBundles/IrisCreateAppDocument.swift b/Sources/ASCKit/Iris/AppBundles/Internal/IrisCreateAppDocument.swift similarity index 100% rename from Sources/Infrastructure/Iris/AppBundles/IrisCreateAppDocument.swift rename to Sources/ASCKit/Iris/AppBundles/Internal/IrisCreateAppDocument.swift diff --git a/Sources/Infrastructure/Iris/AppBundles/IrisSDKAppBundleRepository.swift b/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift similarity index 99% rename from Sources/Infrastructure/Iris/AppBundles/IrisSDKAppBundleRepository.swift rename to Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift index a19f3ff6..41ae4b24 100644 --- a/Sources/Infrastructure/Iris/AppBundles/IrisSDKAppBundleRepository.swift +++ b/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Implements `IrisAppBundleRepository` via the iris private API. diff --git a/Sources/Domain/Iris/AppBundles/IrisAppBundleRepository.swift b/Sources/ASCKit/Iris/AppBundles/IrisAppBundleRepository.swift similarity index 100% rename from Sources/Domain/Iris/AppBundles/IrisAppBundleRepository.swift rename to Sources/ASCKit/Iris/AppBundles/IrisAppBundleRepository.swift diff --git a/Sources/Infrastructure/Iris/InAppPurchases/IrisSDKInAppPurchaseStateRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift similarity index 99% rename from Sources/Infrastructure/Iris/InAppPurchases/IrisSDKInAppPurchaseStateRepository.swift rename to Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift index 34b2d799..74328ef1 100644 --- a/Sources/Infrastructure/Iris/InAppPurchases/IrisSDKInAppPurchaseStateRepository.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Implements `IrisInAppPurchaseStateRepository` against diff --git a/Sources/Infrastructure/Iris/InAppPurchases/IrisSDKInAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift similarity index 99% rename from Sources/Infrastructure/Iris/InAppPurchases/IrisSDKInAppPurchaseSubmissionRepository.swift rename to Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift index 51cf1b38..ddbef382 100644 --- a/Sources/Infrastructure/Iris/InAppPurchases/IrisSDKInAppPurchaseSubmissionRepository.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Implements `IrisInAppPurchaseSubmissionRepository` via the iris private API. diff --git a/Sources/Domain/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift similarity index 100% rename from Sources/Domain/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift rename to Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift diff --git a/Sources/Domain/Iris/InAppPurchases/IrisInAppPurchaseSubmission.swift b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmission.swift similarity index 100% rename from Sources/Domain/Iris/InAppPurchases/IrisInAppPurchaseSubmission.swift rename to Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmission.swift diff --git a/Sources/Domain/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift similarity index 100% rename from Sources/Domain/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift rename to Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift diff --git a/Sources/Infrastructure/Iris/Auth/CompositeIrisCookieProvider.swift b/Sources/ASCKit/Iris/Internal/Auth/CompositeIrisCookieProvider.swift similarity index 98% rename from Sources/Infrastructure/Iris/Auth/CompositeIrisCookieProvider.swift rename to Sources/ASCKit/Iris/Internal/Auth/CompositeIrisCookieProvider.swift index e07bb009..bbdbdd1d 100644 --- a/Sources/Infrastructure/Iris/Auth/CompositeIrisCookieProvider.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/CompositeIrisCookieProvider.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Tries each provider in order; the first one that successfully resolves wins. diff --git a/Sources/Infrastructure/Iris/Auth/FileIrisSessionRepository.swift b/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift similarity index 99% rename from Sources/Infrastructure/Iris/Auth/FileIrisSessionRepository.swift rename to Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift index d883f906..1ba190c0 100644 --- a/Sources/Infrastructure/Iris/Auth/FileIrisSessionRepository.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Persists `IrisAuthSession` to `~/.asc/iris/session.json` with `0600` permissions. diff --git a/Sources/Infrastructure/Iris/Auth/IdmsaAPIClient.swift b/Sources/ASCKit/Iris/Internal/Auth/IdmsaAPIClient.swift similarity index 99% rename from Sources/Infrastructure/Iris/Auth/IdmsaAPIClient.swift rename to Sources/ASCKit/Iris/Internal/Auth/IdmsaAPIClient.swift index 919266ce..b4b3af21 100644 --- a/Sources/Infrastructure/Iris/Auth/IdmsaAPIClient.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/IdmsaAPIClient.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// HTTP client for `https://idmsa.apple.com/appleauth/auth/...`. Knows nothing about diff --git a/Sources/Infrastructure/Iris/Auth/IrisAuthSDKRepository.swift b/Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift similarity index 98% rename from Sources/Infrastructure/Iris/Auth/IrisAuthSDKRepository.swift rename to Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift index 0f90d270..11aafeaa 100644 --- a/Sources/Infrastructure/Iris/Auth/IrisAuthSDKRepository.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift @@ -1,8 +1,7 @@ -import Domain import Foundation /// Drives the full Apple ID SRP login + olympus session lookup, conforming to -/// `Domain.IrisAuthRepository`. Composition root for all the Apple-specific bits: +/// `ASCKit.IrisAuthRepository`. Composition root for all the Apple-specific bits: /// `AppleSRPClient` for crypto, `IdmsaAPIClient` for `idmsa.apple.com`, `OlympusClient` /// for ASC team metadata. public struct IrisAuthSDKRepository: IrisAuthRepository, @unchecked Sendable { diff --git a/Sources/Infrastructure/Iris/Auth/OlympusClient.swift b/Sources/ASCKit/Iris/Internal/Auth/OlympusClient.swift similarity index 100% rename from Sources/Infrastructure/Iris/Auth/OlympusClient.swift rename to Sources/ASCKit/Iris/Internal/Auth/OlympusClient.swift diff --git a/Sources/Infrastructure/Iris/Auth/SRP/AppleHashcash.swift b/Sources/ASCKit/Iris/Internal/Auth/SRP/AppleHashcash.swift similarity index 100% rename from Sources/Infrastructure/Iris/Auth/SRP/AppleHashcash.swift rename to Sources/ASCKit/Iris/Internal/Auth/SRP/AppleHashcash.swift diff --git a/Sources/Infrastructure/Iris/Auth/SRP/AppleSRPClient.swift b/Sources/ASCKit/Iris/Internal/Auth/SRP/AppleSRPClient.swift similarity index 100% rename from Sources/Infrastructure/Iris/Auth/SRP/AppleSRPClient.swift rename to Sources/ASCKit/Iris/Internal/Auth/SRP/AppleSRPClient.swift diff --git a/Sources/Infrastructure/Iris/Auth/StoredSRPIrisCookieProvider.swift b/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift similarity index 98% rename from Sources/Infrastructure/Iris/Auth/StoredSRPIrisCookieProvider.swift rename to Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift index 18605357..897a5957 100644 --- a/Sources/Infrastructure/Iris/Auth/StoredSRPIrisCookieProvider.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Surfaces an `IrisAuthSession` previously written by `asc iris auth login` as an diff --git a/Sources/Infrastructure/Iris/BrowserIrisCookieProvider.swift b/Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift similarity index 99% rename from Sources/Infrastructure/Iris/BrowserIrisCookieProvider.swift rename to Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift index 16f72db3..bafedc2a 100644 --- a/Sources/Infrastructure/Iris/BrowserIrisCookieProvider.swift +++ b/Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift @@ -1,4 +1,3 @@ -import Domain import Foundation import SweetCookieKit diff --git a/Sources/Infrastructure/Iris/IrisClient.swift b/Sources/ASCKit/Iris/Internal/IrisClient.swift similarity index 99% rename from Sources/Infrastructure/Iris/IrisClient.swift rename to Sources/ASCKit/Iris/Internal/IrisClient.swift index eb744388..756cdcb9 100644 --- a/Sources/Infrastructure/Iris/IrisClient.swift +++ b/Sources/ASCKit/Iris/Internal/IrisClient.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Generic HTTP client for the iris private API. diff --git a/Sources/Domain/Iris/IrisCookieProvider.swift b/Sources/ASCKit/Iris/IrisCookieProvider.swift similarity index 100% rename from Sources/Domain/Iris/IrisCookieProvider.swift rename to Sources/ASCKit/Iris/IrisCookieProvider.swift diff --git a/Sources/Domain/Iris/IrisSession.swift b/Sources/ASCKit/Iris/IrisSession.swift similarity index 100% rename from Sources/Domain/Iris/IrisSession.swift rename to Sources/ASCKit/Iris/IrisSession.swift diff --git a/Sources/Domain/Iris/IrisStatus.swift b/Sources/ASCKit/Iris/IrisStatus.swift similarity index 100% rename from Sources/Domain/Iris/IrisStatus.swift rename to Sources/ASCKit/Iris/IrisStatus.swift diff --git a/Sources/Infrastructure/Iris/ResolutionCenter/IrisSDKResolutionCenterRepository.swift b/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift similarity index 95% rename from Sources/Infrastructure/Iris/ResolutionCenter/IrisSDKResolutionCenterRepository.swift rename to Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift index 25a6db6b..d7f30501 100644 --- a/Sources/Infrastructure/Iris/ResolutionCenter/IrisSDKResolutionCenterRepository.swift +++ b/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Implements `IrisResolutionCenterRepository` via the iris private API. @@ -19,7 +18,7 @@ public struct IrisSDKResolutionCenterRepository: IrisResolutionCenterRepository, public func getResolution( session: IrisSession, submissionId: String - ) async throws -> Domain.ResolutionCenterDetail { + ) async throws -> ASCKit.ResolutionCenterDetail { let (threadsData, _) = try await client.get( path: "resolutionCenterThreads", queryItems: [URLQueryItem(name: "filter[reviewSubmission]", value: submissionId)], @@ -63,10 +62,10 @@ public struct IrisSDKResolutionCenterRepository: IrisResolutionCenterRepository, .filter { $0.type == "resolutionCenterMessageAttachments" } .map { ($0.id, $0) } ) - let attachments: [Domain.ResolutionCenterAttachment] = messages.data.flatMap { message in + let attachments: [ASCKit.ResolutionCenterAttachment] = messages.data.flatMap { message in (message.relationships?.resolutionCenterMessageAttachments?.data ?? []).compactMap { ref in guard let included = attachmentsById[ref.id] else { return nil } - return Domain.ResolutionCenterAttachment( + return ASCKit.ResolutionCenterAttachment( id: ref.id, messageId: message.id, fileName: included.attributes?.fileName ?? ref.id, @@ -76,14 +75,14 @@ public struct IrisSDKResolutionCenterRepository: IrisResolutionCenterRepository, } } - return Domain.ResolutionCenterDetail( + return ASCKit.ResolutionCenterDetail( id: thread.id, submissionId: submissionId, threadState: thread.attributes?.state, messages: messages.data.map { message in let actorId = message.relationships?.fromActor?.data?.id let actor = actorId.flatMap { actorsById[$0] } - return Domain.ResolutionCenterMessage( + return ASCKit.ResolutionCenterMessage( id: message.id, threadId: thread.id, createdDate: message.attributes?.createdDate.flatMap(Self.parseDate), @@ -94,7 +93,7 @@ public struct IrisSDKResolutionCenterRepository: IrisResolutionCenterRepository, rejectionReasons: rejections.data.flatMap { rejection in let reasons = rejection.attributes?.reasons ?? [] return reasons.enumerated().map { index, reason in - Domain.ReviewRejectionReason( + ASCKit.ReviewRejectionReason( id: reasons.count > 1 ? "\(rejection.id)-\(index)" : rejection.id, section: reason.reasonSection, descriptionText: reason.reasonDescription, @@ -110,7 +109,7 @@ public struct IrisSDKResolutionCenterRepository: IrisResolutionCenterRepository, session: IrisSession, url: String ) async throws -> Data { - guard Domain.ResolutionCenterAttachment.isValidDownloadURL(url), + guard ASCKit.ResolutionCenterAttachment.isValidDownloadURL(url), let downloadURL = URL(string: url) else { throw IrisResolutionCenterError.invalidAttachmentURL(url) } diff --git a/Sources/Domain/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift b/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift similarity index 100% rename from Sources/Domain/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift rename to Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift diff --git a/Sources/Domain/Iris/ResolutionCenter/ResolutionCenterAttachment.swift b/Sources/ASCKit/Iris/ResolutionCenter/ResolutionCenterAttachment.swift similarity index 100% rename from Sources/Domain/Iris/ResolutionCenter/ResolutionCenterAttachment.swift rename to Sources/ASCKit/Iris/ResolutionCenter/ResolutionCenterAttachment.swift diff --git a/Sources/Domain/Iris/ResolutionCenter/ResolutionCenterDetail+RESTRoutes.swift b/Sources/ASCKit/Iris/ResolutionCenter/ResolutionCenterDetail+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Iris/ResolutionCenter/ResolutionCenterDetail+RESTRoutes.swift rename to Sources/ASCKit/Iris/ResolutionCenter/ResolutionCenterDetail+RESTRoutes.swift diff --git a/Sources/Domain/Iris/ResolutionCenter/ResolutionCenterDetail.swift b/Sources/ASCKit/Iris/ResolutionCenter/ResolutionCenterDetail.swift similarity index 100% rename from Sources/Domain/Iris/ResolutionCenter/ResolutionCenterDetail.swift rename to Sources/ASCKit/Iris/ResolutionCenter/ResolutionCenterDetail.swift diff --git a/Sources/Domain/Iris/ResolutionCenter/ResolutionCenterMessage.swift b/Sources/ASCKit/Iris/ResolutionCenter/ResolutionCenterMessage.swift similarity index 100% rename from Sources/Domain/Iris/ResolutionCenter/ResolutionCenterMessage.swift rename to Sources/ASCKit/Iris/ResolutionCenter/ResolutionCenterMessage.swift diff --git a/Sources/Domain/Iris/ResolutionCenter/ReviewRejectionReason.swift b/Sources/ASCKit/Iris/ResolutionCenter/ReviewRejectionReason.swift similarity index 100% rename from Sources/Domain/Iris/ResolutionCenter/ReviewRejectionReason.swift rename to Sources/ASCKit/Iris/ResolutionCenter/ReviewRejectionReason.swift diff --git a/Sources/Infrastructure/Plugins/GitHubPluginSource.swift b/Sources/ASCKit/Plugins/Internal/GitHubPluginSource.swift similarity index 99% rename from Sources/Infrastructure/Plugins/GitHubPluginSource.swift rename to Sources/ASCKit/Plugins/Internal/GitHubPluginSource.swift index 6c276a3e..f0ed3158 100644 --- a/Sources/Infrastructure/Plugins/GitHubPluginSource.swift +++ b/Sources/ASCKit/Plugins/Internal/GitHubPluginSource.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Fetches available plugins from a `registry.json` hosted in a GitHub repository. diff --git a/Sources/Infrastructure/Plugins/PluginMarketRepository.swift b/Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift similarity index 99% rename from Sources/Infrastructure/Plugins/PluginMarketRepository.swift rename to Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift index b8093b2b..7a3a6ada 100644 --- a/Sources/Infrastructure/Plugins/PluginMarketRepository.swift +++ b/Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation import ASCPlugin diff --git a/Sources/Domain/Plugins/Plugin.swift b/Sources/ASCKit/Plugins/Plugin.swift similarity index 100% rename from Sources/Domain/Plugins/Plugin.swift rename to Sources/ASCKit/Plugins/Plugin.swift diff --git a/Sources/Domain/Plugins/PluginRepository.swift b/Sources/ASCKit/Plugins/PluginRepository.swift similarity index 100% rename from Sources/Domain/Plugins/PluginRepository.swift rename to Sources/ASCKit/Plugins/PluginRepository.swift diff --git a/Sources/Domain/Plugins/PluginSource.swift b/Sources/ASCKit/Plugins/PluginSource.swift similarity index 100% rename from Sources/Domain/Plugins/PluginSource.swift rename to Sources/ASCKit/Plugins/PluginSource.swift diff --git a/Sources/Domain/Plugins/PluginUpdate.swift b/Sources/ASCKit/Plugins/PluginUpdate.swift similarity index 100% rename from Sources/Domain/Plugins/PluginUpdate.swift rename to Sources/ASCKit/Plugins/PluginUpdate.swift diff --git a/Sources/Infrastructure/Projects/FileProjectConfigStorage.swift b/Sources/ASCKit/Projects/Internal/FileProjectConfigStorage.swift similarity index 98% rename from Sources/Infrastructure/Projects/FileProjectConfigStorage.swift rename to Sources/ASCKit/Projects/Internal/FileProjectConfigStorage.swift index d75a17c6..c1aad9d4 100644 --- a/Sources/Infrastructure/Projects/FileProjectConfigStorage.swift +++ b/Sources/ASCKit/Projects/Internal/FileProjectConfigStorage.swift @@ -1,4 +1,3 @@ -import Domain import Foundation public struct FileProjectConfigStorage: ProjectConfigStorage { diff --git a/Sources/Domain/Projects/ProjectConfig.swift b/Sources/ASCKit/Projects/ProjectConfig.swift similarity index 100% rename from Sources/Domain/Projects/ProjectConfig.swift rename to Sources/ASCKit/Projects/ProjectConfig.swift diff --git a/Sources/Domain/Projects/ProjectConfigStorage.swift b/Sources/ASCKit/Projects/ProjectConfigStorage.swift similarity index 100% rename from Sources/Domain/Projects/ProjectConfigStorage.swift rename to Sources/ASCKit/Projects/ProjectConfigStorage.swift diff --git a/Sources/Domain/Reports/Analytics/AnalyticsFilter.swift b/Sources/ASCKit/Reports/Analytics/AnalyticsFilter.swift similarity index 100% rename from Sources/Domain/Reports/Analytics/AnalyticsFilter.swift rename to Sources/ASCKit/Reports/Analytics/AnalyticsFilter.swift diff --git a/Sources/Domain/Reports/Analytics/AnalyticsReport.swift b/Sources/ASCKit/Reports/Analytics/AnalyticsReport.swift similarity index 100% rename from Sources/Domain/Reports/Analytics/AnalyticsReport.swift rename to Sources/ASCKit/Reports/Analytics/AnalyticsReport.swift diff --git a/Sources/Domain/Reports/Analytics/AnalyticsReportInstance.swift b/Sources/ASCKit/Reports/Analytics/AnalyticsReportInstance.swift similarity index 100% rename from Sources/Domain/Reports/Analytics/AnalyticsReportInstance.swift rename to Sources/ASCKit/Reports/Analytics/AnalyticsReportInstance.swift diff --git a/Sources/Domain/Reports/Analytics/AnalyticsReportRepository.swift b/Sources/ASCKit/Reports/Analytics/AnalyticsReportRepository.swift similarity index 100% rename from Sources/Domain/Reports/Analytics/AnalyticsReportRepository.swift rename to Sources/ASCKit/Reports/Analytics/AnalyticsReportRepository.swift diff --git a/Sources/Domain/Reports/Analytics/AnalyticsReportRequest.swift b/Sources/ASCKit/Reports/Analytics/AnalyticsReportRequest.swift similarity index 100% rename from Sources/Domain/Reports/Analytics/AnalyticsReportRequest.swift rename to Sources/ASCKit/Reports/Analytics/AnalyticsReportRequest.swift diff --git a/Sources/Domain/Reports/Analytics/AnalyticsReportSegment.swift b/Sources/ASCKit/Reports/Analytics/AnalyticsReportSegment.swift similarity index 100% rename from Sources/Domain/Reports/Analytics/AnalyticsReportSegment.swift rename to Sources/ASCKit/Reports/Analytics/AnalyticsReportSegment.swift diff --git a/Sources/Infrastructure/Reports/Analytics/SDKAnalyticsReportRepository.swift b/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift similarity index 84% rename from Sources/Infrastructure/Reports/Analytics/SDKAnalyticsReportRepository.swift rename to Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift index 1322a85f..38e11fb7 100644 --- a/Sources/Infrastructure/Reports/Analytics/SDKAnalyticsReportRepository.swift +++ b/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecked Sendable { @@ -9,7 +8,7 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke self.client = client } - public func createRequest(appId: String, accessType: Domain.AnalyticsAccessType) async throws -> Domain.AnalyticsReportRequest { + public func createRequest(appId: String, accessType: ASCKit.AnalyticsAccessType) async throws -> ASCKit.AnalyticsReportRequest { let sdkAccessType: AnalyticsReportRequestCreateRequest.Data.Attributes.AccessType switch accessType { case .oneTimeSnapshot: sdkAccessType = .oneTimeSnapshot @@ -27,7 +26,7 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke return mapRequest(response.data, appId: appId) } - public func listRequests(appId: String, accessType: Domain.AnalyticsAccessType?) async throws -> [Domain.AnalyticsReportRequest] { + public func listRequests(appId: String, accessType: ASCKit.AnalyticsAccessType?) async throws -> [ASCKit.AnalyticsReportRequest] { let filterAccessType: [APIEndpoint.V1.Apps.WithID.AnalyticsReportRequests.GetParameters.FilterAccessType]? if let accessType { switch accessType { @@ -49,7 +48,7 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke try await client.request(APIEndpoint.v1.analyticsReportRequests.id(id).delete) } - public func listReports(requestId: String, category: Domain.AnalyticsCategory?) async throws -> [Domain.AnalyticsReport] { + public func listReports(requestId: String, category: ASCKit.AnalyticsCategory?) async throws -> [ASCKit.AnalyticsReport] { let filterCategory: [APIEndpoint.V1.AnalyticsReportRequests.WithID.Reports.GetParameters.FilterCategory]? if let category { switch category { @@ -70,7 +69,7 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke return response.data.map { mapReport($0, requestId: requestId) } } - public func listInstances(reportId: String, granularity: Domain.AnalyticsGranularity?) async throws -> [Domain.AnalyticsReportInstance] { + public func listInstances(reportId: String, granularity: ASCKit.AnalyticsGranularity?) async throws -> [ASCKit.AnalyticsReportInstance] { let filterGranularity: [APIEndpoint.V1.AnalyticsReports.WithID.Instances.GetParameters.FilterGranularity]? if let granularity { switch granularity { @@ -89,7 +88,7 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke return response.data.map { mapInstance($0, reportId: reportId) } } - public func listSegments(instanceId: String) async throws -> [Domain.AnalyticsReportSegment] { + public func listSegments(instanceId: String) async throws -> [ASCKit.AnalyticsReportSegment] { let endpoint = APIEndpoint.v1.analyticsReportInstances.id(instanceId).segments.get() let response = try await client.request(endpoint) return response.data.map { mapSegment($0, instanceId: instanceId) } @@ -100,13 +99,13 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke private func mapRequest( _ sdk: AppStoreConnect_Swift_SDK.AnalyticsReportRequest, appId: String - ) -> Domain.AnalyticsReportRequest { - let accessType: Domain.AnalyticsAccessType + ) -> ASCKit.AnalyticsReportRequest { + let accessType: ASCKit.AnalyticsAccessType switch sdk.attributes?.accessType { case .ongoing: accessType = .ongoing default: accessType = .oneTimeSnapshot } - return Domain.AnalyticsReportRequest( + return ASCKit.AnalyticsReportRequest( id: sdk.id, appId: appId, accessType: accessType, @@ -117,8 +116,8 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke private func mapReport( _ sdk: AppStoreConnect_Swift_SDK.AnalyticsReport, requestId: String - ) -> Domain.AnalyticsReport { - Domain.AnalyticsReport( + ) -> ASCKit.AnalyticsReport { + ASCKit.AnalyticsReport( id: sdk.id, requestId: requestId, name: sdk.attributes?.name, @@ -126,7 +125,7 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke ) } - private func mapCategory(_ sdk: AppStoreConnect_Swift_SDK.AnalyticsReport.Attributes.Category) -> Domain.AnalyticsCategory { + private func mapCategory(_ sdk: AppStoreConnect_Swift_SDK.AnalyticsReport.Attributes.Category) -> ASCKit.AnalyticsCategory { switch sdk { case .appUsage: return .appUsage case .appStoreEngagement: return .appStoreEngagement @@ -139,8 +138,8 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke private func mapInstance( _ sdk: AppStoreConnect_Swift_SDK.AnalyticsReportInstance, reportId: String - ) -> Domain.AnalyticsReportInstance { - Domain.AnalyticsReportInstance( + ) -> ASCKit.AnalyticsReportInstance { + ASCKit.AnalyticsReportInstance( id: sdk.id, reportId: reportId, granularity: sdk.attributes?.granularity.map { mapGranularity($0) }, @@ -148,7 +147,7 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke ) } - private func mapGranularity(_ sdk: AppStoreConnect_Swift_SDK.AnalyticsReportInstance.Attributes.Granularity) -> Domain.AnalyticsGranularity { + private func mapGranularity(_ sdk: AppStoreConnect_Swift_SDK.AnalyticsReportInstance.Attributes.Granularity) -> ASCKit.AnalyticsGranularity { switch sdk { case .daily: return .daily case .weekly: return .weekly @@ -159,8 +158,8 @@ public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecke private func mapSegment( _ sdk: AppStoreConnect_Swift_SDK.AnalyticsReportSegment, instanceId: String - ) -> Domain.AnalyticsReportSegment { - Domain.AnalyticsReportSegment( + ) -> ASCKit.AnalyticsReportSegment { + ASCKit.AnalyticsReportSegment( id: sdk.id, instanceId: instanceId, checksum: sdk.attributes?.checksum, diff --git a/Sources/Domain/Reports/FinanceReportFilter.swift b/Sources/ASCKit/Reports/FinanceReportFilter.swift similarity index 100% rename from Sources/Domain/Reports/FinanceReportFilter.swift rename to Sources/ASCKit/Reports/FinanceReportFilter.swift diff --git a/Sources/Infrastructure/Reports/SDKReportRepository.swift b/Sources/ASCKit/Reports/Internal/SDKReportRepository.swift similarity index 99% rename from Sources/Infrastructure/Reports/SDKReportRepository.swift rename to Sources/ASCKit/Reports/Internal/SDKReportRepository.swift index 2d717ce6..28cb1fa7 100644 --- a/Sources/Infrastructure/Reports/SDKReportRepository.swift +++ b/Sources/ASCKit/Reports/Internal/SDKReportRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKReportRepository: ReportRepository, @unchecked Sendable { diff --git a/Sources/Infrastructure/Reports/TSVParser.swift b/Sources/ASCKit/Reports/Internal/TSVParser.swift similarity index 100% rename from Sources/Infrastructure/Reports/TSVParser.swift rename to Sources/ASCKit/Reports/Internal/TSVParser.swift diff --git a/Sources/Domain/Reports/ReportRepository.swift b/Sources/ASCKit/Reports/ReportRepository.swift similarity index 100% rename from Sources/Domain/Reports/ReportRepository.swift rename to Sources/ASCKit/Reports/ReportRepository.swift diff --git a/Sources/Domain/Reports/SalesReportFilter.swift b/Sources/ASCKit/Reports/SalesReportFilter.swift similarity index 100% rename from Sources/Domain/Reports/SalesReportFilter.swift rename to Sources/ASCKit/Reports/SalesReportFilter.swift diff --git a/Sources/Domain/Screenshots/AppShotTemplate.swift b/Sources/ASCKit/Screenshots/AppShotTemplate.swift similarity index 100% rename from Sources/Domain/Screenshots/AppShotTemplate.swift rename to Sources/ASCKit/Screenshots/AppShotTemplate.swift diff --git a/Sources/Domain/Screenshots/AppShotsConfig.swift b/Sources/ASCKit/Screenshots/AppShotsConfig.swift similarity index 100% rename from Sources/Domain/Screenshots/AppShotsConfig.swift rename to Sources/ASCKit/Screenshots/AppShotsConfig.swift diff --git a/Sources/Domain/Screenshots/AppShotsConfigStorage.swift b/Sources/ASCKit/Screenshots/AppShotsConfigStorage.swift similarity index 100% rename from Sources/Domain/Screenshots/AppShotsConfigStorage.swift rename to Sources/ASCKit/Screenshots/AppShotsConfigStorage.swift diff --git a/Sources/Domain/Screenshots/Gallery/AppShot.swift b/Sources/ASCKit/Screenshots/Gallery/AppShot.swift similarity index 100% rename from Sources/Domain/Screenshots/Gallery/AppShot.swift rename to Sources/ASCKit/Screenshots/Gallery/AppShot.swift diff --git a/Sources/Domain/Screenshots/Gallery/Gallery.swift b/Sources/ASCKit/Screenshots/Gallery/Gallery.swift similarity index 100% rename from Sources/Domain/Screenshots/Gallery/Gallery.swift rename to Sources/ASCKit/Screenshots/Gallery/Gallery.swift diff --git a/Sources/Domain/Screenshots/Gallery/GalleryHTMLRenderer.swift b/Sources/ASCKit/Screenshots/Gallery/GalleryHTMLRenderer.swift similarity index 100% rename from Sources/Domain/Screenshots/Gallery/GalleryHTMLRenderer.swift rename to Sources/ASCKit/Screenshots/Gallery/GalleryHTMLRenderer.swift diff --git a/Sources/Domain/Screenshots/Gallery/GalleryPalette.swift b/Sources/ASCKit/Screenshots/Gallery/GalleryPalette.swift similarity index 100% rename from Sources/Domain/Screenshots/Gallery/GalleryPalette.swift rename to Sources/ASCKit/Screenshots/Gallery/GalleryPalette.swift diff --git a/Sources/Domain/Screenshots/Gallery/GalleryTemplate.swift b/Sources/ASCKit/Screenshots/Gallery/GalleryTemplate.swift similarity index 100% rename from Sources/Domain/Screenshots/Gallery/GalleryTemplate.swift rename to Sources/ASCKit/Screenshots/Gallery/GalleryTemplate.swift diff --git a/Sources/Domain/Screenshots/Gallery/GalleryTemplateRepository.swift b/Sources/ASCKit/Screenshots/Gallery/GalleryTemplateRepository.swift similarity index 100% rename from Sources/Domain/Screenshots/Gallery/GalleryTemplateRepository.swift rename to Sources/ASCKit/Screenshots/Gallery/GalleryTemplateRepository.swift diff --git a/Sources/Domain/Screenshots/Gallery/HTMLComposer.swift b/Sources/ASCKit/Screenshots/Gallery/HTMLComposer.swift similarity index 100% rename from Sources/Domain/Screenshots/Gallery/HTMLComposer.swift rename to Sources/ASCKit/Screenshots/Gallery/HTMLComposer.swift diff --git a/Sources/Domain/Screenshots/Gallery/Resources/keyframes.mustache b/Sources/ASCKit/Screenshots/Gallery/Resources/keyframes.mustache similarity index 100% rename from Sources/Domain/Screenshots/Gallery/Resources/keyframes.mustache rename to Sources/ASCKit/Screenshots/Gallery/Resources/keyframes.mustache diff --git a/Sources/Domain/Screenshots/Gallery/Resources/page-wrapper.mustache b/Sources/ASCKit/Screenshots/Gallery/Resources/page-wrapper.mustache similarity index 100% rename from Sources/Domain/Screenshots/Gallery/Resources/page-wrapper.mustache rename to Sources/ASCKit/Screenshots/Gallery/Resources/page-wrapper.mustache diff --git a/Sources/Domain/Screenshots/Gallery/Resources/preview-page.mustache b/Sources/ASCKit/Screenshots/Gallery/Resources/preview-page.mustache similarity index 100% rename from Sources/Domain/Screenshots/Gallery/Resources/preview-page.mustache rename to Sources/ASCKit/Screenshots/Gallery/Resources/preview-page.mustache diff --git a/Sources/Domain/Screenshots/Gallery/Resources/preview-screen.mustache b/Sources/ASCKit/Screenshots/Gallery/Resources/preview-screen.mustache similarity index 100% rename from Sources/Domain/Screenshots/Gallery/Resources/preview-screen.mustache rename to Sources/ASCKit/Screenshots/Gallery/Resources/preview-screen.mustache diff --git a/Sources/Domain/Screenshots/Gallery/Resources/screen.mustache b/Sources/ASCKit/Screenshots/Gallery/Resources/screen.mustache similarity index 100% rename from Sources/Domain/Screenshots/Gallery/Resources/screen.mustache rename to Sources/ASCKit/Screenshots/Gallery/Resources/screen.mustache diff --git a/Sources/Domain/Screenshots/Gallery/Resources/theme-vars.mustache b/Sources/ASCKit/Screenshots/Gallery/Resources/theme-vars.mustache similarity index 100% rename from Sources/Domain/Screenshots/Gallery/Resources/theme-vars.mustache rename to Sources/ASCKit/Screenshots/Gallery/Resources/theme-vars.mustache diff --git a/Sources/Domain/Screenshots/Gallery/Resources/wireframe.mustache b/Sources/ASCKit/Screenshots/Gallery/Resources/wireframe.mustache similarity index 100% rename from Sources/Domain/Screenshots/Gallery/Resources/wireframe.mustache rename to Sources/ASCKit/Screenshots/Gallery/Resources/wireframe.mustache diff --git a/Sources/Domain/Screenshots/Gallery/ScreenLayout.swift b/Sources/ASCKit/Screenshots/Gallery/ScreenLayout.swift similarity index 100% rename from Sources/Domain/Screenshots/Gallery/ScreenLayout.swift rename to Sources/ASCKit/Screenshots/Gallery/ScreenLayout.swift diff --git a/Sources/Domain/Screenshots/HTMLRenderer.swift b/Sources/ASCKit/Screenshots/HTMLRenderer.swift similarity index 100% rename from Sources/Domain/Screenshots/HTMLRenderer.swift rename to Sources/ASCKit/Screenshots/HTMLRenderer.swift diff --git a/Sources/Infrastructure/ScreenshotPlans/AggregateGalleryTemplateRepository.swift b/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift similarity index 98% rename from Sources/Infrastructure/ScreenshotPlans/AggregateGalleryTemplateRepository.swift rename to Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift index 736d1ff2..990b93f3 100644 --- a/Sources/Infrastructure/ScreenshotPlans/AggregateGalleryTemplateRepository.swift +++ b/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Aggregates gallery templates from all registered providers. diff --git a/Sources/Infrastructure/ScreenshotPlans/AggregateTemplateRepository.swift b/Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift similarity index 98% rename from Sources/Infrastructure/ScreenshotPlans/AggregateTemplateRepository.swift rename to Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift index eeff8c0a..5f91762d 100644 --- a/Sources/Infrastructure/ScreenshotPlans/AggregateTemplateRepository.swift +++ b/Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Aggregates templates from all registered `TemplateProvider`s. diff --git a/Sources/Infrastructure/ScreenshotPlans/AggregateThemeRepository.swift b/Sources/ASCKit/Screenshots/Internal/AggregateThemeRepository.swift similarity index 99% rename from Sources/Infrastructure/ScreenshotPlans/AggregateThemeRepository.swift rename to Sources/ASCKit/Screenshots/Internal/AggregateThemeRepository.swift index c3465252..78782a5d 100644 --- a/Sources/Infrastructure/ScreenshotPlans/AggregateThemeRepository.swift +++ b/Sources/ASCKit/Screenshots/Internal/AggregateThemeRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Aggregates themes from all registered `ThemeProvider`s. diff --git a/Sources/Infrastructure/ScreenshotPlans/FileAppShotsConfigStorage.swift b/Sources/ASCKit/Screenshots/Internal/FileAppShotsConfigStorage.swift similarity index 98% rename from Sources/Infrastructure/ScreenshotPlans/FileAppShotsConfigStorage.swift rename to Sources/ASCKit/Screenshots/Internal/FileAppShotsConfigStorage.swift index 13ad4909..abaed014 100644 --- a/Sources/Infrastructure/ScreenshotPlans/FileAppShotsConfigStorage.swift +++ b/Sources/ASCKit/Screenshots/Internal/FileAppShotsConfigStorage.swift @@ -1,4 +1,3 @@ -import Domain import Foundation public struct FileAppShotsConfigStorage: AppShotsConfigStorage { diff --git a/Sources/Infrastructure/ScreenshotPlans/WebKitHTMLRenderer.swift b/Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift similarity index 99% rename from Sources/Infrastructure/ScreenshotPlans/WebKitHTMLRenderer.swift rename to Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift index d3c13337..1ad7c8bd 100644 --- a/Sources/Infrastructure/ScreenshotPlans/WebKitHTMLRenderer.swift +++ b/Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift @@ -1,6 +1,5 @@ #if canImport(WebKit) import AppKit -import Domain import Foundation import WebKit diff --git a/Sources/Domain/Screenshots/ScreenTheme.swift b/Sources/ASCKit/Screenshots/ScreenTheme.swift similarity index 100% rename from Sources/Domain/Screenshots/ScreenTheme.swift rename to Sources/ASCKit/Screenshots/ScreenTheme.swift diff --git a/Sources/Domain/Screenshots/ScreenshotPlans+RESTRoutes.swift b/Sources/ASCKit/Screenshots/ScreenshotPlans+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Screenshots/ScreenshotPlans+RESTRoutes.swift rename to Sources/ASCKit/Screenshots/ScreenshotPlans+RESTRoutes.swift diff --git a/Sources/Domain/Screenshots/TemplateRepository.swift b/Sources/ASCKit/Screenshots/TemplateRepository.swift similarity index 100% rename from Sources/Domain/Screenshots/TemplateRepository.swift rename to Sources/ASCKit/Screenshots/TemplateRepository.swift diff --git a/Sources/Domain/Screenshots/ThemeDesign.swift b/Sources/ASCKit/Screenshots/ThemeDesign.swift similarity index 100% rename from Sources/Domain/Screenshots/ThemeDesign.swift rename to Sources/ASCKit/Screenshots/ThemeDesign.swift diff --git a/Sources/Domain/Screenshots/ThemeDesignApplier.swift b/Sources/ASCKit/Screenshots/ThemeDesignApplier.swift similarity index 100% rename from Sources/Domain/Screenshots/ThemeDesignApplier.swift rename to Sources/ASCKit/Screenshots/ThemeDesignApplier.swift diff --git a/Sources/Domain/Screenshots/ThemedPage.swift b/Sources/ASCKit/Screenshots/ThemedPage.swift similarity index 100% rename from Sources/Domain/Screenshots/ThemedPage.swift rename to Sources/ASCKit/Screenshots/ThemedPage.swift diff --git a/Sources/Domain/Shared/APIError.swift b/Sources/ASCKit/Shared/APIError.swift similarity index 100% rename from Sources/Domain/Shared/APIError.swift rename to Sources/ASCKit/Shared/APIError.swift diff --git a/Sources/Domain/Shared/APIRoot.swift b/Sources/ASCKit/Shared/APIRoot.swift similarity index 100% rename from Sources/Domain/Shared/APIRoot.swift rename to Sources/ASCKit/Shared/APIRoot.swift diff --git a/Sources/Domain/Shared/Affordance.swift b/Sources/ASCKit/Shared/Affordance.swift similarity index 100% rename from Sources/Domain/Shared/Affordance.swift rename to Sources/ASCKit/Shared/Affordance.swift diff --git a/Sources/Domain/Shared/AffordanceProviding.swift b/Sources/ASCKit/Shared/AffordanceProviding.swift similarity index 100% rename from Sources/Domain/Shared/AffordanceProviding.swift rename to Sources/ASCKit/Shared/AffordanceProviding.swift diff --git a/Sources/Domain/Shared/AffordanceRegistry.swift b/Sources/ASCKit/Shared/AffordanceRegistry.swift similarity index 100% rename from Sources/Domain/Shared/AffordanceRegistry.swift rename to Sources/ASCKit/Shared/AffordanceRegistry.swift diff --git a/Sources/Domain/Shared/ImageAsset.swift b/Sources/ASCKit/Shared/ImageAsset.swift similarity index 100% rename from Sources/Domain/Shared/ImageAsset.swift rename to Sources/ASCKit/Shared/ImageAsset.swift diff --git a/Sources/Infrastructure/Client/APIClient.swift b/Sources/ASCKit/Shared/Internal/APIClient.swift similarity index 100% rename from Sources/Infrastructure/Client/APIClient.swift rename to Sources/ASCKit/Shared/Internal/APIClient.swift diff --git a/Sources/Infrastructure/Client/ClientFactory.swift b/Sources/ASCKit/Shared/Internal/ClientFactory.swift similarity index 99% rename from Sources/Infrastructure/Client/ClientFactory.swift rename to Sources/ASCKit/Shared/Internal/ClientFactory.swift index 024eb9b5..ab1359fe 100644 --- a/Sources/Infrastructure/Client/ClientFactory.swift +++ b/Sources/ASCKit/Shared/Internal/ClientFactory.swift @@ -1,5 +1,4 @@ import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct ClientFactory: Sendable { diff --git a/Sources/Infrastructure/Client/DataExtensions.swift b/Sources/ASCKit/Shared/Internal/DataExtensions.swift similarity index 100% rename from Sources/Infrastructure/Client/DataExtensions.swift rename to Sources/ASCKit/Shared/Internal/DataExtensions.swift diff --git a/Sources/Infrastructure/Shared/HTTPPerforming.swift b/Sources/ASCKit/Shared/Internal/HTTPPerforming.swift similarity index 100% rename from Sources/Infrastructure/Shared/HTTPPerforming.swift rename to Sources/ASCKit/Shared/Internal/HTTPPerforming.swift diff --git a/Sources/Infrastructure/Shared/SDKFilter.swift b/Sources/ASCKit/Shared/Internal/SDKFilter.swift similarity index 100% rename from Sources/Infrastructure/Shared/SDKFilter.swift rename to Sources/ASCKit/Shared/Internal/SDKFilter.swift diff --git a/Sources/Infrastructure/Shared/UploadOperationsExecutor.swift b/Sources/ASCKit/Shared/Internal/UploadOperationsExecutor.swift similarity index 99% rename from Sources/Infrastructure/Shared/UploadOperationsExecutor.swift rename to Sources/ASCKit/Shared/Internal/UploadOperationsExecutor.swift index 1de551f1..683c340d 100644 --- a/Sources/Infrastructure/Shared/UploadOperationsExecutor.swift +++ b/Sources/ASCKit/Shared/Internal/UploadOperationsExecutor.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation /// Sends a file's bytes to the upload URLs App Store Connect hands out when an asset is diff --git a/Sources/Domain/Shared/OfferCodeEnvironment.swift b/Sources/ASCKit/Shared/OfferCodeEnvironment.swift similarity index 100% rename from Sources/Domain/Shared/OfferCodeEnvironment.swift rename to Sources/ASCKit/Shared/OfferCodeEnvironment.swift diff --git a/Sources/Domain/Shared/OfferCodePriceInput.swift b/Sources/ASCKit/Shared/OfferCodePriceInput.swift similarity index 100% rename from Sources/Domain/Shared/OfferCodePriceInput.swift rename to Sources/ASCKit/Shared/OfferCodePriceInput.swift diff --git a/Sources/Domain/Shared/OutputFormat.swift b/Sources/ASCKit/Shared/OutputFormat.swift similarity index 100% rename from Sources/Domain/Shared/OutputFormat.swift rename to Sources/ASCKit/Shared/OutputFormat.swift diff --git a/Sources/Domain/Shared/PaginatedResponse.swift b/Sources/ASCKit/Shared/PaginatedResponse.swift similarity index 100% rename from Sources/Domain/Shared/PaginatedResponse.swift rename to Sources/ASCKit/Shared/PaginatedResponse.swift diff --git a/Sources/Domain/Shared/Presentable.swift b/Sources/ASCKit/Shared/Presentable.swift similarity index 100% rename from Sources/Domain/Shared/Presentable.swift rename to Sources/ASCKit/Shared/Presentable.swift diff --git a/Sources/Domain/Shared/RESTPathResolver.swift b/Sources/ASCKit/Shared/RESTPathResolver.swift similarity index 100% rename from Sources/Domain/Shared/RESTPathResolver.swift rename to Sources/ASCKit/Shared/RESTPathResolver.swift diff --git a/Sources/Infrastructure/Simulators/SimctlSimulatorRepository.swift b/Sources/ASCKit/Simulators/Internal/SimctlSimulatorRepository.swift similarity index 99% rename from Sources/Infrastructure/Simulators/SimctlSimulatorRepository.swift rename to Sources/ASCKit/Simulators/Internal/SimctlSimulatorRepository.swift index 85cf8bf1..86665e34 100644 --- a/Sources/Infrastructure/Simulators/SimctlSimulatorRepository.swift +++ b/Sources/ASCKit/Simulators/Internal/SimctlSimulatorRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation public struct SimctlSimulatorRepository: SimulatorRepository, @unchecked Sendable { diff --git a/Sources/Domain/Simulators/Simulator.swift b/Sources/ASCKit/Simulators/Simulator.swift similarity index 100% rename from Sources/Domain/Simulators/Simulator.swift rename to Sources/ASCKit/Simulators/Simulator.swift diff --git a/Sources/Domain/Simulators/SimulatorRepository.swift b/Sources/ASCKit/Simulators/SimulatorRepository.swift similarity index 100% rename from Sources/Domain/Simulators/SimulatorRepository.swift rename to Sources/ASCKit/Simulators/SimulatorRepository.swift diff --git a/Sources/Domain/Simulators/SimulatorState.swift b/Sources/ASCKit/Simulators/SimulatorState.swift similarity index 100% rename from Sources/Domain/Simulators/SimulatorState.swift rename to Sources/ASCKit/Simulators/SimulatorState.swift diff --git a/Sources/Infrastructure/Skills/FileSkillConfigStorage.swift b/Sources/ASCKit/Skills/Internal/FileSkillConfigStorage.swift similarity index 98% rename from Sources/Infrastructure/Skills/FileSkillConfigStorage.swift rename to Sources/ASCKit/Skills/Internal/FileSkillConfigStorage.swift index 244183c2..4747b623 100644 --- a/Sources/Infrastructure/Skills/FileSkillConfigStorage.swift +++ b/Sources/ASCKit/Skills/Internal/FileSkillConfigStorage.swift @@ -1,4 +1,3 @@ -import Domain import Foundation public struct FileSkillConfigStorage: SkillConfigStorage { diff --git a/Sources/Infrastructure/Skills/ProcessSkillRepository.swift b/Sources/ASCKit/Skills/Internal/ProcessSkillRepository.swift similarity index 99% rename from Sources/Infrastructure/Skills/ProcessSkillRepository.swift rename to Sources/ASCKit/Skills/Internal/ProcessSkillRepository.swift index d88c395e..aa1d8240 100644 --- a/Sources/Infrastructure/Skills/ProcessSkillRepository.swift +++ b/Sources/ASCKit/Skills/Internal/ProcessSkillRepository.swift @@ -1,4 +1,3 @@ -import Domain import Foundation /// Manages skills by shelling out to the `skills` CLI or `npx`. diff --git a/Sources/Infrastructure/Skills/ShellRunner.swift b/Sources/ASCKit/Skills/Internal/ShellRunner.swift similarity index 100% rename from Sources/Infrastructure/Skills/ShellRunner.swift rename to Sources/ASCKit/Skills/Internal/ShellRunner.swift diff --git a/Sources/Domain/Skills/Skill.swift b/Sources/ASCKit/Skills/Skill.swift similarity index 100% rename from Sources/Domain/Skills/Skill.swift rename to Sources/ASCKit/Skills/Skill.swift diff --git a/Sources/Domain/Skills/SkillCheckResult.swift b/Sources/ASCKit/Skills/SkillCheckResult.swift similarity index 100% rename from Sources/Domain/Skills/SkillCheckResult.swift rename to Sources/ASCKit/Skills/SkillCheckResult.swift diff --git a/Sources/Domain/Skills/SkillConfig.swift b/Sources/ASCKit/Skills/SkillConfig.swift similarity index 100% rename from Sources/Domain/Skills/SkillConfig.swift rename to Sources/ASCKit/Skills/SkillConfig.swift diff --git a/Sources/Domain/Skills/SkillConfigStorage.swift b/Sources/ASCKit/Skills/SkillConfigStorage.swift similarity index 100% rename from Sources/Domain/Skills/SkillConfigStorage.swift rename to Sources/ASCKit/Skills/SkillConfigStorage.swift diff --git a/Sources/Domain/Skills/SkillRepository.swift b/Sources/ASCKit/Skills/SkillRepository.swift similarity index 100% rename from Sources/Domain/Skills/SkillRepository.swift rename to Sources/ASCKit/Skills/SkillRepository.swift diff --git a/Sources/Infrastructure/Submissions/OpenAPISubmissionRepository.swift b/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift similarity index 90% rename from Sources/Infrastructure/Submissions/OpenAPISubmissionRepository.swift rename to Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift index 7c40f054..0b4b6900 100644 --- a/Sources/Infrastructure/Submissions/OpenAPISubmissionRepository.swift +++ b/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Sendable { private let client: any APIClient @@ -8,7 +7,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send self.client = client } - public func submitVersion(versionId: String) async throws -> Domain.ReviewSubmission { + public func submitVersion(versionId: String) async throws -> ASCKit.ReviewSubmission { // Step 1: Fetch the version to extract appId and platform let versionReq = APIEndpoint.v1.appStoreVersions.id(versionId).get( parameters: .init(include: [.app]) @@ -17,7 +16,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send guard let appId = versionResp.data.relationships?.app?.data?.id, let sdkPlatform = versionResp.data.attributes?.platform, - let platform = Domain.AppStorePlatform(rawValue: sdkPlatform.rawValue) + let platform = ASCKit.AppStorePlatform(rawValue: sdkPlatform.rawValue) else { throw APIError.unknown("Failed to extract appId and platform from version \(versionId)") } @@ -62,7 +61,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send return try await patchSubmitted(id: submissionId, appId: appId, platform: platform) } - public func createSubmission(appId: String, platform: Domain.AppStorePlatform) async throws -> Domain.ReviewSubmission { + public func createSubmission(appId: String, platform: ASCKit.AppStorePlatform) async throws -> ASCKit.ReviewSubmission { guard let sdkPlatform = AppStoreConnect_Swift_SDK.Platform(rawValue: platform.rawValue) else { throw APIError.unknown("Unsupported review submission platform \(platform.rawValue)") } @@ -84,7 +83,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send return mapListedSubmission(created.data, appId: appId) } - public func addItem(submissionId: String, target: Domain.ReviewItemTarget) async throws -> Domain.ReviewSubmissionItem { + public func addItem(submissionId: String, target: ASCKit.ReviewItemTarget) async throws -> ASCKit.ReviewSubmissionItem { var relationships = ReviewSubmissionItemCreateRequest.Data.Relationships( reviewSubmission: .init(data: .init(type: .reviewSubmissions, id: submissionId)) ) @@ -105,7 +104,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send } // Apple's create response omits the relationship, so the target supplies it. let item = mapSubmissionItem(response.data, submissionId: submissionId) - return Domain.ReviewSubmissionItem( + return ASCKit.ReviewSubmissionItem( id: item.id, submissionId: submissionId, state: item.state, linkedResourceId: target.id, linkedResourceType: target.linkedResource ) @@ -115,7 +114,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send try await client.request(APIEndpoint.v1.reviewSubmissionItems.id(itemId).delete) } - public func submit(submissionId: String) async throws -> Domain.ReviewSubmission { + public func submit(submissionId: String) async throws -> ASCKit.ReviewSubmission { _ = try await explainingRefusal { try await client.request(APIEndpoint.v1.reviewSubmissions.id(submissionId).patch( ReviewSubmissionUpdateRequest(data: .init( @@ -127,7 +126,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send return try await getSubmission(id: submissionId) } - public func getSubmission(id: String) async throws -> Domain.ReviewSubmission { + public func getSubmission(id: String) async throws -> ASCKit.ReviewSubmission { let request = APIEndpoint.v1.reviewSubmissions.id(id).get(parameters: .init( include: [.app] )) @@ -136,7 +135,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send return mapListedSubmission(response.data, appId: appId) } - public func listSubmissionItems(submissionId: String) async throws -> [Domain.ReviewSubmissionItem] { + public func listSubmissionItems(submissionId: String) async throws -> [ASCKit.ReviewSubmissionItem] { // `include` makes Apple return each item's relationship linkage, which the mapper // reads to report what the item points at. let request = APIEndpoint.v1.reviewSubmissions.id(submissionId).items.get(parameters: .init( @@ -155,15 +154,15 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send private func mapSubmissionItem( _ sdkItem: AppStoreConnect_Swift_SDK.ReviewSubmissionItem, submissionId: String - ) -> Domain.ReviewSubmissionItem { + ) -> ASCKit.ReviewSubmissionItem { let state = sdkItem.attributes?.state.flatMap { - Domain.ReviewSubmissionItemState(rawValue: $0.rawValue) + ASCKit.ReviewSubmissionItemState(rawValue: $0.rawValue) } ?? .readyForReview // Apple attaches exactly one related resource per item, expressed as // separate optional relationships. Probe the well-known kinds in priority // order — appStoreVersion first since it's by far the common case. - let (linkedId, linkedType): (String?, Domain.ReviewSubmissionItemLinkedResource?) = { + let (linkedId, linkedType): (String?, ASCKit.ReviewSubmissionItemLinkedResource?) = { if let id = sdkItem.relationships?.appStoreVersion?.data?.id { return (id, .appStoreVersion) } if let id = sdkItem.relationships?.appCustomProductPageVersion?.data?.id { return (id, .appCustomProductPageVersion) } if let id = sdkItem.relationships?.appStoreVersionExperiment?.data?.id { return (id, .appStoreVersionExperiment) } @@ -181,7 +180,7 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send return (nil, nil) }() - return Domain.ReviewSubmissionItem( + return ASCKit.ReviewSubmissionItem( id: sdkItem.id, submissionId: submissionId, state: state, @@ -192,9 +191,9 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send public func listSubmissions( appId: String, - states: [Domain.ReviewSubmissionState]?, + states: [ASCKit.ReviewSubmissionState]?, limit: Int? - ) async throws -> [Domain.ReviewSubmission] { + ) async throws -> [ASCKit.ReviewSubmission] { let filterState = states?.compactMap { APIEndpoint.V1.ReviewSubmissions.GetParameters.FilterState(rawValue: $0.rawValue) } @@ -210,14 +209,14 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send private func mapListedSubmission( _ sdkSubmission: AppStoreConnect_Swift_SDK.ReviewSubmission, appId: String - ) -> Domain.ReviewSubmission { + ) -> ASCKit.ReviewSubmission { let platform = sdkSubmission.attributes?.platform.flatMap { - Domain.AppStorePlatform(rawValue: $0.rawValue) + ASCKit.AppStorePlatform(rawValue: $0.rawValue) } ?? .iOS let state = sdkSubmission.attributes?.state.flatMap { - Domain.ReviewSubmissionState(rawValue: $0.rawValue) + ASCKit.ReviewSubmissionState(rawValue: $0.rawValue) } ?? .readyForReview - return Domain.ReviewSubmission( + return ASCKit.ReviewSubmission( id: sdkSubmission.id, appId: appId, platform: platform, @@ -229,8 +228,8 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send private func patchSubmitted( id: String, appId: String, - platform: Domain.AppStorePlatform - ) async throws -> Domain.ReviewSubmission { + platform: ASCKit.AppStorePlatform + ) async throws -> ASCKit.ReviewSubmission { let submitReq = APIEndpoint.v1.reviewSubmissions.id(id).patch( ReviewSubmissionUpdateRequest( data: .init( @@ -247,12 +246,12 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send private func mapSubmission( _ sdkSubmission: AppStoreConnect_Swift_SDK.ReviewSubmission, appId: String, - platform: Domain.AppStorePlatform - ) -> Domain.ReviewSubmission { + platform: ASCKit.AppStorePlatform + ) -> ASCKit.ReviewSubmission { let state = sdkSubmission.attributes?.state.flatMap { - Domain.ReviewSubmissionState(rawValue: $0.rawValue) + ASCKit.ReviewSubmissionState(rawValue: $0.rawValue) } ?? .readyForReview - return Domain.ReviewSubmission( + return ASCKit.ReviewSubmission( id: sdkSubmission.id, appId: appId, platform: platform, diff --git a/Sources/Domain/Submissions/ReviewItemTarget.swift b/Sources/ASCKit/Submissions/ReviewItemTarget.swift similarity index 100% rename from Sources/Domain/Submissions/ReviewItemTarget.swift rename to Sources/ASCKit/Submissions/ReviewItemTarget.swift diff --git a/Sources/Domain/Submissions/ReviewSubmission+RESTRoutes.swift b/Sources/ASCKit/Submissions/ReviewSubmission+RESTRoutes.swift similarity index 100% rename from Sources/Domain/Submissions/ReviewSubmission+RESTRoutes.swift rename to Sources/ASCKit/Submissions/ReviewSubmission+RESTRoutes.swift diff --git a/Sources/Domain/Submissions/ReviewSubmission.swift b/Sources/ASCKit/Submissions/ReviewSubmission.swift similarity index 100% rename from Sources/Domain/Submissions/ReviewSubmission.swift rename to Sources/ASCKit/Submissions/ReviewSubmission.swift diff --git a/Sources/Domain/Submissions/ReviewSubmissionError.swift b/Sources/ASCKit/Submissions/ReviewSubmissionError.swift similarity index 100% rename from Sources/Domain/Submissions/ReviewSubmissionError.swift rename to Sources/ASCKit/Submissions/ReviewSubmissionError.swift diff --git a/Sources/Domain/Submissions/ReviewSubmissionItem.swift b/Sources/ASCKit/Submissions/ReviewSubmissionItem.swift similarity index 100% rename from Sources/Domain/Submissions/ReviewSubmissionItem.swift rename to Sources/ASCKit/Submissions/ReviewSubmissionItem.swift diff --git a/Sources/Domain/Submissions/ReviewSubmissionItemState.swift b/Sources/ASCKit/Submissions/ReviewSubmissionItemState.swift similarity index 100% rename from Sources/Domain/Submissions/ReviewSubmissionItemState.swift rename to Sources/ASCKit/Submissions/ReviewSubmissionItemState.swift diff --git a/Sources/Domain/Submissions/ReviewSubmissionState.swift b/Sources/ASCKit/Submissions/ReviewSubmissionState.swift similarity index 100% rename from Sources/Domain/Submissions/ReviewSubmissionState.swift rename to Sources/ASCKit/Submissions/ReviewSubmissionState.swift diff --git a/Sources/Domain/Submissions/SubmissionPlan.swift b/Sources/ASCKit/Submissions/SubmissionPlan.swift similarity index 100% rename from Sources/Domain/Submissions/SubmissionPlan.swift rename to Sources/ASCKit/Submissions/SubmissionPlan.swift diff --git a/Sources/Domain/Submissions/SubmissionRepository.swift b/Sources/ASCKit/Submissions/SubmissionRepository.swift similarity index 100% rename from Sources/Domain/Submissions/SubmissionRepository.swift rename to Sources/ASCKit/Submissions/SubmissionRepository.swift diff --git a/Sources/Infrastructure/Territories/SDKTerritoryRepository.swift b/Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift similarity index 78% rename from Sources/Infrastructure/Territories/SDKTerritoryRepository.swift rename to Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift index 696b4287..376fb5e9 100644 --- a/Sources/Infrastructure/Territories/SDKTerritoryRepository.swift +++ b/Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKTerritoryRepository: TerritoryRepository, @unchecked Sendable { private let client: any APIClient @@ -8,14 +7,14 @@ public struct SDKTerritoryRepository: TerritoryRepository, @unchecked Sendable { self.client = client } - public func listTerritories() async throws -> [Domain.Territory] { + public func listTerritories() async throws -> [ASCKit.Territory] { let request = APIEndpoint.v1.territories.get( fieldsTerritories: [.currency], limit: 200 ) let response = try await client.request(request) return response.data.map { sdk in - Domain.Territory(id: sdk.id, currency: sdk.attributes?.currency) + ASCKit.Territory(id: sdk.id, currency: sdk.attributes?.currency) } } } diff --git a/Sources/Domain/Territories/Territory.swift b/Sources/ASCKit/Territories/Territory.swift similarity index 100% rename from Sources/Domain/Territories/Territory.swift rename to Sources/ASCKit/Territories/Territory.swift diff --git a/Sources/Domain/Territories/TerritoryRepository.swift b/Sources/ASCKit/Territories/TerritoryRepository.swift similarity index 100% rename from Sources/Domain/Territories/TerritoryRepository.swift rename to Sources/ASCKit/Territories/TerritoryRepository.swift diff --git a/Sources/Infrastructure/Users/SDKUserRepository.swift b/Sources/ASCKit/Users/Internal/SDKUserRepository.swift similarity index 84% rename from Sources/Infrastructure/Users/SDKUserRepository.swift rename to Sources/ASCKit/Users/Internal/SDKUserRepository.swift index 2ca1edd2..62a7def4 100644 --- a/Sources/Infrastructure/Users/SDKUserRepository.swift +++ b/Sources/ASCKit/Users/Internal/SDKUserRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation public struct SDKUserRepository: UserRepository, @unchecked Sendable { @@ -9,7 +8,7 @@ public struct SDKUserRepository: UserRepository, @unchecked Sendable { self.client = client } - public func listUsers(role: Domain.UserRole?) async throws -> [Domain.TeamMember] { + public func listUsers(role: ASCKit.UserRole?) async throws -> [ASCKit.TeamMember] { let filterRole = role.flatMap { APIEndpoint.V1.Users.GetParameters.FilterRoles(rawValue: $0.rawValue) } @@ -23,7 +22,7 @@ public struct SDKUserRepository: UserRepository, @unchecked Sendable { return pages.flatMap(\.data).map(mapTeamMember) } - public func updateUser(id: String, roles: [Domain.UserRole]) async throws -> Domain.TeamMember { + public func updateUser(id: String, roles: [ASCKit.UserRole]) async throws -> ASCKit.TeamMember { let sdkRoles = roles.compactMap { AppStoreConnect_Swift_SDK.UserRole(rawValue: $0.rawValue) } let body = UserUpdateRequest(data: .init( type: .users, @@ -38,7 +37,7 @@ public struct SDKUserRepository: UserRepository, @unchecked Sendable { try await client.request(APIEndpoint.v1.users.id(id).delete) } - public func listUserInvitations(role: Domain.UserRole?) async throws -> [Domain.UserInvitationRecord] { + public func listUserInvitations(role: ASCKit.UserRole?) async throws -> [ASCKit.UserInvitationRecord] { let filterRole = role.flatMap { APIEndpoint.V1.UserInvitations.GetParameters.FilterRoles(rawValue: $0.rawValue) } @@ -53,9 +52,9 @@ public struct SDKUserRepository: UserRepository, @unchecked Sendable { email: String, firstName: String, lastName: String, - roles: [Domain.UserRole], + roles: [ASCKit.UserRole], allAppsVisible: Bool - ) async throws -> Domain.UserInvitationRecord { + ) async throws -> ASCKit.UserInvitationRecord { let sdkRoles = roles.compactMap { AppStoreConnect_Swift_SDK.UserRole(rawValue: $0.rawValue) } let body = UserInvitationCreateRequest(data: .init( type: .userInvitations, @@ -77,11 +76,11 @@ public struct SDKUserRepository: UserRepository, @unchecked Sendable { // MARK: - Mappers - private func mapTeamMember(_ sdk: AppStoreConnect_Swift_SDK.User) -> Domain.TeamMember { + private func mapTeamMember(_ sdk: AppStoreConnect_Swift_SDK.User) -> ASCKit.TeamMember { let roles = (sdk.attributes?.roles ?? []).compactMap { - Domain.UserRole(rawValue: $0.rawValue) + ASCKit.UserRole(rawValue: $0.rawValue) } - return Domain.TeamMember( + return ASCKit.TeamMember( id: sdk.id, username: sdk.attributes?.username ?? "", firstName: sdk.attributes?.firstName ?? "", @@ -92,11 +91,11 @@ public struct SDKUserRepository: UserRepository, @unchecked Sendable { ) } - private func mapInvitation(_ sdk: AppStoreConnect_Swift_SDK.UserInvitation) -> Domain.UserInvitationRecord { + private func mapInvitation(_ sdk: AppStoreConnect_Swift_SDK.UserInvitation) -> ASCKit.UserInvitationRecord { let roles = (sdk.attributes?.roles ?? []).compactMap { - Domain.UserRole(rawValue: $0.rawValue) + ASCKit.UserRole(rawValue: $0.rawValue) } - return Domain.UserInvitationRecord( + return ASCKit.UserInvitationRecord( id: sdk.id, email: sdk.attributes?.email ?? "", firstName: sdk.attributes?.firstName ?? "", diff --git a/Sources/Domain/Users/TeamMember.swift b/Sources/ASCKit/Users/TeamMember.swift similarity index 100% rename from Sources/Domain/Users/TeamMember.swift rename to Sources/ASCKit/Users/TeamMember.swift diff --git a/Sources/Domain/Users/UserInvitationRecord.swift b/Sources/ASCKit/Users/UserInvitationRecord.swift similarity index 100% rename from Sources/Domain/Users/UserInvitationRecord.swift rename to Sources/ASCKit/Users/UserInvitationRecord.swift diff --git a/Sources/Domain/Users/UserRepository.swift b/Sources/ASCKit/Users/UserRepository.swift similarity index 100% rename from Sources/Domain/Users/UserRepository.swift rename to Sources/ASCKit/Users/UserRepository.swift diff --git a/Sources/Domain/Users/UserRole.swift b/Sources/ASCKit/Users/UserRole.swift similarity index 100% rename from Sources/Domain/Users/UserRole.swift rename to Sources/ASCKit/Users/UserRole.swift diff --git a/Sources/Infrastructure/Web/ASCWebServer.swift b/Sources/ASCKit/Web/ASCWebServer.swift similarity index 99% rename from Sources/Infrastructure/Web/ASCWebServer.swift rename to Sources/ASCKit/Web/ASCWebServer.swift index 298c155e..f3194835 100644 --- a/Sources/Infrastructure/Web/ASCWebServer.swift +++ b/Sources/ASCKit/Web/ASCWebServer.swift @@ -4,7 +4,6 @@ import HummingbirdTLS import HummingbirdWebSocket import NIOCore import NIOSSL -import Domain import ASCPlugin /// Hummingbird-based API server for ASC web apps. diff --git a/Sources/Infrastructure/Web/CORSMiddleware.swift b/Sources/ASCKit/Web/CORSMiddleware.swift similarity index 100% rename from Sources/Infrastructure/Web/CORSMiddleware.swift rename to Sources/ASCKit/Web/CORSMiddleware.swift diff --git a/Sources/Infrastructure/Web/SelfSignedCert.swift b/Sources/ASCKit/Web/SelfSignedCert.swift similarity index 100% rename from Sources/Infrastructure/Web/SelfSignedCert.swift rename to Sources/ASCKit/Web/SelfSignedCert.swift diff --git a/Sources/Infrastructure/XcodeCloud/SDKXcodeCloudBuildRunRepository.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift similarity index 99% rename from Sources/Infrastructure/XcodeCloud/SDKXcodeCloudBuildRunRepository.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift index f7cd9f03..7033ec92 100644 --- a/Sources/Infrastructure/XcodeCloud/SDKXcodeCloudBuildRunRepository.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKXcodeCloudBuildRunRepository: XcodeCloudBuildRunRepository, @unchecked Sendable { private let client: any APIClient diff --git a/Sources/Infrastructure/XcodeCloud/SDKXcodeCloudProductRepository.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift similarity index 98% rename from Sources/Infrastructure/XcodeCloud/SDKXcodeCloudProductRepository.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift index 5b8557fe..58448e90 100644 --- a/Sources/Infrastructure/XcodeCloud/SDKXcodeCloudProductRepository.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKXcodeCloudProductRepository: XcodeCloudProductRepository, @unchecked Sendable { private let client: any APIClient diff --git a/Sources/Infrastructure/XcodeCloud/SDKXcodeCloudWorkflowRepository.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift similarity index 98% rename from Sources/Infrastructure/XcodeCloud/SDKXcodeCloudWorkflowRepository.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift index 2a71be15..93fa21dd 100644 --- a/Sources/Infrastructure/XcodeCloud/SDKXcodeCloudWorkflowRepository.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift @@ -1,5 +1,4 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain public struct SDKXcodeCloudWorkflowRepository: XcodeCloudWorkflowRepository, @unchecked Sendable { private let client: any APIClient diff --git a/Sources/Domain/XcodeCloud/XcodeCloud+RESTRoutes.swift b/Sources/ASCKit/XcodeCloud/XcodeCloud+RESTRoutes.swift similarity index 100% rename from Sources/Domain/XcodeCloud/XcodeCloud+RESTRoutes.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloud+RESTRoutes.swift diff --git a/Sources/Domain/XcodeCloud/XcodeCloudBuildRun.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRun.swift similarity index 100% rename from Sources/Domain/XcodeCloud/XcodeCloudBuildRun.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudBuildRun.swift diff --git a/Sources/Domain/XcodeCloud/XcodeCloudBuildRunRepository.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRunRepository.swift similarity index 100% rename from Sources/Domain/XcodeCloud/XcodeCloudBuildRunRepository.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudBuildRunRepository.swift diff --git a/Sources/Domain/XcodeCloud/XcodeCloudProduct.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudProduct.swift similarity index 100% rename from Sources/Domain/XcodeCloud/XcodeCloudProduct.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudProduct.swift diff --git a/Sources/Domain/XcodeCloud/XcodeCloudProductRepository.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudProductRepository.swift similarity index 100% rename from Sources/Domain/XcodeCloud/XcodeCloudProductRepository.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudProductRepository.swift diff --git a/Sources/Domain/XcodeCloud/XcodeCloudWorkflow.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflow.swift similarity index 100% rename from Sources/Domain/XcodeCloud/XcodeCloudWorkflow.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudWorkflow.swift diff --git a/Sources/Domain/XcodeCloud/XcodeCloudWorkflowRepository.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflowRepository.swift similarity index 100% rename from Sources/Domain/XcodeCloud/XcodeCloudWorkflowRepository.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudWorkflowRepository.swift diff --git a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift index 8d6106aa..5a0066d1 100644 --- a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift +++ b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AgeRatingGetTests { diff --git a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift index a0413dcc..214a6274 100644 --- a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AgeRatingUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift b/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift index b45f609c..135a1172 100644 --- a/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift +++ b/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AnalyticsReportsRequestTests { diff --git a/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift b/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift index 2550b55d..94a71d5f 100644 --- a/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppCategoriesListTests { diff --git a/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift index e1019fe2..32594968 100644 --- a/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppClipExperienceLocalizationsListTests { diff --git a/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift b/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift index 8b6a89d1..496ddb74 100644 --- a/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppClipExperiencesListTests { diff --git a/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift b/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift index 329abf18..9aa60653 100644 --- a/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppClipsListTests { diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift index d866f051..95d0a5bb 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppInfoLocalizationsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift index c84f17e2..fb5d31d8 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppInfoLocalizationsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift index 9936efae..dc5be0b2 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppInfoLocalizationsListTests { diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift index 0706bc0a..163c3760 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppInfoLocalizationsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift index 0cdf7c52..58333c84 100644 --- a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppInfosListTests { diff --git a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift index 1f051b3e..1de87ebe 100644 --- a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppInfosUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift b/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift index 300360fe..43677f8e 100644 --- a/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppPreviewSetsCommandTests { diff --git a/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift b/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift index e2f02838..870a21fa 100644 --- a/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppPreviewsCommandTests { diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsConfigTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsConfigTests.swift index be36611a..b67e6a21 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsConfigTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsConfigTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppShotsConfigCommandTests { @@ -20,7 +20,7 @@ struct AppShotsConfigCommandTests { @Test func `config shows file key when no flags given`() async throws { let mockStorage = MockAppShotsConfigStorage() - given(mockStorage).load().willReturn(Domain.AppShotsConfig(geminiApiKey: "AIzaSyBUwwho8MWw9gsPDAuIp")) + given(mockStorage).load().willReturn(ASCKit.AppShotsConfig(geminiApiKey: "AIzaSyBUwwho8MWw9gsPDAuIp")) var cmd = try AppShotsConfig.parse([]) let output = try await cmd.execute(storage: mockStorage) @@ -58,7 +58,7 @@ struct AppShotsGenerateKeyResolutionTests { @Test func `resolveApiKey falls back to config file`() throws { let mockStorage = MockAppShotsConfigStorage() - given(mockStorage).load().willReturn(Domain.AppShotsConfig(geminiApiKey: "stored-key")) + given(mockStorage).load().willReturn(ASCKit.AppShotsConfig(geminiApiKey: "stored-key")) let key = try resolveGeminiApiKey(nil, configStorage: mockStorage) #expect(key == "stored-key") } diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsExportTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsExportTests.swift index 02684bdc..7dd88645 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsExportTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsExportTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("AppShotsExport") struct AppShotsExportTests { diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift index 0bd44578..a1fc83b2 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("AppShotsGalleryTemplates") struct AppShotsGalleryTemplatesTests { diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsGenerateTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsGenerateTests.swift index d68d84fd..20ccf2cd 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsGenerateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsGenerateTests.swift @@ -1,7 +1,7 @@ import Foundation import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppShotsGenerateTests { diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift index 4ffcf068..4e95dd0c 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("AppShotsTemplates") struct AppShotsTemplatesTests { diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift index cc73d551..87d52a71 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("AppShotsThemes") struct AppShotsThemesTests { diff --git a/Tests/ASCCommandTests/Commands/AppWall/AppWallSubmitTests.swift b/Tests/ASCCommandTests/Commands/AppWall/AppWallSubmitTests.swift index 744aebd8..fbd7b2a1 100644 --- a/Tests/ASCCommandTests/Commands/AppWall/AppWallSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/AppWall/AppWallSubmitTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("AppWallSubmit") struct AppWallSubmitTests { diff --git a/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift index 2f221fed..a6ec193d 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppPricingCommandsTests { diff --git a/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift index e4893d76..7ccf36b8 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppsListTests { diff --git a/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift index b32e5e5b..1d8e3bd5 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift index 4a1767d6..ae5a6edd 100644 --- a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift @@ -2,7 +2,7 @@ import ArgumentParser import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppAvailabilityCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift index d48f6162..0e22be16 100644 --- a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppAvailabilityGetTests { diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift index 0200f800..69081862 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AssetImagesCommandTests { diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift index 8cfb9dbc..f4a87166 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AssetLibraryCommandTests { diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift index cf9456ca..ca6ce0f7 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AssetPlacementsCommandTests { diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift index 8f715bdf..5537ff7e 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AssetVideosCommandTests { diff --git a/Tests/ASCCommandTests/Commands/Auth/AuthCheckTests.swift b/Tests/ASCCommandTests/Commands/Auth/AuthCheckTests.swift index ff6379ed..0837d45e 100644 --- a/Tests/ASCCommandTests/Commands/Auth/AuthCheckTests.swift +++ b/Tests/ASCCommandTests/Commands/Auth/AuthCheckTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AuthCheckTests { diff --git a/Tests/ASCCommandTests/Commands/Auth/AuthListTests.swift b/Tests/ASCCommandTests/Commands/Auth/AuthListTests.swift index 0610c1ba..b0351226 100644 --- a/Tests/ASCCommandTests/Commands/Auth/AuthListTests.swift +++ b/Tests/ASCCommandTests/Commands/Auth/AuthListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AuthListTests { diff --git a/Tests/ASCCommandTests/Commands/Auth/AuthLoginTests.swift b/Tests/ASCCommandTests/Commands/Auth/AuthLoginTests.swift index f74e052e..f7d1c4a1 100644 --- a/Tests/ASCCommandTests/Commands/Auth/AuthLoginTests.swift +++ b/Tests/ASCCommandTests/Commands/Auth/AuthLoginTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AuthLoginTests { diff --git a/Tests/ASCCommandTests/Commands/Auth/AuthLogoutTests.swift b/Tests/ASCCommandTests/Commands/Auth/AuthLogoutTests.swift index b047788d..e9f68ed6 100644 --- a/Tests/ASCCommandTests/Commands/Auth/AuthLogoutTests.swift +++ b/Tests/ASCCommandTests/Commands/Auth/AuthLogoutTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AuthLogoutTests { diff --git a/Tests/ASCCommandTests/Commands/Auth/AuthUpdateTests.swift b/Tests/ASCCommandTests/Commands/Auth/AuthUpdateTests.swift index a4b6177b..5d71e103 100644 --- a/Tests/ASCCommandTests/Commands/Auth/AuthUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Auth/AuthUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AuthUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/Auth/AuthUseTests.swift b/Tests/ASCCommandTests/Commands/Auth/AuthUseTests.swift index 01c19e81..1c65dbc7 100644 --- a/Tests/ASCCommandTests/Commands/Auth/AuthUseTests.swift +++ b/Tests/ASCCommandTests/Commands/Auth/AuthUseTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AuthUseTests { diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift index a38a460b..3fce3490 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaAppLocalizationsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift index 72f535e8..480b3423 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaAppLocalizationsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift index 8fbae49d..f814dfd9 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaAppLocalizationsGetTests { diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift index 3da761fa..4ef0a425 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaAppLocalizationsListTests { diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift index 7055d5cc..d1409006 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaAppLocalizationsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift index 829f2901..a92edd95 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaReviewDetailGetTests { diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift index 1c74bf89..d57f9766 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaReviewDetailUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift index 6493c92f..75838909 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaReviewSubmissionsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift index c6c8fd75..9931a98b 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaReviewSubmissionsGetTests { diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift index 94eafdde..b2095e1b 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaReviewSubmissionsListTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift index 4b355bb4..7c4f6734 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsAddBetaGroupTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift index 16d6c320..ff0f61be 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsArchiveTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift index e47bdbfc..63d6c040 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsListTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift index 2abae943..61c5e214 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsNextNumberTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift index c2b504b0..0c41dde4 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsRemoveBetaGroupTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift index 6a419097..b5048e98 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsSetEncryptionComplianceTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift index f78fe4a4..502ae79c 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsUpdateBetaNotesTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift index e4684779..3a82d6e6 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsUploadCommandTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift index 806bd988..3d4cb535 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsUploadsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift index fb24d496..319be93f 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsUploadsGetTests { diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift index cf330fae..027aa14e 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BuildsUploadsListTests { diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift index 11254ae8..3619f308 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BundleIDsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift index 4da92d4f..3ff0e1f2 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BundleIDsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift index 55de0bc3..f6a25afe 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BundleIDsListTests { diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift index c1abff4d..34749c12 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct CertificatesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift index 8246d62b..be75c3b2 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct CertificatesListTests { diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift index d643b9dd..f52c49f1 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct CertificatesRevokeTests { diff --git a/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift b/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift index a44a1946..6dffd7d1 100644 --- a/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct DevicesListTests { diff --git a/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift b/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift index f0345955..9645faec 100644 --- a/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift +++ b/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct DevicesRegisterTests { diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift index 53d803c0..d556f95b 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ExperimentTreatmentLocalizationsTests { diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift index 42af10c1..f8d83609 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit private func makeTreatment(id: String = "trt-1", experimentId: String = "exp-1", appIconName: String? = "AppIcon-Blue") -> ExperimentTreatment { ExperimentTreatment(id: id, experimentId: experimentId, name: "Blue icon", appIconName: appIconName) diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift index 39e4990d..36b7af0c 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit private func makeExperiment( id: String = "exp-1", diff --git a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift index 4f83005f..b8f61eec 100644 --- a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct GameCenterDetailGetTests { diff --git a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift index c4f4314a..43547749 100644 --- a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit private func makeScore( id: String = "mod-1", diff --git a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift index ae527cf1..3b2ba4bd 100644 --- a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPAvailabilityCreateTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift index b9136932..2efff7e9 100644 --- a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPAvailabilityGetTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift index 2a56d46e..269b0f41 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPCreateTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift index 4e46f7f2..8c8ba91e 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift index 56df0a4b..f25c2e9c 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPListTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift index 4380fedd..4845da4a 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPPricePointsListTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift index 15f8e8df..7e157f99 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPPricesSetTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift index f496e7a7..7dfebcfc 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPSubmitTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift index bbc6c757..576bb817 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPUnsubmitTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift index 3fbc13a8..331bcfee 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift index 73905651..404eed9c 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPVersionsListTests { diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift index b9aaf9a4..78cf2184 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPLocalizationsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift index 4731ac51..2ddac85d 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPLocalizationsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift index d28717e7..11996b31 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPLocalizationsListTests { diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift index 503da2ff..b274b043 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPLocalizationsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift index 96b396c4..5c640a2c 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodeCustomCodesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift index 5fd155a1..42c3cf96 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodeCustomCodesListTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift index 643efd42..366bcfb1 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodeCustomCodesUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift index 2a642880..08b63954 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodeOneTimeCodesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift index da6d4326..336c6377 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodeOneTimeCodesListTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift index 1ad5ed7c..ea3b1aef 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodeOneTimeCodesUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift index 308f9046..ab26cae1 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodeOneTimeCodesValuesTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift index b1e24b66..0d6dd60c 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift index 91e42bdd..477af90c 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodesListTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift index 68a15e53..3fbc9502 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodesPricesListTests { diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift index e00f180e..47662ac7 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPOfferCodesUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift b/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift index d07be577..5f29bd32 100644 --- a/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IAPReviewScreenshotGetTests { diff --git a/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift b/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift index 6ec221d3..849a2751 100644 --- a/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct InitCommandTests { diff --git a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift index 47daf6bc..62b78be2 100644 --- a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IrisIAPSubmissionsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift index c9dc9c0a..cfdb264f 100644 --- a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IrisIAPSubmissionsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift b/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift index c924aa06..19fe6279 100644 --- a/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IrisAppsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift b/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift index d9131441..ec62f445 100644 --- a/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IrisAppsListTests { diff --git a/Tests/ASCCommandTests/Commands/Iris/IrisStatusTests.swift b/Tests/ASCCommandTests/Commands/Iris/IrisStatusTests.swift index d86a3193..e2e266b5 100644 --- a/Tests/ASCCommandTests/Commands/Iris/IrisStatusTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/IrisStatusTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IrisStatusTests { @@ -9,7 +9,7 @@ struct IrisStatusTests { @Test func `status shows source and cookie count with affordances`() async throws { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveStatus().willReturn( - Domain.IrisStatus(source: .browser, cookieCount: 5) + ASCKit.IrisStatus(source: .browser, cookieCount: 5) ) let cmd = try ASCCommand.IrisStatus.parse(["--pretty"]) @@ -35,7 +35,7 @@ struct IrisStatusTests { @Test func `status shows environment source`() async throws { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveStatus().willReturn( - Domain.IrisStatus(source: .environment, cookieCount: 3) + ASCKit.IrisStatus(source: .environment, cookieCount: 3) ) let cmd = try ASCCommand.IrisStatus.parse(["--pretty"]) diff --git a/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift b/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift index b6286a87..145e81a2 100644 --- a/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct IrisResolutionCenterGetTests { diff --git a/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift index eebdde78..b6daa6cf 100644 --- a/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift @@ -1,6 +1,6 @@ import Testing import Mockable -@testable import Domain +@testable import ASCKit @testable import ASCCommand @Suite diff --git a/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift index 474e20ff..8848daba 100644 --- a/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift @@ -1,6 +1,6 @@ import Testing import Mockable -@testable import Domain +@testable import ASCKit @testable import ASCCommand @Suite diff --git a/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift index ebb07abc..7dbae9c2 100644 --- a/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift @@ -1,6 +1,6 @@ import Testing import Mockable -@testable import Domain +@testable import ASCKit @testable import ASCCommand @Suite diff --git a/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift b/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift index 70838f7b..cf37d73b 100644 --- a/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct PerfOverviewGetTests { diff --git a/Tests/ASCCommandTests/Commands/Plugins/PluginsListTests.swift b/Tests/ASCCommandTests/Commands/Plugins/PluginsListTests.swift index 81403960..26862e0c 100644 --- a/Tests/ASCCommandTests/Commands/Plugins/PluginsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Plugins/PluginsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("PluginsList — list installed dylib plugins") struct PluginsListTests { diff --git a/Tests/ASCCommandTests/Commands/Plugins/PluginsMarketTests.swift b/Tests/ASCCommandTests/Commands/Plugins/PluginsMarketTests.swift index 5fdabc26..97a3ff69 100644 --- a/Tests/ASCCommandTests/Commands/Plugins/PluginsMarketTests.swift +++ b/Tests/ASCCommandTests/Commands/Plugins/PluginsMarketTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("PluginsMarket — browse and search marketplace") struct PluginsMarketTests { diff --git a/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdateTests.swift index 9de57daf..23ab46c8 100644 --- a/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("PluginsUpdate — apply an update to one plugin") struct PluginsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdatesTests.swift b/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdatesTests.swift index 83e29e36..c7bc169d 100644 --- a/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdatesTests.swift +++ b/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdatesTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("PluginsUpdates — list outdated plugins") struct PluginsUpdatesTests { diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift index 6f1b6789..da4df370 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ProfilesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift index bf4b9fe9..fe868107 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ProfilesDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift index 96eea62a..5869d84b 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ProfilesListTests { diff --git a/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift b/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift index c20fd58b..31875536 100644 --- a/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift +++ b/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit private func makePromoted(id: String = "pp-1", appId: String = "app-1") -> PromotedPurchase { PromotedPurchase(id: id, appId: appId, isVisibleForAllUsers: true, isEnabled: true, diff --git a/Tests/ASCCommandTests/Commands/Reports/FinanceReportsDownloadTests.swift b/Tests/ASCCommandTests/Commands/Reports/FinanceReportsDownloadTests.swift index 1807b6e6..f480d284 100644 --- a/Tests/ASCCommandTests/Commands/Reports/FinanceReportsDownloadTests.swift +++ b/Tests/ASCCommandTests/Commands/Reports/FinanceReportsDownloadTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct FinanceReportsDownloadTests { diff --git a/Tests/ASCCommandTests/Commands/Reports/SalesReportsDownloadTests.swift b/Tests/ASCCommandTests/Commands/Reports/SalesReportsDownloadTests.swift index 758418a8..049d8ea8 100644 --- a/Tests/ASCCommandTests/Commands/Reports/SalesReportsDownloadTests.swift +++ b/Tests/ASCCommandTests/Commands/Reports/SalesReportsDownloadTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SalesReportsDownloadTests { diff --git a/Tests/ASCCommandTests/Commands/Reports/SalesReportsSummaryTests.swift b/Tests/ASCCommandTests/Commands/Reports/SalesReportsSummaryTests.swift index ae399e3a..db6beca9 100644 --- a/Tests/ASCCommandTests/Commands/Reports/SalesReportsSummaryTests.swift +++ b/Tests/ASCCommandTests/Commands/Reports/SalesReportsSummaryTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SalesReportsSummaryTests { diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift index 499e4ac5..724d5be6 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewSubmissionItemsListTests { diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift index 7eb50601..225c48d9 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift @@ -2,7 +2,7 @@ import ArgumentParser import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewSubmissionsBuildTests { diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift index d45979d6..bb425283 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewSubmissionsGetTests { diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift index 77ef1dae..c10eeae1 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewSubmissionsListTests { diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift index 5df3d230..5a7741a3 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewResponsesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift index e2fd0499..ec282997 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewResponsesDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift index d51bf8a2..c56b27e6 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewResponsesGetTests { diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift index 6b97544d..33aa6c0d 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewsGetTests { diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift index 0640ffd4..9d51393e 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ReviewsListTests { diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift index d1b2bbf7..8a47b3cd 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotSetsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift index 5306673e..d4cd73da 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotSetsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift index 0e54246c..43011dd4 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotSetsListTests { diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotImportFilesTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotImportFilesTests.swift index 875426bd..f40af509 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotImportFilesTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotImportFilesTests.swift @@ -4,7 +4,7 @@ import ImageIO import Testing import UniformTypeIdentifiers @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotImportFilesTests { diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift index a40f4f8a..740287fe 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift index c04c88a5..a4b1b384 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotsImportTests { diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift index 185a8f1a..7091ff23 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift @@ -3,7 +3,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotsImportToLibraryTests { diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift index 7e776abe..2541a799 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotsListTests { diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift index 32e44382..24242c7c 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotsUploadTests { diff --git a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsBootTests.swift b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsBootTests.swift index 72f825d2..8014c6a5 100644 --- a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsBootTests.swift +++ b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsBootTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SimulatorsBootTests { diff --git a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsListTests.swift b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsListTests.swift index b73fbfb5..0c2eefc2 100644 --- a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SimulatorsListTests { diff --git a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsShutdownTests.swift b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsShutdownTests.swift index 70ff069a..0a278bb7 100644 --- a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsShutdownTests.swift +++ b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsShutdownTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SimulatorsShutdownTests { diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillUpdateCheckerTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillUpdateCheckerTests.swift index 71f6d485..fef9a8e4 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillUpdateCheckerTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillUpdateCheckerTests.swift @@ -2,7 +2,7 @@ import Foundation import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("SkillUpdateChecker") struct SkillUpdateCheckerTests { diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsCheckTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsCheckTests.swift index 078003b3..5c85e465 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsCheckTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsCheckTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("SkillsCheck") struct SkillsCheckTests { diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsInstallTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsInstallTests.swift index 01d54bbc..0c0df305 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsInstallTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsInstallTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("SkillsInstall") struct SkillsInstallTests { diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsInstalledTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsInstalledTests.swift index e2a29a98..8a1281ba 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsInstalledTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsInstalledTests.swift @@ -1,7 +1,7 @@ import Foundation import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("SkillsInstalled") struct SkillsInstalledTests { diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsListTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsListTests.swift index 0cff4328..081b2135 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("SkillsList") struct SkillsListTests { diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsUninstallTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsUninstallTests.swift index a41ae893..5a7fcf03 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsUninstallTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsUninstallTests.swift @@ -1,7 +1,7 @@ import Foundation import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("SkillsUninstall") struct SkillsUninstallTests { diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsUpdateTests.swift index 01d36d06..5b559403 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite("SkillsUpdate") struct SkillsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift index 64254319..4e1f6ab1 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionGroupLocalizationsListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift index 06fc3f2b..f4d7e419 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionGroupVersionsListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift index bce2e10c..e46cc6aa 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionGroupsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift index ee4b7bf6..1bc668a7 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionGroupsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift index 83f29603..d40fbae2 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionGroupsListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift index 9af3c626..91dc3de4 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionGroupsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift index ab0afde3..8254467a 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionLocalizationsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift index a88c01b7..34bd2216 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionLocalizationsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift index 8f9df28d..dc583b09 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionLocalizationsListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift index fd17ffe5..764694fc 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionLocalizationsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift index d6b4eabf..cd10dc09 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeCustomCodesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift index 568771dd..f5c08f5a 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeCustomCodesListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift index 266e2ceb..07bd864e 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeCustomCodesUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift index c1f3f231..81be6fe6 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeOneTimeCodesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift index 26e32704..d1fdcf3b 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeOneTimeCodesListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift index a34d6632..16c636f4 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeOneTimeCodesUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift index 7dca9ca6..7875201b 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeOneTimeCodesValuesTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift index 58f5405e..910f1691 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodesCreateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift index 44385c5c..ff6b2661 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodesListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift index a0e942e3..7a37bbb1 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodesPricesListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift index 63ab3e31..afb739ac 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodesUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift index 41e7055a..93779d7c 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOffersCreateTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift index 7ef25d5c..5477e489 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOffersDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift index 39eff0dd..4a4b6bbc 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOffersListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift index 905a7b63..adeeb93a 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPromotionalOffersListTests { diff --git a/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift index f3ec2f1c..016472cb 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionReviewScreenshotGetTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift index a71e2841..3a460f40 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionAvailabilityCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift index 3ae2d7e0..c27f2eaa 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionAvailabilityGetTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift index 7219553f..8a2370fe 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPricePointsListTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift index 89162e37..e368b8e3 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPricesSetTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift index 8f747cdc..d0e8102d 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionVersionsListTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift index c8c6dfab..d0fb0578 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift index 07c02c90..1616c709 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionsDeleteTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift index 03da906f..3127ea7d 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionsListTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift index b90881b9..2759e6d3 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionsSubmitTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift index f80930dc..3788a161 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionsUnsubmitTests { diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift index 6b505367..c3de583d 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift b/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift index 615037c9..34a15bc4 100644 --- a/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct TerritoriesListTests { diff --git a/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift b/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift index c0f903f0..466030f9 100644 --- a/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct BetaGroupsListTests { diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift index a3dece56..11bc2d2c 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct UserInvitationsCancelTests { diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift index 62f15f13..bf1ae4ce 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct UserInvitationsInviteTests { diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift index 30cd2670..c7760b94 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct UserInvitationsListTests { diff --git a/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift index fdb724dd..e7e0cab5 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct UsersListTests { diff --git a/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift index 31ae6f75..75205cda 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct UsersRemoveTests { diff --git a/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift index d648b16c..8cb5b3b6 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct UsersUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift index c90a9b87..03fa82ba 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionLocalizationsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift index 9e5290f6..7aa63d3b 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionLocalizationsListTests { diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift index 77469467..568f6ffa 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionLocalizationsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift b/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift index 5256ce00..539cfc2c 100644 --- a/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionReviewDetailGetTests { diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift index 3e96dd46..4a233b77 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionsCheckReadinessTests { diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift index e69303de..8157c33b 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionsCreateTests { diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift index 48f7ec9b..9cad6ee8 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionsListTests { diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift index 2a2d47f1..3cdef952 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionsSetBuildTests { diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift index 4361bfb8..77ad9654 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionsSubmitTests { diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift index ca646732..7c68e20d 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct VersionsUpdateTests { diff --git a/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift index c4b31a4c..87903f85 100644 --- a/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift @@ -2,7 +2,7 @@ import Foundation import Testing import Mockable @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppShotsControllerTests { diff --git a/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift index 68edd16c..c05dfca8 100644 --- a/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift @@ -2,7 +2,7 @@ import Foundation import Testing import Mockable @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AppsControllerTests { diff --git a/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift index 3cf10a8f..50fcab03 100644 --- a/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct AssetLibraryControllerTests { diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift index 08da0161..2df17a33 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift @@ -6,8 +6,7 @@ import Mockable import NIOCore import Testing @testable import ASCCommand -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct AgeRatingRoutesTests { diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/AuthRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/AuthRoutesTests.swift index 33c81e2d..23bdd431 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/AuthRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/AuthRoutesTests.swift @@ -6,8 +6,7 @@ import Mockable import NIOCore import Testing @testable import ASCCommand -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct AuthRoutesTests { diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift index b426834e..94b296d8 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift @@ -5,8 +5,7 @@ import Mockable import NIOCore import Testing @testable import ASCCommand -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct CustomProductPagePlacementRoutesTests { diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift index 5478780c..8077d8da 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift @@ -4,8 +4,7 @@ import HummingbirdWebSocket import Mockable import Testing @testable import ASCCommand -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct ScreenshotDeleteRoutesTests { diff --git a/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift index 217ab1df..bd8d5f42 100644 --- a/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct GameCenterControllerTests { diff --git a/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift index 094d6a1b..bf7a4fc3 100644 --- a/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift @@ -2,7 +2,7 @@ import Foundation import Testing import Mockable @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct RESTRoutesTests { diff --git a/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift index 498ebb05..1481b692 100644 --- a/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionsControllerTests { diff --git a/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift b/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift index 2a16538e..0058c866 100644 --- a/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift +++ b/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit private func makeOffer(id: String = "wb-1", subscriptionId: String = "sub-1") -> WinBackOffer { WinBackOffer( diff --git a/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift b/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift index 22f23229..b3721ac9 100644 --- a/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift @@ -1,7 +1,7 @@ import Mockable import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct XcodeCloudProductsListTests { diff --git a/Tests/ASCCommandTests/OutputFormatterTests.swift b/Tests/ASCCommandTests/OutputFormatterTests.swift index 7d1df823..41629ada 100644 --- a/Tests/ASCCommandTests/OutputFormatterTests.swift +++ b/Tests/ASCCommandTests/OutputFormatterTests.swift @@ -1,7 +1,7 @@ import Foundation import Testing @testable import ASCCommand -@testable import Domain +@testable import ASCKit @Suite struct OutputFormatterTests { diff --git a/Tests/DomainTests/AppWall/AppWallEntryTests.swift b/Tests/ASCKitTests/AppWall/AppWallEntryTests.swift similarity index 99% rename from Tests/DomainTests/AppWall/AppWallEntryTests.swift rename to Tests/ASCKitTests/AppWall/AppWallEntryTests.swift index 43c659eb..58f6997e 100644 --- a/Tests/DomainTests/AppWall/AppWallEntryTests.swift +++ b/Tests/ASCKitTests/AppWall/AppWallEntryTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("AppWallApp") struct AppWallAppTests { diff --git a/Tests/DomainTests/AppWall/AppWallErrorTests.swift b/Tests/ASCKitTests/AppWall/AppWallErrorTests.swift similarity index 98% rename from Tests/DomainTests/AppWall/AppWallErrorTests.swift rename to Tests/ASCKitTests/AppWall/AppWallErrorTests.swift index 8cd38f98..fd48bb4f 100644 --- a/Tests/DomainTests/AppWall/AppWallErrorTests.swift +++ b/Tests/ASCKitTests/AppWall/AppWallErrorTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite("AppWallError — error descriptions") struct AppWallErrorTests { diff --git a/Tests/InfrastructureTests/AppWall/GitHubAppWallRepositoryTests.swift b/Tests/ASCKitTests/AppWall/Internal/GitHubAppWallRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/AppWall/GitHubAppWallRepositoryTests.swift rename to Tests/ASCKitTests/AppWall/Internal/GitHubAppWallRepositoryTests.swift index 8a8e0f8a..54c195d1 100644 --- a/Tests/InfrastructureTests/AppWall/GitHubAppWallRepositoryTests.swift +++ b/Tests/ASCKitTests/AppWall/Internal/GitHubAppWallRepositoryTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct GitHubAppWallRepositoryTests { diff --git a/Tests/DomainTests/Apps/AffordancesTests.swift b/Tests/ASCKitTests/Apps/AffordancesTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AffordancesTests.swift rename to Tests/ASCKitTests/Apps/AffordancesTests.swift index 6bb9d6d4..f9ac113a 100644 --- a/Tests/DomainTests/Apps/AffordancesTests.swift +++ b/Tests/ASCKitTests/Apps/AffordancesTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AffordancesTests { diff --git a/Tests/DomainTests/Apps/AppClips/AppClipTests.swift b/Tests/ASCKitTests/Apps/AppClips/AppClipTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AppClips/AppClipTests.swift rename to Tests/ASCKitTests/Apps/AppClips/AppClipTests.swift index 00e644c0..374c5e06 100644 --- a/Tests/DomainTests/Apps/AppClips/AppClipTests.swift +++ b/Tests/ASCKitTests/Apps/AppClips/AppClipTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppClipTests { diff --git a/Tests/InfrastructureTests/Apps/AppClips/SDKAppClipRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/AppClips/SDKAppClipRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift index 55890e85..65905689 100644 --- a/Tests/InfrastructureTests/Apps/AppClips/SDKAppClipRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKAppClipRepositoryListAppClipsTests { diff --git a/Tests/DomainTests/Apps/AppIconTests.swift b/Tests/ASCKitTests/Apps/AppIconTests.swift similarity index 98% rename from Tests/DomainTests/Apps/AppIconTests.swift rename to Tests/ASCKitTests/Apps/AppIconTests.swift index 4ed0835f..44d63937 100644 --- a/Tests/DomainTests/Apps/AppIconTests.swift +++ b/Tests/ASCKitTests/Apps/AppIconTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppIconTests { diff --git a/Tests/DomainTests/Apps/AppInfos/AgeRatingDeclarationTests.swift b/Tests/ASCKitTests/Apps/AppInfos/AgeRatingDeclarationTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AppInfos/AgeRatingDeclarationTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/AgeRatingDeclarationTests.swift index 7dc48030..87ea2e52 100644 --- a/Tests/DomainTests/Apps/AppInfos/AgeRatingDeclarationTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/AgeRatingDeclarationTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AgeRatingDeclarationTests { diff --git a/Tests/DomainTests/Apps/AppInfos/AppCategoryTests.swift b/Tests/ASCKitTests/Apps/AppInfos/AppCategoryTests.swift similarity index 98% rename from Tests/DomainTests/Apps/AppInfos/AppCategoryTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/AppCategoryTests.swift index c6c09193..a028d1e5 100644 --- a/Tests/DomainTests/Apps/AppInfos/AppCategoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/AppCategoryTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppCategoryTests { diff --git a/Tests/DomainTests/Apps/AppInfos/AppInfoLocalizationTests.swift b/Tests/ASCKitTests/Apps/AppInfos/AppInfoLocalizationTests.swift similarity index 98% rename from Tests/DomainTests/Apps/AppInfos/AppInfoLocalizationTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/AppInfoLocalizationTests.swift index cef7b582..5018bcea 100644 --- a/Tests/DomainTests/Apps/AppInfos/AppInfoLocalizationTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/AppInfoLocalizationTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppInfoLocalizationTests { diff --git a/Tests/DomainTests/Apps/AppInfos/AppInfoTests.swift b/Tests/ASCKitTests/Apps/AppInfos/AppInfoTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AppInfos/AppInfoTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/AppInfoTests.swift index c3c5fa0d..35e4fb9d 100644 --- a/Tests/DomainTests/Apps/AppInfos/AppInfoTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/AppInfoTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppInfoTests { diff --git a/Tests/InfrastructureTests/Apps/AppInfos/SDKAgeRatingDeclarationRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/AppInfos/SDKAgeRatingDeclarationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift index f80a6196..2d230ccc 100644 --- a/Tests/InfrastructureTests/Apps/AppInfos/SDKAgeRatingDeclarationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKAgeRatingDeclarationRepositoryTests { @@ -161,7 +160,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - var update = Domain.AgeRatingDeclarationUpdate() + var update = ASCKit.AgeRatingDeclarationUpdate() update.isAdvertising = false update.violenceRealistic = .frequentOrIntense @@ -217,7 +216,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { data: AgeRatingDeclaration(type: .ageRatingDeclarations, id: "decl-1"), links: .init(this: "") )) - var update = Domain.AgeRatingDeclarationUpdate() + var update = ASCKit.AgeRatingDeclarationUpdate() update.isSocialMedia = false update.isSocialMediaAgeRestricted = true update.developerAgeRatingInfoUrl = "https://example.com/age" diff --git a/Tests/InfrastructureTests/Apps/AppInfos/SDKAppCategoryRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/AppInfos/SDKAppCategoryRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift index 2bce4e03..2cab012b 100644 --- a/Tests/InfrastructureTests/Apps/AppInfos/SDKAppCategoryRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKAppCategoryRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/AppInfos/SDKAppInfoRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/AppInfos/SDKAppInfoRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift index 43157da0..865b82f5 100644 --- a/Tests/InfrastructureTests/Apps/AppInfos/SDKAppInfoRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKAppInfoRepositoryTests { diff --git a/Tests/DomainTests/Apps/AppRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppRepositoryTests.swift similarity index 98% rename from Tests/DomainTests/Apps/AppRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppRepositoryTests.swift index c20f7f99..de043659 100644 --- a/Tests/DomainTests/Apps/AppRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppRepositoryTests.swift @@ -1,6 +1,6 @@ import Mockable import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppRepositoryTests { diff --git a/Tests/DomainTests/Apps/AppTests.swift b/Tests/ASCKitTests/Apps/AppTests.swift similarity index 98% rename from Tests/DomainTests/Apps/AppTests.swift rename to Tests/ASCKitTests/Apps/AppTests.swift index 97f18a61..1cd4aeeb 100644 --- a/Tests/DomainTests/Apps/AppTests.swift +++ b/Tests/ASCKitTests/Apps/AppTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppTests { diff --git a/Tests/DomainTests/Apps/AssetLibrary/AppAssetLibraryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/AppAssetLibraryTests.swift similarity index 98% rename from Tests/DomainTests/Apps/AssetLibrary/AppAssetLibraryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/AppAssetLibraryTests.swift index eb44d649..10afcc4e 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/AppAssetLibraryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/AppAssetLibraryTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppAssetLibraryTests { diff --git a/Tests/InfrastructureTests/Apps/AssetLibrary/Images/SDKLibraryImageRepositoryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/AssetLibrary/Images/SDKLibraryImageRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift index fbb9d2cf..d5f0a446 100644 --- a/Tests/InfrastructureTests/Apps/AssetLibrary/Images/SDKLibraryImageRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKLibraryImageRepositoryTests { diff --git a/Tests/DomainTests/Apps/AssetLibrary/Images/LibraryAssetStateTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Images/LibraryAssetStateTests.swift similarity index 98% rename from Tests/DomainTests/Apps/AssetLibrary/Images/LibraryAssetStateTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Images/LibraryAssetStateTests.swift index b50f485e..738549c7 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/Images/LibraryAssetStateTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Images/LibraryAssetStateTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct LibraryAssetStateTests { diff --git a/Tests/DomainTests/Apps/AssetLibrary/Images/LibraryImageTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Images/LibraryImageTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AssetLibrary/Images/LibraryImageTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Images/LibraryImageTests.swift index e16ead98..aa55450c 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/Images/LibraryImageTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Images/LibraryImageTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct LibraryImageTests { diff --git a/Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift index 22cfee59..fdb7bfc1 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotImportExecuteTests { diff --git a/Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportGroupResultTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportGroupResultTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportGroupResultTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportGroupResultTests.swift index 7f3b0789..3904d13b 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportGroupResultTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportGroupResultTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotImportGroupResultTests { diff --git a/Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportPlanTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportPlanTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportPlanTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportPlanTests.swift index 07266d58..badad3f9 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/Import/ScreenshotImportPlanTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportPlanTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotImportPlanTests { diff --git a/Tests/InfrastructureTests/Apps/AssetLibrary/SDKAssetLibraryRepositoryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/AssetLibrary/SDKAssetLibraryRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift index 1211a3b8..2d8e4fcc 100644 --- a/Tests/InfrastructureTests/Apps/AssetLibrary/SDKAssetLibraryRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKAssetLibraryRepositoryTests { @@ -18,7 +17,7 @@ struct SDKAssetLibraryRepositoryTests { let library = try await SDKAssetLibraryRepository(client: stub).getAssetLibrary(appId: "app-42") - #expect(library == Domain.AppAssetLibrary(id: "lib-1", appId: "app-42")) + #expect(library == ASCKit.AppAssetLibrary(id: "lib-1", appId: "app-42")) #expect(stub.lastPath == "/v1/apps/app-42/assetLibrary") } diff --git a/Tests/DomainTests/Apps/AssetLibrary/Placements/AssetPlacementTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Placements/AssetPlacementTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AssetLibrary/Placements/AssetPlacementTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Placements/AssetPlacementTests.swift index da982142..fa1e242c 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/Placements/AssetPlacementTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Placements/AssetPlacementTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AssetPlacementTests { diff --git a/Tests/InfrastructureTests/Apps/AssetLibrary/Placements/SDKAssetPlacementRepositoryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/AssetLibrary/Placements/SDKAssetPlacementRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift index 2fc0f8b7..e2211512 100644 --- a/Tests/InfrastructureTests/Apps/AssetLibrary/Placements/SDKAssetPlacementRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKAssetPlacementRepositoryTests { diff --git a/Tests/DomainTests/Apps/AssetLibrary/RefData/AssetPlacementGroupTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/RefData/AssetPlacementGroupTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AssetLibrary/RefData/AssetPlacementGroupTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/RefData/AssetPlacementGroupTests.swift index 212392a8..0f9c3263 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/RefData/AssetPlacementGroupTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/RefData/AssetPlacementGroupTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AssetPlacementGroupTests { diff --git a/Tests/InfrastructureTests/Apps/AssetLibrary/Videos/SDKLibraryVideoRepositoryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/AssetLibrary/Videos/SDKLibraryVideoRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift index 5e83c21a..545c2da3 100644 --- a/Tests/InfrastructureTests/Apps/AssetLibrary/Videos/SDKLibraryVideoRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK -import Domain import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKLibraryVideoRepositoryTests { diff --git a/Tests/DomainTests/Apps/AssetLibrary/Videos/LibraryVideoTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Videos/LibraryVideoTests.swift similarity index 99% rename from Tests/DomainTests/Apps/AssetLibrary/Videos/LibraryVideoTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Videos/LibraryVideoTests.swift index af345805..cca38c72 100644 --- a/Tests/DomainTests/Apps/AssetLibrary/Videos/LibraryVideoTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Videos/LibraryVideoTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct LibraryVideoTests { diff --git a/Tests/DomainTests/Apps/Availability/AppAvailabilityTests.swift b/Tests/ASCKitTests/Apps/Availability/AppAvailabilityTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Availability/AppAvailabilityTests.swift rename to Tests/ASCKitTests/Apps/Availability/AppAvailabilityTests.swift index ab06aed2..4502f8ee 100644 --- a/Tests/DomainTests/Apps/Availability/AppAvailabilityTests.swift +++ b/Tests/ASCKitTests/Apps/Availability/AppAvailabilityTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppAvailabilityTests { diff --git a/Tests/DomainTests/Apps/Availability/AppTerritoryAvailabilityTests.swift b/Tests/ASCKitTests/Apps/Availability/AppTerritoryAvailabilityTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Availability/AppTerritoryAvailabilityTests.swift rename to Tests/ASCKitTests/Apps/Availability/AppTerritoryAvailabilityTests.swift index e3cf3f91..0fd1ff39 100644 --- a/Tests/DomainTests/Apps/Availability/AppTerritoryAvailabilityTests.swift +++ b/Tests/ASCKitTests/Apps/Availability/AppTerritoryAvailabilityTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppTerritoryAvailabilityTests { diff --git a/Tests/InfrastructureTests/Apps/Availability/SDKAppAvailabilityRepositoryTests.swift b/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Availability/SDKAppAvailabilityRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift index 3b58cc53..a4ceeab2 100644 --- a/Tests/InfrastructureTests/Apps/Availability/SDKAppAvailabilityRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKAppAvailabilityRepositoryTests { diff --git a/Tests/DomainTests/Apps/Builds/BetaBuildLocalizationTests.swift b/Tests/ASCKitTests/Apps/Builds/BetaBuildLocalizationTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Builds/BetaBuildLocalizationTests.swift rename to Tests/ASCKitTests/Apps/Builds/BetaBuildLocalizationTests.swift index 269d372b..c399e6c3 100644 --- a/Tests/DomainTests/Apps/Builds/BetaBuildLocalizationTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/BetaBuildLocalizationTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct BetaBuildLocalizationTests { diff --git a/Tests/DomainTests/Apps/Builds/BuildTests.swift b/Tests/ASCKitTests/Apps/Builds/BuildTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Builds/BuildTests.swift rename to Tests/ASCKitTests/Apps/Builds/BuildTests.swift index 9d224ad1..6aaaf74a 100644 --- a/Tests/DomainTests/Apps/Builds/BuildTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/BuildTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct BuildTests { diff --git a/Tests/DomainTests/Apps/Builds/BuildUploadTests.swift b/Tests/ASCKitTests/Apps/Builds/BuildUploadTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Builds/BuildUploadTests.swift rename to Tests/ASCKitTests/Apps/Builds/BuildUploadTests.swift index a31a69c6..112e4e43 100644 --- a/Tests/DomainTests/Apps/Builds/BuildUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/BuildUploadTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct BuildUploadTests { diff --git a/Tests/InfrastructureTests/Apps/Builds/SDKBetaBuildLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Builds/SDKBetaBuildLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift index 86a10e5b..7cd1ff9e 100644 --- a/Tests/InfrastructureTests/Apps/Builds/SDKBetaBuildLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKBetaBuildLocalizationRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Builds/SDKBuildRepositoryTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Builds/SDKBuildRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift index 9c9a9d3a..94668e72 100644 --- a/Tests/InfrastructureTests/Apps/Builds/SDKBuildRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKBuildRepositoryTests { @@ -78,7 +77,7 @@ struct SDKBuildRepositoryTests { } @Test func `listBuilds maps all processing states`() async throws { - let cases: [(AppStoreConnect_Swift_SDK.Build.Attributes.ProcessingState, Domain.Build.ProcessingState)] = [ + let cases: [(AppStoreConnect_Swift_SDK.Build.Attributes.ProcessingState, ASCKit.Build.ProcessingState)] = [ (.processing, .processing), (.failed, .failed), (.invalid, .invalid), diff --git a/Tests/InfrastructureTests/Apps/Builds/SDKBuildUploadRepositoryTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Builds/SDKBuildUploadRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift index 8fd20364..610c343a 100644 --- a/Tests/InfrastructureTests/Apps/Builds/SDKBuildUploadRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKBuildUploadRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Builds/SDKBuildUploadRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Builds/SDKBuildUploadRepositoryUploadTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift index 998c2807..587e9a71 100644 --- a/Tests/InfrastructureTests/Apps/Builds/SDKBuildUploadRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKBuildUploadRepositoryUploadTests { diff --git a/Tests/DomainTests/Apps/Builds/NextBuildNumberTests.swift b/Tests/ASCKitTests/Apps/Builds/NextBuildNumberTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Builds/NextBuildNumberTests.swift rename to Tests/ASCKitTests/Apps/Builds/NextBuildNumberTests.swift index 313b137f..ce375ab8 100644 --- a/Tests/DomainTests/Apps/Builds/NextBuildNumberTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/NextBuildNumberTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct NextBuildNumberTests { diff --git a/Tests/DomainTests/Apps/Builds/XcodeBuild/ArchiveExportTests.swift b/Tests/ASCKitTests/Apps/Builds/XcodeBuild/ArchiveExportTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Builds/XcodeBuild/ArchiveExportTests.swift rename to Tests/ASCKitTests/Apps/Builds/XcodeBuild/ArchiveExportTests.swift index 64d3fd62..1df37598 100644 --- a/Tests/DomainTests/Apps/Builds/XcodeBuild/ArchiveExportTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/XcodeBuild/ArchiveExportTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ArchiveExportTests { diff --git a/Tests/InfrastructureTests/Apps/Builds/XcodeBuild/ProcessXcodeBuildRunnerTests.swift b/Tests/ASCKitTests/Apps/Builds/XcodeBuild/Internal/ProcessXcodeBuildRunnerTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Builds/XcodeBuild/ProcessXcodeBuildRunnerTests.swift rename to Tests/ASCKitTests/Apps/Builds/XcodeBuild/Internal/ProcessXcodeBuildRunnerTests.swift index 88ea9a34..b50c9f5d 100644 --- a/Tests/InfrastructureTests/Apps/Builds/XcodeBuild/ProcessXcodeBuildRunnerTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/XcodeBuild/Internal/ProcessXcodeBuildRunnerTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite("ProcessXcodeBuildRunner") struct ProcessXcodeBuildRunnerTests { diff --git a/Tests/DomainTests/Apps/Experiments/AppStoreVersionExperimentTests.swift b/Tests/ASCKitTests/Apps/Experiments/AppStoreVersionExperimentTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Experiments/AppStoreVersionExperimentTests.swift rename to Tests/ASCKitTests/Apps/Experiments/AppStoreVersionExperimentTests.swift index 21b73eb9..cf344b6c 100644 --- a/Tests/DomainTests/Apps/Experiments/AppStoreVersionExperimentTests.swift +++ b/Tests/ASCKitTests/Apps/Experiments/AppStoreVersionExperimentTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppStoreVersionExperimentTests { diff --git a/Tests/DomainTests/Apps/Experiments/ExperimentTreatmentLocalizationTests.swift b/Tests/ASCKitTests/Apps/Experiments/ExperimentTreatmentLocalizationTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Experiments/ExperimentTreatmentLocalizationTests.swift rename to Tests/ASCKitTests/Apps/Experiments/ExperimentTreatmentLocalizationTests.swift index aa60483f..f8ad5518 100644 --- a/Tests/DomainTests/Apps/Experiments/ExperimentTreatmentLocalizationTests.swift +++ b/Tests/ASCKitTests/Apps/Experiments/ExperimentTreatmentLocalizationTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ExperimentTreatmentLocalizationTests { diff --git a/Tests/DomainTests/Apps/Experiments/ExperimentTreatmentTests.swift b/Tests/ASCKitTests/Apps/Experiments/ExperimentTreatmentTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Experiments/ExperimentTreatmentTests.swift rename to Tests/ASCKitTests/Apps/Experiments/ExperimentTreatmentTests.swift index 1afd928c..f8d5694a 100644 --- a/Tests/DomainTests/Apps/Experiments/ExperimentTreatmentTests.swift +++ b/Tests/ASCKitTests/Apps/Experiments/ExperimentTreatmentTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ExperimentTreatmentTests { diff --git a/Tests/InfrastructureTests/Apps/Experiments/SDKExperimentRepositoryTests.swift b/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Experiments/SDKExperimentRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift index 380a4961..ec4638fa 100644 --- a/Tests/InfrastructureTests/Apps/Experiments/SDKExperimentRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKExperimentRepositoryTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityTests.swift similarity index 98% rename from Tests/DomainTests/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityTests.swift index 810f307a..3e79e7ea 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseAvailabilityTests { diff --git a/Tests/InfrastructureTests/Apps/InAppPurchases/Availability/SDKInAppPurchaseAvailabilityRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/InAppPurchases/Availability/SDKInAppPurchaseAvailabilityRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift index ee3cab5d..653ecfd7 100644 --- a/Tests/InfrastructureTests/Apps/InAppPurchases/Availability/SDKInAppPurchaseAvailabilityRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKInAppPurchaseAvailabilityRepositoryTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/InAppPurchasePricePointTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchasePricePointTests.swift similarity index 98% rename from Tests/DomainTests/Apps/InAppPurchases/InAppPurchasePricePointTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchasePricePointTests.swift index a3ba37df..37fb6125 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/InAppPurchasePricePointTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchasePricePointTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchasePricePointTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/InAppPurchasePriceScheduleTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchasePriceScheduleTests.swift similarity index 99% rename from Tests/DomainTests/Apps/InAppPurchases/InAppPurchasePriceScheduleTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchasePriceScheduleTests.swift index 47a077cb..57c40382 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/InAppPurchasePriceScheduleTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchasePriceScheduleTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchasePriceScheduleTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/InAppPurchaseSubmissionTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchaseSubmissionTests.swift similarity index 97% rename from Tests/DomainTests/Apps/InAppPurchases/InAppPurchaseSubmissionTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchaseSubmissionTests.swift index 62827386..ac3e1299 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/InAppPurchaseSubmissionTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchaseSubmissionTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseSubmissionTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/InAppPurchaseTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchaseTests.swift similarity index 99% rename from Tests/DomainTests/Apps/InAppPurchases/InAppPurchaseTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchaseTests.swift index 332eaba0..8dd798a7 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/InAppPurchaseTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/InAppPurchaseTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseTests { diff --git a/Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift index 0ef6c6b1..355b0a79 100644 --- a/Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKInAppPurchaseLocalizationRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchasePriceRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchasePriceRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift index 77fb32fb..26fe82ab 100644 --- a/Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchasePriceRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKInAppPurchasePriceRepositoryTests { @@ -274,9 +273,9 @@ struct SDKInAppPurchasePriceRepositoryTests { let result = try await repo.getPriceSchedule(iapId: "iap-7") // territoryPrices contains USA (manual + equalized) deduped + JPN (equalized). - let prices: [Domain.TerritoryPrice] = result?.territoryPrices ?? [] + let prices: [ASCKit.TerritoryPrice] = result?.territoryPrices ?? [] #expect(prices.count == 2) - var byTerritory: [String: Domain.TerritoryPrice] = [:] + var byTerritory: [String: ASCKit.TerritoryPrice] = [:] for entry in prices { byTerritory[entry.territory.id] = entry } #expect(byTerritory["USA"]?.customerPrice == "9.99") #expect(byTerritory["USA"]?.territory.currency == "USD") diff --git a/Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift index 4cab2919..bd30a09f 100644 --- a/Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKInAppPurchaseRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift similarity index 94% rename from Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseSubmissionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift index 5c2a67ed..4ba02e66 100644 --- a/Tests/InfrastructureTests/Apps/InAppPurchases/SDKInAppPurchaseSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKInAppPurchaseSubmissionRepositoryTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCodeTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCodeTests.swift similarity index 98% rename from Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCodeTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCodeTests.swift index 01882393..47197231 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCodeTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeCustomCodeTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseOfferCodeCustomCodeTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCodeTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCodeTests.swift similarity index 99% rename from Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCodeTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCodeTests.swift index 5e851118..20b393e1 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCodeTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeOneTimeUseCodeTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseOfferCodeOneTimeUseCodeTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePriceTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePriceTests.swift similarity index 99% rename from Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePriceTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePriceTests.swift index 73d33648..410dc5bd 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePriceTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodePriceTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseOfferCodePriceTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeTests.swift similarity index 99% rename from Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeTests.swift index 7c94a980..d2dedb07 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseOfferCodeTests { diff --git a/Tests/InfrastructureTests/Apps/InAppPurchases/OfferCodes/SDKInAppPurchaseOfferCodeRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/InAppPurchases/OfferCodes/SDKInAppPurchaseOfferCodeRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift index ac018148..c736d59a 100644 --- a/Tests/InfrastructureTests/Apps/InAppPurchases/OfferCodes/SDKInAppPurchaseOfferCodeRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKInAppPurchaseOfferCodeRepositoryTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/Review/InAppPurchaseReviewCodableTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Review/InAppPurchaseReviewCodableTests.swift similarity index 98% rename from Tests/DomainTests/Apps/InAppPurchases/Review/InAppPurchaseReviewCodableTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Review/InAppPurchaseReviewCodableTests.swift index b4a5cc10..0aef0257 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/Review/InAppPurchaseReviewCodableTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Review/InAppPurchaseReviewCodableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseReviewCodableTests { diff --git a/Tests/DomainTests/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshotTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshotTests.swift similarity index 99% rename from Tests/DomainTests/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshotTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshotTests.swift index ffccefd0..862f3e11 100644 --- a/Tests/DomainTests/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshotTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Review/InAppPurchaseReviewScreenshotTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct InAppPurchaseReviewScreenshotTests { diff --git a/Tests/InfrastructureTests/Apps/InAppPurchases/Review/SDKInAppPurchaseReviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/InAppPurchases/Review/SDKInAppPurchaseReviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift index ec93c7ed..4ceb6ace 100644 --- a/Tests/InfrastructureTests/Apps/InAppPurchases/Review/SDKInAppPurchaseReviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKInAppPurchaseReviewRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/SDKAppRepositoryTests.swift b/Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/SDKAppRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift index f3af84ea..8022e9bc 100644 --- a/Tests/InfrastructureTests/Apps/SDKAppRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKAppRepositoryTests { diff --git a/Tests/DomainTests/Apps/Performance/DiagnosticLogEntryTests.swift b/Tests/ASCKitTests/Apps/Performance/DiagnosticLogEntryTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Performance/DiagnosticLogEntryTests.swift rename to Tests/ASCKitTests/Apps/Performance/DiagnosticLogEntryTests.swift index 0b9ddbf1..daff8966 100644 --- a/Tests/DomainTests/Apps/Performance/DiagnosticLogEntryTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/DiagnosticLogEntryTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("DiagnosticLogEntry") struct DiagnosticLogEntryTests { diff --git a/Tests/DomainTests/Apps/Performance/DiagnosticSignatureInfoTests.swift b/Tests/ASCKitTests/Apps/Performance/DiagnosticSignatureInfoTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Performance/DiagnosticSignatureInfoTests.swift rename to Tests/ASCKitTests/Apps/Performance/DiagnosticSignatureInfoTests.swift index 045fe4ee..40d95448 100644 --- a/Tests/DomainTests/Apps/Performance/DiagnosticSignatureInfoTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/DiagnosticSignatureInfoTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("DiagnosticSignatureInfo") struct DiagnosticSignatureInfoTests { diff --git a/Tests/InfrastructureTests/Apps/Performance/SDKDiagnosticsRepositoryTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Performance/SDKDiagnosticsRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift index 730fa25d..e4d3e03b 100644 --- a/Tests/InfrastructureTests/Apps/Performance/SDKDiagnosticsRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKDiagnosticsRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Performance/SDKPerfMetricsRepositoryTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Performance/SDKPerfMetricsRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift index bb5c3db4..a1c544d0 100644 --- a/Tests/InfrastructureTests/Apps/Performance/SDKPerfMetricsRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKPerfMetricsRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Performance/SDKPerfOverviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Performance/SDKPerfOverviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift index 0721328f..42a96011 100644 --- a/Tests/InfrastructureTests/Apps/Performance/SDKPerfOverviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKPerfOverviewRepositoryTests { diff --git a/Tests/DomainTests/Apps/Performance/PerfPowerMetricTests.swift b/Tests/ASCKitTests/Apps/Performance/PerfPowerMetricTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Performance/PerfPowerMetricTests.swift rename to Tests/ASCKitTests/Apps/Performance/PerfPowerMetricTests.swift index 99625774..73d1c1c8 100644 --- a/Tests/DomainTests/Apps/Performance/PerfPowerMetricTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/PerfPowerMetricTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("PerformanceMetric") struct PerformanceMetricTests { diff --git a/Tests/DomainTests/Apps/Performance/PerformanceOverviewTests.swift b/Tests/ASCKitTests/Apps/Performance/PerformanceOverviewTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Performance/PerformanceOverviewTests.swift rename to Tests/ASCKitTests/Apps/Performance/PerformanceOverviewTests.swift index 84e55281..7e1e8bd1 100644 --- a/Tests/DomainTests/Apps/Performance/PerformanceOverviewTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/PerformanceOverviewTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("PerformanceOverview") struct PerformanceOverviewTests { diff --git a/Tests/DomainTests/Apps/Pricing/AppPricingTests.swift b/Tests/ASCKitTests/Apps/Pricing/AppPricingTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Pricing/AppPricingTests.swift rename to Tests/ASCKitTests/Apps/Pricing/AppPricingTests.swift index 242066a3..0ea9c927 100644 --- a/Tests/DomainTests/Apps/Pricing/AppPricingTests.swift +++ b/Tests/ASCKitTests/Apps/Pricing/AppPricingTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppPricingTests { diff --git a/Tests/InfrastructureTests/Apps/Pricing/SDKPricingRepositoryTests.swift b/Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift similarity index 95% rename from Tests/InfrastructureTests/Apps/Pricing/SDKPricingRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift index 8ada941a..3437e746 100644 --- a/Tests/InfrastructureTests/Apps/Pricing/SDKPricingRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKPricingRepositoryTests { @@ -58,7 +57,7 @@ private final class ThrowingStubAPIClient: APIClient, @unchecked Sendable { let points = try await repo.listPricePoints(appId: "app-1", territory: "USA") #expect(points.count == 250) - #expect(points.last == Domain.AppPricePoint(id: "pp-249", appId: "app-1", territory: "USA", + #expect(points.last == ASCKit.AppPricePoint(id: "pp-249", appId: "app-1", territory: "USA", customerPrice: "249.99", proceeds: "249.50")) let query = Dictionary(uniqueKeysWithValues: (stub.requests.first?.query ?? []).map { ($0.0, $0.1 ?? "") }) #expect(stub.requests.first?.path == "/v1/apps/app-1/appPricePoints") @@ -74,7 +73,7 @@ private final class ThrowingStubAPIClient: APIClient, @unchecked Sendable { let repo = SDKPricingRepository(client: stub) let schedule = try await repo.setPriceSchedule(appId: "app-1", baseTerritory: "USA", pricePointId: "pp-9") - #expect(schedule == Domain.AppPriceSchedule(id: "sched-1", appId: "app-1", baseTerritory: "USA")) + #expect(schedule == ASCKit.AppPriceSchedule(id: "sched-1", appId: "app-1", baseTerritory: "USA")) let post = stub.requests.first { $0.method == "POST" } #expect(post?.path == "/v1/appPriceSchedules") #expect(post?.body == #"{"data":{"relationships":{"app":{"data":{"id":"app-1","type":"apps"}},"baseTerritory":{"data":{"id":"USA","type":"territories"}},"manualPrices":{"data":[{"id":"${local-app-price-1}","type":"appPrices"}]}},"type":"appPriceSchedules"},"included":[{"id":"${local-app-price-1}","relationships":{"appPricePoint":{"data":{"id":"pp-9","type":"appPricePoints"}}},"type":"appPrices"}]}"#) diff --git a/Tests/InfrastructureTests/Apps/ProductVersions/SDKProductVersionRepositoryTests.swift b/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/ProductVersions/SDKProductVersionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift index 62238c7f..2862958f 100644 --- a/Tests/InfrastructureTests/Apps/ProductVersions/SDKProductVersionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKProductVersionRepositoryTests { diff --git a/Tests/DomainTests/Apps/ProductVersions/ProductVersionTests.swift b/Tests/ASCKitTests/Apps/ProductVersions/ProductVersionTests.swift similarity index 99% rename from Tests/DomainTests/Apps/ProductVersions/ProductVersionTests.swift rename to Tests/ASCKitTests/Apps/ProductVersions/ProductVersionTests.swift index e405613a..d3f2a2df 100644 --- a/Tests/DomainTests/Apps/ProductVersions/ProductVersionTests.swift +++ b/Tests/ASCKitTests/Apps/ProductVersions/ProductVersionTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct ProductVersionTests { diff --git a/Tests/InfrastructureTests/Apps/PromotedPurchases/SDKPromotedPurchaseRepositoryTests.swift b/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/PromotedPurchases/SDKPromotedPurchaseRepositoryTests.swift rename to Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift index 899c74ab..ad3204c3 100644 --- a/Tests/InfrastructureTests/Apps/PromotedPurchases/SDKPromotedPurchaseRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKPromotedPurchaseRepositoryTests { diff --git a/Tests/DomainTests/Apps/PromotedPurchases/PromotedPurchaseCodableTests.swift b/Tests/ASCKitTests/Apps/PromotedPurchases/PromotedPurchaseCodableTests.swift similarity index 98% rename from Tests/DomainTests/Apps/PromotedPurchases/PromotedPurchaseCodableTests.swift rename to Tests/ASCKitTests/Apps/PromotedPurchases/PromotedPurchaseCodableTests.swift index 6c971940..2cafcef1 100644 --- a/Tests/DomainTests/Apps/PromotedPurchases/PromotedPurchaseCodableTests.swift +++ b/Tests/ASCKitTests/Apps/PromotedPurchases/PromotedPurchaseCodableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct PromotedPurchaseCodableTests { diff --git a/Tests/DomainTests/Apps/PromotedPurchases/PromotedPurchaseTests.swift b/Tests/ASCKitTests/Apps/PromotedPurchases/PromotedPurchaseTests.swift similarity index 99% rename from Tests/DomainTests/Apps/PromotedPurchases/PromotedPurchaseTests.swift rename to Tests/ASCKitTests/Apps/PromotedPurchases/PromotedPurchaseTests.swift index 8b6d6129..ea234915 100644 --- a/Tests/DomainTests/Apps/PromotedPurchases/PromotedPurchaseTests.swift +++ b/Tests/ASCKitTests/Apps/PromotedPurchases/PromotedPurchaseTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct PromotedPurchaseTests { diff --git a/Tests/DomainTests/Apps/Reviews/CustomerReviewResponseTests.swift b/Tests/ASCKitTests/Apps/Reviews/CustomerReviewResponseTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Reviews/CustomerReviewResponseTests.swift rename to Tests/ASCKitTests/Apps/Reviews/CustomerReviewResponseTests.swift index d2cb9ebc..cf267e39 100644 --- a/Tests/DomainTests/Apps/Reviews/CustomerReviewResponseTests.swift +++ b/Tests/ASCKitTests/Apps/Reviews/CustomerReviewResponseTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct CustomerReviewResponseTests { diff --git a/Tests/DomainTests/Apps/Reviews/CustomerReviewTests.swift b/Tests/ASCKitTests/Apps/Reviews/CustomerReviewTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Reviews/CustomerReviewTests.swift rename to Tests/ASCKitTests/Apps/Reviews/CustomerReviewTests.swift index e266b374..5bbe0913 100644 --- a/Tests/DomainTests/Apps/Reviews/CustomerReviewTests.swift +++ b/Tests/ASCKitTests/Apps/Reviews/CustomerReviewTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct CustomerReviewTests { diff --git a/Tests/InfrastructureTests/Apps/Reviews/SDKCustomerReviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Reviews/SDKCustomerReviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift index a93711ef..a51f5060 100644 --- a/Tests/InfrastructureTests/Apps/Reviews/SDKCustomerReviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKCustomerReviewRepositoryListReviewsTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/Availability/SDKSubscriptionAvailabilityRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Subscriptions/Availability/SDKSubscriptionAvailabilityRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift index 0f748b56..a5b21311 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/Availability/SDKSubscriptionAvailabilityRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionAvailabilityRepositoryTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/Availability/SubscriptionAvailabilityTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Availability/SubscriptionAvailabilityTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/Availability/SubscriptionAvailabilityTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Availability/SubscriptionAvailabilityTests.swift index cff391fa..8053f5cd 100644 --- a/Tests/DomainTests/Apps/Subscriptions/Availability/SubscriptionAvailabilityTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Availability/SubscriptionAvailabilityTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionAvailabilityTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionGroupLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionGroupLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift index e003ae15..b3bb5fee 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionGroupLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionGroupLocalizationRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionGroupRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionGroupRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift index ccbe63cf..ee273830 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionGroupRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionGroupRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift index 99928146..d8aed37a 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionLocalizationRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionPriceRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionPriceRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift index b2578b38..e4937871 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionPriceRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionPriceRepositoryTests { @@ -197,9 +196,9 @@ struct SDKSubscriptionPriceRepositoryTests { let repo = SDKSubscriptionPriceRepository(client: stub) let result = try await repo.getPriceSchedule(subscriptionId: "sub-7") - let prices: [Domain.TerritoryPrice] = result?.territoryPrices ?? [] + let prices: [ASCKit.TerritoryPrice] = result?.territoryPrices ?? [] #expect(prices.count == 2) - var byTerritory: [String: Domain.TerritoryPrice] = [:] + var byTerritory: [String: ASCKit.TerritoryPrice] = [:] for entry in prices { byTerritory[entry.territory.id] = entry } #expect(byTerritory["USA"]?.customerPrice == "5.99") #expect(byTerritory["USA"]?.territory.currency == "USD") diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionPromotionalOfferRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionPromotionalOfferRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift index 69c5cbb6..bb36a0b4 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionPromotionalOfferRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionPromotionalOfferRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift index 78d038b1..45691cbe 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift similarity index 95% rename from Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionSubmissionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift index de865dcd..d55f34ea 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/SDKSubscriptionSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionSubmissionRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/SDKWinBackOfferRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Subscriptions/SDKWinBackOfferRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift index 3a9a8b7c..c90a8e84 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/SDKWinBackOfferRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKWinBackOfferRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/IntroductoryOffers/SDKSubscriptionIntroductoryOfferRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Subscriptions/IntroductoryOffers/SDKSubscriptionIntroductoryOfferRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift index e5c5d8ed..902d91fd 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/IntroductoryOffers/SDKSubscriptionIntroductoryOfferRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionIntroductoryOfferRepositoryTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferTests.swift index 8d511ff0..8ef6f9aa 100644 --- a/Tests/DomainTests/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionIntroductoryOfferTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/OfferCodes/SDKSubscriptionOfferCodeRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Subscriptions/OfferCodes/SDKSubscriptionOfferCodeRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift index 990db551..8f578b35 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/OfferCodes/SDKSubscriptionOfferCodeRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionOfferCodeRepositoryTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCodeTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCodeTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCodeTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCodeTests.swift index 5b4eb53d..8832593a 100644 --- a/Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCodeTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeCustomCodeTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeCustomCodeTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCodeTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCodeTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCodeTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCodeTests.swift index 83fd00a7..3edee6ca 100644 --- a/Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCodeTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeOneTimeUseCodeTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeOneTimeUseCodeTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePriceTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePriceTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePriceTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePriceTests.swift index fdd27b27..4fd87ad8 100644 --- a/Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePriceTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodePriceTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodePriceTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeTests.swift index 01af0559..20e40448 100644 --- a/Tests/DomainTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionOfferCodeTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/Review/SDKSubscriptionReviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Subscriptions/Review/SDKSubscriptionReviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift index 7cfed78a..2073bdf4 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/Review/SDKSubscriptionReviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubscriptionReviewRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Subscriptions/Review/SDKSubscriptionReviewRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Subscriptions/Review/SDKSubscriptionReviewRepositoryUploadTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift index 7f8bb171..2f4c2ecf 100644 --- a/Tests/InfrastructureTests/Apps/Subscriptions/Review/SDKSubscriptionReviewRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKSubscriptionReviewRepositoryUploadTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionPromotionalImageTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionPromotionalImageTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionPromotionalImageTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionPromotionalImageTests.swift index e75cd944..4f5b474b 100644 --- a/Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionPromotionalImageTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionPromotionalImageTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPromotionalImageTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionReviewCodableTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionReviewCodableTests.swift similarity index 97% rename from Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionReviewCodableTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionReviewCodableTests.swift index 0031b3f6..1e793557 100644 --- a/Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionReviewCodableTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionReviewCodableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionReviewCodableTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionReviewScreenshotTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionReviewScreenshotTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionReviewScreenshotTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionReviewScreenshotTests.swift index fa2c2f41..e83d0def 100644 --- a/Tests/DomainTests/Apps/Subscriptions/Review/SubscriptionReviewScreenshotTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/SubscriptionReviewScreenshotTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionReviewScreenshotTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionGroupLocalizationCodableTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionGroupLocalizationCodableTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionGroupLocalizationCodableTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionGroupLocalizationCodableTests.swift index 4cd39a9c..f49b3ec0 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionGroupLocalizationCodableTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionGroupLocalizationCodableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionGroupLocalizationCodableTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionGroupLocalizationTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionGroupLocalizationTests.swift similarity index 97% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionGroupLocalizationTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionGroupLocalizationTests.swift index 3a09f46c..366273f7 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionGroupLocalizationTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionGroupLocalizationTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionGroupLocalizationTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPriceCodableTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPriceCodableTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionPriceCodableTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPriceCodableTests.swift index 87217d7b..9bb80a94 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPriceCodableTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPriceCodableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPriceCodableTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPricePointTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPricePointTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionPricePointTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPricePointTests.swift index 5fc1f9d8..e6ede642 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPricePointTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPricePointTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPricePointTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPriceScheduleTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPriceScheduleTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionPriceScheduleTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPriceScheduleTests.swift index 6436f6ae..7e0bfaae 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPriceScheduleTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPriceScheduleTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPriceScheduleTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPromotionalOfferCodableTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPromotionalOfferCodableTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionPromotionalOfferCodableTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPromotionalOfferCodableTests.swift index 6c8557c4..e177f406 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPromotionalOfferCodableTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPromotionalOfferCodableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPromotionalOfferCodableTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPromotionalOfferTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPromotionalOfferTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionPromotionalOfferTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPromotionalOfferTests.swift index ee7f8bef..1519b17c 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionPromotionalOfferTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionPromotionalOfferTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionPromotionalOfferTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionSubmissionTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionSubmissionTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionSubmissionTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionSubmissionTests.swift index 9bd51fe8..aa1204dc 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionSubmissionTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionSubmissionTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionSubmissionTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/SubscriptionTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Subscriptions/SubscriptionTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/SubscriptionTests.swift index d9eb8709..16247a2d 100644 --- a/Tests/DomainTests/Apps/Subscriptions/SubscriptionTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/SubscriptionTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubscriptionTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/WinBackOfferCodableTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/WinBackOfferCodableTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/WinBackOfferCodableTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/WinBackOfferCodableTests.swift index dbcd9580..0e409c45 100644 --- a/Tests/DomainTests/Apps/Subscriptions/WinBackOfferCodableTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/WinBackOfferCodableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct WinBackOfferCodableTests { diff --git a/Tests/DomainTests/Apps/Subscriptions/WinBackOfferTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/WinBackOfferTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Subscriptions/WinBackOfferTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/WinBackOfferTests.swift index ce3658db..d1259916 100644 --- a/Tests/DomainTests/Apps/Subscriptions/WinBackOfferTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/WinBackOfferTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct WinBackOfferTests { diff --git a/Tests/DomainTests/Apps/TestFlight/BetaAppLocalizationTests.swift b/Tests/ASCKitTests/Apps/TestFlight/BetaAppLocalizationTests.swift similarity index 99% rename from Tests/DomainTests/Apps/TestFlight/BetaAppLocalizationTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/BetaAppLocalizationTests.swift index cfe8957c..beced922 100644 --- a/Tests/DomainTests/Apps/TestFlight/BetaAppLocalizationTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/BetaAppLocalizationTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct BetaAppLocalizationTests { diff --git a/Tests/DomainTests/Apps/TestFlight/BetaAppReviewDetailTests.swift b/Tests/ASCKitTests/Apps/TestFlight/BetaAppReviewDetailTests.swift similarity index 99% rename from Tests/DomainTests/Apps/TestFlight/BetaAppReviewDetailTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/BetaAppReviewDetailTests.swift index 48e4f550..312629ca 100644 --- a/Tests/DomainTests/Apps/TestFlight/BetaAppReviewDetailTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/BetaAppReviewDetailTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct BetaAppReviewDetailTests { diff --git a/Tests/DomainTests/Apps/TestFlight/BetaAppReviewSubmissionTests.swift b/Tests/ASCKitTests/Apps/TestFlight/BetaAppReviewSubmissionTests.swift similarity index 99% rename from Tests/DomainTests/Apps/TestFlight/BetaAppReviewSubmissionTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/BetaAppReviewSubmissionTests.swift index 50b3b810..1a401ef0 100644 --- a/Tests/DomainTests/Apps/TestFlight/BetaAppReviewSubmissionTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/BetaAppReviewSubmissionTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct BetaAppReviewSubmissionTests { diff --git a/Tests/DomainTests/Apps/TestFlight/BetaGroupTests.swift b/Tests/ASCKitTests/Apps/TestFlight/BetaGroupTests.swift similarity index 97% rename from Tests/DomainTests/Apps/TestFlight/BetaGroupTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/BetaGroupTests.swift index a10b27be..98c9231f 100644 --- a/Tests/DomainTests/Apps/TestFlight/BetaGroupTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/BetaGroupTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct BetaGroupTests { diff --git a/Tests/DomainTests/Apps/TestFlight/BetaTesterTests.swift b/Tests/ASCKitTests/Apps/TestFlight/BetaTesterTests.swift similarity index 99% rename from Tests/DomainTests/Apps/TestFlight/BetaTesterTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/BetaTesterTests.swift index 1318612d..af2b16ee 100644 --- a/Tests/DomainTests/Apps/TestFlight/BetaTesterTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/BetaTesterTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct BetaTesterTests { diff --git a/Tests/InfrastructureTests/Apps/TestFlight/SDKBetaAppLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/TestFlight/SDKBetaAppLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift index 96ecc539..7c811c32 100644 --- a/Tests/InfrastructureTests/Apps/TestFlight/SDKBetaAppLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKBetaAppLocalizationRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/TestFlight/SDKBetaAppReviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/TestFlight/SDKBetaAppReviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift index 806e42ce..7a84e8de 100644 --- a/Tests/InfrastructureTests/Apps/TestFlight/SDKBetaAppReviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKBetaAppReviewRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/TestFlight/SDKTestFlightRepositoryTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/TestFlight/SDKTestFlightRepositoryTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift index 68633216..49561f10 100644 --- a/Tests/InfrastructureTests/Apps/TestFlight/SDKTestFlightRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKTestFlightRepositoryTests { @@ -71,7 +70,7 @@ struct SDKTestFlightRepositoryTests { } @Test func `listBetaTesters maps inviteType email and publicLink`() async throws { - let cases: [(BetaInviteType, Domain.BetaTester.InviteType)] = [ + let cases: [(BetaInviteType, ASCKit.BetaTester.InviteType)] = [ (.email, .email), (.publicLink, .publicLink), ] diff --git a/Tests/DomainTests/Apps/Versions/AppStoreReviewDetailTests.swift b/Tests/ASCKitTests/Apps/Versions/AppStoreReviewDetailTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/AppStoreReviewDetailTests.swift rename to Tests/ASCKitTests/Apps/Versions/AppStoreReviewDetailTests.swift index e5372143..8a95a9af 100644 --- a/Tests/DomainTests/Apps/Versions/AppStoreReviewDetailTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/AppStoreReviewDetailTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppStoreReviewDetailTests { diff --git a/Tests/DomainTests/Apps/Versions/AppStoreVersionStateTests.swift b/Tests/ASCKitTests/Apps/Versions/AppStoreVersionStateTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/AppStoreVersionStateTests.swift rename to Tests/ASCKitTests/Apps/Versions/AppStoreVersionStateTests.swift index 8a81fc06..4d3a8986 100644 --- a/Tests/DomainTests/Apps/Versions/AppStoreVersionStateTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/AppStoreVersionStateTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppStoreVersionStateTests { diff --git a/Tests/DomainTests/Apps/Versions/AppStoreVersionTests.swift b/Tests/ASCKitTests/Apps/Versions/AppStoreVersionTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/AppStoreVersionTests.swift rename to Tests/ASCKitTests/Apps/Versions/AppStoreVersionTests.swift index b6f37cef..31e0b278 100644 --- a/Tests/DomainTests/Apps/Versions/AppStoreVersionTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/AppStoreVersionTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppStoreVersionTests { diff --git a/Tests/InfrastructureTests/Apps/Versions/SDKReviewDetailRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Versions/SDKReviewDetailRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift index e3442fcc..c0bdd9c5 100644 --- a/Tests/InfrastructureTests/Apps/Versions/SDKReviewDetailRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKReviewDetailRepositoryTests { @@ -103,7 +102,7 @@ struct SDKReviewDetailRepositoryTests { links: .init(this: "") ) let repo = SDKReviewDetailRepository(client: stub) - let update = Domain.ReviewDetailUpdate( + let update = ASCKit.ReviewDetailUpdate( contactFirstName: "Jane", contactLastName: "Smith", contactPhone: "+1-555-0101", @@ -156,7 +155,7 @@ struct SDKReviewDetailRepositoryTests { links: .init(this: "") )) let repo = SDKReviewDetailRepository(client: stub) - let update = Domain.ReviewDetailUpdate( + let update = ASCKit.ReviewDetailUpdate( contactFirstName: "New", contactPhone: "+1-555-9999", contactEmail: "new@example.com", diff --git a/Tests/InfrastructureTests/Apps/Versions/SDKVersionRepositoryCreateTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift similarity index 97% rename from Tests/InfrastructureTests/Apps/Versions/SDKVersionRepositoryCreateTests.swift rename to Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift index cd865817..c2d11d84 100644 --- a/Tests/InfrastructureTests/Apps/Versions/SDKVersionRepositoryCreateTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKVersionRepositoryCreateTests { diff --git a/Tests/InfrastructureTests/Apps/Versions/SDKVersionRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Versions/SDKVersionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift index 07019ba7..b51fb16d 100644 --- a/Tests/InfrastructureTests/Apps/Versions/SDKVersionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKVersionRepositoryTests { diff --git a/Tests/DomainTests/Apps/Versions/Localizations/AppStoreVersionLocalizationTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/AppStoreVersionLocalizationTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/Localizations/AppStoreVersionLocalizationTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/AppStoreVersionLocalizationTests.swift index 6095081c..e002dae7 100644 --- a/Tests/DomainTests/Apps/Versions/Localizations/AppStoreVersionLocalizationTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/AppStoreVersionLocalizationTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppStoreVersionLocalizationTests { diff --git a/Tests/InfrastructureTests/Apps/Versions/Localizations/SDKLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Versions/Localizations/SDKLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift index 9803a951..a2902b3a 100644 --- a/Tests/InfrastructureTests/Apps/Versions/Localizations/SDKLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKLocalizationRepositoryTests { diff --git a/Tests/DomainTests/Apps/Versions/Localizations/PreviewSets/AppPreviewSetTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/AppPreviewSetTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/Localizations/PreviewSets/AppPreviewSetTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/AppPreviewSetTests.swift index fad504cf..d76cb332 100644 --- a/Tests/DomainTests/Apps/Versions/Localizations/PreviewSets/AppPreviewSetTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/AppPreviewSetTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppPreviewSetTests { diff --git a/Tests/DomainTests/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreviewTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreviewTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreviewTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreviewTests.swift index 6ffef6db..62545912 100644 --- a/Tests/DomainTests/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreviewTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/AppPreviews/AppPreviewTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppPreviewTests { diff --git a/Tests/InfrastructureTests/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift index 6ed77ad5..9e108932 100644 --- a/Tests/InfrastructureTests/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct OpenAPIPreviewRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepositoryUploadTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift index 90215850..afc88c2b 100644 --- a/Tests/InfrastructureTests/Apps/Versions/Localizations/PreviewSets/OpenAPIPreviewRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct OpenAPIPreviewRepositoryUploadTests { diff --git a/Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift index d7fe3561..c1311fa4 100644 --- a/Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift @@ -1,7 +1,7 @@ import Foundation import Mockable import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppScreenshotSetTests { diff --git a/Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryCreateTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift similarity index 97% rename from Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryCreateTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift index 933e6c0f..ee38ffab 100644 --- a/Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryCreateTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKScreenshotRepositoryCreateTests { diff --git a/Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift index 9cc5130e..aa3a05ed 100644 --- a/Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKScreenshotRepositoryTests { diff --git a/Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift similarity index 98% rename from Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryUploadTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift index a2b3f6cf..319eb08b 100644 --- a/Tests/InfrastructureTests/Apps/Versions/Localizations/ScreenshotSets/SDKScreenshotRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKScreenshotRepositoryUploadTests { diff --git a/Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayTypeTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayTypeTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayTypeTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayTypeTests.swift index b47b961f..8be7dc6d 100644 --- a/Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayTypeTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotDisplayTypeTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotDisplayTypeTests { diff --git a/Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift similarity index 98% rename from Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift index f2facc65..4dd1d93c 100644 --- a/Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift @@ -1,6 +1,6 @@ import Mockable import Testing -@testable import Domain +@testable import ASCKit @Suite struct ScreenshotRepositoryTests { diff --git a/Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshotTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshotTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshotTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshotTests.swift index f45bbce5..a1446745 100644 --- a/Tests/DomainTests/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshotTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Screenshots/AppScreenshotTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppScreenshotTests { diff --git a/Tests/DomainTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift index 1c011992..546026d6 100644 --- a/Tests/DomainTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift @@ -1,6 +1,6 @@ import Mockable import Testing -@testable import Domain +@testable import ASCKit @Suite struct VersionLocalizationRepositoryTests { diff --git a/Tests/DomainTests/Apps/Versions/VersionReadinessTests.swift b/Tests/ASCKitTests/Apps/Versions/VersionReadinessTests.swift similarity index 99% rename from Tests/DomainTests/Apps/Versions/VersionReadinessTests.swift rename to Tests/ASCKitTests/Apps/Versions/VersionReadinessTests.swift index 4ff26e9e..43f7584d 100644 --- a/Tests/DomainTests/Apps/Versions/VersionReadinessTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/VersionReadinessTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct VersionReadinessTests { diff --git a/Tests/DomainTests/Apps/Versions/VersionRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift similarity index 97% rename from Tests/DomainTests/Apps/Versions/VersionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift index 0c76ac1f..fd888344 100644 --- a/Tests/DomainTests/Apps/Versions/VersionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift @@ -1,6 +1,6 @@ import Mockable import Testing -@testable import Domain +@testable import ASCKit @Suite struct VersionRepositoryTests { diff --git a/Tests/DomainTests/Auth/AccountEntryTests.swift b/Tests/ASCKitTests/Auth/AccountEntryTests.swift similarity index 99% rename from Tests/DomainTests/Auth/AccountEntryTests.swift rename to Tests/ASCKitTests/Auth/AccountEntryTests.swift index 70888928..b784b8f5 100644 --- a/Tests/DomainTests/Auth/AccountEntryTests.swift +++ b/Tests/ASCKitTests/Auth/AccountEntryTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ConnectAccountTests { diff --git a/Tests/DomainTests/Auth/AuthCredentialsTests.swift b/Tests/ASCKitTests/Auth/AuthCredentialsTests.swift similarity index 99% rename from Tests/DomainTests/Auth/AuthCredentialsTests.swift rename to Tests/ASCKitTests/Auth/AuthCredentialsTests.swift index f8fe61b6..44e13d4d 100644 --- a/Tests/DomainTests/Auth/AuthCredentialsTests.swift +++ b/Tests/ASCKitTests/Auth/AuthCredentialsTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AuthCredentialsTests { diff --git a/Tests/DomainTests/Auth/AuthStatusTests.swift b/Tests/ASCKitTests/Auth/AuthStatusTests.swift similarity index 99% rename from Tests/DomainTests/Auth/AuthStatusTests.swift rename to Tests/ASCKitTests/Auth/AuthStatusTests.swift index f6dfdcff..48b0c061 100644 --- a/Tests/DomainTests/Auth/AuthStatusTests.swift +++ b/Tests/ASCKitTests/Auth/AuthStatusTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AuthStatusTests { diff --git a/Tests/InfrastructureTests/Auth/CompositeAuthProviderTests.swift b/Tests/ASCKitTests/Auth/Internal/CompositeAuthProviderTests.swift similarity index 96% rename from Tests/InfrastructureTests/Auth/CompositeAuthProviderTests.swift rename to Tests/ASCKitTests/Auth/Internal/CompositeAuthProviderTests.swift index c3e93c5e..bb3e187c 100644 --- a/Tests/InfrastructureTests/Auth/CompositeAuthProviderTests.swift +++ b/Tests/ASCKitTests/Auth/Internal/CompositeAuthProviderTests.swift @@ -1,7 +1,6 @@ import Mockable import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct CompositeAuthProviderTests { diff --git a/Tests/InfrastructureTests/Auth/EnvironmentAuthProviderTests.swift b/Tests/ASCKitTests/Auth/Internal/EnvironmentAuthProviderTests.swift similarity index 98% rename from Tests/InfrastructureTests/Auth/EnvironmentAuthProviderTests.swift rename to Tests/ASCKitTests/Auth/Internal/EnvironmentAuthProviderTests.swift index 53c62f48..5837cd7b 100644 --- a/Tests/InfrastructureTests/Auth/EnvironmentAuthProviderTests.swift +++ b/Tests/ASCKitTests/Auth/Internal/EnvironmentAuthProviderTests.swift @@ -1,6 +1,5 @@ import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct EnvironmentAuthProviderTests { diff --git a/Tests/InfrastructureTests/Auth/FileAuthProviderTests.swift b/Tests/ASCKitTests/Auth/Internal/FileAuthProviderTests.swift similarity index 97% rename from Tests/InfrastructureTests/Auth/FileAuthProviderTests.swift rename to Tests/ASCKitTests/Auth/Internal/FileAuthProviderTests.swift index 192a19d9..49033b8f 100644 --- a/Tests/InfrastructureTests/Auth/FileAuthProviderTests.swift +++ b/Tests/ASCKitTests/Auth/Internal/FileAuthProviderTests.swift @@ -1,7 +1,6 @@ import Mockable import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite("FileAuthProvider — resolves credentials from storage") struct FileAuthProviderTests { diff --git a/Tests/InfrastructureTests/Auth/FileAuthStorageMultiAccountTests.swift b/Tests/ASCKitTests/Auth/Internal/FileAuthStorageMultiAccountTests.swift similarity index 99% rename from Tests/InfrastructureTests/Auth/FileAuthStorageMultiAccountTests.swift rename to Tests/ASCKitTests/Auth/Internal/FileAuthStorageMultiAccountTests.swift index 2fc89c52..2fb198e5 100644 --- a/Tests/InfrastructureTests/Auth/FileAuthStorageMultiAccountTests.swift +++ b/Tests/ASCKitTests/Auth/Internal/FileAuthStorageMultiAccountTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct FileAuthStorageMultiAccountTests { diff --git a/Tests/InfrastructureTests/Auth/FileAuthStorageTests.swift b/Tests/ASCKitTests/Auth/Internal/FileAuthStorageTests.swift similarity index 97% rename from Tests/InfrastructureTests/Auth/FileAuthStorageTests.swift rename to Tests/ASCKitTests/Auth/Internal/FileAuthStorageTests.swift index 27117064..59ffd3bd 100644 --- a/Tests/InfrastructureTests/Auth/FileAuthStorageTests.swift +++ b/Tests/ASCKitTests/Auth/Internal/FileAuthStorageTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct FileAuthStorageTests { diff --git a/Tests/DomainTests/Auth/Iris/IrisAuthSummaryTests.swift b/Tests/ASCKitTests/Auth/Iris/IrisAuthSummaryTests.swift similarity index 99% rename from Tests/DomainTests/Auth/Iris/IrisAuthSummaryTests.swift rename to Tests/ASCKitTests/Auth/Iris/IrisAuthSummaryTests.swift index a6b7714a..42c35ac3 100644 --- a/Tests/DomainTests/Auth/Iris/IrisAuthSummaryTests.swift +++ b/Tests/ASCKitTests/Auth/Iris/IrisAuthSummaryTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct IrisAuthSummaryTests { diff --git a/Tests/DomainTests/Auth/Iris/IrisAuthTypesTests.swift b/Tests/ASCKitTests/Auth/Iris/IrisAuthTypesTests.swift similarity index 99% rename from Tests/DomainTests/Auth/Iris/IrisAuthTypesTests.swift rename to Tests/ASCKitTests/Auth/Iris/IrisAuthTypesTests.swift index b2c2ae00..8798ff3d 100644 --- a/Tests/DomainTests/Auth/Iris/IrisAuthTypesTests.swift +++ b/Tests/ASCKitTests/Auth/Iris/IrisAuthTypesTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct IrisAuthTypesTests { diff --git a/Tests/DomainTests/CodeSigning/BundleIDTests.swift b/Tests/ASCKitTests/CodeSigning/BundleIDTests.swift similarity index 98% rename from Tests/DomainTests/CodeSigning/BundleIDTests.swift rename to Tests/ASCKitTests/CodeSigning/BundleIDTests.swift index 092239b8..2c8ab179 100644 --- a/Tests/DomainTests/CodeSigning/BundleIDTests.swift +++ b/Tests/ASCKitTests/CodeSigning/BundleIDTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct BundleIDTests { diff --git a/Tests/DomainTests/CodeSigning/CertificateTests.swift b/Tests/ASCKitTests/CodeSigning/CertificateTests.swift similarity index 98% rename from Tests/DomainTests/CodeSigning/CertificateTests.swift rename to Tests/ASCKitTests/CodeSigning/CertificateTests.swift index ae7b6172..3319abc3 100644 --- a/Tests/DomainTests/CodeSigning/CertificateTests.swift +++ b/Tests/ASCKitTests/CodeSigning/CertificateTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct CertificateTests { diff --git a/Tests/DomainTests/CodeSigning/DeviceTests.swift b/Tests/ASCKitTests/CodeSigning/DeviceTests.swift similarity index 98% rename from Tests/DomainTests/CodeSigning/DeviceTests.swift rename to Tests/ASCKitTests/CodeSigning/DeviceTests.swift index 45581a04..de67af93 100644 --- a/Tests/DomainTests/CodeSigning/DeviceTests.swift +++ b/Tests/ASCKitTests/CodeSigning/DeviceTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct DeviceTests { diff --git a/Tests/InfrastructureTests/CodeSigning/SDKBundleIDRepositoryTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/CodeSigning/SDKBundleIDRepositoryTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift index 405d0c4c..be0cb830 100644 --- a/Tests/InfrastructureTests/CodeSigning/SDKBundleIDRepositoryTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKBundleIDRepositoryTests { diff --git a/Tests/InfrastructureTests/CodeSigning/SDKCertificateRepositoryTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift similarity index 97% rename from Tests/InfrastructureTests/CodeSigning/SDKCertificateRepositoryTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift index f2e91d9e..7a7d0a48 100644 --- a/Tests/InfrastructureTests/CodeSigning/SDKCertificateRepositoryTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKCertificateRepositoryTests { diff --git a/Tests/InfrastructureTests/CodeSigning/SDKDeviceRepositoryTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/CodeSigning/SDKDeviceRepositoryTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift index 6b5842f0..67b1bf93 100644 --- a/Tests/InfrastructureTests/CodeSigning/SDKDeviceRepositoryTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKDeviceRepositoryTests { diff --git a/Tests/InfrastructureTests/CodeSigning/SDKProfileRepositoryTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/CodeSigning/SDKProfileRepositoryTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift index d27e3a37..d7d837b0 100644 --- a/Tests/InfrastructureTests/CodeSigning/SDKProfileRepositoryTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKProfileRepositoryTests { diff --git a/Tests/DomainTests/CodeSigning/ProfileTests.swift b/Tests/ASCKitTests/CodeSigning/ProfileTests.swift similarity index 97% rename from Tests/DomainTests/CodeSigning/ProfileTests.swift rename to Tests/ASCKitTests/CodeSigning/ProfileTests.swift index a436af49..7728285b 100644 --- a/Tests/DomainTests/CodeSigning/ProfileTests.swift +++ b/Tests/ASCKitTests/CodeSigning/ProfileTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct ProfileTests { diff --git a/Tests/DomainTests/GameCenter/GameCenterTests.swift b/Tests/ASCKitTests/GameCenter/GameCenterTests.swift similarity index 99% rename from Tests/DomainTests/GameCenter/GameCenterTests.swift rename to Tests/ASCKitTests/GameCenter/GameCenterTests.swift index 86d57eb4..51c20fbe 100644 --- a/Tests/DomainTests/GameCenter/GameCenterTests.swift +++ b/Tests/ASCKitTests/GameCenter/GameCenterTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit // MARK: - GameCenterDetail diff --git a/Tests/InfrastructureTests/GameCenter/SDKGameCenterRepositoryTests.swift b/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/GameCenter/SDKGameCenterRepositoryTests.swift rename to Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift index a30d03e3..55ca398f 100644 --- a/Tests/InfrastructureTests/GameCenter/SDKGameCenterRepositoryTests.swift +++ b/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKGameCenterRepositoryTests { diff --git a/Tests/DomainTests/GameCenter/Moderation/GameCenterModerationTests.swift b/Tests/ASCKitTests/GameCenter/Moderation/GameCenterModerationTests.swift similarity index 99% rename from Tests/DomainTests/GameCenter/Moderation/GameCenterModerationTests.swift rename to Tests/ASCKitTests/GameCenter/Moderation/GameCenterModerationTests.swift index 4b1c61c7..2e60bd6c 100644 --- a/Tests/DomainTests/GameCenter/Moderation/GameCenterModerationTests.swift +++ b/Tests/ASCKitTests/GameCenter/Moderation/GameCenterModerationTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit // MARK: - GameCenterScoreModeration diff --git a/Tests/InfrastructureTests/GameCenter/Moderation/SDKGameCenterModerationRepositoryTests.swift b/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift similarity index 97% rename from Tests/InfrastructureTests/GameCenter/Moderation/SDKGameCenterModerationRepositoryTests.swift rename to Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift index 108b4126..f843468d 100644 --- a/Tests/InfrastructureTests/GameCenter/Moderation/SDKGameCenterModerationRepositoryTests.swift +++ b/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKGameCenterModerationRepositoryTests { @@ -42,7 +41,7 @@ struct SDKGameCenterModerationRepositoryTests { let result = try await repo.listScoreModerations(leaderboardId: "lb-42", blockedOnly: false) #expect(result == [ - Domain.GameCenterScoreModeration( + ASCKit.GameCenterScoreModeration( id: "mod-1", leaderboardId: "lb-42", rank: "1", @@ -77,7 +76,7 @@ struct SDKGameCenterModerationRepositoryTests { let result = try await repo.listScoreModerations(leaderboardId: "lb-42", blockedOnly: true) #expect(result == [ - Domain.GameCenterScoreModeration( + ASCKit.GameCenterScoreModeration( id: "mod-1", leaderboardId: "lb-42", rank: nil, score: nil, submittedDate: nil, isBlocked: true, isPreReleased: false, context: nil, challengeIds: [], playerId: "player-1", playerNickname: nil, isPlayerBlocked: nil @@ -120,7 +119,7 @@ struct SDKGameCenterModerationRepositoryTests { let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.updateScoreModeration(id: "mod-1", isBlocked: true) - #expect(result == Domain.GameCenterScoreModeration( + #expect(result == ASCKit.GameCenterScoreModeration( id: "mod-1", leaderboardId: nil, rank: "3", score: "1200", submittedDate: nil, isBlocked: true, isPreReleased: false, context: nil, challengeIds: [], playerId: "player-1", playerNickname: nil, isPlayerBlocked: nil @@ -159,7 +158,7 @@ struct SDKGameCenterModerationRepositoryTests { let result = try await repo.listBlockedPlayers(gameCenterDetailId: "gc-42") #expect(result == [ - Domain.GameCenterPlayer( + ASCKit.GameCenterPlayer( id: "player-1", gameCenterDetailId: "gc-42", nickname: "Player One", bundleId: "com.example.game", isBlocked: true ), @@ -213,7 +212,7 @@ struct SDKGameCenterModerationRepositoryTests { let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.updatePlayer(id: "player-1", isBlocked: false) - #expect(result == Domain.GameCenterPlayer( + #expect(result == ASCKit.GameCenterPlayer( id: "player-1", gameCenterDetailId: nil, nickname: "Player One", bundleId: "com.example.game", isBlocked: false )) diff --git a/Tests/DomainTests/Iris/AppBundles/AppBundleTests.swift b/Tests/ASCKitTests/Iris/AppBundles/AppBundleTests.swift similarity index 99% rename from Tests/DomainTests/Iris/AppBundles/AppBundleTests.swift rename to Tests/ASCKitTests/Iris/AppBundles/AppBundleTests.swift index 1dd684ce..8aa33062 100644 --- a/Tests/DomainTests/Iris/AppBundles/AppBundleTests.swift +++ b/Tests/ASCKitTests/Iris/AppBundles/AppBundleTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppBundleTests { diff --git a/Tests/InfrastructureTests/Iris/InAppPurchases/IrisSDKInAppPurchaseStateRepositoryTests.swift b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Iris/InAppPurchases/IrisSDKInAppPurchaseStateRepositoryTests.swift rename to Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift index 87b08073..9a926291 100644 --- a/Tests/InfrastructureTests/Iris/InAppPurchases/IrisSDKInAppPurchaseStateRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift @@ -1,7 +1,6 @@ -import Domain import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit /// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionRepositoryTests` /// for why we don't share `URLProtocolStub` between iris suites. diff --git a/Tests/InfrastructureTests/Iris/InAppPurchases/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Iris/InAppPurchases/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift rename to Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift index 26c11c6f..5efff7d5 100644 --- a/Tests/InfrastructureTests/Iris/InAppPurchases/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift @@ -1,7 +1,6 @@ -import Domain import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit private func collectBody(from request: URLRequest) -> Data? { if let body = request.httpBody { return body } diff --git a/Tests/DomainTests/Iris/InAppPurchases/IrisInAppPurchaseSubmissionTests.swift b/Tests/ASCKitTests/Iris/InAppPurchases/IrisInAppPurchaseSubmissionTests.swift similarity index 98% rename from Tests/DomainTests/Iris/InAppPurchases/IrisInAppPurchaseSubmissionTests.swift rename to Tests/ASCKitTests/Iris/InAppPurchases/IrisInAppPurchaseSubmissionTests.swift index 564e0c19..355e396e 100644 --- a/Tests/DomainTests/Iris/InAppPurchases/IrisInAppPurchaseSubmissionTests.swift +++ b/Tests/ASCKitTests/Iris/InAppPurchases/IrisInAppPurchaseSubmissionTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct IrisInAppPurchaseSubmissionTests { diff --git a/Tests/InfrastructureTests/Iris/Auth/CompositeIrisCookieProviderTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/CompositeIrisCookieProviderTests.swift similarity index 98% rename from Tests/InfrastructureTests/Iris/Auth/CompositeIrisCookieProviderTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/CompositeIrisCookieProviderTests.swift index 046b87f1..054a9226 100644 --- a/Tests/InfrastructureTests/Iris/Auth/CompositeIrisCookieProviderTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/CompositeIrisCookieProviderTests.swift @@ -1,8 +1,7 @@ -import Domain import Foundation import Mockable import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct CompositeIrisCookieProviderTests { diff --git a/Tests/InfrastructureTests/Iris/Auth/FileIrisSessionRepositoryTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift similarity index 97% rename from Tests/InfrastructureTests/Iris/Auth/FileIrisSessionRepositoryTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift index 493a6acc..0e40d370 100644 --- a/Tests/InfrastructureTests/Iris/Auth/FileIrisSessionRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct FileIrisSessionRepositoryTests { diff --git a/Tests/InfrastructureTests/Iris/Auth/IdmsaAPIClientTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/IdmsaAPIClientTests.swift similarity index 99% rename from Tests/InfrastructureTests/Iris/Auth/IdmsaAPIClientTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/IdmsaAPIClientTests.swift index 2cd93ca8..afc9ae81 100644 --- a/Tests/InfrastructureTests/Iris/Auth/IdmsaAPIClientTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/IdmsaAPIClientTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit final class CapturedBody: @unchecked Sendable { private let lock = NSLock() diff --git a/Tests/InfrastructureTests/Iris/Auth/OlympusClientTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift similarity index 99% rename from Tests/InfrastructureTests/Iris/Auth/OlympusClientTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift index 01357cc8..a9b1c66e 100644 --- a/Tests/InfrastructureTests/Iris/Auth/OlympusClientTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit /// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionRepositoryTests` /// for the rationale (avoids racing the shared `URLProtocolStub.handler` static used diff --git a/Tests/InfrastructureTests/Iris/Auth/SRP/AppleHashcashTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/SRP/AppleHashcashTests.swift similarity index 98% rename from Tests/InfrastructureTests/Iris/Auth/SRP/AppleHashcashTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/SRP/AppleHashcashTests.swift index 01357cf4..52393e51 100644 --- a/Tests/InfrastructureTests/Iris/Auth/SRP/AppleHashcashTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/SRP/AppleHashcashTests.swift @@ -1,7 +1,7 @@ import Crypto import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct AppleHashcashTests { diff --git a/Tests/InfrastructureTests/Iris/Auth/SRP/AppleSRPClientTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/SRP/AppleSRPClientTests.swift similarity index 99% rename from Tests/InfrastructureTests/Iris/Auth/SRP/AppleSRPClientTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/SRP/AppleSRPClientTests.swift index 8951b919..a79c1d32 100644 --- a/Tests/InfrastructureTests/Iris/Auth/SRP/AppleSRPClientTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/SRP/AppleSRPClientTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct AppleSRPClientTests { diff --git a/Tests/InfrastructureTests/Iris/Auth/StoredSRPIrisCookieProviderTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift similarity index 98% rename from Tests/InfrastructureTests/Iris/Auth/StoredSRPIrisCookieProviderTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift index 09c324c9..ee434aab 100644 --- a/Tests/InfrastructureTests/Iris/Auth/StoredSRPIrisCookieProviderTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift @@ -1,8 +1,7 @@ -import Domain import Foundation import Mockable import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct StoredSRPIrisCookieProviderTests { diff --git a/Tests/InfrastructureTests/Iris/Auth/URLProtocolStub.swift b/Tests/ASCKitTests/Iris/Internal/Auth/URLProtocolStub.swift similarity index 100% rename from Tests/InfrastructureTests/Iris/Auth/URLProtocolStub.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/URLProtocolStub.swift diff --git a/Tests/InfrastructureTests/Iris/IrisAPIErrorTests.swift b/Tests/ASCKitTests/Iris/Internal/IrisAPIErrorTests.swift similarity index 96% rename from Tests/InfrastructureTests/Iris/IrisAPIErrorTests.swift rename to Tests/ASCKitTests/Iris/Internal/IrisAPIErrorTests.swift index 3c1ab811..73143c88 100644 --- a/Tests/InfrastructureTests/Iris/IrisAPIErrorTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/IrisAPIErrorTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct IrisAPIErrorTests { diff --git a/Tests/InfrastructureTests/Iris/IrisCookieErrorTests.swift b/Tests/ASCKitTests/Iris/Internal/IrisCookieErrorTests.swift similarity index 91% rename from Tests/InfrastructureTests/Iris/IrisCookieErrorTests.swift rename to Tests/ASCKitTests/Iris/Internal/IrisCookieErrorTests.swift index 19a7bbd1..8f18f4d8 100644 --- a/Tests/InfrastructureTests/Iris/IrisCookieErrorTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/IrisCookieErrorTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct IrisCookieErrorTests { diff --git a/Tests/InfrastructureTests/Iris/IrisCreateAppDocumentTests.swift b/Tests/ASCKitTests/Iris/Internal/IrisCreateAppDocumentTests.swift similarity index 99% rename from Tests/InfrastructureTests/Iris/IrisCreateAppDocumentTests.swift rename to Tests/ASCKitTests/Iris/Internal/IrisCreateAppDocumentTests.swift index 5a12ab4f..eebeefa2 100644 --- a/Tests/InfrastructureTests/Iris/IrisCreateAppDocumentTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/IrisCreateAppDocumentTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct AppCreateRequestTests { diff --git a/Tests/InfrastructureTests/Iris/IrisResponseDecodingTests.swift b/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift similarity index 98% rename from Tests/InfrastructureTests/Iris/IrisResponseDecodingTests.swift rename to Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift index c4e1d810..eea95beb 100644 --- a/Tests/InfrastructureTests/Iris/IrisResponseDecodingTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct IrisResponseDecodingTests { diff --git a/Tests/DomainTests/Iris/IrisSessionTests.swift b/Tests/ASCKitTests/Iris/IrisSessionTests.swift similarity index 94% rename from Tests/DomainTests/Iris/IrisSessionTests.swift rename to Tests/ASCKitTests/Iris/IrisSessionTests.swift index 8a700e70..9c5d173c 100644 --- a/Tests/DomainTests/Iris/IrisSessionTests.swift +++ b/Tests/ASCKitTests/Iris/IrisSessionTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct IrisSessionTests { diff --git a/Tests/DomainTests/Iris/IrisStatusTests.swift b/Tests/ASCKitTests/Iris/IrisStatusTests.swift similarity index 97% rename from Tests/DomainTests/Iris/IrisStatusTests.swift rename to Tests/ASCKitTests/Iris/IrisStatusTests.swift index 3d67fe5e..f8068782 100644 --- a/Tests/DomainTests/Iris/IrisStatusTests.swift +++ b/Tests/ASCKitTests/Iris/IrisStatusTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct IrisStatusTests { diff --git a/Tests/InfrastructureTests/Iris/ResolutionCenter/IrisSDKResolutionCenterRepositoryTests.swift b/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Iris/ResolutionCenter/IrisSDKResolutionCenterRepositoryTests.swift rename to Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift index 58fd7878..a3e7ef33 100644 --- a/Tests/InfrastructureTests/Iris/ResolutionCenter/IrisSDKResolutionCenterRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift @@ -1,7 +1,6 @@ -import Domain import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit /// Private URLProtocol subclass with its own `handler` static so this suite's /// stubs can't race with other iris suites' handlers when run in parallel diff --git a/Tests/DomainTests/Iris/ResolutionCenter/ResolutionCenterDetailTests.swift b/Tests/ASCKitTests/Iris/ResolutionCenter/ResolutionCenterDetailTests.swift similarity index 99% rename from Tests/DomainTests/Iris/ResolutionCenter/ResolutionCenterDetailTests.swift rename to Tests/ASCKitTests/Iris/ResolutionCenter/ResolutionCenterDetailTests.swift index 7b19adbe..a62382e9 100644 --- a/Tests/DomainTests/Iris/ResolutionCenter/ResolutionCenterDetailTests.swift +++ b/Tests/ASCKitTests/Iris/ResolutionCenter/ResolutionCenterDetailTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ResolutionCenterDetailTests { diff --git a/Tests/InfrastructureTests/Plugins/GitHubPluginSourceTests.swift b/Tests/ASCKitTests/Plugins/Internal/GitHubPluginSourceTests.swift similarity index 97% rename from Tests/InfrastructureTests/Plugins/GitHubPluginSourceTests.swift rename to Tests/ASCKitTests/Plugins/Internal/GitHubPluginSourceTests.swift index 43566760..47efd806 100644 --- a/Tests/InfrastructureTests/Plugins/GitHubPluginSourceTests.swift +++ b/Tests/ASCKitTests/Plugins/Internal/GitHubPluginSourceTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite("GitHubPluginSource — fetches registry from GitHub") struct GitHubPluginSourceTests { diff --git a/Tests/InfrastructureTests/Plugins/PluginSettingsStoreTests.swift b/Tests/ASCKitTests/Plugins/Internal/PluginSettingsStoreTests.swift similarity index 100% rename from Tests/InfrastructureTests/Plugins/PluginSettingsStoreTests.swift rename to Tests/ASCKitTests/Plugins/Internal/PluginSettingsStoreTests.swift diff --git a/Tests/DomainTests/Plugins/PluginSourceTests.swift b/Tests/ASCKitTests/Plugins/PluginSourceTests.swift similarity index 97% rename from Tests/DomainTests/Plugins/PluginSourceTests.swift rename to Tests/ASCKitTests/Plugins/PluginSourceTests.swift index b10aec33..0d87e690 100644 --- a/Tests/DomainTests/Plugins/PluginSourceTests.swift +++ b/Tests/ASCKitTests/Plugins/PluginSourceTests.swift @@ -1,7 +1,7 @@ import Foundation import Mockable import Testing -@testable import Domain +@testable import ASCKit @Suite("PluginSource — composable registry sources") struct PluginSourceTests { diff --git a/Tests/DomainTests/Plugins/PluginTests.swift b/Tests/ASCKitTests/Plugins/PluginTests.swift similarity index 99% rename from Tests/DomainTests/Plugins/PluginTests.swift rename to Tests/ASCKitTests/Plugins/PluginTests.swift index 563439da..8c160465 100644 --- a/Tests/DomainTests/Plugins/PluginTests.swift +++ b/Tests/ASCKitTests/Plugins/PluginTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Plugin — unified plugin model") struct PluginTests { diff --git a/Tests/DomainTests/Plugins/PluginUpdateTests.swift b/Tests/ASCKitTests/Plugins/PluginUpdateTests.swift similarity index 98% rename from Tests/DomainTests/Plugins/PluginUpdateTests.swift rename to Tests/ASCKitTests/Plugins/PluginUpdateTests.swift index edab860f..f3dde8d2 100644 --- a/Tests/DomainTests/Plugins/PluginUpdateTests.swift +++ b/Tests/ASCKitTests/Plugins/PluginUpdateTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct PluginUpdateTests { diff --git a/Tests/InfrastructureTests/Projects/FileProjectConfigStorageTests.swift b/Tests/ASCKitTests/Projects/Internal/FileProjectConfigStorageTests.swift similarity index 98% rename from Tests/InfrastructureTests/Projects/FileProjectConfigStorageTests.swift rename to Tests/ASCKitTests/Projects/Internal/FileProjectConfigStorageTests.swift index 95c524f8..0aeefe65 100644 --- a/Tests/InfrastructureTests/Projects/FileProjectConfigStorageTests.swift +++ b/Tests/ASCKitTests/Projects/Internal/FileProjectConfigStorageTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct FileProjectConfigStorageTests { diff --git a/Tests/DomainTests/Projects/ProjectConfigTests.swift b/Tests/ASCKitTests/Projects/ProjectConfigTests.swift similarity index 99% rename from Tests/DomainTests/Projects/ProjectConfigTests.swift rename to Tests/ASCKitTests/Projects/ProjectConfigTests.swift index a5c2280a..aaac087a 100644 --- a/Tests/DomainTests/Projects/ProjectConfigTests.swift +++ b/Tests/ASCKitTests/Projects/ProjectConfigTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ProjectConfigTests { diff --git a/Tests/DomainTests/Reports/AnalyticsReportTests.swift b/Tests/ASCKitTests/Reports/AnalyticsReportTests.swift similarity index 99% rename from Tests/DomainTests/Reports/AnalyticsReportTests.swift rename to Tests/ASCKitTests/Reports/AnalyticsReportTests.swift index ab6ed489..338ebaa1 100644 --- a/Tests/DomainTests/Reports/AnalyticsReportTests.swift +++ b/Tests/ASCKitTests/Reports/AnalyticsReportTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AnalyticsAccessTypeTests { diff --git a/Tests/InfrastructureTests/Reports/SDKAnalyticsReportRepositoryTests.swift b/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Reports/SDKAnalyticsReportRepositoryTests.swift rename to Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift index c99c9051..b3068498 100644 --- a/Tests/InfrastructureTests/Reports/SDKAnalyticsReportRepositoryTests.swift +++ b/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct SDKAnalyticsReportRepositoryCreateRequestTests { diff --git a/Tests/InfrastructureTests/Reports/SDKReportRepositoryTests.swift b/Tests/ASCKitTests/Reports/Internal/SDKReportRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Reports/SDKReportRepositoryTests.swift rename to Tests/ASCKitTests/Reports/Internal/SDKReportRepositoryTests.swift index 9b7fe870..7f946460 100644 --- a/Tests/InfrastructureTests/Reports/SDKReportRepositoryTests.swift +++ b/Tests/ASCKitTests/Reports/Internal/SDKReportRepositoryTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct GzipDecompressionTests { diff --git a/Tests/DomainTests/Reports/ReportFilterTests.swift b/Tests/ASCKitTests/Reports/ReportFilterTests.swift similarity index 99% rename from Tests/DomainTests/Reports/ReportFilterTests.swift rename to Tests/ASCKitTests/Reports/ReportFilterTests.swift index 3a6bf1f2..83a63a2a 100644 --- a/Tests/DomainTests/Reports/ReportFilterTests.swift +++ b/Tests/ASCKitTests/Reports/ReportFilterTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct SalesReportTypeTests { diff --git a/Tests/DomainTests/Screenshots/AppShotTemplateTests.swift b/Tests/ASCKitTests/Screenshots/AppShotTemplateTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/AppShotTemplateTests.swift rename to Tests/ASCKitTests/Screenshots/AppShotTemplateTests.swift index e09c5157..0fcb235d 100644 --- a/Tests/DomainTests/Screenshots/AppShotTemplateTests.swift +++ b/Tests/ASCKitTests/Screenshots/AppShotTemplateTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("AppShotTemplate") struct AppShotTemplateTests { diff --git a/Tests/DomainTests/Screenshots/AppShotsConfigTests.swift b/Tests/ASCKitTests/Screenshots/AppShotsConfigTests.swift similarity index 97% rename from Tests/DomainTests/Screenshots/AppShotsConfigTests.swift rename to Tests/ASCKitTests/Screenshots/AppShotsConfigTests.swift index 5ac34f5e..a42babf5 100644 --- a/Tests/DomainTests/Screenshots/AppShotsConfigTests.swift +++ b/Tests/ASCKitTests/Screenshots/AppShotsConfigTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppShotsConfigTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/AppShotTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/AppShotTests.swift similarity index 98% rename from Tests/DomainTests/Screenshots/Gallery/AppShotTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/AppShotTests.swift index 7b46dd1d..a13ae5d4 100644 --- a/Tests/DomainTests/Screenshots/Gallery/AppShotTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/AppShotTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("AppShot") struct AppShotTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/GalleryApplyTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryApplyTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/GalleryApplyTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryApplyTests.swift index 5847154c..e1881576 100644 --- a/Tests/DomainTests/Screenshots/Gallery/GalleryApplyTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryApplyTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Gallery Apply Screenshots") struct GalleryApplyTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/GalleryCodableTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryCodableTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/GalleryCodableTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryCodableTests.swift index 3e0a89da..d6904ce1 100644 --- a/Tests/DomainTests/Screenshots/Gallery/GalleryCodableTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryCodableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Gallery Codable") struct GalleryCodableTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/GalleryComposeTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryComposeTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/GalleryComposeTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryComposeTests.swift index 6ef50729..a97decc5 100644 --- a/Tests/DomainTests/Screenshots/Gallery/GalleryComposeTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryComposeTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Gallery Compose") struct GalleryComposeTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/GalleryHTMLRendererTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryHTMLRendererTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/GalleryHTMLRendererTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryHTMLRendererTests.swift index cee7d12c..98ab1393 100644 --- a/Tests/DomainTests/Screenshots/Gallery/GalleryHTMLRendererTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryHTMLRendererTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("GalleryHTMLRenderer") struct GalleryHTMLRendererTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/GalleryPreviewOutputTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryPreviewOutputTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/GalleryPreviewOutputTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryPreviewOutputTests.swift index dda2776a..d23fb85f 100644 --- a/Tests/DomainTests/Screenshots/Gallery/GalleryPreviewOutputTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryPreviewOutputTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Gallery Preview Output") struct GalleryPreviewOutputTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/GalleryPreviewTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryPreviewTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/GalleryPreviewTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryPreviewTests.swift index 6e71c7df..8ffe4a6c 100644 --- a/Tests/DomainTests/Screenshots/Gallery/GalleryPreviewTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryPreviewTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Gallery Preview HTML") struct GalleryPreviewTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift similarity index 98% rename from Tests/DomainTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift index 6c00a0a1..763d3d7d 100644 --- a/Tests/DomainTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift @@ -1,7 +1,7 @@ import Foundation import Testing import Mockable -@testable import Domain +@testable import ASCKit @Suite("GalleryTemplateRepository") struct GalleryTemplateRepositoryTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/GalleryTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/GalleryTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryTests.swift index 01f1b18b..d5bc2b66 100644 --- a/Tests/DomainTests/Screenshots/Gallery/GalleryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Gallery") struct GalleryTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/HTMLComposerTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/HTMLComposerTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/HTMLComposerTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/HTMLComposerTests.swift index f76d9677..26649b5f 100644 --- a/Tests/DomainTests/Screenshots/Gallery/HTMLComposerTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/HTMLComposerTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("HTMLComposer") struct HTMLComposerTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/ScreenLayoutTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/ScreenLayoutTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/ScreenLayoutTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/ScreenLayoutTests.swift index 14e0e940..61e8349d 100644 --- a/Tests/DomainTests/Screenshots/Gallery/ScreenLayoutTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/ScreenLayoutTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("ScreenLayout") struct ScreenLayoutGalleryTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/TemplatePreviewPageTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/TemplatePreviewPageTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/TemplatePreviewPageTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/TemplatePreviewPageTests.swift index 258a0f20..a34c4950 100644 --- a/Tests/DomainTests/Screenshots/Gallery/TemplatePreviewPageTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/TemplatePreviewPageTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Template Preview Page") struct TemplatePreviewPageTests { diff --git a/Tests/DomainTests/Screenshots/Gallery/TextSlotPreviewTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/TextSlotPreviewTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/Gallery/TextSlotPreviewTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/TextSlotPreviewTests.swift index 40aaf1cc..366806c0 100644 --- a/Tests/DomainTests/Screenshots/Gallery/TextSlotPreviewTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/TextSlotPreviewTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("TextSlot Preview") struct TextSlotPreviewTests { diff --git a/Tests/InfrastructureTests/ScreenshotPlans/AggregateGalleryTemplateRepositoryTests.swift b/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/ScreenshotPlans/AggregateGalleryTemplateRepositoryTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift index bfa63408..6bfebe3a 100644 --- a/Tests/InfrastructureTests/ScreenshotPlans/AggregateGalleryTemplateRepositoryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift @@ -1,8 +1,7 @@ import Foundation import Mockable import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite("AggregateGalleryTemplateRepository") struct AggregateGalleryTemplateRepositoryTests { diff --git a/Tests/InfrastructureTests/ScreenshotPlans/AggregateTemplateRepositoryTests.swift b/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/ScreenshotPlans/AggregateTemplateRepositoryTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift index ff82a167..1549359b 100644 --- a/Tests/InfrastructureTests/ScreenshotPlans/AggregateTemplateRepositoryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite("AggregateTemplateRepository") struct AggregateTemplateRepositoryTests { diff --git a/Tests/InfrastructureTests/ScreenshotPlans/AggregateThemeRepositoryTests.swift b/Tests/ASCKitTests/Screenshots/Internal/AggregateThemeRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/ScreenshotPlans/AggregateThemeRepositoryTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/AggregateThemeRepositoryTests.swift index 5b19b13a..fc74df8b 100644 --- a/Tests/InfrastructureTests/ScreenshotPlans/AggregateThemeRepositoryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/AggregateThemeRepositoryTests.swift @@ -1,8 +1,7 @@ import Foundation import Mockable import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite("AggregateThemeRepository") struct AggregateThemeRepositoryTests { diff --git a/Tests/InfrastructureTests/ScreenshotPlans/FileAppShotsConfigStorageTests.swift b/Tests/ASCKitTests/Screenshots/Internal/FileAppShotsConfigStorageTests.swift similarity index 96% rename from Tests/InfrastructureTests/ScreenshotPlans/FileAppShotsConfigStorageTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/FileAppShotsConfigStorageTests.swift index 5b645f5b..61b64cd0 100644 --- a/Tests/InfrastructureTests/ScreenshotPlans/FileAppShotsConfigStorageTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/FileAppShotsConfigStorageTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct FileAppShotsConfigStorageTests { diff --git a/Tests/DomainTests/Screenshots/ScreenThemeTests.swift b/Tests/ASCKitTests/Screenshots/ScreenThemeTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/ScreenThemeTests.swift rename to Tests/ASCKitTests/Screenshots/ScreenThemeTests.swift index a60a67ca..e41d075b 100644 --- a/Tests/DomainTests/Screenshots/ScreenThemeTests.swift +++ b/Tests/ASCKitTests/Screenshots/ScreenThemeTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("ScreenTheme") struct ScreenThemeTests { diff --git a/Tests/DomainTests/Screenshots/TemplateApplyTests.swift b/Tests/ASCKitTests/Screenshots/TemplateApplyTests.swift similarity index 97% rename from Tests/DomainTests/Screenshots/TemplateApplyTests.swift rename to Tests/ASCKitTests/Screenshots/TemplateApplyTests.swift index 3fb1e6a2..48c6bd44 100644 --- a/Tests/DomainTests/Screenshots/TemplateApplyTests.swift +++ b/Tests/ASCKitTests/Screenshots/TemplateApplyTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct TemplateApplyTests { diff --git a/Tests/DomainTests/Screenshots/TemplateRenderTests.swift b/Tests/ASCKitTests/Screenshots/TemplateRenderTests.swift similarity index 98% rename from Tests/DomainTests/Screenshots/TemplateRenderTests.swift rename to Tests/ASCKitTests/Screenshots/TemplateRenderTests.swift index f047bb79..83008b1a 100644 --- a/Tests/DomainTests/Screenshots/TemplateRenderTests.swift +++ b/Tests/ASCKitTests/Screenshots/TemplateRenderTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct TemplateRenderTests { diff --git a/Tests/DomainTests/Screenshots/ThemeDesignApplierTests.swift b/Tests/ASCKitTests/Screenshots/ThemeDesignApplierTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/ThemeDesignApplierTests.swift rename to Tests/ASCKitTests/Screenshots/ThemeDesignApplierTests.swift index e5b4ae59..4cbb15b0 100644 --- a/Tests/DomainTests/Screenshots/ThemeDesignApplierTests.swift +++ b/Tests/ASCKitTests/Screenshots/ThemeDesignApplierTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("ThemeDesignApplier") struct ThemeDesignApplierTests { diff --git a/Tests/DomainTests/Screenshots/ThemeDesignTests.swift b/Tests/ASCKitTests/Screenshots/ThemeDesignTests.swift similarity index 99% rename from Tests/DomainTests/Screenshots/ThemeDesignTests.swift rename to Tests/ASCKitTests/Screenshots/ThemeDesignTests.swift index c4050447..a17a2e33 100644 --- a/Tests/DomainTests/Screenshots/ThemeDesignTests.swift +++ b/Tests/ASCKitTests/Screenshots/ThemeDesignTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("ThemeDesign") struct ThemeDesignTests { diff --git a/Tests/DomainTests/Shared/AffordanceRegistryTests.swift b/Tests/ASCKitTests/Shared/AffordanceRegistryTests.swift similarity index 99% rename from Tests/DomainTests/Shared/AffordanceRegistryTests.swift rename to Tests/ASCKitTests/Shared/AffordanceRegistryTests.swift index 4d93f914..a27a3843 100644 --- a/Tests/DomainTests/Shared/AffordanceRegistryTests.swift +++ b/Tests/ASCKitTests/Shared/AffordanceRegistryTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit /// Test-only type to avoid polluting the global AffordanceRegistry for real domain types. private struct StubModel: AffordanceProviding { diff --git a/Tests/DomainTests/Shared/AffordanceTests.swift b/Tests/ASCKitTests/Shared/AffordanceTests.swift similarity index 99% rename from Tests/DomainTests/Shared/AffordanceTests.swift rename to Tests/ASCKitTests/Shared/AffordanceTests.swift index 14d3571c..7fb0b44b 100644 --- a/Tests/DomainTests/Shared/AffordanceTests.swift +++ b/Tests/ASCKitTests/Shared/AffordanceTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct AffordanceTests { diff --git a/Tests/DomainTests/Shared/ImageAssetTests.swift b/Tests/ASCKitTests/Shared/ImageAssetTests.swift similarity index 96% rename from Tests/DomainTests/Shared/ImageAssetTests.swift rename to Tests/ASCKitTests/Shared/ImageAssetTests.swift index ceda350c..4180ea29 100644 --- a/Tests/DomainTests/Shared/ImageAssetTests.swift +++ b/Tests/ASCKitTests/Shared/ImageAssetTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ImageAssetTests { diff --git a/Tests/InfrastructureTests/Client/ClientFactoryTests.swift b/Tests/ASCKitTests/Shared/Internal/ClientFactoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Client/ClientFactoryTests.swift rename to Tests/ASCKitTests/Shared/Internal/ClientFactoryTests.swift index 4bc9be73..77e9b15a 100644 --- a/Tests/InfrastructureTests/Client/ClientFactoryTests.swift +++ b/Tests/ASCKitTests/Shared/Internal/ClientFactoryTests.swift @@ -3,8 +3,7 @@ import CryptoKit import Foundation import Mockable import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct ClientFactoryTests { diff --git a/Tests/InfrastructureTests/Shared/UploadOperationsExecutorTests.swift b/Tests/ASCKitTests/Shared/Internal/UploadOperationsExecutorTests.swift similarity index 98% rename from Tests/InfrastructureTests/Shared/UploadOperationsExecutorTests.swift rename to Tests/ASCKitTests/Shared/Internal/UploadOperationsExecutorTests.swift index a974168e..4ff4ac3a 100644 --- a/Tests/InfrastructureTests/Shared/UploadOperationsExecutorTests.swift +++ b/Tests/ASCKitTests/Shared/Internal/UploadOperationsExecutorTests.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure +@testable import ASCKit @Suite struct UploadOperationsExecutorTests { diff --git a/Tests/DomainTests/Shared/OfferCodeEnvironmentTests.swift b/Tests/ASCKitTests/Shared/OfferCodeEnvironmentTests.swift similarity index 95% rename from Tests/DomainTests/Shared/OfferCodeEnvironmentTests.swift rename to Tests/ASCKitTests/Shared/OfferCodeEnvironmentTests.swift index 43c572ef..7b3b8534 100644 --- a/Tests/DomainTests/Shared/OfferCodeEnvironmentTests.swift +++ b/Tests/ASCKitTests/Shared/OfferCodeEnvironmentTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct OfferCodeEnvironmentTests { diff --git a/Tests/DomainTests/Shared/OfferCodePriceInputTests.swift b/Tests/ASCKitTests/Shared/OfferCodePriceInputTests.swift similarity index 97% rename from Tests/DomainTests/Shared/OfferCodePriceInputTests.swift rename to Tests/ASCKitTests/Shared/OfferCodePriceInputTests.swift index 964acc15..2285840b 100644 --- a/Tests/DomainTests/Shared/OfferCodePriceInputTests.swift +++ b/Tests/ASCKitTests/Shared/OfferCodePriceInputTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct OfferCodePriceInputTests { diff --git a/Tests/DomainTests/Shared/PaginatedResponseTests.swift b/Tests/ASCKitTests/Shared/PaginatedResponseTests.swift similarity index 97% rename from Tests/DomainTests/Shared/PaginatedResponseTests.swift rename to Tests/ASCKitTests/Shared/PaginatedResponseTests.swift index 154b8fe8..623d4b3d 100644 --- a/Tests/DomainTests/Shared/PaginatedResponseTests.swift +++ b/Tests/ASCKitTests/Shared/PaginatedResponseTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct PaginatedResponseTests { diff --git a/Tests/DomainTests/Shared/PresentableTests.swift b/Tests/ASCKitTests/Shared/PresentableTests.swift similarity index 99% rename from Tests/DomainTests/Shared/PresentableTests.swift rename to Tests/ASCKitTests/Shared/PresentableTests.swift index e71d866a..52501115 100644 --- a/Tests/DomainTests/Shared/PresentableTests.swift +++ b/Tests/ASCKitTests/Shared/PresentableTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct PresentableTests { diff --git a/Tests/InfrastructureTests/Simulators/SimctlSimulatorRepositoryTests.swift b/Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Simulators/SimctlSimulatorRepositoryTests.swift rename to Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorRepositoryTests.swift index 6f59f3f1..f3301eb6 100644 --- a/Tests/InfrastructureTests/Simulators/SimctlSimulatorRepositoryTests.swift +++ b/Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorRepositoryTests.swift @@ -1,6 +1,5 @@ import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct SimctlSimulatorRepositoryTests { diff --git a/Tests/DomainTests/Simulators/SimulatorTests.swift b/Tests/ASCKitTests/Simulators/SimulatorTests.swift similarity index 99% rename from Tests/DomainTests/Simulators/SimulatorTests.swift rename to Tests/ASCKitTests/Simulators/SimulatorTests.swift index eb68a5ff..8d7adc07 100644 --- a/Tests/DomainTests/Simulators/SimulatorTests.swift +++ b/Tests/ASCKitTests/Simulators/SimulatorTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct SimulatorTests { diff --git a/Tests/InfrastructureTests/Skills/FileSkillConfigStorageTests.swift b/Tests/ASCKitTests/Skills/Internal/FileSkillConfigStorageTests.swift similarity index 96% rename from Tests/InfrastructureTests/Skills/FileSkillConfigStorageTests.swift rename to Tests/ASCKitTests/Skills/Internal/FileSkillConfigStorageTests.swift index c935a950..026c35eb 100644 --- a/Tests/InfrastructureTests/Skills/FileSkillConfigStorageTests.swift +++ b/Tests/ASCKitTests/Skills/Internal/FileSkillConfigStorageTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct FileSkillConfigStorageTests { diff --git a/Tests/InfrastructureTests/Skills/ProcessSkillRepositoryTests.swift b/Tests/ASCKitTests/Skills/Internal/ProcessSkillRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Skills/ProcessSkillRepositoryTests.swift rename to Tests/ASCKitTests/Skills/Internal/ProcessSkillRepositoryTests.swift index 80db90b9..696debef 100644 --- a/Tests/InfrastructureTests/Skills/ProcessSkillRepositoryTests.swift +++ b/Tests/ASCKitTests/Skills/Internal/ProcessSkillRepositoryTests.swift @@ -1,7 +1,6 @@ import Foundation import Testing -@testable import Domain -@testable import Infrastructure +@testable import ASCKit @Suite struct ProcessSkillRepositoryTests { diff --git a/Tests/InfrastructureTests/Skills/StubShellRunner.swift b/Tests/ASCKitTests/Skills/Internal/StubShellRunner.swift similarity index 93% rename from Tests/InfrastructureTests/Skills/StubShellRunner.swift rename to Tests/ASCKitTests/Skills/Internal/StubShellRunner.swift index 45dd4cdf..1fb43937 100644 --- a/Tests/InfrastructureTests/Skills/StubShellRunner.swift +++ b/Tests/ASCKitTests/Skills/Internal/StubShellRunner.swift @@ -1,5 +1,5 @@ import Foundation -@testable import Infrastructure +@testable import ASCKit struct StubShellRunner: ShellRunner { let stdout: String? diff --git a/Tests/DomainTests/Skills/SkillTests.swift b/Tests/ASCKitTests/Skills/SkillTests.swift similarity index 99% rename from Tests/DomainTests/Skills/SkillTests.swift rename to Tests/ASCKitTests/Skills/SkillTests.swift index 232d378c..7abdb1df 100644 --- a/Tests/DomainTests/Skills/SkillTests.swift +++ b/Tests/ASCKitTests/Skills/SkillTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite("Skill") struct SkillTests { diff --git a/Tests/InfrastructureTests/Submissions/SDKSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/Submissions/SDKSubmissionRepositoryTests.swift rename to Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift index 2c4b5fb9..c20e9cd2 100644 --- a/Tests/InfrastructureTests/Submissions/SDKSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift @@ -1,8 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKSubmissionRepositoryTests { @@ -361,7 +360,7 @@ struct SDKSubmissionRepositoryTests { let repo = OpenAPISubmissionRepository(client: stub) let submission = try await repo.createSubmission(appId: "app-1", platform: .iOS) - #expect(submission == Domain.ReviewSubmission(id: "draft-1", appId: "app-1", platform: .iOS, state: .readyForReview)) + #expect(submission == ASCKit.ReviewSubmission(id: "draft-1", appId: "app-1", platform: .iOS, state: .readyForReview)) #expect(!stub.requests.contains { $0.method == "POST" }) } @@ -377,14 +376,14 @@ struct SDKSubmissionRepositoryTests { let repo = OpenAPISubmissionRepository(client: stub) let submission = try await repo.createSubmission(appId: "app-1", platform: .iOS) - #expect(submission == Domain.ReviewSubmission(id: "new-1", appId: "app-1", platform: .iOS, state: .readyForReview)) + #expect(submission == ASCKit.ReviewSubmission(id: "new-1", appId: "app-1", platform: .iOS, state: .readyForReview)) let post = stub.requests.first { $0.method == "POST" } #expect(post?.path == "/v1/reviewSubmissions") #expect(post?.body == #"{"data":{"attributes":{"platform":"IOS"},"relationships":{"app":{"data":{"id":"app-1","type":"apps"}}},"type":"reviewSubmissions"}}"#) } @Test func `adding each kind of version sends it as the item's relationship`() async throws { - let cases: [(ReviewItemTarget, String, Domain.ReviewSubmissionItemLinkedResource)] = [ + let cases: [(ReviewItemTarget, String, ASCKit.ReviewSubmissionItemLinkedResource)] = [ (.appStoreVersion("v-1"), #""appStoreVersion":{"data":{"id":"v-1","type":"appStoreVersions"}}"#, .appStoreVersion), (.inAppPurchaseVersion("iv-1"), #""inAppPurchaseVersion":{"data":{"id":"iv-1","type":"inAppPurchaseVersions"}}"#, .inAppPurchaseVersion), (.subscriptionVersion("sv-1"), #""subscriptionVersion":{"data":{"id":"sv-1","type":"subscriptionVersions"}}"#, .subscriptionVersion), @@ -404,7 +403,7 @@ struct SDKSubmissionRepositoryTests { #expect(post?.path == "/v1/reviewSubmissionItems") #expect(post?.body?.contains(relationship) == true) #expect(post?.body?.contains(#""reviewSubmission":{"data":{"id":"sub-1","type":"reviewSubmissions"}}"#) == true) - #expect(item == Domain.ReviewSubmissionItem( + #expect(item == ASCKit.ReviewSubmissionItem( id: "item-1", submissionId: "sub-1", state: .readyForReview, linkedResourceId: target.id, linkedResourceType: linkedType )) @@ -435,7 +434,7 @@ struct SDKSubmissionRepositoryTests { let patch = stub.requests.first { $0.method == "PATCH" } #expect(patch?.path == "/v1/reviewSubmissions/sub-1") #expect(patch?.body == #"{"data":{"attributes":{"submitted":true},"id":"sub-1","type":"reviewSubmissions"}}"#) - #expect(submission == Domain.ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .waitingForReview)) + #expect(submission == ASCKit.ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .waitingForReview)) } // MARK: - Apple's reasons for refusing diff --git a/Tests/DomainTests/Submissions/ReviewItemTargetTests.swift b/Tests/ASCKitTests/Submissions/ReviewItemTargetTests.swift similarity index 96% rename from Tests/DomainTests/Submissions/ReviewItemTargetTests.swift rename to Tests/ASCKitTests/Submissions/ReviewItemTargetTests.swift index 61489d93..ccd36b38 100644 --- a/Tests/DomainTests/Submissions/ReviewItemTargetTests.swift +++ b/Tests/ASCKitTests/Submissions/ReviewItemTargetTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct ReviewItemTargetTests { diff --git a/Tests/DomainTests/Submissions/ReviewSubmissionItemTests.swift b/Tests/ASCKitTests/Submissions/ReviewSubmissionItemTests.swift similarity index 99% rename from Tests/DomainTests/Submissions/ReviewSubmissionItemTests.swift rename to Tests/ASCKitTests/Submissions/ReviewSubmissionItemTests.swift index c71b6ecf..7b8da4a3 100644 --- a/Tests/DomainTests/Submissions/ReviewSubmissionItemTests.swift +++ b/Tests/ASCKitTests/Submissions/ReviewSubmissionItemTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ReviewSubmissionItemTests { diff --git a/Tests/DomainTests/Submissions/ReviewSubmissionTests.swift b/Tests/ASCKitTests/Submissions/ReviewSubmissionTests.swift similarity index 99% rename from Tests/DomainTests/Submissions/ReviewSubmissionTests.swift rename to Tests/ASCKitTests/Submissions/ReviewSubmissionTests.swift index 3aa3535a..9fb7e675 100644 --- a/Tests/DomainTests/Submissions/ReviewSubmissionTests.swift +++ b/Tests/ASCKitTests/Submissions/ReviewSubmissionTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct ReviewSubmissionTests { diff --git a/Tests/DomainTests/Submissions/SubmissionPlannerTests.swift b/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift similarity index 99% rename from Tests/DomainTests/Submissions/SubmissionPlannerTests.swift rename to Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift index bc31fc9b..d69e7cbe 100644 --- a/Tests/DomainTests/Submissions/SubmissionPlannerTests.swift +++ b/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift @@ -1,7 +1,7 @@ import Foundation import Mockable import Testing -@testable import Domain +@testable import ASCKit @Suite struct SubmissionPlannerTests { diff --git a/Tests/InfrastructureTests/Territories/SDKTerritoryRepositoryTests.swift b/Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift similarity index 96% rename from Tests/InfrastructureTests/Territories/SDKTerritoryRepositoryTests.swift rename to Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift index 23930aed..0f943ade 100644 --- a/Tests/InfrastructureTests/Territories/SDKTerritoryRepositoryTests.swift +++ b/Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKTerritoryRepositoryTests { diff --git a/Tests/DomainTests/Territories/TerritoryTests.swift b/Tests/ASCKitTests/Territories/TerritoryTests.swift similarity index 97% rename from Tests/DomainTests/Territories/TerritoryTests.swift rename to Tests/ASCKitTests/Territories/TerritoryTests.swift index 50871368..a2ac26f3 100644 --- a/Tests/DomainTests/Territories/TerritoryTests.swift +++ b/Tests/ASCKitTests/Territories/TerritoryTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct TerritoryTests { diff --git a/Tests/DomainTests/TestHelpers/MockRepositoryFactory.swift b/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift similarity index 99% rename from Tests/DomainTests/TestHelpers/MockRepositoryFactory.swift rename to Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift index c2ba912a..8d91783e 100644 --- a/Tests/DomainTests/TestHelpers/MockRepositoryFactory.swift +++ b/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift @@ -1,6 +1,6 @@ import Foundation import Mockable -@testable import Domain +@testable import ASCKit struct MockRepositoryFactory { diff --git a/Tests/InfrastructureTests/TestHelpers/SequencedStubAPIClient.swift b/Tests/ASCKitTests/TestHelpers/SequencedStubAPIClient.swift similarity index 95% rename from Tests/InfrastructureTests/TestHelpers/SequencedStubAPIClient.swift rename to Tests/ASCKitTests/TestHelpers/SequencedStubAPIClient.swift index cd292487..3765722f 100644 --- a/Tests/InfrastructureTests/TestHelpers/SequencedStubAPIClient.swift +++ b/Tests/ASCKitTests/TestHelpers/SequencedStubAPIClient.swift @@ -1,5 +1,5 @@ @preconcurrency import AppStoreConnect_Swift_SDK -@testable import Infrastructure +@testable import ASCKit final class SequencedStubAPIClient: APIClient, @unchecked Sendable { private var queue: [Any] = [] diff --git a/Tests/InfrastructureTests/TestHelpers/SequencedStubHTTPClient.swift b/Tests/ASCKitTests/TestHelpers/SequencedStubHTTPClient.swift similarity index 97% rename from Tests/InfrastructureTests/TestHelpers/SequencedStubHTTPClient.swift rename to Tests/ASCKitTests/TestHelpers/SequencedStubHTTPClient.swift index b3c6f6d3..a353f543 100644 --- a/Tests/InfrastructureTests/TestHelpers/SequencedStubHTTPClient.swift +++ b/Tests/ASCKitTests/TestHelpers/SequencedStubHTTPClient.swift @@ -1,5 +1,5 @@ import Foundation -@testable import Infrastructure +@testable import ASCKit final class SequencedStubHTTPClient: HTTPPerforming, @unchecked Sendable { private var queue: [Result<(Data, URLResponse), Error>] = [] diff --git a/Tests/InfrastructureTests/TestHelpers/StubAPIClient.swift b/Tests/ASCKitTests/TestHelpers/StubAPIClient.swift similarity index 99% rename from Tests/InfrastructureTests/TestHelpers/StubAPIClient.swift rename to Tests/ASCKitTests/TestHelpers/StubAPIClient.swift index abc2b76d..1f2e62a4 100644 --- a/Tests/InfrastructureTests/TestHelpers/StubAPIClient.swift +++ b/Tests/ASCKitTests/TestHelpers/StubAPIClient.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -@testable import Infrastructure +@testable import ASCKit /// Throwing error used by `StubAPIClient` when no stub matches the requested response type. /// Adapters that tolerate ASC 404s (like `getAvailability` for new IAPs) can be tested by diff --git a/Tests/InfrastructureTests/TestHelpers/StubHTTPClient.swift b/Tests/ASCKitTests/TestHelpers/StubHTTPClient.swift similarity index 92% rename from Tests/InfrastructureTests/TestHelpers/StubHTTPClient.swift rename to Tests/ASCKitTests/TestHelpers/StubHTTPClient.swift index fb71a6f4..e895fec3 100644 --- a/Tests/InfrastructureTests/TestHelpers/StubHTTPClient.swift +++ b/Tests/ASCKitTests/TestHelpers/StubHTTPClient.swift @@ -1,5 +1,5 @@ import Foundation -@testable import Infrastructure +@testable import ASCKit final class StubHTTPClient: HTTPPerforming, @unchecked Sendable { var response: (Data, URLResponse)? diff --git a/Tests/InfrastructureTests/TestHelpers/UploadFixtures.swift b/Tests/ASCKitTests/TestHelpers/UploadFixtures.swift similarity index 100% rename from Tests/InfrastructureTests/TestHelpers/UploadFixtures.swift rename to Tests/ASCKitTests/TestHelpers/UploadFixtures.swift diff --git a/Tests/InfrastructureTests/Users/SDKUserRepositoryTests.swift b/Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift similarity index 99% rename from Tests/InfrastructureTests/Users/SDKUserRepositoryTests.swift rename to Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift index f33f7cde..a09f0478 100644 --- a/Tests/InfrastructureTests/Users/SDKUserRepositoryTests.swift +++ b/Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKUserRepositoryTests { diff --git a/Tests/DomainTests/Users/UserRoleTests.swift b/Tests/ASCKitTests/Users/UserRoleTests.swift similarity index 99% rename from Tests/DomainTests/Users/UserRoleTests.swift rename to Tests/ASCKitTests/Users/UserRoleTests.swift index 8ad23701..3d51ebdd 100644 --- a/Tests/DomainTests/Users/UserRoleTests.swift +++ b/Tests/ASCKitTests/Users/UserRoleTests.swift @@ -1,5 +1,5 @@ import Testing -@testable import Domain +@testable import ASCKit @Suite struct UserRoleTests { diff --git a/Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudBuildRunRepositoryTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift similarity index 98% rename from Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudBuildRunRepositoryTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift index 82a8321b..c8729c90 100644 --- a/Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudBuildRunRepositoryTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKXcodeCloudBuildRunRepositoryTests { diff --git a/Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudProductRepositoryTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift similarity index 97% rename from Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudProductRepositoryTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift index 87b4a35e..e097cd4f 100644 --- a/Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudProductRepositoryTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKXcodeCloudProductRepositoryTests { diff --git a/Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudWorkflowRepositoryTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift similarity index 97% rename from Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudWorkflowRepositoryTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift index e311e127..5ad42ad5 100644 --- a/Tests/InfrastructureTests/XcodeCloud/SDKXcodeCloudWorkflowRepositoryTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift @@ -1,7 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Testing -@testable import Infrastructure -@testable import Domain +@testable import ASCKit @Suite struct SDKXcodeCloudWorkflowRepositoryTests { diff --git a/Tests/DomainTests/XcodeCloud/XcodeCloudBuildRunTests.swift b/Tests/ASCKitTests/XcodeCloud/XcodeCloudBuildRunTests.swift similarity index 99% rename from Tests/DomainTests/XcodeCloud/XcodeCloudBuildRunTests.swift rename to Tests/ASCKitTests/XcodeCloud/XcodeCloudBuildRunTests.swift index 07e55ff7..f620f514 100644 --- a/Tests/DomainTests/XcodeCloud/XcodeCloudBuildRunTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/XcodeCloudBuildRunTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct XcodeCloudBuildRunTests { diff --git a/Tests/DomainTests/XcodeCloud/XcodeCloudProductTests.swift b/Tests/ASCKitTests/XcodeCloud/XcodeCloudProductTests.swift similarity index 98% rename from Tests/DomainTests/XcodeCloud/XcodeCloudProductTests.swift rename to Tests/ASCKitTests/XcodeCloud/XcodeCloudProductTests.swift index cdb55392..12a89df2 100644 --- a/Tests/DomainTests/XcodeCloud/XcodeCloudProductTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/XcodeCloudProductTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct XcodeCloudProductTests { diff --git a/Tests/DomainTests/XcodeCloud/XcodeCloudWorkflowTests.swift b/Tests/ASCKitTests/XcodeCloud/XcodeCloudWorkflowTests.swift similarity index 99% rename from Tests/DomainTests/XcodeCloud/XcodeCloudWorkflowTests.swift rename to Tests/ASCKitTests/XcodeCloud/XcodeCloudWorkflowTests.swift index d3de946d..b5ada40e 100644 --- a/Tests/DomainTests/XcodeCloud/XcodeCloudWorkflowTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/XcodeCloudWorkflowTests.swift @@ -1,6 +1,6 @@ import Foundation import Testing -@testable import Domain +@testable import ASCKit @Suite struct XcodeCloudWorkflowTests { diff --git a/codecov.yml b/codecov.yml index a45ce28a..91506a1a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -21,7 +21,7 @@ ignore: # Composition roots — wire real SDK clients, not unit-testable - "Sources/ASCCommand/ClientProvider.swift" - - "Sources/Infrastructure/Client/ClientFactory.swift" + - "Sources/ASCKit/Shared/Internal/ClientFactory.swift" # Entry points (minimal logic, hard to unit test) - "Sources/ASCCommand/ASC.swift" @@ -35,26 +35,26 @@ ignore: # Web server runtime — Hummingbird server, certs, dylib loading - "Sources/ASCCommand/Commands/Web/**/*" - - "Sources/Infrastructure/Web/**/*" + - "Sources/ASCKit/Web/**/*" # Iris — real browser cookie extraction and HTTP calls, not unit-testable - - "Sources/Infrastructure/Iris/BrowserIrisCookieProvider.swift" - - "Sources/Infrastructure/Iris/IrisClient.swift" + - "Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift" + - "Sources/ASCKit/Iris/Internal/IrisClient.swift" # Iris auth — drives Apple SRP login + idmsa.apple.com HTTP, third-party-interactive - - "Sources/Infrastructure/Iris/Auth/**" + - "Sources/ASCKit/Iris/Internal/Auth/**" # Iris private app-bundle API — Apple iris HTTP adapter, third-party-interactive - - "Sources/Infrastructure/Iris/AppBundles/**" + - "Sources/ASCKit/Iris/AppBundles/Internal/**" # WebKit HTML renderer — WKWebView + AppKit GUI snapshot, not unit-testable - - "Sources/Infrastructure/ScreenshotPlans/WebKitHTMLRenderer.swift" + - "Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift" # Shell runner — spawns real subprocesses, not unit-testable - - "Sources/Infrastructure/Skills/ShellRunner.swift" + - "Sources/ASCKit/Skills/Internal/ShellRunner.swift" # Plugin marketplace — wraps PluginLoader (filesystem) + URLSession download + unzip - - "Sources/Infrastructure/Plugins/PluginMarketRepository.swift" + - "Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift" # Simulator stream — HTTP server, subprocess management, AXe shell integration - "Sources/Infrastructure/Simulators/DeviceStreamServer.swift" diff --git a/docs/features/concept-folders/design.md b/docs/features/concept-folders/design.md new file mode 100644 index 00000000..b63bec33 --- /dev/null +++ b/docs/features/concept-folders/design.md @@ -0,0 +1,139 @@ +--- +description: The source layout reworked from layers (Domain/, Infrastructure/) to concept folders — one ASCKit module where each App Store Connect concept holds its public face at the top, its implementations in Internal/, and the bare outside call in Internal/System/. Evidence from today's code, the target tree, the rules and their owners, and the refactor as one-PR steps. +--- + +# Concept folders, not layers + +**Status: step 1 BUILT** (one `ASCKit` module, concept folders); steps 2–5 not built. asc-cli is split by layer: `Sources/Domain/` +and `Sources/Infrastructure/` are two modules that mirror each other folder +for folder. Every concept therefore lives in two places, and every change to +one touches both trees. The goal, stated as a test: + +> **A concept is one folder.** Adding or changing a resource (a model, its +> repository, its SDK adapter, its tests) touches `Sources/ASCKit//` +> and `Tests/ASCKitTests//` and nothing else below the way in. + +| For | Read | +|---|---| +| why the CLI is built this way (CAEOAS, parent ids) | [docs/design.md](../../design.md) | +| how the REST server is wired | [web-server-architecture](../web-server-architecture/design.md) | +| the pattern this follows | `.claude/skills/app-implement-feature/SKILL.md` | + +## 1 · What's wrong today (measured on `main`, f75d42821) + +| Cost | Evidence | What it costs a change | +|---|---|---| +| **A concept lives in two trees** | `Domain/` 269 files and `Infrastructure/` 107 files mirror each other: `Domain/Apps/Builds/` beside `Infrastructure/Apps/Builds/`, 17 concept folders each side | one feature opens two folder trees and two test targets (`DomainTests`, `InfrastructureTests`) | +| **The two trees already disagree** | `Domain/Screenshots/` is implemented by `Infrastructure/ScreenshotPlans/`; `Infrastructure/Client/`, `Web/` and `Iris/Auth/` have no Domain twin | finding an implementation means knowing a second name | +| **The module split is paid for by hand** | 613 `Domain.X` qualifiers in 69 files, to tell a Domain type from the SDK type of the same name (`Domain.Territory` vs the SDK's `Territory`) | every new adapter repeats the qualifier dance | +| **Implementations leak to the way in** | `ASCCommand` imports `Infrastructure` in 80 files and builds concretes itself: `CompositeAuthProvider(` ×63 | a new auth source edits 63 call sites, not one | +| **The outside call is mixed with decisions** | 67 of 107 Infrastructure files import the SDK; most `SDK…Repository` files build the request, call the SDK and map the result in one type | the mapping (the part with rules) is only testable by stubbing the whole SDK client | + +## 2 · The shape — outside to inside + +``` + asc asc web-server (REST + _links) asc tui + │ │ │ + └────────────────────────────┴──────────────────────────────┘ + │ parse, call one concept, render + ▼ + ASCCommand/ THE WAY IN — commands, output formatting, the TUI, the composition root (ClientProvider) + │ imports the public face only + ▼ + ASCKit// WHAT IT IS — models, state enums with semantic booleans, affordances, + @Mockable repositories; the CLI and REST both derive from these + │ + ASCKit//Internal/ HOW IT WORKS — SDK adapters, DTO mapping, file storage + │ + ASCKit//Internal/System/ THE BARE CALL — the SDK request, URLSession, WebKit, SRP; ≤100 lines + ▼ + App Store Connect API · iris · the file system +``` + +``` +Sources/ +├── ASCCommand/ THE WAY IN (unchanged) +├── ASCPlugin/ the plugin SDK third parties link (unchanged) +└── ASCKit/ ONE module, one folder per App Store Connect concept + ├── Shared/ the kernel: Affordance, APIError, OutputFormat, pagination, RESTPathResolver + │ └── Internal/ APIClient, ClientFactory, HTTPPerforming, SDKFilter, uploads + ├── Apps/ + │ ├── App.swift AppRepository.swift App+RESTRoutes.swift public face + │ ├── Internal/OpenAPIAppRepository.swift implementation + │ ├── Builds/ + │ │ ├── Build.swift BuildRepository.swift … public face + │ │ └── Internal/SDKBuildRepository.swift … implementation + │ ├── Versions/ TestFlight/ InAppPurchases/ Subscriptions/ … (same shape, nested as today) + ├── Auth/ Internal/ (FileAuthProvider, EnvironmentAuthProvider, CompositeAuthProvider) + ├── Iris/ Internal/ Internal/Auth/ Internal/Auth/SRP/ + ├── Screenshots/ Internal/ (was Infrastructure/ScreenshotPlans/) + ├── Web/ the REST server (ASCWebServer, CORS, routes) + └── CodeSigning/ GameCenter/ Plugins/ Projects/ Reports/ Simulators/ + Skills/ Submissions/ Territories/ Users/ XcodeCloud/ AppWall/ +Tests/ +├── ASCKitTests/ mirrors Sources/ASCKit/ folder for folder (was DomainTests + InfrastructureTests) +└── ASCCommandTests/ unchanged +``` + +| Part | Holds | Access | Tested how | +|---|---|---|---| +| `/` | models, state enums, affordances, `@Mockable` repositories, `+RESTRoutes` | `public` | 100%, state-based | +| `/Internal/` | the SDK adapters, DTO mappers, file storage — every decision about the outside | `public` only where `ASCCommand`'s composition root builds it; otherwise `internal` | via `MockAPIClient` / the role's mock | +| `/Internal/System/` | the irreducible call: the SDK request, `URLSession`, `WebKit`, SRP | `internal` | integration only; the one folder coverage leaves out | +| `ASCCommand/` | parse, call, render; the composition root | — | command tests assert the full output | + +## 3 · The rules, each with one owner + +| Rule | Owner — and how it's checked | +|---|---| +| **A concept is one folder**: its face, its `Internal/`, its tests | the tree (§2); no `Domain/` or `Infrastructure/` folder exists | +| **Imports flow inward**: `ASCCommand → ASCKit`; a concept may use another's public face, never its `Internal/` | the module graph; a grep for `/Internal/` type names outside their concept | +| **Only the composition root names an `Internal/` type** | `ASCCommand/ClientProvider.swift`; today `CompositeAuthProvider(` ×63 is the evidence it isn't yet | +| **The bare call is ≤100 lines with no decisions** | `Internal/System/`; a decision found there moves up into `Internal/` with a test | +| **Every model carries its parent id; affordances are state-aware; CLI and REST ship together** | unchanged — [CLAUDE.md](../../../CLAUDE.md) still owns these | + +## 4 · Adding a resource, under this design + +| Step | Touches | +|---|---| +| the model, its repository, its affordances | `ASCKit//.swift` (+ test beside it in `ASCKitTests//`) | +| the SDK adapter | `ASCKit//Internal/SDKRepository.swift` (+ test) | +| wiring | one factory in `ClientProvider` | +| the command and the route | `ASCCommand/Commands//`, `/+RESTRoutes.swift` | + +Contrast with today: the same resource is split over `Domain/`, `Infrastructure/`, +`DomainTests/` and `InfrastructureTests/`. + +## 5 · The refactor, step by step + +Each step is one PR: green (`swift test`, `make check-docs`), no behaviour a +user sees changed. A pure move adds no behaviour, so the existing tests are its +safety net; any step that moves a rule writes its test first. + +| # | Step | Today | Change | Test first | +|---|---|---|---|---| +| 0 | **this doc** | — | the target tree and rules | — | +| 1 | **one module, concept folders** ✓ | `Domain` + `Infrastructure` targets, `DomainTests` + `InfrastructureTests` | `git mv` into `Sources/ASCKit//` and `/Internal/`; `ScreenshotPlans` → `Screenshots/Internal/`; `Client` + infra `Shared` → `Shared/Internal/`; one `ASCKit` target, one `ASCKitTests`; `import Domain`/`Infrastructure` → `import ASCKit`; `Domain.X` → `ASCKit.X`. Library users and `examples/blitz-screenshots` change two imports to one (CHANGELOG line, `docs/library.md`) | — (move only; 787+ tests stay green) | +| 2 | **docs and skills follow** | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | +| 3 | **one composition root** | `CompositeAuthProvider(` ×63 in `ASCCommand` | built once in `ClientProvider`; commands ask for it | "should authenticate with the stored credentials when no env vars are set" (existing behaviour, pinned) | +| 4 | **`Internal/System/` per concept** (several PRs) | SDK call + mapping in one `SDK…Repository` | the mapping stays in `Internal/` and is tested from DTOs; only the request goes in `Internal/System/` | per concept: "should map a with its parent id" from a DTO, no SDK stub | +| 5 | **names for roles** (several PRs) | 75 `XxxRepository` protocols, `XxxProvider`s | plural collection nouns (`Apps`, `Builds`), role nouns for the rest | per rename — none; behaviour unchanged | + +Step 1 removes most of §1's cost on its own; 3 and 4 make the fence real; 5 is +cosmetic and can wait. + +## 6 · Decided + +- **`Web/`** stays in `ASCKit/Web/` for step 1, so the step is a pure move. + Whether it moves out to the way in is still open (below). +- **Library users break cleanly**: one CHANGELOG line, no `Domain` / + `Infrastructure` re-export shims. +- **`MOCKING` in release builds** is its own fix, not part of this refactor. + +## 7 · Open + +- **`Web/`** — the REST server is a *way in*, like `ASCCommand`. Move it into + `ASCCommand/` (or its own module), or keep it in `ASCKit` because plugins + mount routes on it? +- **`MOCKING` in release builds** — the `ASCKit` target defines it + unconditionally (inherited from `Domain`), so mocks ship in `asc`. diff --git a/docs/library.md b/docs/library.md index 2bcc1887..b67d6ef8 100644 --- a/docs/library.md +++ b/docs/library.md @@ -23,8 +23,7 @@ targets: [ ## Example ```swift -import Domain -import Infrastructure +import ASCKit // 1. Provide credentials (inline, env vars, or your own AuthProvider) let credentials = AuthCredentials( @@ -57,4 +56,4 @@ let builds = try await buildRepo.listBuilds(appId: "YOUR_APP_ID", platform: nil, ## Repositories -`ClientFactory` has a `make…Repository(authProvider:)` method for every domain area: apps, builds, versions, TestFlight, screenshots, in-app purchases, subscriptions, reports, code signing, Xcode Cloud and more. The full list is in [`Sources/Infrastructure/Client/ClientFactory.swift`](../Sources/Infrastructure/Client/ClientFactory.swift); each returns a protocol from the `Domain` module. +`ClientFactory` has a `make…Repository(authProvider:)` method for every domain area: apps, builds, versions, TestFlight, screenshots, in-app purchases, subscriptions, reports, code signing, Xcode Cloud and more. The full list is in [`Sources/ASCKit/Shared/Internal/ClientFactory.swift`](../Sources/ASCKit/Shared/Internal/ClientFactory.swift); each returns a protocol from the concept's public face. diff --git a/examples/hello-plugin/Sources/HelloPlugin/HelloPlugin.swift b/examples/hello-plugin/Sources/HelloPlugin/HelloPlugin.swift index cd71d1e2..12d0b1f5 100644 --- a/examples/hello-plugin/Sources/HelloPlugin/HelloPlugin.swift +++ b/examples/hello-plugin/Sources/HelloPlugin/HelloPlugin.swift @@ -1,6 +1,6 @@ import Foundation import ASCPlugin -import Domain +import ASCKit import Hummingbird // MARK: - Entry point (required) From 92f37e76c248eb16507fd873286c10d01a37b026 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:16:04 +0800 Subject: [PATCH 03/18] docs: describe concept folders instead of Domain/Infrastructure layers CLAUDE.md, CONTRIBUTING.md, docs/design.md, the implement-feature, fix-bug and improvement skills, and the feature designs' file maps now point at Sources/ASCKit// and its Internal/, and at Tests/ASCKitTests/. Step 2 of docs/features/concept-folders/design.md. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/fix-bug/SKILL.md | 8 +-- .claude/skills/implement-feature/SKILL.md | 34 +++++------ .../references/architecture-diagrams.md | 26 ++++---- .../references/command-affordances.md | 4 +- .../references/domain-models.md | 22 +++---- .../references/swift-concurrency.md | 6 +- .../references/swift-observable.md | 4 +- .../references/tdd-patterns.md | 29 ++++----- .claude/skills/improvement/SKILL.md | 8 +-- CLAUDE.md | 18 +++--- CONTRIBUTING.md | 10 ++-- docs/design.md | 60 +++++-------------- docs/features/command-center-react/design.md | 2 +- docs/features/concept-folders/design.md | 4 +- .../submission-iris-parity.md | 6 +- docs/features/iris/iris-srp-login.md | 24 ++++---- docs/features/screenshot-editor/design.md | 4 +- .../web-server-architecture/design.md | 6 +- 18 files changed, 120 insertions(+), 155 deletions(-) diff --git a/.claude/skills/fix-bug/SKILL.md b/.claude/skills/fix-bug/SKILL.md index 43233a0b..4cff1b8e 100644 --- a/.claude/skills/fix-bug/SKILL.md +++ b/.claude/skills/fix-bug/SKILL.md @@ -28,10 +28,10 @@ Fix the bug where the rule lives, not at a call site that happens to show it: | Symptom | Owner | Test lives in | |---|---|---| -| Wrong `isLive` / `isEditable` / `isPending` | the state enum in `Sources/Domain/…` | `Tests/DomainTests/…` | -| Missing or wrong next command / `_links` | the model's `structuredAffordances` (CLI and REST both derive from it) | `Tests/DomainTests/…` | -| Field `null`, wrong value, missing parent ID | the `SDK*Repository` mapper in `Sources/Infrastructure/…` | `Tests/InfrastructureTests/…` | -| A value App Store Connect sends shows as `null` | a domain enum missing a case the SDK has (mapped via `init(rawValue:)` → `nil`) | Domain + Infrastructure | +| Wrong `isLive` / `isEditable` / `isPending` | the state enum in `Sources/ASCKit//` | `Tests/ASCKitTests//` | +| Missing or wrong next command / `_links` | the model's `structuredAffordances` (CLI and REST both derive from it) | `Tests/ASCKitTests//` | +| Field `null`, wrong value, missing parent ID | the `SDK*Repository` mapper in `Sources/ASCKit//Internal/` | `Tests/ASCKitTests//Internal/` | +| A value App Store Connect sends shows as `null` | a domain enum missing a case the SDK has (mapped via `init(rawValue:)` → `nil`) | the concept's face + its `Internal/` mapper | | Wrong flag parsing, table, or JSON shape | the command in `Sources/ASCCommand/Commands/…` | `Tests/ASCCommandTests/…` | | CLI right but REST wrong (or the reverse) | the controller in `Commands/Web/Controllers/` — CLI and REST should share one path; make them | `Tests/ASCCommandTests/…` | diff --git a/.claude/skills/implement-feature/SKILL.md b/.claude/skills/implement-feature/SKILL.md index b75c5fea..d5b223c9 100644 --- a/.claude/skills/implement-feature/SKILL.md +++ b/.claude/skills/implement-feature/SKILL.md @@ -6,7 +6,7 @@ description: | (2) Creating domain models that follow user's mental model (3) Building new CLI commands that consume domain repositories (4) User asks "how do I implement X" or "add feature Y" - (5) Implementing any feature that spans Domain, Infrastructure, and ASCCommand layers + (5) Implementing any feature that spans a concept folder in ASCKit (its public face and Internal/) and ASCCommand --- # Implement Feature in asc-swift @@ -24,10 +24,10 @@ Implement features using architecture-first design, TDD, rich domain models, and 2. TDD IMPLEMENTATION (Always write tests FIRST) • NEVER write implementation code without a failing test • Think from user's mental model — test cases describe what the user expects, not internals - • Write domain tests first → then infrastructure tests → then command tests + • Write public-face tests first → then Internal/ adapter tests → then command tests • Each test must FAIL (red) before writing implementation - • Domain tests → Domain value types + AffordanceProviding + @Mockable protocol - • Infrastructure: SDK adapter injecting parent IDs, composing multi-call flows + • Public face (ASCKit//) → value types + AffordanceProviding + @Mockable protocol + • Internal/ (ASCKit//Internal/): SDK adapter injecting parent IDs, composing multi-call flows • Command: formatAgentItems → {"data":[{...,"affordances":{...}}]} 3. REST EXPOSURE (no feature is done until reachable via REST) @@ -151,7 +151,7 @@ The REST controller calls the same `execute(repo:affordanceMode: .rest)` — no When ASC paginates a relationship or splits a single user-visible resource across endpoints, compose them inside the SDK adapter. **Apple's parent-endpoint `include=foo` truncates the relationship to ~10 entries** — for full lists, hit the dedicated relationship endpoint with explicit `limit`. The iOS SDK does this for `fetchAvailability`, `fetchPriceSchedule`, `fetchEqualizations`, and others. ```swift -public func getAvailability(iapId: String) async throws -> Domain.InAppPurchaseAvailability { +public func getAvailability(iapId: String) async throws -> ASCKit.InAppPurchaseAvailability { // Two parallel calls — `include=availableTerritories` truncates to ~10. async let availResponse = client.request( APIEndpoint.v2.inAppPurchases.id(iapId).inAppPurchaseAvailability.get(parameters: .init()) @@ -163,8 +163,8 @@ public func getAvailability(iapId: String) async throws -> Domain.InAppPurchaseA ) let (avail, terr) = try await (availResponse, terrResponse) - let territories = terr.data.map { Domain.Territory(id: $0.id, currency: $0.attributes?.currency) } - return Domain.InAppPurchaseAvailability( + let territories = terr.data.map { ASCKit.Territory(id: $0.id, currency: $0.attributes?.currency) } + return ASCKit.InAppPurchaseAvailability( id: avail.data.id, iapId: iapId, isAvailableInNewTerritories: avail.data.attributes?.isAvailableInNewTerritories ?? false, territories: territories @@ -183,12 +183,12 @@ public func getAvailability(iapId: String) async throws -> Domain.InAppPurchaseA See [tdd-patterns.md](references/tdd-patterns.md) for complete patterns including: - `MockRepositoryFactory` (always use, never construct models inline) - Affordance tests -- Infrastructure parent-ID injection tests +- `Internal/` adapter parent-ID injection tests - `@Mockable` / `given().willReturn()` usage Name each test `should [when ]`, in the words of the person, agent or REST client who sees the result — never a method, type or mechanism verb → [Naming tests](references/tdd-patterns.md#naming-tests). -### Phase 1: Domain +### Phase 1: Public face (`ASCKit//`) ```swift @Test func `should belong to the parent it was listed under`() { @@ -210,7 +210,7 @@ Name each test `should [when ]`, in the words of the person Both `affordances` and `apiLinks` derive from the same `structuredAffordances` — testing each catches both the CLI and REST surfaces in one set of assertions. -### Phase 2: Infrastructure +### Phase 2: Adapter (`ASCKit//Internal/`) ```swift @Test func `should tie each model to the parent it was listed under`() async throws { @@ -337,7 +337,7 @@ Per CLAUDE.md, **a feature is not complete until it is reachable via REST.** Ste } ``` -6. **Advertise the resource** from `APIRoot.structuredAffordances` (`Sources/Domain/Shared/APIRoot.swift`) when it is a new top-level resource, so `GET /api/v1` lists it. +6. **Advertise the resource** from `APIRoot.structuredAffordances` (`Sources/ASCKit/Shared/APIRoot.swift`) when it is a new top-level resource, so `GET /api/v1` lists it. 7. Add a REST test in `Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift` that calls `execute(repo:affordanceMode: .rest)` and asserts `_links` + the resolved REST path. @@ -345,7 +345,7 @@ Per CLAUDE.md, **a feature is not complete until it is reachable via REST.** Ste **REST rules:** - CLI flag and REST query-param names match: `--expired-only` ↔ `?expired-only=true`, both calling the same repository method. -- Helpers in `RESTRoutes.swift`: `restFormat(items)` (REST twin of `formatAgentItems(…, affordanceMode: .rest)`) and `jsonError(message, status:)` (from `Infrastructure/Web/ASCWebServer.swift`). +- Helpers in `RESTRoutes.swift`: `restFormat(items)` (REST twin of `formatAgentItems(…, affordanceMode: .rest)`) and `jsonError(message, status:)` (from `ASCKit/Web/ASCWebServer.swift`). - `RESTPathResolver` maps affordance actions to HTTP: `list`/`get` → GET, `create`/`add` → POST to the parent's collection, `update` → PATCH, `delete`/`remove` → DELETE, anything else (e.g. `submit`) → POST `…/{id}/{action}`. - Controllers are structs with dependencies injected at init; repositories are constructed once in `RESTRoutes.configure`, never per request. @@ -396,22 +396,22 @@ Docs follow `docs/documentation-design/README.md`: each fact has one home, and n - [ ] Files table filled - [ ] **User approval received** -### Phase 1: Domain +### Phase 1: Public face - [ ] `XModel.swift` — `struct` + `Sendable` + `Equatable` + `Identifiable` + `Codable` -- [ ] Carries `parentId` (ASC API omits parent IDs from response — Infrastructure injects them) +- [ ] Carries `parentId` (ASC API omits parent IDs from response — the `Internal/` mapper injects them) - [ ] `Presentable` conformance (`tableHeaders`, `tableRow`) - [ ] `AffordanceProviding` via `structuredAffordances` (NOT raw `affordances`) - [ ] State enum with semantic booleans (`isLive`, `isEditable`, `isPendingReview`, etc.) - [ ] `XRepository.swift` — `@Mockable` protocol with primitive methods only - [ ] `make*` factory added to `MockRepositoryFactory.swift` -- [ ] Domain tests: model fields, semantic booleans, affordances, **and `apiLinks`** for the new keys +- [ ] Public-face tests: model fields, semantic booleans, affordances, **and `apiLinks`** for the new keys -### Phase 2: Infrastructure +### Phase 2: Adapter (`Internal/`) - [ ] `SDKXRepository.swift` — implements protocol, injects parent IDs in mappers - [ ] Multi-call composition where needed (relationships paginate at ~10 — use dedicated endpoints with `limit:`) - [ ] Factory registered in `ClientFactory.swift` - [ ] `_xRoutes` registered AND touched in `RESTPathResolver.ensureInitialized()` -- [ ] Infrastructure tests cover: parent ID injection, multi-call composition, >10-entry regression +- [ ] `Internal/` adapter tests cover: parent ID injection, multi-call composition, >10-entry regression ### Phase 3: Command - [ ] `XCommand.swift` + subcommands using `formatAgentItems` diff --git a/.claude/skills/implement-feature/references/architecture-diagrams.md b/.claude/skills/implement-feature/references/architecture-diagrams.md index 1f011a63..9a292fed 100644 --- a/.claude/skills/implement-feature/references/architecture-diagrams.md +++ b/.claude/skills/implement-feature/references/architecture-diagrams.md @@ -45,18 +45,18 @@ ## Full System Overview ``` -Domain Layer +ASCKit// (public face) App AppStoreVersion AppStoreVersionLocalization AppRepository (+ affordances) AppScreenshotSet BuildRepository AppStoreVersionState AppScreenshot TestFlight repos ScreenshotRepository AffordanceProviding -Infrastructure Layer (implements Domain protocols) +ASCKit//Internal/ (implements the face's protocols) SDKAppRepository SDKBuildRepository SDKTestFlightRepository SDKScreenshotRepository ClientFactory EnvironmentAuthProvider -ASCCommand Layer +ASCCommand (the way in) asc apps list → formatAgentItems → {"data":[{...,"affordances":{...}}]} asc versions list → formatAgentItems asc version-localizations list → formatAgentItems @@ -111,7 +111,7 @@ AsyncParsableCommand.run() ├─ ClientProvider.makeXRepository() │ │ │ ▼ - │ OpenAPI call → map SDK types → Domain structs (with parentId injected) + │ OpenAPI call → map SDK types → ASCKit structs (with parentId injected) │ ├─ OutputFormatter.formatAgentItems(items, ...) │ │ @@ -141,17 +141,17 @@ AsyncParsableCommand.run() | File | Action | Notes | |-------------------------------------------------------------|----------|----------------------------------------------| -| `Sources/Domain/X/XModel.swift` | Create | Struct + AffordanceProviding | -| `Sources/Domain/X/XRepository.swift` | Create | @Mockable protocol | -| `Sources/Infrastructure/X/SDKXRepository.swift` | Create | Implements XRepository, injects parent IDs | -| `Sources/Infrastructure/Client/ClientFactory.swift` | Modify | Add `makeXRepository()` factory | +| `Sources/ASCKit/X/XModel.swift` | Create | Struct + AffordanceProviding | +| `Sources/ASCKit/X/XRepository.swift` | Create | @Mockable protocol | +| `Sources/ASCKit/X/Internal/SDKXRepository.swift` | Create | Implements XRepository, injects parent IDs | +| `Sources/ASCKit/Shared/Internal/ClientFactory.swift` | Modify | Add `makeXRepository()` factory | | `Sources/ASCCommand/Commands/X/XCommand.swift` | Create | AsyncParsableCommand group + List subcommand | | `Sources/ASCCommand/ASC.swift` | Modify | Add XCommand to subcommands | | `Sources/ASCCommand/ClientProvider.swift` | Modify | Add `makeXRepository()` static factory | -| `Tests/DomainTests/X/XModelTests.swift` | Create | State, computed props, Codable | -| `Tests/DomainTests/X/XRepositoryTests.swift` | Create | Mock-based repository tests | -| `Tests/DomainTests/Apps/AffordancesTests.swift` | Modify | Add affordance tests for new model | -| `Tests/DomainTests/TestHelpers/MockRepositoryFactory.swift`| Modify | Add `makeX(...)` factory method | +| `Tests/ASCKitTests/X/XModelTests.swift` | Create | State, computed props, Codable | +| `Tests/ASCKitTests/X/XRepositoryTests.swift` | Create | Mock-based repository tests | +| `Tests/ASCKitTests/Apps/AffordancesTests.swift` | Modify | Add affordance tests for new model | +| `Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift`| Modify | Add `makeX(...)` factory method | --- @@ -170,7 +170,7 @@ AsyncParsableCommand.run() ### Files -- `Sources/Domain/X/XModel.swift` — ... +- `Sources/ASCKit/X/XModel.swift` — ... - ... **Proceed with TDD implementation?** diff --git a/.claude/skills/implement-feature/references/command-affordances.md b/.claude/skills/implement-feature/references/command-affordances.md index 28f8102b..d9397fcd 100644 --- a/.claude/skills/implement-feature/references/command-affordances.md +++ b/.claude/skills/implement-feature/references/command-affordances.md @@ -5,7 +5,7 @@ The CLI equivalent of REST HATEOAS. Every JSON response embeds ready-to-run CLI ## Protocol ```swift -// Sources/Domain/Shared/AffordanceProviding.swift +// Sources/ASCKit/Shared/AffordanceProviding.swift public protocol AffordanceProviding { var affordances: [String: String] { get } } @@ -88,7 +88,7 @@ let output = try formatter.formatItems(versions, ...) ## Tests -Add affordance tests in `Tests/DomainTests/Apps/AffordancesTests.swift`: +Add affordance tests in `Tests/ASCKitTests/Apps/AffordancesTests.swift`: ```swift @Test func `app affordances include listVersions command`() { diff --git a/.claude/skills/implement-feature/references/domain-models.md b/.claude/skills/implement-feature/references/domain-models.md index 2e06dd2d..9df20579 100644 --- a/.claude/skills/implement-feature/references/domain-models.md +++ b/.claude/skills/implement-feature/references/domain-models.md @@ -24,12 +24,12 @@ Required conformances: The ASC API never includes parent IDs in response bodies. The infrastructure mapper must inject them: ```swift -// Infrastructure: inject parentId from the request parameter +// Internal/ mapper: inject parentId from the request parameter private func mapLocalization( _ sdk: AppStoreVersionLocalization, versionId: String // ← comes from the request, not the response -) -> Domain.AppStoreVersionLocalization { - Domain.AppStoreVersionLocalization( +) -> ASCKit.AppStoreVersionLocalization { + ASCKit.AppStoreVersionLocalization( id: sdk.id, versionId: versionId, // ← injected locale: sdk.attributes?.locale ?? "" @@ -123,7 +123,7 @@ Method naming convention: `list` prefix (not `fetch`). All tests use `MockRepositoryFactory` with sensible defaults — never construct models inline: ```swift -// Tests/DomainTests/TestHelpers/MockRepositoryFactory.swift +// Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift enum MockRepositoryFactory { static func makeVersion( id: String = "v1", @@ -147,24 +147,24 @@ let loc = MockRepositoryFactory.makeLocalization(versionId: "v-99") Add new `make*` methods to `MockRepositoryFactory` whenever you add a new domain model. -## Infrastructure Mapper Pattern +## `Internal/` Mapper Pattern Use private mapper functions (not static factory methods on the domain type): ```swift -// In OpenAPIXxxRepository.swift (Infrastructure layer) +// In OpenAPIXxxRepository.swift (in the concept's Internal/) private func mapVersion( _ sdkVersion: AppStoreConnect_Swift_SDK.AppStoreVersion, appId: String -) -> Domain.AppStoreVersion { - let state = Domain.AppStoreVersionState( +) -> ASCKit.AppStoreVersion { + let state = ASCKit.AppStoreVersionState( rawValue: sdkVersion.attributes?.appStoreState?.rawValue ?? "" ) ?? .prepareForSubmission - return Domain.AppStoreVersion( + return ASCKit.AppStoreVersion( id: sdkVersion.id, appId: appId, versionString: sdkVersion.attributes?.versionString ?? "", - platform: Domain.AppStorePlatform(rawValue: sdkVersion.attributes?.platform?.rawValue ?? "") ?? .iOS, + platform: ASCKit.AppStorePlatform(rawValue: sdkVersion.attributes?.platform?.rawValue ?? "") ?? .iOS, state: state, createdDate: sdkVersion.attributes?.createdDate ) @@ -264,7 +264,7 @@ The mock ignores the URL value — no real filesystem needed. `MockRepositoryFac ## What NOT to Put in Domain Models -- No `import AppStoreConnect_Swift_SDK` (Infrastructure concern) +- No `import AppStoreConnect_Swift_SDK` (an `Internal/` concern) - No CLI output formatting (ASCCommand concern) - No network code or `URLSession` - No SwiftUI or `@Observable` (this is a CLI, not a GUI app) diff --git a/.claude/skills/implement-feature/references/swift-concurrency.md b/.claude/skills/implement-feature/references/swift-concurrency.md index db497ce3..1078f0d6 100644 --- a/.claude/skills/implement-feature/references/swift-concurrency.md +++ b/.claude/skills/implement-feature/references/swift-concurrency.md @@ -60,9 +60,9 @@ struct AppsList: AsyncParsableCommand { } ``` -## Stateless Infrastructure Types +## Stateless `Internal/` Types -Infrastructure types that don't hold mutable state use `struct`: +`Internal/` types that don't hold mutable state use `struct`: ```swift // Stateless — reads environment at call time, no stored mutable state @@ -129,7 +129,7 @@ func run() async throws { - [ ] Domain models are `struct` + `Sendable` (not `class`) - [ ] Repository protocols conform to `Sendable` -- [ ] Infrastructure structs are stateless or explicitly `Sendable` +- [ ] `Internal/` structs are stateless or explicitly `Sendable` - [ ] Commands use `AsyncParsableCommand` for async entry points - [ ] No `@unchecked Sendable` unless absolutely necessary with documented reason - [ ] All `async throws` propagate errors rather than swallowing them \ No newline at end of file diff --git a/.claude/skills/implement-feature/references/swift-observable.md b/.claude/skills/implement-feature/references/swift-observable.md index ad6b5d17..a665a05c 100644 --- a/.claude/skills/implement-feature/references/swift-observable.md +++ b/.claude/skills/implement-feature/references/swift-observable.md @@ -4,7 +4,7 @@ - All domain models: `Sendable` (struct is implicitly Sendable when all stored props are Sendable) - Repository protocols: `: Sendable` (required for `@Mockable` compatibility) -- Infrastructure repos: `@unchecked Sendable` (hold `APIProvider` which is a reference type) +- `Internal/` repos: `@unchecked Sendable` (hold `APIProvider` which is a reference type) - Commands: `AsyncParsableCommand` with `async throws func run()` ## Domain Models (Pure Structs) @@ -31,7 +31,7 @@ public protocol AppRepository: Sendable { } ``` -## Infrastructure (APIProvider wrapper) +## `Internal/` adapters (APIProvider wrapper) ```swift // @unchecked Sendable because APIProvider is a reference type diff --git a/.claude/skills/implement-feature/references/tdd-patterns.md b/.claude/skills/implement-feature/references/tdd-patterns.md index e073cb39..b4344351 100644 --- a/.claude/skills/implement-feature/references/tdd-patterns.md +++ b/.claude/skills/implement-feature/references/tdd-patterns.md @@ -92,7 +92,7 @@ Use `@Test` and `@Suite` with backtick test names: ```swift import Testing -@testable import Domain +@testable import ASCKit @Suite struct AppStoreVersionTests { @@ -114,7 +114,7 @@ struct AppStoreVersionTests { Never construct domain models inline in tests. Use the shared factory: ```swift -// Tests/DomainTests/TestHelpers/MockRepositoryFactory.swift +// Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift // All params have sensible defaults MockRepositoryFactory.makeVersion(id: "v1", appId: "app-1", state: .readyForSale) @@ -128,7 +128,7 @@ Add a new `make*` method when adding a new domain model. ## Affordance Tests -Add to `Tests/DomainTests/Apps/AffordancesTests.swift` (or a domain-specific file): +Add to `Tests/ASCKitTests/Apps/AffordancesTests.swift` (or a domain-specific file): ```swift @Test func `should point to the model's children and siblings`() { @@ -174,7 +174,7 @@ struct VersionsListTests { } ``` -## Infrastructure Adapter Tests +## `Internal/` Adapter Tests Stub the SDK response with `StubAPIClient`, read through the real `SDK*Repository`, assert the domain value: @@ -225,25 +225,18 @@ struct AppStoreVersionStateTests { ``` Tests/ -├── DomainTests/ +├── ASCKitTests/ ← mirrors Sources/ASCKit/ │ ├── Apps/ │ │ ├── AppTests.swift │ │ ├── AppStoreVersionTests.swift -│ │ ├── AppStoreVersionStateTests.swift -│ │ ├── AppRepositoryTests.swift -│ │ └── AffordancesTests.swift ← all affordance tests -│ ├── Screenshots/ -│ │ ├── AppStoreVersionLocalizationTests.swift -│ │ ├── AppScreenshotSetTests.swift -│ │ ├── AppScreenshotTests.swift -│ │ └── ScreenshotRepositoryTests.swift -│ ├── Builds/ +│ │ ├── AffordancesTests.swift ← all affordance tests +│ │ ├── Internal/ ← adapter tests (parent-ID injection, mapping) +│ │ └── Versions/Localizations/ScreenshotSets/… │ ├── Auth/ +│ │ └── Internal/ │ ├── Shared/ │ └── TestHelpers/ -│ └── MockRepositoryFactory.swift ← shared factory -├── InfrastructureTests/ -│ └── Auth/ +│ └── MockRepositoryFactory.swift ← shared factory └── ASCCommandTests/ └── OutputFormatterTests.swift ``` @@ -252,7 +245,7 @@ Tests/ ```bash swift test # All tests -swift test --filter DomainTests # Domain only +swift test --filter ASCKitTests # ASCKit only swift test --filter "AppStoreVersionTests" # One suite ``` diff --git a/.claude/skills/improvement/SKILL.md b/.claude/skills/improvement/SKILL.md index 0941d706..25c223d5 100644 --- a/.claude/skills/improvement/SKILL.md +++ b/.claude/skills/improvement/SKILL.md @@ -102,7 +102,7 @@ Use `formatter.formatAgentItems()` (not `formatItems`) for commands that should **Test approach**: `OutputFormatterTests` with known domain model inputs; affordance tests in `AffordancesTests.swift` -### 3. Infrastructure Improvements +### 3. Adapter (`Internal/`) Improvements Enhance OpenAPI adapters or error handling: @@ -163,15 +163,15 @@ swift test # Must remain all green | Layer | Location | Improvement Examples | |-------|----------|---------------------| -| **Domain** | `Sources/Domain/` | New computed properties, convenience methods, better enums | -| **Infrastructure** | `Sources/Infrastructure/` | Better error mapping, additional field mapping | +| **Public face** | `Sources/ASCKit//` | New computed properties, convenience methods, better enums | +| **Implementations** | `Sources/ASCKit//Internal/` | Better error mapping, additional field mapping | | **ASCCommand** | `Sources/ASCCommand/` | Output formatting, command options, TUI enhancements | ## Guidelines ### Do - Keep changes focused and minimal -- Put the rule on the type that owns it — a state enum's semantic boolean, a model's `structuredAffordances`, the Infrastructure mapper — not in a command or controller +- Put the rule on the type that owns it — a state enum's semantic boolean, a model's `structuredAffordances`, the `Internal/` mapper — not in a command or controller - Maintain existing behavior - Add tests for new behavior - Follow existing code patterns diff --git a/CLAUDE.md b/CLAUDE.md index 7c0b80cd..a42c9832 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -25,7 +25,7 @@ Chicago School — state-based, not interaction-based: tests verify what domain - Assert exact output values (`"READY_FOR_SALE"`, `"expired": true`), never "is non-empty" or "doesn't throw". Command tests assert the full JSON string. - Implement just enough to pass — no extra fields, no speculative branches. - Difficult to test = design problem. Never modify a test to make it pass; if it fails unexpectedly, the spec was wrong. -- `@Testing` (not XCTest); `@Mockable` protocols with `given().willReturn()`; shared test data in `Tests/DomainTests/TestHelpers/MockRepositoryFactory.swift`. +- `@Testing` (not XCTest); `@Mockable` protocols with `given().willReturn()`; shared test data in `Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift`. ## Commands @@ -41,20 +41,22 @@ make check-docs # broken links, doc size budgets ## Architecture -Three strict layers, dependencies pointing one way: `ASCCommand → Infrastructure → Domain`. +Concept folders, not layers. Imports point one way: `ASCCommand → ASCKit`. ``` Sources/ -├── Domain/ # Pure value types, @Mockable protocols — zero I/O -├── Infrastructure/ # Implements Domain protocols via appstoreconnect-swift-sdk -└── ASCCommand/ # CLI entry (ASC.swift), output formatting, REST server (Commands/Web/), TUI +├── ASCKit// # public face: models, state enums, affordances, @Mockable repositories — zero I/O +│ └── Internal/ # implementations: SDK adapters, DTO mapping, file storage +│ └── System/ # only the bare outside call (SDK request, URLSession, WebKit), ≤100 lines +├── ASCCommand/ # the way in: CLI entry (ASC.swift), output formatting, REST commands, TUI +└── ASCPlugin/ # the plugin SDK third parties link ``` -Domain folders mirror the App Store Connect resource hierarchy (`Domain/Apps/Versions/Localizations/…`); Infrastructure and `Tests/` mirror Domain exactly. Look at the tree rather than a list here. +Concept folders mirror the App Store Connect resource hierarchy (`ASCKit/Apps/Versions/Localizations/…`); `Tests/ASCKitTests/` mirrors `Sources/ASCKit/` folder for folder. A concept never reaches into another concept's `Internal/`; only `ASCCommand/ClientProvider.swift` names `Internal/` types. Look at the tree rather than a list here. Why: [concept-folders design](docs/features/concept-folders/design.md). **Rules every change follows:** -- Domain models are `public struct` + `Sendable` + `Equatable` + `Codable`; the JSON encoding is the public schema. Optional text fields use `encodeIfPresent` so nil is omitted. -- Every model carries its **parent ID** (`AppStoreVersion.appId`, `AppScreenshot.setId`). The API doesn't return parent IDs, so Infrastructure mappers inject them from the request. +- Models are `public struct` + `Sendable` + `Equatable` + `Codable`; the JSON encoding is the public schema. Optional text fields use `encodeIfPresent` so nil is omitted. +- Every model carries its **parent ID** (`AppStoreVersion.appId`, `AppScreenshot.setId`). The API doesn't return parent IDs, so the `Internal/` mappers inject them from the request. - State enums expose **semantic booleans** (`isLive`, `isEditable`, `isPending`) for agent decisions. - **CAEOAS:** every model provides `structuredAffordances` — ready-to-run next commands, state-aware (e.g. `submitForReview` only when `isEditable`). The CLI `affordances` and REST `_links` both derive from it. - **CLI and REST ship together:** a command that returns data is also exposed by `asc web-server`. A feature isn't done until it is reachable over REST. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 80d47a1b..573b6914 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,15 +17,17 @@ swift build -c release && cp .build/release/asc /usr/local/bin/ # install from ## How the code is organised -Three layers, dependencies pointing one way: `ASCCommand → Infrastructure → Domain`. +Concept folders, not layers. Imports point one way: `ASCCommand → ASCKit`. ``` Sources/ -├── Domain/ # Pure value types, @Mockable protocols — zero I/O -├── Infrastructure/ # SDK adapters (appstoreconnect-swift-sdk), parent ID injection -└── ASCCommand/ # CLI commands, REST server, output formatting, TUI +├── ASCKit// # public face: models, @Mockable repositories — zero I/O +│ └── Internal/ # SDK adapters (appstoreconnect-swift-sdk), parent ID injection +└── ASCCommand/ # CLI commands, REST server, output formatting, TUI ``` +`Tests/ASCKitTests/` mirrors `Sources/ASCKit/`. The layout's rules: [concept-folders design](docs/features/concept-folders/design.md). + Why it's built this way (CAEOAS, rich domain models, parent IDs): [docs/design.md](docs/design.md). ## Rules diff --git a/docs/design.md b/docs/design.md index 032c9fc1..e4879760 100644 --- a/docs/design.md +++ b/docs/design.md @@ -127,48 +127,24 @@ extension AppStoreVersion: AffordanceProviding { ``` Sources/ -├── Domain/ # Pure business logic, protocols, rich models (zero deps except Mockable) -├── Infrastructure/ # Implementations: API client, auth provider -└── ASCCommand/ # CLI executable + TUI: argument parsing, output formatting, interactive UI +├── ASCKit// # public face: rich models, state enums, affordances, @Mockable repositories (zero I/O) +│ └── Internal/ # implementations: SDK adapters (appstoreconnect-swift-sdk), DTO mapping, auth providers +│ └── System/ # only the bare outside call, ≤100 lines +└── ASCCommand/ # CLI executable + TUI: argument parsing, output formatting, interactive UI ``` -Dependency flow: `ASCCommand -> Infrastructure -> Domain` +Import flow: `ASCCommand -> ASCKit`. One folder per App Store Connect concept +(`ASCKit/Apps/Builds/`, `ASCKit/Auth/`, …), each with its public face at the +top and its implementations in `Internal/`. The layout and its rules: +[concept-folders design](features/concept-folders/design.md). -### Domain Layer +**Key model design rules:** -Pure value types and `@Mockable` protocols. No networking, no frameworks. - -| Directory | Contents | -|-----------|----------| -| `Apps/` | `App`, `AppStoreVersion` (+ `AppStorePlatform`, `AppStoreVersionState`), `AppRepository` protocol | -| `Builds/` | `Build` model (version, state, expired), `BuildRepository` protocol | -| `TestFlight/` | `BetaGroup`, `BetaTester` models, `TestFlightRepository` protocol | -| `Screenshots/` | `AppStoreVersionLocalization`, `AppScreenshotSet`, `AppScreenshot`, `ScreenshotDisplayType` (32 display types), `ScreenshotRepository` protocol | -| `Auth/` | `AuthCredentials` value object, `AuthProvider` protocol, `AuthError` enum | -| `Shared/` | `PaginatedResponse`, `OutputFormat` enum, `APIError` | - -**Key domain design rules:** - -- Every model carries its **parent ID** (e.g. `AppStoreVersion.appId`, `AppScreenshot.setId`) +- Every model carries its **parent ID** (e.g. `AppStoreVersion.appId`, `AppScreenshot.setId`). The App Store Connect API does not include parent IDs in response bodies, so the `Internal/` mappers inject them from the request parameter. - State enums expose **semantic booleans** (`isLive`, `isEditable`, `isPending`, `isComplete`) - All models are `Sendable`, `Equatable`, `Codable` — the JSON encoding IS the public schema -### Infrastructure Layer - -Implements Domain protocols using [appstoreconnect-swift-sdk](https://github.com/AvdLee/appstoreconnect-swift-sdk). - -| File | Role | -|------|------| -| `Auth/EnvironmentAuthProvider.swift` | Resolves credentials from environment variables | -| `Apps/OpenAPIAppRepository.swift` | `AppRepository` — injects `appId` into each mapped `AppStoreVersion` | -| `Builds/OpenAPIBuildRepository.swift` | `BuildRepository` implementation | -| `TestFlight/OpenAPITestFlightRepository.swift` | `TestFlightRepository` implementation | -| `Screenshots/OpenAPIScreenshotRepository.swift` | `ScreenshotRepository` — injects parent IDs at each level | -| `Client/ClientFactory.swift` | Wires authenticated client from `AuthProvider` | - -Mappers always inject the parent ID from the request parameter into the response models, since the App Store Connect API does not include parent IDs in response bodies. - -### ASCCommand Layer (CLI + TUI) +### ASCCommand (CLI + TUI) #### CLI Commands @@ -196,7 +172,7 @@ Key files: #### TUI Mode (`asc tui`) -Interactive terminal UI built with [TauTUI](https://github.com/steipete/TauTUI). Purely a presentation layer — reuses the same Domain protocols and Infrastructure implementations as the CLI. +Interactive terminal UI built with [TauTUI](https://github.com/steipete/TauTUI). Purely a presentation layer — reuses the same `ASCKit` repositories as the CLI. Navigation follows the real App Store Connect resource hierarchy: @@ -220,17 +196,9 @@ Chicago School TDD — state-based, not interaction-based. Tests verify what dom ``` Tests/ -├── DomainTests/ -│ ├── Apps/ # AppTests, AppStoreVersionTests, AppStoreVersionStateTests, AppRepositoryTests -│ ├── Builds/ # BuildTests -│ ├── Auth/ # AuthCredentialsTests -│ ├── Shared/ # PaginatedResponseTests -│ ├── Screenshots/ # ScreenshotDisplayTypeTests, AppScreenshotSetTests, AppScreenshotTests, ScreenshotRepositoryTests +├── ASCKitTests/ # mirrors Sources/ASCKit/ folder for folder — / and /Internal/ │ └── TestHelpers/ # MockRepositoryFactory -├── InfrastructureTests/ -│ └── Auth/ # EnvironmentAuthProviderTests -└── ASCCommandTests/ - └── OutputFormatterTests +└── ASCCommandTests/ # commands and REST routes, asserting the full output ``` Test naming: backtick style (`func \`version is live when state is readyForSale\`()`). Mocking: `@Mockable` + `given().willReturn()`. diff --git a/docs/features/command-center-react/design.md b/docs/features/command-center-react/design.md index b21fc65a..89f36e12 100644 --- a/docs/features/command-center-react/design.md +++ b/docs/features/command-center-react/design.md @@ -1327,7 +1327,7 @@ Progressive migration — React app runs alongside the existing vanilla JS durin ### What stays unchanged - `apps/asc-web/console/` — unchanged (separate app) -- `Sources/Infrastructure/Web/` — unchanged (same REST API) +- `Sources/ASCKit/Web/` — unchanged (same REST API) - `Sources/ASCCommand/Commands/Web/` — unchanged (same controllers) - `Sources/ASCPlugin/` — unchanged (same plugin loading, manifest format) diff --git a/docs/features/concept-folders/design.md b/docs/features/concept-folders/design.md index b63bec33..5a5ebf2d 100644 --- a/docs/features/concept-folders/design.md +++ b/docs/features/concept-folders/design.md @@ -4,7 +4,7 @@ description: The source layout reworked from layers (Domain/, Infrastructure/) t # Concept folders, not layers -**Status: step 1 BUILT** (one `ASCKit` module, concept folders); steps 2–5 not built. asc-cli is split by layer: `Sources/Domain/` +**Status: steps 1–2 BUILT** (one `ASCKit` module, concept folders; docs and skills follow); steps 3–5 not built. asc-cli is split by layer: `Sources/Domain/` and `Sources/Infrastructure/` are two modules that mirror each other folder for folder. Every concept therefore lives in two places, and every change to one touches both trees. The goal, stated as a test: @@ -114,7 +114,7 @@ safety net; any step that moves a rule writes its test first. |---|---|---|---|---| | 0 | **this doc** | — | the target tree and rules | — | | 1 | **one module, concept folders** ✓ | `Domain` + `Infrastructure` targets, `DomainTests` + `InfrastructureTests` | `git mv` into `Sources/ASCKit//` and `/Internal/`; `ScreenshotPlans` → `Screenshots/Internal/`; `Client` + infra `Shared` → `Shared/Internal/`; one `ASCKit` target, one `ASCKitTests`; `import Domain`/`Infrastructure` → `import ASCKit`; `Domain.X` → `ASCKit.X`. Library users and `examples/blitz-screenshots` change two imports to one (CHANGELOG line, `docs/library.md`) | — (move only; 787+ tests stay green) | -| 2 | **docs and skills follow** | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | +| 2 | **docs and skills follow** ✓ | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | | 3 | **one composition root** | `CompositeAuthProvider(` ×63 in `ASCCommand` | built once in `ClientProvider`; commands ask for it | "should authenticate with the stored credentials when no env vars are set" (existing behaviour, pinned) | | 4 | **`Internal/System/` per concept** (several PRs) | SDK call + mapping in one `SDK…Repository` | the mapping stays in `Internal/` and is tested from DTOs; only the request goes in `Internal/System/` | per concept: "should map a with its parent id" from a DTO, no SDK stub | | 5 | **names for roles** (several PRs) | 75 `XxxRepository` protocols, `XxxProvider`s | plural collection nouns (`Apps`, `Builds`), role nouns for the rest | per rename — none; behaviour unchanged | diff --git a/docs/features/iap-subscriptions/submission-iris-parity.md b/docs/features/iap-subscriptions/submission-iris-parity.md index 1629cc0c..88e65ab4 100644 --- a/docs/features/iap-subscriptions/submission-iris-parity.md +++ b/docs/features/iap-subscriptions/submission-iris-parity.md @@ -40,8 +40,8 @@ The web UI expresses "alongside next version" via `submitWithNextAppStoreVersion ## Plumbing already in place -- `Sources/Infrastructure/Iris/IrisClient.swift` — handles cookie injection, `[asc-ui]` CSRF header, JSON:API content-type -- `Sources/Infrastructure/Iris/BrowserIrisCookieProvider.swift` — pulls cookies from the user's logged-in browser +- `Sources/ASCKit/Iris/Internal/IrisClient.swift` — handles cookie injection, `[asc-ui]` CSRF header, JSON:API content-type +- `Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift` — pulls cookies from the user's logged-in browser - Working precedent: `IrisSDKAppBundleRepository` already calls iris through `IrisClient` ## Shipped approach (IAP) @@ -133,4 +133,4 @@ Same gap exists at `POST /iris/v1/subscriptionSubmissions`. The implementation w ## See also - `docs/features/iap-subscriptions/lifecycle.md` — current submission CLI/REST commands -- `Sources/Infrastructure/Iris/IrisClient.swift` — iris HTTP layer +- `Sources/ASCKit/Iris/Internal/IrisClient.swift` — iris HTTP layer diff --git a/docs/features/iris/iris-srp-login.md b/docs/features/iris/iris-srp-login.md index a2083ff6..cdf19cf6 100644 --- a/docs/features/iris/iris-srp-login.md +++ b/docs/features/iris/iris-srp-login.md @@ -8,7 +8,7 @@ The iris private API at `https://appstoreconnect.apple.com/iris/v1/` is the only path Apple exposes for several App Store Connect features (notably `submitWithNextAppStoreVersion` for IAP/subscription submissions). Iris is gated by **session cookies obtained from an Apple ID login** at `idmsa.apple.com`. -We already have **`BrowserIrisCookieProvider`** (`Sources/Infrastructure/Iris/BrowserIrisCookieProvider.swift`) which borrows cookies from the user's browser after they've signed in to App Store Connect manually. That works for desktop interactive use but **not for headless CI** — there's no browser to borrow from. +We already have **`BrowserIrisCookieProvider`** (`Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift`) which borrows cookies from the user's browser after they've signed in to App Store Connect manually. That works for desktop interactive use but **not for headless CI** — there's no browser to borrow from. Three paths considered. Only one survives: @@ -93,7 +93,7 @@ The existing `BrowserIrisCookieProvider` is **not removed** — users on a deskt ``` Sources/ -├── Domain/Auth/Iris/ (new — pure value types & @Mockable protocols, zero I/O) +├── ASCKit/Auth/Iris/ (new — pure value types & @Mockable protocols, zero I/O) │ ├── IrisAuthCredentials.swift appleId, password │ ├── IrisAuthSession.swift cookies, scnt, serviceKey, appleIDSessionID, providerID, teamId, userEmail, expiresAt │ ├── IrisAuthRepository.swift @Mockable: login, requestTwoFactorCode, submitTwoFactorCode, logout @@ -102,18 +102,18 @@ Sources/ │ ├── TwoFactorChallenge.swift method (trustedDevice/phone), maskedDestination, codeLength │ └── PendingTwoFactorState.swift serialized partial session: scnt, serviceKey, appleIDSessionID, twoFactorCookieBag │ -├── Infrastructure/Iris/Auth/ (new — implementations of Domain protocols) +├── ASCKit/Iris/Internal/Auth/ (new — implementations of the face's protocols) │ ├── SRP/ (Apple-specific glue on top of swift-srp) │ │ ├── AppleSRPClient.swift init() → A using swift-srp keys; completeWith(salt, B, iterations) computes Apple x via PBKDF2 then S using swift-srp's BigNum + config.k/g/N │ │ └── AppleM1.swift HKDF-SHA256-derived M1 — Apple's variant, distinct from RFC 2945 proof │ ├── IdmsaAPIClient.swift HTTP for idmsa.apple.com (signin/init, signin/complete, verify//securitycode, 2sv/trust); cookie jar & header threading │ ├── OlympusClient.swift olympus/v1/session for team metadata -│ ├── IrisAuthSDKRepository.swift implements `Domain.IrisAuthRepository`; composes AppleSRPClient + IdmsaAPIClient + OlympusClient -│ ├── KeychainIrisSessionRepository.swift implements `Domain.IrisSessionRepository` via macOS Keychain (Security framework) -│ ├── FileIrisSessionRepository.swift implements `Domain.IrisSessionRepository` via `~/.asc/iris/session.json`, written with `0600` -│ ├── CompositeIrisSessionRepository.swift implements `Domain.IrisSessionRepository` by trying Keychain first, falling back to file (so macOS gets keychain protection, Linux silently falls through) -│ ├── KeychainIrisCookieProvider.swift implements existing `Domain.IrisCookieProvider`; reads from any `IrisSessionRepository` -│ └── CompositeIrisCookieProvider.swift implements `Domain.IrisCookieProvider`; resolution order env → stored → browser +│ ├── IrisAuthSDKRepository.swift implements `ASCKit.IrisAuthRepository`; composes AppleSRPClient + IdmsaAPIClient + OlympusClient +│ ├── KeychainIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` via macOS Keychain (Security framework) +│ ├── FileIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` via `~/.asc/iris/session.json`, written with `0600` +│ ├── CompositeIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` by trying Keychain first, falling back to file (so macOS gets keychain protection, Linux silently falls through) +│ ├── KeychainIrisCookieProvider.swift implements existing `ASCKit.IrisCookieProvider`; reads from any `IrisSessionRepository` +│ └── CompositeIrisCookieProvider.swift implements `ASCKit.IrisCookieProvider`; resolution order env → stored → browser │ └── ASCCommand/Commands/Iris/Auth/ (new — CLI) ├── IrisAuthCommand.swift `asc iris auth` @@ -234,7 +234,7 @@ Strict TDD. Each slice has a red test before any production code. ### Crypto primitives (slice 1) - **RFC 5054 base correctness comes free** — `swift-srp` already has its own test suite verified against RFC 5054 vectors, Mozilla's verifier vectors, and several cross-implementations. We do not re-test what they own. -- **Apple-specific test vectors**: we test only our delta — Apple's PBKDF2-based `x` derivation and HKDF-based `M1`. Captured from a single real successful login through `mitmproxy`. Stored as `Tests/InfrastructureTests/Iris/Auth/Fixtures/apple-srp-vectors.json` (no real password — only the post-derivation values: salt, iterations, expected `x`, expected `M1`). +- **Apple-specific test vectors**: we test only our delta — Apple's PBKDF2-based `x` derivation and HKDF-based `M1`. Captured from a single real successful login through `mitmproxy`. Stored as `Tests/ASCKitTests/Iris/Internal/Auth/Fixtures/apple-srp-vectors.json` (no real password — only the post-derivation values: salt, iterations, expected `x`, expected `M1`). ### Idmsa flow (slices 2–3) - `IdmsaAPIClient` accepts an injected `URLSession` (via `URLProtocol` mock or `XCTNetworking` shim). @@ -284,5 +284,5 @@ Strict TDD. Each slice has a red test before any production code. ## See also - `docs/features/iap-subscriptions/submission-iris-parity.md` — the original gap that motivated this build -- `Sources/Infrastructure/Iris/IrisClient.swift` — the iris HTTP layer that consumes the cookies SRP login produces -- `Sources/Infrastructure/Iris/BrowserIrisCookieProvider.swift` — the existing browser-based path; remains as the third resolver in the composite +- `Sources/ASCKit/Iris/Internal/IrisClient.swift` — the iris HTTP layer that consumes the cookies SRP login produces +- `Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift` — the existing browser-based path; remains as the third resolver in the composite diff --git a/docs/features/screenshot-editor/design.md b/docs/features/screenshot-editor/design.md index f880e589..be423cce 100644 --- a/docs/features/screenshot-editor/design.md +++ b/docs/features/screenshot-editor/design.md @@ -147,11 +147,11 @@ homepage/editor/ Web editor source └── *.png 121 device bezels Sources/ -├── Domain/Screenshots/ +├── ASCKit/Apps/Versions/Localizations/ScreenshotSets/ │ ├── ScreenshotImport.swift ScreenshotManifest + nested types │ └── ScreenshotRepository.swift Modified: added importScreenshots │ -├── Infrastructure/Screenshots/ +├── ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/ │ └── OpenAPIScreenshotRepository.swift Modified: implements importScreenshots │ └── ASCCommand/Commands/Screenshots/ diff --git a/docs/features/web-server-architecture/design.md b/docs/features/web-server-architecture/design.md index ee0eda69..64ef5ebd 100644 --- a/docs/features/web-server-architecture/design.md +++ b/docs/features/web-server-architecture/design.md @@ -18,7 +18,7 @@ Browser (asccli.app) ←──HTTP/WS──→ Swift Server (localhost:8420) │ ASCCommand │ │ └── WebServerCommand.swift CLI entry, command runner │ ├──────────────────────────────────────────────────────────────┤ -│ Infrastructure/Web │ +│ ASCKit/Web │ │ ├── ASCWebServer.swift Hummingbird app, routes, │ │ │ plugin loading, HTTPS │ │ ├── CORSMiddleware.swift Cross-origin for asccli.app │ @@ -98,11 +98,11 @@ Sources/ ├── ASCPlugin/ │ ├── ASCPlugin.swift # @objc protocol, ASCRouter typealias │ └── PluginLoader.swift # .plugin/.framework/.dylib discovery -├── Infrastructure/Web/ +├── ASCKit/Web/ │ ├── ASCWebServer.swift # Hummingbird server, plugin loading │ ├── CORSMiddleware.swift # CORS for asccli.app → localhost │ └── SelfSignedCert.swift # HTTPS cert management -├── Domain/Shared/ +├── ASCKit/Shared/ │ └── AffordanceRegistry.swift # Plugin affordance extension └── ASCCommand/Commands/Web/ └── WebServerCommand.swift # CLI entry point From c6cdebf5a92fc107df5dd646c272966ca76d28ef Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:20:08 +0800 Subject: [PATCH 04/18] refactor(cli): name Internal/ implementations only in ClientProvider Commands and RESTRoutes ask ClientProvider for a concept's public protocol instead of building FileAuthStorage, EnvironmentAuthProvider, ProcessXcodeBuildRunner, FileProjectConfigStorage, the screenshot repositories or their own ClientFactory. CompositionRootTests holds the fence: it fails, naming file and type, when any other ASCCommand file names an ASCKit Internal/ type. Step 3 of the concept-folders design. Co-Authored-By: Claude Opus 5.5 --- Sources/ASCCommand/ClientProvider.swift | 16 ++ .../Commands/AppShots/AppShotsConfig.swift | 2 +- .../Commands/AppShots/AppShotsGenerate.swift | 2 +- .../Commands/Auth/AuthCommand.swift | 4 +- .../ASCCommand/Commands/Auth/AuthList.swift | 2 +- .../ASCCommand/Commands/Auth/AuthLogin.swift | 2 +- .../ASCCommand/Commands/Auth/AuthLogout.swift | 2 +- .../ASCCommand/Commands/Auth/AuthUpdate.swift | 2 +- .../ASCCommand/Commands/Auth/AuthUse.swift | 2 +- .../Commands/Builds/BuildsArchive.swift | 2 +- .../Commands/Init/InitCommand.swift | 2 +- .../Reports/FinanceReportsDownload.swift | 4 +- .../Reports/SalesReportsDownload.swift | 4 +- .../Reports/SalesReportsSummary.swift | 4 +- .../ASCCommand/Commands/Web/RESTRoutes.swift | 156 +++++++++--------- .../CompositionRootTests.swift | 52 ++++++ docs/features/concept-folders/design.md | 8 +- 17 files changed, 166 insertions(+), 100 deletions(-) create mode 100644 Tests/ASCCommandTests/CompositionRootTests.swift diff --git a/Sources/ASCCommand/ClientProvider.swift b/Sources/ASCCommand/ClientProvider.swift index 531d0780..8f33dbfc 100644 --- a/Sources/ASCCommand/ClientProvider.swift +++ b/Sources/ASCCommand/ClientProvider.swift @@ -324,6 +324,22 @@ struct ClientProvider { AggregateThemeRepository.shared } + static func makeAuthStorage() -> any AuthStorage { + FileAuthStorage() + } + + static func makeEnvironmentAuthProvider() -> any AuthProvider { + EnvironmentAuthProvider() + } + + static func makeXcodeBuildRunner() -> any XcodeBuildRunner { + ProcessXcodeBuildRunner() + } + + static func makeProjectConfigStorage() -> any ProjectConfigStorage { + FileProjectConfigStorage() + } + static func makeHTMLRenderer() -> any HTMLRenderer { WebKitHTMLRenderer() } diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsConfig.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsConfig.swift index 0f6c9aea..ceac50cf 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsConfig.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsConfig.swift @@ -17,7 +17,7 @@ struct AppShotsConfig: AsyncParsableCommand { var remove: Bool = false func run() async throws { - let storage = FileAppShotsConfigStorage() + let storage = ClientProvider.makeAppShotsConfigStorage() print(try await execute(storage: storage)) } diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsGenerate.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsGenerate.swift index e3e8886a..e187050b 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsGenerate.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsGenerate.swift @@ -32,7 +32,7 @@ struct AppShotsGenerate: AsyncParsableCommand { var prompt: String? func run() async throws { - let configStorage = FileAppShotsConfigStorage() + let configStorage = ClientProvider.makeAppShotsConfigStorage() let apiKey = try resolveGeminiApiKey(geminiApiKey, configStorage: configStorage) let path = try await Self.run( file: file, apiKey: apiKey, model: model, diff --git a/Sources/ASCCommand/Commands/Auth/AuthCommand.swift b/Sources/ASCCommand/Commands/Auth/AuthCommand.swift index 828986cd..c8984e8d 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthCommand.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthCommand.swift @@ -18,8 +18,8 @@ struct AuthCheck: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let storage = FileAuthStorage() - let envProvider = EnvironmentAuthProvider() + let storage = ClientProvider.makeAuthStorage() + let envProvider = ClientProvider.makeEnvironmentAuthProvider() print(try await execute(storage: storage, envProvider: envProvider)) } diff --git a/Sources/ASCCommand/Commands/Auth/AuthList.swift b/Sources/ASCCommand/Commands/Auth/AuthList.swift index a48732f0..f1142ed6 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthList.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthList.swift @@ -10,7 +10,7 @@ struct AuthList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let storage = FileAuthStorage() + let storage = ClientProvider.makeAuthStorage() print(try await execute(storage: storage)) } diff --git a/Sources/ASCCommand/Commands/Auth/AuthLogin.swift b/Sources/ASCCommand/Commands/Auth/AuthLogin.swift index 307e13dc..9e227041 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthLogin.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthLogin.swift @@ -29,7 +29,7 @@ struct AuthLogin: AsyncParsableCommand { var vendorNumber: String? func run() async throws { - let storage = FileAuthStorage() + let storage = ClientProvider.makeAuthStorage() print(try await execute(storage: storage)) } diff --git a/Sources/ASCCommand/Commands/Auth/AuthLogout.swift b/Sources/ASCCommand/Commands/Auth/AuthLogout.swift index fc56d69a..857d5052 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthLogout.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthLogout.swift @@ -13,7 +13,7 @@ struct AuthLogout: AsyncParsableCommand { var name: String? func run() async throws { - let storage = FileAuthStorage() + let storage = ClientProvider.makeAuthStorage() try await execute(storage: storage) } diff --git a/Sources/ASCCommand/Commands/Auth/AuthUpdate.swift b/Sources/ASCCommand/Commands/Auth/AuthUpdate.swift index dcf9daf5..a075ced9 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthUpdate.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthUpdate.swift @@ -16,7 +16,7 @@ struct AuthUpdate: AsyncParsableCommand { var vendorNumber: String? func run() async throws { - let storage = FileAuthStorage() + let storage = ClientProvider.makeAuthStorage() print(try await execute(storage: storage)) } diff --git a/Sources/ASCCommand/Commands/Auth/AuthUse.swift b/Sources/ASCCommand/Commands/Auth/AuthUse.swift index b1c4dfd8..12012451 100644 --- a/Sources/ASCCommand/Commands/Auth/AuthUse.swift +++ b/Sources/ASCCommand/Commands/Auth/AuthUse.swift @@ -13,7 +13,7 @@ struct AuthUse: AsyncParsableCommand { var name: String func run() async throws { - let storage = FileAuthStorage() + let storage = ClientProvider.makeAuthStorage() try await execute(storage: storage) } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift b/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift index c30e034c..5c3bf9b4 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift @@ -52,7 +52,7 @@ struct BuildsArchive: AsyncParsableCommand { var buildNumber: String? func run() async throws { - let runner = ProcessXcodeBuildRunner() + let runner = ClientProvider.makeXcodeBuildRunner() let uploadRepo = upload ? try ClientProvider.makeBuildUploadRepository() : nil print(try await execute(runner: runner, uploadRepo: uploadRepo)) } diff --git a/Sources/ASCCommand/Commands/Init/InitCommand.swift b/Sources/ASCCommand/Commands/Init/InitCommand.swift index 9a5240d5..16c220dd 100644 --- a/Sources/ASCCommand/Commands/Init/InitCommand.swift +++ b/Sources/ASCCommand/Commands/Init/InitCommand.swift @@ -30,7 +30,7 @@ struct InitCommand: AsyncParsableCommand { func run() async throws { let repo = try ClientProvider.makeAppRepository() - let storage = FileProjectConfigStorage() + let storage = ClientProvider.makeProjectConfigStorage() print(try await execute(repo: repo, storage: storage)) } diff --git a/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift b/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift index 47984a35..1b062cc6 100644 --- a/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift +++ b/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift @@ -23,11 +23,11 @@ struct FinanceReportsDownload: AsyncParsableCommand { func run() async throws { let repo = try ClientProvider.makeReportRepository() - let storage = FileAuthStorage() + let storage = ClientProvider.makeAuthStorage() print(try await execute(repo: repo, storage: storage)) } - func execute(repo: any ReportRepository, storage: any AuthStorage = FileAuthStorage()) async throws -> String { + func execute(repo: any ReportRepository, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { let resolvedVendorNumber = try VendorNumberResolver.resolve(explicit: vendorNumber, storage: storage) guard let parsedReportType = FinanceReportType(cliArgument: reportType) else { diff --git a/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift b/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift index d1ee089d..8b2083bf 100644 --- a/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift +++ b/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift @@ -29,11 +29,11 @@ struct SalesReportsDownload: AsyncParsableCommand { func run() async throws { let repo = try ClientProvider.makeReportRepository() - let storage = FileAuthStorage() + let storage = ClientProvider.makeAuthStorage() print(try await execute(repo: repo, storage: storage)) } - func execute(repo: any ReportRepository, storage: any AuthStorage = FileAuthStorage()) async throws -> String { + func execute(repo: any ReportRepository, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { let resolvedVendorNumber = try VendorNumberResolver.resolve(explicit: vendorNumber, storage: storage) guard let parsedReportType = SalesReportType(cliArgument: reportType) else { diff --git a/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift b/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift index 4fe5fa0b..e35cee3e 100644 --- a/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift +++ b/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift @@ -21,11 +21,11 @@ struct SalesReportsSummary: AsyncParsableCommand { func run() async throws { let repo = try ClientProvider.makeReportRepository() - let storage = FileAuthStorage() + let storage = ClientProvider.makeAuthStorage() print(try await execute(repo: repo, storage: storage)) } - func execute(repo: any ReportRepository, storage: any AuthStorage = FileAuthStorage()) async throws -> String { + func execute(repo: any ReportRepository, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { let resolvedVendorNumber = try VendorNumberResolver.resolve(explicit: vendorNumber, storage: storage) let dates = try expandDateRange(from: from, to: to) diff --git a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift index 80112950..5caadd13 100644 --- a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift +++ b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift @@ -15,78 +15,76 @@ enum RESTRoutes { let v1 = router.group("/api/v1") - // Create shared auth + factory once - let auth = CompositeAuthProvider() - let factory = ClientFactory() + // Every repository comes from the one composition root, ClientProvider. // App resource hierarchy — one focused controller per resource type. // Order is incidental; each controller registers its own routes. - if let appRepo = try? factory.makeAppRepository(authProvider: auth) { + if let appRepo = try? ClientProvider.makeAppRepository() { AppsController(repo: appRepo).addRoutes(to: v1) } - if let versionRepo = try? factory.makeVersionRepository(authProvider: auth) { + if let versionRepo = try? ClientProvider.makeVersionRepository() { VersionsController(repo: versionRepo).addRoutes(to: v1) } - if let localizationRepo = try? factory.makeVersionLocalizationRepository(authProvider: auth) { + if let localizationRepo = try? ClientProvider.makeVersionLocalizationRepository() { VersionLocalizationsController(repo: localizationRepo).addRoutes(to: v1) } - if let screenshotRepo = try? factory.makeScreenshotRepository(authProvider: auth) { + if let screenshotRepo = try? ClientProvider.makeScreenshotRepository() { ScreenshotSetsController(repo: screenshotRepo).addRoutes(to: v1) ScreenshotsController(repo: screenshotRepo).addRoutes(to: v1) } - if let libraryRepo = try? factory.makeAssetLibraryRepository(authProvider: auth), - let imageRepo = try? factory.makeLibraryImageRepository(authProvider: auth), - let videoRepo = try? factory.makeLibraryVideoRepository(authProvider: auth), - let placementRepo = try? factory.makeAssetPlacementRepository(authProvider: auth) { + if let libraryRepo = try? ClientProvider.makeAssetLibraryRepository(), + let imageRepo = try? ClientProvider.makeLibraryImageRepository(), + let videoRepo = try? ClientProvider.makeLibraryVideoRepository(), + let placementRepo = try? ClientProvider.makeAssetPlacementRepository() { AssetLibraryController( libraryRepo: libraryRepo, imageRepo: imageRepo, videoRepo: videoRepo, placementRepo: placementRepo ).addRoutes(to: v1) - if let versionRepo = try? factory.makeVersionRepository(authProvider: auth), - let localizationRepo = try? factory.makeVersionLocalizationRepository(authProvider: auth) { + if let versionRepo = try? ClientProvider.makeVersionRepository(), + let localizationRepo = try? ClientProvider.makeVersionLocalizationRepository() { ScreenshotImportController( versionRepo: versionRepo, localizationRepo: localizationRepo, libraryRepo: libraryRepo, imageRepo: imageRepo, placementRepo: placementRepo ).addRoutes(to: v1) } } - if let buildRepo = try? factory.makeBuildRepository(authProvider: auth) { + if let buildRepo = try? ClientProvider.makeBuildRepository() { BuildsController(repo: buildRepo).addRoutes(to: v1) } - if let testFlightRepo = try? factory.makeTestFlightRepository(authProvider: auth) { + if let testFlightRepo = try? ClientProvider.makeTestFlightRepository() { TestFlightController(repo: testFlightRepo).addRoutes(to: v1) } - if let betaAppLocRepo = try? factory.makeBetaAppLocalizationRepository(authProvider: auth) { + if let betaAppLocRepo = try? ClientProvider.makeBetaAppLocalizationRepository() { BetaAppLocalizationsController(repo: betaAppLocRepo).addRoutes(to: v1) } - if let reviewRepo = try? factory.makeCustomerReviewRepository(authProvider: auth) { + if let reviewRepo = try? ClientProvider.makeCustomerReviewRepository() { CustomerReviewsController(repo: reviewRepo).addRoutes(to: v1) } - if let iapRepo = try? factory.makeInAppPurchaseRepository(authProvider: auth) { + if let iapRepo = try? ClientProvider.makeInAppPurchaseRepository() { IAPController(repo: iapRepo).addRoutes(to: v1) } - if let subscriptionGroupRepo = try? factory.makeSubscriptionGroupRepository(authProvider: auth) { + if let subscriptionGroupRepo = try? ClientProvider.makeSubscriptionGroupRepository() { SubscriptionGroupsController(repo: subscriptionGroupRepo).addRoutes(to: v1) } - if let subscriptionRepo = try? factory.makeSubscriptionRepository(authProvider: auth) { + if let subscriptionRepo = try? ClientProvider.makeSubscriptionRepository() { SubscriptionsController(repo: subscriptionRepo).addRoutes(to: v1) } - if let promotedRepo = try? factory.makePromotedPurchaseRepository(authProvider: auth) { + if let promotedRepo = try? ClientProvider.makePromotedPurchaseRepository() { PromotedPurchasesController(repo: promotedRepo).addRoutes(to: v1) } - if let availabilityRepo = try? factory.makeAppAvailabilityRepository(authProvider: auth), - let territoryRepo = try? factory.makeTerritoryRepository(authProvider: auth) { + if let availabilityRepo = try? ClientProvider.makeAppAvailabilityRepository(), + let territoryRepo = try? ClientProvider.makeTerritoryRepository() { AppAvailabilityController(repo: availabilityRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let pricingRepo = try? factory.makePricingRepository(authProvider: auth) { + if let pricingRepo = try? ClientProvider.makePricingRepository() { AppPricingController(repo: pricingRepo).addRoutes(to: v1) } - if let productVersionRepo = try? factory.makeProductVersionRepository(authProvider: auth) { + if let productVersionRepo = try? ClientProvider.makeProductVersionRepository() { ProductVersionsController(repo: productVersionRepo).addRoutes(to: v1) - if let submissionRepo = try? factory.makeSubmissionRepository(authProvider: auth), - let versionRepo = try? factory.makeVersionRepository(authProvider: auth), - let iapRepo = try? factory.makeInAppPurchaseRepository(authProvider: auth), - let groupRepo = try? factory.makeSubscriptionGroupRepository(authProvider: auth), - let subscriptionRepo = try? factory.makeSubscriptionRepository(authProvider: auth) { + if let submissionRepo = try? ClientProvider.makeSubmissionRepository(), + let versionRepo = try? ClientProvider.makeVersionRepository(), + let iapRepo = try? ClientProvider.makeInAppPurchaseRepository(), + let groupRepo = try? ClientProvider.makeSubscriptionGroupRepository(), + let subscriptionRepo = try? ClientProvider.makeSubscriptionRepository() { VersionSubmissionController( submissionRepo: submissionRepo, versionRepo: versionRepo, @@ -95,80 +93,80 @@ enum RESTRoutes { ).addRoutes(to: v1) } } - if let perfOverviewRepo = try? factory.makePerfOverviewRepository(authProvider: auth) { + if let perfOverviewRepo = try? ClientProvider.makePerfOverviewRepository() { PerfOverviewController(repo: perfOverviewRepo).addRoutes(to: v1) } - if let perfMetricsRepo = try? factory.makePerfMetricsRepository(authProvider: auth) { + if let perfMetricsRepo = try? ClientProvider.makePerfMetricsRepository() { PerfMetricsController(repo: perfMetricsRepo).addRoutes(to: v1) } - if let diagnosticsRepo = try? factory.makeDiagnosticsRepository(authProvider: auth) { + if let diagnosticsRepo = try? ClientProvider.makeDiagnosticsRepository() { DiagnosticsController(repo: diagnosticsRepo).addRoutes(to: v1) } - if let experimentRepo = try? factory.makeExperimentRepository(authProvider: auth) { + if let experimentRepo = try? ClientProvider.makeExperimentRepository() { ExperimentsController(repo: experimentRepo).addRoutes(to: v1) } - if let gameCenterRepo = try? factory.makeGameCenterRepository(authProvider: auth), - let moderationRepo = try? factory.makeGameCenterModerationRepository(authProvider: auth) { + if let gameCenterRepo = try? ClientProvider.makeGameCenterRepository(), + let moderationRepo = try? ClientProvider.makeGameCenterModerationRepository() { GameCenterController(repo: gameCenterRepo, moderationRepo: moderationRepo).addRoutes(to: v1) } - if let groupLocRepo = try? factory.makeSubscriptionGroupLocalizationRepository(authProvider: auth) { + if let groupLocRepo = try? ClientProvider.makeSubscriptionGroupLocalizationRepository() { SubscriptionGroupLocalizationsController(repo: groupLocRepo).addRoutes(to: v1) } - if let promoRepo = try? factory.makeSubscriptionPromotionalOfferRepository(authProvider: auth) { + if let promoRepo = try? ClientProvider.makeSubscriptionPromotionalOfferRepository() { SubscriptionPromotionalOffersController(repo: promoRepo).addRoutes(to: v1) } - if let winBackRepo = try? factory.makeWinBackOfferRepository(authProvider: auth) { + if let winBackRepo = try? ClientProvider.makeWinBackOfferRepository() { WinBackOffersController(repo: winBackRepo).addRoutes(to: v1) } - if let subPriceRepo = try? factory.makeSubscriptionPriceRepository(authProvider: auth) { + if let subPriceRepo = try? ClientProvider.makeSubscriptionPriceRepository() { SubscriptionPricePointsController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionPriceScheduleController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionEqualizationsController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionPricesController(repo: subPriceRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? factory.makeInAppPurchaseOfferCodeRepository(authProvider: auth), - let subOfferCodeRepo = try? factory.makeSubscriptionOfferCodeRepository(authProvider: auth) { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository(), + let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { OfferCodePricesController(iapRepo: iapOfferCodeRepo, subRepo: subOfferCodeRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? factory.makeInAppPurchaseOfferCodeRepository(authProvider: auth) { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository() { IAPOfferCodeOneTimeCodesController(repo: iapOfferCodeRepo).addRoutes(to: v1) } - if let subOfferCodeRepo = try? factory.makeSubscriptionOfferCodeRepository(authProvider: auth) { + if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { SubscriptionOfferCodeOneTimeCodesController(repo: subOfferCodeRepo).addRoutes(to: v1) } - if let iapReviewRepo = try? factory.makeInAppPurchaseReviewRepository(authProvider: auth) { + if let iapReviewRepo = try? ClientProvider.makeInAppPurchaseReviewRepository() { IAPReviewController(repo: iapReviewRepo).addRoutes(to: v1) } - if let subReviewRepo = try? factory.makeSubscriptionReviewRepository(authProvider: auth) { + if let subReviewRepo = try? ClientProvider.makeSubscriptionReviewRepository() { SubscriptionReviewController(repo: subReviewRepo).addRoutes(to: v1) } - if let iapSubmissionRepo = try? factory.makeInAppPurchaseSubmissionRepository(authProvider: auth) { + if let iapSubmissionRepo = try? ClientProvider.makeInAppPurchaseSubmissionRepository() { IAPSubmissionController(repo: iapSubmissionRepo).addRoutes(to: v1) } IrisIAPSubmissionsController( - cookieProvider: factory.makeIrisCookieProvider(), - repo: factory.makeIrisInAppPurchaseSubmissionRepository() + cookieProvider: ClientProvider.makeIrisCookieProvider(), + repo: ClientProvider.makeIrisInAppPurchaseSubmissionRepository() ).addRoutes(to: v1) IrisResolutionCenterController( - cookieProvider: factory.makeIrisCookieProvider(), - repo: factory.makeIrisResolutionCenterRepository() + cookieProvider: ClientProvider.makeIrisCookieProvider(), + repo: ClientProvider.makeIrisResolutionCenterRepository() ).addRoutes(to: v1) - if let subSubmissionRepo = try? factory.makeSubscriptionSubmissionRepository(authProvider: auth) { + if let subSubmissionRepo = try? ClientProvider.makeSubscriptionSubmissionRepository() { SubscriptionSubmissionController(repo: subSubmissionRepo).addRoutes(to: v1) } // IAP detail listings - if let iapLocRepo = try? factory.makeInAppPurchaseLocalizationRepository(authProvider: auth) { + if let iapLocRepo = try? ClientProvider.makeInAppPurchaseLocalizationRepository() { IAPLocalizationsController(repo: iapLocRepo).addRoutes(to: v1) } - if let iapAvailRepo = try? factory.makeInAppPurchaseAvailabilityRepository(authProvider: auth), - let territoryRepo = try? factory.makeTerritoryRepository(authProvider: auth) { + if let iapAvailRepo = try? ClientProvider.makeInAppPurchaseAvailabilityRepository(), + let territoryRepo = try? ClientProvider.makeTerritoryRepository() { IAPAvailabilityController(repo: iapAvailRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? factory.makeInAppPurchaseOfferCodeRepository(authProvider: auth) { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository() { IAPOfferCodesController(repo: iapOfferCodeRepo).addRoutes(to: v1) } - if let iapPriceRepo = try? factory.makeInAppPurchasePriceRepository(authProvider: auth) { + if let iapPriceRepo = try? ClientProvider.makeInAppPurchasePriceRepository() { IAPPricePointsController(repo: iapPriceRepo).addRoutes(to: v1) IAPPriceScheduleController(repo: iapPriceRepo).addRoutes(to: v1) IAPEqualizationsController(repo: iapPriceRepo).addRoutes(to: v1) @@ -176,60 +174,60 @@ enum RESTRoutes { } // Subscription detail listings - if let subLocRepo = try? factory.makeSubscriptionLocalizationRepository(authProvider: auth) { + if let subLocRepo = try? ClientProvider.makeSubscriptionLocalizationRepository() { SubscriptionLocalizationsController(repo: subLocRepo).addRoutes(to: v1) } - if let subAvailRepo = try? factory.makeSubscriptionAvailabilityRepository(authProvider: auth), - let territoryRepo = try? factory.makeTerritoryRepository(authProvider: auth) { + if let subAvailRepo = try? ClientProvider.makeSubscriptionAvailabilityRepository(), + let territoryRepo = try? ClientProvider.makeTerritoryRepository() { SubscriptionAvailabilityController(repo: subAvailRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let subOfferCodeRepo = try? factory.makeSubscriptionOfferCodeRepository(authProvider: auth) { + if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { SubscriptionOfferCodesController(repo: subOfferCodeRepo).addRoutes(to: v1) } - if let subIntroRepo = try? factory.makeSubscriptionIntroductoryOfferRepository(authProvider: auth) { + if let subIntroRepo = try? ClientProvider.makeSubscriptionIntroductoryOfferRepository() { SubscriptionIntroductoryOffersController(repo: subIntroRepo).addRoutes(to: v1) } - if let appInfoRepo = try? factory.makeAppInfoRepository(authProvider: auth) { + if let appInfoRepo = try? ClientProvider.makeAppInfoRepository() { AppInfosController(repo: appInfoRepo).addRoutes(to: v1) } - if let appCategoryRepo = try? factory.makeAppCategoryRepository(authProvider: auth) { + if let appCategoryRepo = try? ClientProvider.makeAppCategoryRepository() { AppCategoriesController(repo: appCategoryRepo).addRoutes(to: v1) } - if let ageRatingRepo = try? factory.makeAgeRatingDeclarationRepository(authProvider: auth) { + if let ageRatingRepo = try? ClientProvider.makeAgeRatingDeclarationRepository() { AgeRatingController(repo: ageRatingRepo).addRoutes(to: v1) } // Code signing if let signing = try? CodeSigningController( - certRepo: factory.makeCertificateRepository(authProvider: auth), - bundleIDRepo: factory.makeBundleIDRepository(authProvider: auth), - deviceRepo: factory.makeDeviceRepository(authProvider: auth), - profileRepo: factory.makeProfileRepository(authProvider: auth) + certRepo: ClientProvider.makeCertificateRepository(), + bundleIDRepo: ClientProvider.makeBundleIDRepository(), + deviceRepo: ClientProvider.makeDeviceRepository(), + profileRepo: ClientProvider.makeProfileRepository() ) { signing.addRoutes(to: v1) } // Review submissions if let submissions = try? ReviewSubmissionsController( - submissionRepo: factory.makeSubmissionRepository(authProvider: auth) + submissionRepo: ClientProvider.makeSubmissionRepository() ) { submissions.addRoutes(to: v1) } // Auth — manages the credential store the rest of the controllers consume. - AuthController(storage: FileAuthStorage()).addRoutes(to: v1) + AuthController(storage: ClientProvider.makeAuthStorage()).addRoutes(to: v1) // Non-authenticated resources - SimulatorsController(repo: factory.makeSimulatorRepository()).addRoutes(to: v1) - PluginsController(repo: factory.makePluginRepository()).addRoutes(to: v1) + SimulatorsController(repo: ClientProvider.makeSimulatorRepository()).addRoutes(to: v1) + PluginsController(repo: ClientProvider.makePluginRepository()).addRoutes(to: v1) if let territories = try? TerritoriesController( - repo: factory.makeTerritoryRepository(authProvider: auth) + repo: ClientProvider.makeTerritoryRepository() ) { territories.addRoutes(to: v1) } // App Shots AppShotsController( - templateRepo: AggregateTemplateRepository.shared, - themeRepo: AggregateThemeRepository.shared, - htmlRenderer: WebKitHTMLRenderer(), - configStorage: FileAppShotsConfigStorage(), - galleryTemplateRepo: AggregateGalleryTemplateRepository.shared + templateRepo: ClientProvider.makeTemplateRepository(), + themeRepo: ClientProvider.makeThemeRepository(), + htmlRenderer: ClientProvider.makeHTMLRenderer(), + configStorage: ClientProvider.makeAppShotsConfigStorage(), + galleryTemplateRepo: ClientProvider.makeGalleryTemplateRepository() ).addRoutes(to: v1) } } diff --git a/Tests/ASCCommandTests/CompositionRootTests.swift b/Tests/ASCCommandTests/CompositionRootTests.swift new file mode 100644 index 00000000..ceb3129a --- /dev/null +++ b/Tests/ASCCommandTests/CompositionRootTests.swift @@ -0,0 +1,52 @@ +import Foundation +import Testing + +/// The fence around each concept's `Internal/`: only the composition root +/// (`ClientProvider.swift`) may name an implementation; every command and +/// route asks it for the concept's public protocol instead. +/// See docs/features/concept-folders/design.md §3. +@Suite +struct CompositionRootTests { + @Test func `should build every concept's Internal implementation only in the composition root`() throws { + let root = URL(fileURLWithPath: #filePath) + .deletingLastPathComponent() // ASCCommandTests + .deletingLastPathComponent() // Tests + .deletingLastPathComponent() // repo root + let internalTypes = try Self.internalTypeNames(in: root.appendingPathComponent("Sources/ASCKit")) + let commands = root.appendingPathComponent("Sources/ASCCommand") + + var leaks: [String] = [] + for file in try Self.swiftFiles(in: commands) where file.lastPathComponent != "ClientProvider.swift" { + let code = try String(contentsOf: file, encoding: .utf8) + .split(separator: "\n", omittingEmptySubsequences: false) + .filter { !$0.trimmingCharacters(in: .whitespaces).hasPrefix("//") } + .joined(separator: "\n") + let identifiers = Set(code.split { !($0.isLetter || $0.isNumber || $0 == "_") }.map(String.init)) + for name in internalTypes.intersection(identifiers) { + leaks.append("\(file.path.replacingOccurrences(of: commands.path + "/", with: "")): \(name)") + } + } + + #expect(leaks.sorted() == []) + } + + private static func internalTypeNames(in kit: URL) throws -> Set { + var names: Set = [] + let declaration = try NSRegularExpression( + pattern: "^(?:public |open )?(?:final )?(?:struct|class|enum|actor) ([A-Z][A-Za-z0-9_]*)", + options: .anchorsMatchLines + ) + for file in try swiftFiles(in: kit) where file.pathComponents.contains("Internal") { + let code = try String(contentsOf: file, encoding: .utf8) + for match in declaration.matches(in: code, range: NSRange(code.startIndex..., in: code)) { + if let range = Range(match.range(at: 1), in: code) { names.insert(String(code[range])) } + } + } + return names + } + + private static func swiftFiles(in directory: URL) throws -> [URL] { + let walker = FileManager.default.enumerator(at: directory, includingPropertiesForKeys: nil) + return (walker?.allObjects as? [URL] ?? []).filter { $0.pathExtension == "swift" } + } +} diff --git a/docs/features/concept-folders/design.md b/docs/features/concept-folders/design.md index 5a5ebf2d..8f805650 100644 --- a/docs/features/concept-folders/design.md +++ b/docs/features/concept-folders/design.md @@ -4,7 +4,7 @@ description: The source layout reworked from layers (Domain/, Infrastructure/) t # Concept folders, not layers -**Status: steps 1–2 BUILT** (one `ASCKit` module, concept folders; docs and skills follow); steps 3–5 not built. asc-cli is split by layer: `Sources/Domain/` +**Status: steps 1–3 BUILT** (one `ASCKit` module, concept folders; docs and skills follow; one composition root, held by a test); steps 4–5 not built. asc-cli is split by layer: `Sources/Domain/` and `Sources/Infrastructure/` are two modules that mirror each other folder for folder. Every concept therefore lives in two places, and every change to one touches both trees. The goal, stated as a test: @@ -26,7 +26,7 @@ one touches both trees. The goal, stated as a test: | **A concept lives in two trees** | `Domain/` 269 files and `Infrastructure/` 107 files mirror each other: `Domain/Apps/Builds/` beside `Infrastructure/Apps/Builds/`, 17 concept folders each side | one feature opens two folder trees and two test targets (`DomainTests`, `InfrastructureTests`) | | **The two trees already disagree** | `Domain/Screenshots/` is implemented by `Infrastructure/ScreenshotPlans/`; `Infrastructure/Client/`, `Web/` and `Iris/Auth/` have no Domain twin | finding an implementation means knowing a second name | | **The module split is paid for by hand** | 613 `Domain.X` qualifiers in 69 files, to tell a Domain type from the SDK type of the same name (`Domain.Territory` vs the SDK's `Territory`) | every new adapter repeats the qualifier dance | -| **Implementations leak to the way in** | `ASCCommand` imports `Infrastructure` in 80 files and builds concretes itself: `CompositeAuthProvider(` ×63 | a new auth source edits 63 call sites, not one | +| **Implementations leak to the way in** | `ASCCommand` imports `Infrastructure` in 80 files; outside `ClientProvider`, 14 files name 12 implementation types (22 uses) — `FileAuthStorage()` in 10 auth and report commands, and `RESTRoutes` builds its own `CompositeAuthProvider`, `ClientFactory` and five more | swapping an implementation (keychain auth storage, another renderer) edits every command that names it | | **The outside call is mixed with decisions** | 67 of 107 Infrastructure files import the SDK; most `SDK…Repository` files build the request, call the SDK and map the result in one type | the mapping (the part with rules) is only testable by stubbing the whole SDK client | ## 2 · The shape — outside to inside @@ -88,7 +88,7 @@ Tests/ |---|---| | **A concept is one folder**: its face, its `Internal/`, its tests | the tree (§2); no `Domain/` or `Infrastructure/` folder exists | | **Imports flow inward**: `ASCCommand → ASCKit`; a concept may use another's public face, never its `Internal/` | the module graph; a grep for `/Internal/` type names outside their concept | -| **Only the composition root names an `Internal/` type** | `ASCCommand/ClientProvider.swift`; today `CompositeAuthProvider(` ×63 is the evidence it isn't yet | +| **Only the composition root names an `Internal/` type** | `ASCCommand/ClientProvider.swift`; `CompositionRootTests` fails, naming the file and type, when any other `ASCCommand` file names one | | **The bare call is ≤100 lines with no decisions** | `Internal/System/`; a decision found there moves up into `Internal/` with a test | | **Every model carries its parent id; affordances are state-aware; CLI and REST ship together** | unchanged — [CLAUDE.md](../../../CLAUDE.md) still owns these | @@ -115,7 +115,7 @@ safety net; any step that moves a rule writes its test first. | 0 | **this doc** | — | the target tree and rules | — | | 1 | **one module, concept folders** ✓ | `Domain` + `Infrastructure` targets, `DomainTests` + `InfrastructureTests` | `git mv` into `Sources/ASCKit//` and `/Internal/`; `ScreenshotPlans` → `Screenshots/Internal/`; `Client` + infra `Shared` → `Shared/Internal/`; one `ASCKit` target, one `ASCKitTests`; `import Domain`/`Infrastructure` → `import ASCKit`; `Domain.X` → `ASCKit.X`. Library users and `examples/blitz-screenshots` change two imports to one (CHANGELOG line, `docs/library.md`) | — (move only; 787+ tests stay green) | | 2 | **docs and skills follow** ✓ | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | -| 3 | **one composition root** | `CompositeAuthProvider(` ×63 in `ASCCommand` | built once in `ClientProvider`; commands ask for it | "should authenticate with the stored credentials when no env vars are set" (existing behaviour, pinned) | +| 3 | **one composition root** ✓ | 22 uses of 12 `Internal/` types in 14 `ASCCommand` files outside `ClientProvider`; `RESTRoutes` wires its own `ClientFactory` | `ClientProvider` gains `makeAuthStorage`, `makeEnvironmentAuthProvider`, `makeXcodeBuildRunner`, `makeProjectConfigStorage`; commands and `RESTRoutes` ask it for the public protocol | "should build every concept's Internal implementation only in the composition root" | | 4 | **`Internal/System/` per concept** (several PRs) | SDK call + mapping in one `SDK…Repository` | the mapping stays in `Internal/` and is tested from DTOs; only the request goes in `Internal/System/` | per concept: "should map a with its parent id" from a DTO, no SDK stub | | 5 | **names for roles** (several PRs) | 75 `XxxRepository` protocols, `XxxProvider`s | plural collection nouns (`Apps`, `Builds`), role nouns for the rest | per rename — none; behaviour unchanged | From 36a1e24404e8c837f2b6cea3147a875ee4a4089f Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:24:03 +0800 Subject: [PATCH 05/18] refactor(skills): split ShellRunner's decisions from the process call ShellCommand owns what SystemShellRunner used to decide inline: argv via /usr/bin/env, the environment merge, exit status -> executionFailed and output trimming, all now unit-tested. SystemShellRunner moves to Skills/Internal/System/ and keeps only the Process and pipe calls. codecov skips Sources/**/Internal/System/** by one rule instead of the file. Step 4 of the concept-folders design, rescoped to the seven untested adapters (the SDK adapters are already split via APIClient). Co-Authored-By: Claude Opus 5.5 --- .../ASCKit/Skills/Internal/ShellCommand.swift | 29 ++++++++++ .../ASCKit/Skills/Internal/ShellRunner.swift | 56 ------------------- .../Internal/System/SystemShellRunner.swift | 47 ++++++++++++++++ .../Skills/Internal/ShellCommandTests.swift | 47 ++++++++++++++++ codecov.yml | 7 ++- docs/features/concept-folders/design.md | 4 +- 6 files changed, 130 insertions(+), 60 deletions(-) create mode 100644 Sources/ASCKit/Skills/Internal/ShellCommand.swift create mode 100644 Sources/ASCKit/Skills/Internal/System/SystemShellRunner.swift create mode 100644 Tests/ASCKitTests/Skills/Internal/ShellCommandTests.swift diff --git a/Sources/ASCKit/Skills/Internal/ShellCommand.swift b/Sources/ASCKit/Skills/Internal/ShellCommand.swift new file mode 100644 index 00000000..4228737d --- /dev/null +++ b/Sources/ASCKit/Skills/Internal/ShellCommand.swift @@ -0,0 +1,29 @@ +import Foundation + +/// One shell command as `SystemShellRunner` runs it: how it is launched, +/// which environment it sees, and what its exit means. The process itself +/// lives in `System/SystemShellRunner.swift`. +struct ShellCommand: Equatable, Sendable { + let command: String + let arguments: [String] + let environment: [String: String]? + + /// Run through `/usr/bin/env`, so the command is found on the `PATH`. + var executable: URL { URL(fileURLWithPath: "/usr/bin/env") } + + var argv: [String] { [command] + arguments } + + /// The given variables on top of `inherited`, or `nil` to inherit it unchanged. + func environment(inheriting inherited: [String: String]) -> [String: String]? { + guard let environment else { return nil } + return inherited.merging(environment) { _, given in given } + } + + /// The trimmed standard output, or `executionFailed` with the exit code and stderr. + func output(exitCode: Int32, stdout: Data, stderr: Data) throws -> String { + guard exitCode == 0 else { + throw ShellRunnerError.executionFailed(exitCode: exitCode, stderr: String(data: stderr, encoding: .utf8) ?? "") + } + return String(data: stdout, encoding: .utf8)?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "" + } +} diff --git a/Sources/ASCKit/Skills/Internal/ShellRunner.swift b/Sources/ASCKit/Skills/Internal/ShellRunner.swift index bf30faec..0c9e6eb4 100644 --- a/Sources/ASCKit/Skills/Internal/ShellRunner.swift +++ b/Sources/ASCKit/Skills/Internal/ShellRunner.swift @@ -18,59 +18,3 @@ public enum ShellRunnerError: Error, LocalizedError { } } } - -/// Runs shell commands via `/usr/bin/env` for real process execution. -public struct SystemShellRunner: ShellRunner { - public init() {} - - public func run(command: String, arguments: [String], environment: [String: String]?) async throws -> String { - let process = Process() - process.executableURL = URL(fileURLWithPath: "/usr/bin/env") - process.arguments = [command] + arguments - process.currentDirectoryURL = FileManager.default.homeDirectoryForCurrentUser - - if let environment { - var env = ProcessInfo.processInfo.environment - for (key, value) in environment { - env[key] = value - } - process.environment = env - } - - // Close stdin so the child process cannot block waiting for input. - process.standardInput = FileHandle.nullDevice - let stdoutPipe = Pipe() - process.standardOutput = stdoutPipe - // Stream stderr directly to the terminal so the user sees progress - // (spinners, banners) in real time. Capture it only for error reporting. - let stderrPipe = Pipe() - process.standardError = stderrPipe - - try process.run() - - // Forward stderr to the terminal in real time while also collecting it - // for error reporting if the process fails. - var stderrData = Data() - let stderrQueue = DispatchQueue(label: "shell-runner-stderr") - stderrQueue.async { - let handle = stderrPipe.fileHandleForReading - while true { - let chunk = handle.availableData - if chunk.isEmpty { break } - FileHandle.standardError.write(chunk) - stderrData.append(chunk) - } - } - - let outputData = stdoutPipe.fileHandleForReading.readDataToEndOfFile() - stderrQueue.sync {} // wait for stderr forwarding to finish - process.waitUntilExit() - - guard process.terminationStatus == 0 else { - let stderr = String(data: stderrData, encoding: .utf8) ?? "" - throw ShellRunnerError.executionFailed(exitCode: process.terminationStatus, stderr: stderr) - } - - return String(data: outputData, encoding: .utf8)?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "" - } -} diff --git a/Sources/ASCKit/Skills/Internal/System/SystemShellRunner.swift b/Sources/ASCKit/Skills/Internal/System/SystemShellRunner.swift new file mode 100644 index 00000000..8197b381 --- /dev/null +++ b/Sources/ASCKit/Skills/Internal/System/SystemShellRunner.swift @@ -0,0 +1,47 @@ +import Foundation + +/// Runs shell commands as real processes. Only the `Process` and pipe calls +/// live here; what to launch and what the exit means is `ShellCommand`'s. +public struct SystemShellRunner: ShellRunner { + public init() {} + + public func run(command: String, arguments: [String], environment: [String: String]?) async throws -> String { + let shell = ShellCommand(command: command, arguments: arguments, environment: environment) + let process = Process() + process.executableURL = shell.executable + process.arguments = shell.argv + process.currentDirectoryURL = FileManager.default.homeDirectoryForCurrentUser + if let env = shell.environment(inheriting: ProcessInfo.processInfo.environment) { + process.environment = env + } + + // Close stdin so the child process cannot block waiting for input. + process.standardInput = FileHandle.nullDevice + let stdoutPipe = Pipe() + process.standardOutput = stdoutPipe + let stderrPipe = Pipe() + process.standardError = stderrPipe + + try process.run() + + // Forward stderr to the terminal in real time (spinners, banners) while + // also collecting it for the error if the process fails. + var stderrData = Data() + let stderrQueue = DispatchQueue(label: "shell-runner-stderr") + stderrQueue.async { + let handle = stderrPipe.fileHandleForReading + while true { + let chunk = handle.availableData + if chunk.isEmpty { break } + FileHandle.standardError.write(chunk) + stderrData.append(chunk) + } + } + + let outputData = stdoutPipe.fileHandleForReading.readDataToEndOfFile() + stderrQueue.sync {} // wait for stderr forwarding to finish + process.waitUntilExit() + + return try shell.output(exitCode: process.terminationStatus, stdout: outputData, stderr: stderrData) + } +} diff --git a/Tests/ASCKitTests/Skills/Internal/ShellCommandTests.swift b/Tests/ASCKitTests/Skills/Internal/ShellCommandTests.swift new file mode 100644 index 00000000..255a9310 --- /dev/null +++ b/Tests/ASCKitTests/Skills/Internal/ShellCommandTests.swift @@ -0,0 +1,47 @@ +import Foundation +import Testing +@testable import ASCKit + +@Suite +struct ShellCommandTests { + @Test func `should run the command through env with its arguments`() { + let command = ShellCommand(command: "npx", arguments: ["skills", "list"], environment: nil) + + #expect(command.executable == URL(fileURLWithPath: "/usr/bin/env")) + #expect(command.argv == ["npx", "skills", "list"]) + } + + @Test func `should add the given variables on top of the inherited environment`() { + let command = ShellCommand(command: "npx", arguments: [], environment: ["A": "2", "B": "3"]) + + #expect(command.environment(inheriting: ["PATH": "/bin", "A": "1"]) == ["PATH": "/bin", "A": "2", "B": "3"]) + } + + @Test func `should inherit the environment unchanged when no variables are given`() { + let command = ShellCommand(command: "npx", arguments: [], environment: nil) + + #expect(command.environment(inheriting: ["PATH": "/bin"]) == nil) + } + + @Test func `should answer the trimmed output when the command succeeds`() throws { + let command = ShellCommand(command: "npx", arguments: [], environment: nil) + + let output = try command.output(exitCode: 0, stdout: Data(" installed\n".utf8), stderr: Data()) + + #expect(output == "installed") + } + + @Test func `should fail with the exit code and what it printed to stderr when the command fails`() { + let command = ShellCommand(command: "npx", arguments: [], environment: nil) + + do { + _ = try command.output(exitCode: 2, stdout: Data(), stderr: Data("boom".utf8)) + Issue.record("expected the command to fail") + } catch ShellRunnerError.executionFailed(let exitCode, let stderr) { + #expect(exitCode == 2) + #expect(stderr == "boom") + } catch { + Issue.record("unexpected error \(error)") + } + } +} diff --git a/codecov.yml b/codecov.yml index 91506a1a..c59dc6da 100644 --- a/codecov.yml +++ b/codecov.yml @@ -16,6 +16,11 @@ comment: ignore: - "Tests/**/*" + # The bare outside call — Process, URLSession, WebKit — ≤100 lines, no decisions. + # Its decisions live beside it in Internal/ and are unit-tested. + # (docs/features/concept-folders/design.md) + - "Sources/**/Internal/System/**" + # TUI — terminal UI framework, not unit-testable - "Sources/ASCCommand/Commands/TUI/**/*" @@ -50,8 +55,6 @@ ignore: # WebKit HTML renderer — WKWebView + AppKit GUI snapshot, not unit-testable - "Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift" - # Shell runner — spawns real subprocesses, not unit-testable - - "Sources/ASCKit/Skills/Internal/ShellRunner.swift" # Plugin marketplace — wraps PluginLoader (filesystem) + URLSession download + unzip - "Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift" diff --git a/docs/features/concept-folders/design.md b/docs/features/concept-folders/design.md index 8f805650..df760426 100644 --- a/docs/features/concept-folders/design.md +++ b/docs/features/concept-folders/design.md @@ -27,7 +27,7 @@ one touches both trees. The goal, stated as a test: | **The two trees already disagree** | `Domain/Screenshots/` is implemented by `Infrastructure/ScreenshotPlans/`; `Infrastructure/Client/`, `Web/` and `Iris/Auth/` have no Domain twin | finding an implementation means knowing a second name | | **The module split is paid for by hand** | 613 `Domain.X` qualifiers in 69 files, to tell a Domain type from the SDK type of the same name (`Domain.Territory` vs the SDK's `Territory`) | every new adapter repeats the qualifier dance | | **Implementations leak to the way in** | `ASCCommand` imports `Infrastructure` in 80 files; outside `ClientProvider`, 14 files name 12 implementation types (22 uses) — `FileAuthStorage()` in 10 auth and report commands, and `RESTRoutes` builds its own `CompositeAuthProvider`, `ClientFactory` and five more | swapping an implementation (keychain auth storage, another renderer) edits every command that names it | -| **The outside call is mixed with decisions** | 67 of 107 Infrastructure files import the SDK; most `SDK…Repository` files build the request, call the SDK and map the result in one type | the mapping (the part with rules) is only testable by stubbing the whole SDK client | +| **The outside call is mixed with decisions** | the SDK adapters are already split right: they depend on the narrow `APIClient` role, whose real implementation is the SDK's own `APIProvider`, and 472 tests drive them through `StubAPIClient`. The rest are not: seven adapters (`ShellRunner`, `IrisClient`, `WebKitHTMLRenderer`, `BrowserIrisCookieProvider`, `IrisSDKAppBundleRepository`, `IrisAuthSDKRepository`, `PluginMarketRepository`, ~860 lines) hold their decisions beside a `Process`, `URLSession`, WebKit or cookie call, and `codecov.yml` skips each by file path | their decisions — argv, environment, status → error, parsing — have no test | ## 2 · The shape — outside to inside @@ -116,7 +116,7 @@ safety net; any step that moves a rule writes its test first. | 1 | **one module, concept folders** ✓ | `Domain` + `Infrastructure` targets, `DomainTests` + `InfrastructureTests` | `git mv` into `Sources/ASCKit//` and `/Internal/`; `ScreenshotPlans` → `Screenshots/Internal/`; `Client` + infra `Shared` → `Shared/Internal/`; one `ASCKit` target, one `ASCKitTests`; `import Domain`/`Infrastructure` → `import ASCKit`; `Domain.X` → `ASCKit.X`. Library users and `examples/blitz-screenshots` change two imports to one (CHANGELOG line, `docs/library.md`) | — (move only; 787+ tests stay green) | | 2 | **docs and skills follow** ✓ | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | | 3 | **one composition root** ✓ | 22 uses of 12 `Internal/` types in 14 `ASCCommand` files outside `ClientProvider`; `RESTRoutes` wires its own `ClientFactory` | `ClientProvider` gains `makeAuthStorage`, `makeEnvironmentAuthProvider`, `makeXcodeBuildRunner`, `makeProjectConfigStorage`; commands and `RESTRoutes` ask it for the public protocol | "should build every concept's Internal implementation only in the composition root" | -| 4 | **`Internal/System/` per concept** (several PRs) | SDK call + mapping in one `SDK…Repository` | the mapping stays in `Internal/` and is tested from DTOs; only the request goes in `Internal/System/` | per concept: "should map a with its parent id" from a DTO, no SDK stub | +| 4 | **`Internal/System/` per adapter** (one commit each) | seven untested adapters mix decisions with I/O; `codecov.yml` lists each file | each adapter's decisions become a tested value or orchestrator in `Internal/`; only the call stays, ≤100 lines, in `Internal/System/`; the per-file ignores become one `**/Internal/System/**` rule. The SDK adapters stay as they are | per adapter, its decisions: e.g. "should add the given variables on top of the inherited environment" | | 5 | **names for roles** (several PRs) | 75 `XxxRepository` protocols, `XxxProvider`s | plural collection nouns (`Apps`, `Builds`), role nouns for the rest | per rename — none; behaviour unchanged | Step 1 removes most of §1's cost on its own; 3 and 4 make the fence real; 5 is From 8aa5f055c4770bf870dd0c0b0e7b1728693e2963 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:25:49 +0800 Subject: [PATCH 06/18] refactor(iris): split IrisClient's requests and replies from the URLSession call IrisRequest builds every iris request (the iris/v1 URL, JSON:API, cookie, CSRF and user-agent headers; downloads with cookies only) and IrisResponse decides what a reply means (2xx body, httpError with status and body, invalidResponse), both unit-tested. IrisClient moves to Iris/Internal/System/ and keeps only session.data(for:). IrisAPIError, which REST controllers catch, moves to the Iris/ public face. Co-Authored-By: Claude Opus 5.5 --- Sources/ASCKit/Iris/Internal/IrisClient.swift | 115 ------------------ .../ASCKit/Iris/Internal/IrisRequest.swift | 59 +++++++++ .../Iris/Internal/System/IrisClient.swift | 34 ++++++ Sources/ASCKit/Iris/IrisAPIError.swift | 19 +++ .../Iris/Internal/IrisRequestTests.swift | 90 ++++++++++++++ codecov.yml | 1 - 6 files changed, 202 insertions(+), 116 deletions(-) delete mode 100644 Sources/ASCKit/Iris/Internal/IrisClient.swift create mode 100644 Sources/ASCKit/Iris/Internal/IrisRequest.swift create mode 100644 Sources/ASCKit/Iris/Internal/System/IrisClient.swift create mode 100644 Sources/ASCKit/Iris/IrisAPIError.swift create mode 100644 Tests/ASCKitTests/Iris/Internal/IrisRequestTests.swift diff --git a/Sources/ASCKit/Iris/Internal/IrisClient.swift b/Sources/ASCKit/Iris/Internal/IrisClient.swift deleted file mode 100644 index 756cdcb9..00000000 --- a/Sources/ASCKit/Iris/Internal/IrisClient.swift +++ /dev/null @@ -1,115 +0,0 @@ -import Foundation - -/// Generic HTTP client for the iris private API. -/// -/// Handles cookie injection, required headers, and JSON:API -/// request/response encoding for `appstoreconnect.apple.com/iris/v1/`. -public struct IrisClient: Sendable { - private static let baseURL = "https://appstoreconnect.apple.com/iris/v1" - - private let session: URLSession - - public init(session: URLSession = .shared) { - self.session = session - } - - /// Perform a GET request against the iris API. - public func get( - path: String, - queryItems: [URLQueryItem] = [], - cookies: String - ) async throws -> (Data, HTTPURLResponse) { - var components = URLComponents(string: "\(Self.baseURL)/\(path)")! - if !queryItems.isEmpty { - components.queryItems = queryItems - } - var request = URLRequest(url: components.url!) - request.httpMethod = "GET" - applyHeaders(to: &request, cookies: cookies) - return try await perform(request) - } - - /// Perform a POST request against the iris API. - public func post( - path: String, - body: Data, - cookies: String - ) async throws -> (Data, HTTPURLResponse) { - let url = URL(string: "\(Self.baseURL)/\(path)")! - var request = URLRequest(url: url) - request.httpMethod = "POST" - request.httpBody = body - applyHeaders(to: &request, cookies: cookies) - return try await perform(request) - } - - /// Fetch an absolute URL (e.g. an Apple-signed attachment URL) with the - /// session cookies attached. Callers validate the host before calling — - /// this method fetches whatever it is given. - public func download( - absoluteURL: URL, - cookies: String - ) async throws -> (Data, HTTPURLResponse) { - var request = URLRequest(url: absoluteURL) - request.httpMethod = "GET" - request.setValue(cookies, forHTTPHeaderField: "cookie") - return try await perform(request) - } - - /// Perform a DELETE request against the iris API. Used by the iris-only - /// IAP submission dequeue (`DELETE /iris/v1/inAppPurchaseSubmissions/:id`), - /// which the public ASC SDK can't call (different auth surface). - public func delete( - path: String, - cookies: String - ) async throws -> (Data, HTTPURLResponse) { - let url = URL(string: "\(Self.baseURL)/\(path)")! - var request = URLRequest(url: url) - request.httpMethod = "DELETE" - applyHeaders(to: &request, cookies: cookies) - return try await perform(request) - } - - private func applyHeaders(to request: inout URLRequest, cookies: String) { - request.setValue("application/vnd.api+json", forHTTPHeaderField: "accept") - request.setValue("application/vnd.api+json", forHTTPHeaderField: "content-type") - request.setValue(cookies, forHTTPHeaderField: "cookie") - request.setValue( - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36", - forHTTPHeaderField: "user-agent" - ) - request.setValue("[asc-ui]", forHTTPHeaderField: "x-csrf-itc") - } - - private func perform(_ request: URLRequest) async throws -> (Data, HTTPURLResponse) { - let (data, response) = try await session.data(for: request) - guard let httpResponse = response as? HTTPURLResponse else { - throw IrisAPIError.invalidResponse - } - guard (200...299).contains(httpResponse.statusCode) else { - throw IrisAPIError.httpError( - statusCode: httpResponse.statusCode, - body: String(data: data, encoding: .utf8) - ) - } - return (data, httpResponse) - } -} - -/// Errors from the iris HTTP layer. -public enum IrisAPIError: LocalizedError { - case invalidResponse - case httpError(statusCode: Int, body: String?) - case decodingError(String) - - public var errorDescription: String? { - switch self { - case .invalidResponse: - "Invalid response from iris API" - case .httpError(let statusCode, let body): - "Iris API error \(statusCode): \(body ?? "no body")" - case .decodingError(let detail): - "Failed to decode iris response: \(detail)" - } - } -} diff --git a/Sources/ASCKit/Iris/Internal/IrisRequest.swift b/Sources/ASCKit/Iris/Internal/IrisRequest.swift new file mode 100644 index 00000000..11571248 --- /dev/null +++ b/Sources/ASCKit/Iris/Internal/IrisRequest.swift @@ -0,0 +1,59 @@ +import Foundation + +/// The requests the iris private API accepts: `appstoreconnect.apple.com/iris/v1/`, +/// JSON:API, the session cookies, and the headers the web UI sends. +enum IrisRequest { + static let baseURL = "https://appstoreconnect.apple.com/iris/v1" + static let userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36" + + static func get(path: String, queryItems: [URLQueryItem], cookies: String) -> URLRequest { + var components = URLComponents(string: "\(baseURL)/\(path)")! + if !queryItems.isEmpty { + components.queryItems = queryItems + } + return iris(url: components.url!, method: "GET", cookies: cookies) + } + + static func post(path: String, body: Data, cookies: String) -> URLRequest { + var request = iris(url: URL(string: "\(baseURL)/\(path)")!, method: "POST", cookies: cookies) + request.httpBody = body + return request + } + + static func delete(path: String, cookies: String) -> URLRequest { + iris(url: URL(string: "\(baseURL)/\(path)")!, method: "DELETE", cookies: cookies) + } + + /// An absolute URL (e.g. an Apple-signed attachment) with only the session cookies. + /// Callers validate the host first: this fetches whatever it is given. + static func download(absoluteURL: URL, cookies: String) -> URLRequest { + var request = URLRequest(url: absoluteURL) + request.httpMethod = "GET" + request.setValue(cookies, forHTTPHeaderField: "cookie") + return request + } + + private static func iris(url: URL, method: String, cookies: String) -> URLRequest { + var request = URLRequest(url: url) + request.httpMethod = method + request.setValue("application/vnd.api+json", forHTTPHeaderField: "accept") + request.setValue("application/vnd.api+json", forHTTPHeaderField: "content-type") + request.setValue(cookies, forHTTPHeaderField: "cookie") + request.setValue(userAgent, forHTTPHeaderField: "user-agent") + request.setValue("[asc-ui]", forHTTPHeaderField: "x-csrf-itc") + return request + } +} + +/// What iris's reply means: the body on a 2xx, `IrisAPIError` otherwise. +enum IrisResponse { + static func accepted(data: Data, response: URLResponse) throws -> (Data, HTTPURLResponse) { + guard let http = response as? HTTPURLResponse else { + throw IrisAPIError.invalidResponse + } + guard (200...299).contains(http.statusCode) else { + throw IrisAPIError.httpError(statusCode: http.statusCode, body: String(data: data, encoding: .utf8)) + } + return (data, http) + } +} diff --git a/Sources/ASCKit/Iris/Internal/System/IrisClient.swift b/Sources/ASCKit/Iris/Internal/System/IrisClient.swift new file mode 100644 index 00000000..3e64cae3 --- /dev/null +++ b/Sources/ASCKit/Iris/Internal/System/IrisClient.swift @@ -0,0 +1,34 @@ +import Foundation + +/// HTTP client for the iris private API. Only the `URLSession` call lives here; +/// the request is `IrisRequest`'s and what the reply means is `IrisResponse`'s. +public struct IrisClient: Sendable { + private let session: URLSession + + public init(session: URLSession = .shared) { + self.session = session + } + + public func get(path: String, queryItems: [URLQueryItem] = [], cookies: String) async throws -> (Data, HTTPURLResponse) { + try await perform(IrisRequest.get(path: path, queryItems: queryItems, cookies: cookies)) + } + + public func post(path: String, body: Data, cookies: String) async throws -> (Data, HTTPURLResponse) { + try await perform(IrisRequest.post(path: path, body: body, cookies: cookies)) + } + + /// Fetch an absolute URL with the session cookies. Callers validate the host first. + public func download(absoluteURL: URL, cookies: String) async throws -> (Data, HTTPURLResponse) { + try await perform(IrisRequest.download(absoluteURL: absoluteURL, cookies: cookies)) + } + + /// Used by the iris-only IAP submission dequeue (`DELETE /iris/v1/inAppPurchaseSubmissions/:id`). + public func delete(path: String, cookies: String) async throws -> (Data, HTTPURLResponse) { + try await perform(IrisRequest.delete(path: path, cookies: cookies)) + } + + private func perform(_ request: URLRequest) async throws -> (Data, HTTPURLResponse) { + let (data, response) = try await session.data(for: request) + return try IrisResponse.accepted(data: data, response: response) + } +} diff --git a/Sources/ASCKit/Iris/IrisAPIError.swift b/Sources/ASCKit/Iris/IrisAPIError.swift new file mode 100644 index 00000000..8a3e2dbc --- /dev/null +++ b/Sources/ASCKit/Iris/IrisAPIError.swift @@ -0,0 +1,19 @@ +import Foundation + +/// Errors from the iris HTTP layer. +public enum IrisAPIError: LocalizedError { + case invalidResponse + case httpError(statusCode: Int, body: String?) + case decodingError(String) + + public var errorDescription: String? { + switch self { + case .invalidResponse: + "Invalid response from iris API" + case .httpError(let statusCode, let body): + "Iris API error \(statusCode): \(body ?? "no body")" + case .decodingError(let detail): + "Failed to decode iris response: \(detail)" + } + } +} diff --git a/Tests/ASCKitTests/Iris/Internal/IrisRequestTests.swift b/Tests/ASCKitTests/Iris/Internal/IrisRequestTests.swift new file mode 100644 index 00000000..57189d54 --- /dev/null +++ b/Tests/ASCKitTests/Iris/Internal/IrisRequestTests.swift @@ -0,0 +1,90 @@ +import Foundation +import Testing +@testable import ASCKit + +@Suite +struct IrisRequestTests { + @Test func `should ask iris for JSON:API as the web UI does, with the session cookies`() { + let request = IrisRequest.get(path: "apps", queryItems: [URLQueryItem(name: "limit", value: "1")], cookies: "myacinfo=abc") + + #expect(request.url?.absoluteString == "https://appstoreconnect.apple.com/iris/v1/apps?limit=1") + #expect(request.httpMethod == "GET") + #expect(request.value(forHTTPHeaderField: "accept") == "application/vnd.api+json") + #expect(request.value(forHTTPHeaderField: "content-type") == "application/vnd.api+json") + #expect(request.value(forHTTPHeaderField: "cookie") == "myacinfo=abc") + #expect(request.value(forHTTPHeaderField: "x-csrf-itc") == "[asc-ui]") + #expect(request.value(forHTTPHeaderField: "user-agent")?.hasPrefix("Mozilla/5.0 (Macintosh") == true) + } + + @Test func `should leave the query off when there are no query items`() { + let request = IrisRequest.get(path: "apps", queryItems: [], cookies: "c") + + #expect(request.url?.absoluteString == "https://appstoreconnect.apple.com/iris/v1/apps") + } + + @Test func `should send the body when posting to iris`() { + let request = IrisRequest.post(path: "appBundles", body: Data("{}".utf8), cookies: "c") + + #expect(request.url?.absoluteString == "https://appstoreconnect.apple.com/iris/v1/appBundles") + #expect(request.httpMethod == "POST") + #expect(request.httpBody == Data("{}".utf8)) + #expect(request.value(forHTTPHeaderField: "x-csrf-itc") == "[asc-ui]") + } + + @Test func `should delete at the iris path`() { + let request = IrisRequest.delete(path: "inAppPurchaseSubmissions/s1", cookies: "c") + + #expect(request.url?.absoluteString == "https://appstoreconnect.apple.com/iris/v1/inAppPurchaseSubmissions/s1") + #expect(request.httpMethod == "DELETE") + } + + @Test func `should fetch a download with only the session cookies`() { + let request = IrisRequest.download(absoluteURL: URL(string: "https://example.apple.com/a.png")!, cookies: "c") + + #expect(request.url?.absoluteString == "https://example.apple.com/a.png") + #expect(request.httpMethod == "GET") + #expect(request.value(forHTTPHeaderField: "cookie") == "c") + #expect(request.value(forHTTPHeaderField: "accept") == nil) + #expect(request.value(forHTTPHeaderField: "x-csrf-itc") == nil) + } +} + +@Suite +struct IrisResponseTests { + private let url = URL(string: "https://appstoreconnect.apple.com/iris/v1/apps")! + + @Test func `should answer the body when iris accepts the request`() throws { + let response = HTTPURLResponse(url: url, statusCode: 201, httpVersion: nil, headerFields: nil)! + + let (data, http) = try IrisResponse.accepted(data: Data("ok".utf8), response: response) + + #expect(data == Data("ok".utf8)) + #expect(http.statusCode == 201) + } + + @Test func `should fail with the status and body when iris refuses the request`() { + let response = HTTPURLResponse(url: url, statusCode: 403, httpVersion: nil, headerFields: nil)! + + do { + _ = try IrisResponse.accepted(data: Data("forbidden".utf8), response: response) + Issue.record("expected iris to refuse") + } catch IrisAPIError.httpError(let statusCode, let body) { + #expect(statusCode == 403) + #expect(body == "forbidden") + } catch { + Issue.record("unexpected error \(error)") + } + } + + @Test func `should fail when the reply is not an HTTP response`() { + let response = URLResponse(url: url, mimeType: nil, expectedContentLength: 0, textEncodingName: nil) + + do { + _ = try IrisResponse.accepted(data: Data(), response: response) + Issue.record("expected an invalid response") + } catch IrisAPIError.invalidResponse { + } catch { + Issue.record("unexpected error \(error)") + } + } +} diff --git a/codecov.yml b/codecov.yml index c59dc6da..8c29bf6b 100644 --- a/codecov.yml +++ b/codecov.yml @@ -44,7 +44,6 @@ ignore: # Iris — real browser cookie extraction and HTTP calls, not unit-testable - "Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift" - - "Sources/ASCKit/Iris/Internal/IrisClient.swift" # Iris auth — drives Apple SRP login + idmsa.apple.com HTTP, third-party-interactive - "Sources/ASCKit/Iris/Internal/Auth/**" From 504c59e001b840edf57b64d987fe64e4acb56e57 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:27:43 +0800 Subject: [PATCH 07/18] refactor(iris): split browser cookie selection from the SweetCookieKit reads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BrowserIrisCookieProvider keeps its decisions — ASC_IRIS_COOKIES first when not blank, only the nine iris cookies, the first browser holding myacinfo, the cookie count — now tested through MockBrowserCookieStores. SweetCookieKitStores in Iris/Internal/System/ only reads each browser's stores. The cookie header is sorted by name instead of dictionary order. Co-Authored-By: Claude Opus 5.5 --- .../Iris/Internal/BrowserCookieStores.swift | 15 +++ .../Internal/BrowserIrisCookieProvider.swift | 105 +++++++----------- .../System/SweetCookieKitStores.swift | 16 +++ .../BrowserIrisCookieProviderTests.swift | 65 +++++++++++ codecov.yml | 3 - 5 files changed, 135 insertions(+), 69 deletions(-) create mode 100644 Sources/ASCKit/Iris/Internal/BrowserCookieStores.swift create mode 100644 Sources/ASCKit/Iris/Internal/System/SweetCookieKitStores.swift create mode 100644 Tests/ASCKitTests/Iris/Internal/BrowserIrisCookieProviderTests.swift diff --git a/Sources/ASCKit/Iris/Internal/BrowserCookieStores.swift b/Sources/ASCKit/Iris/Internal/BrowserCookieStores.swift new file mode 100644 index 00000000..9adef303 --- /dev/null +++ b/Sources/ASCKit/Iris/Internal/BrowserCookieStores.swift @@ -0,0 +1,15 @@ +import Mockable + +/// One cookie a browser holds. +struct BrowserCookie: Equatable, Sendable { + let name: String + let value: String +} + +/// The browsers' cookie stores on this Mac. +@Mockable +protocol BrowserCookieStores: Sendable { + /// For each browser, in the order to try them, the unexpired cookies it holds + /// for any of `domains` (suffix match). A browser that can't be read gives none. + func cookiesPerBrowser(domains: [String]) -> [[BrowserCookie]] +} diff --git a/Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift b/Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift index bafedc2a..d6cc1b59 100644 --- a/Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift +++ b/Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift @@ -1,88 +1,61 @@ import Foundation -import SweetCookieKit -/// Resolves iris session cookies from browser cookie stores or environment. +/// Resolves iris session cookies from the environment or a browser. /// /// Resolution order: -/// 1. `ASC_IRIS_COOKIES` environment variable (for CI/CD) -/// 2. Browser cookies from Chrome/Safari/Firefox (via SweetCookieKit) +/// 1. `ASC_IRIS_COOKIES` environment variable (for CI/CD), when not blank +/// 2. The first browser signed in to App Store Connect (holding `myacinfo`) public struct BrowserIrisCookieProvider: IrisCookieProvider { - public init() {} + /// `myacinfo` is set on .apple.com; the others (itctx, dqsid, wosid) on appstoreconnect.apple.com. + static let domains = ["apple.com", "appstoreconnect.apple.com"] + /// The cookies the iris API reads. + static let irisCookieNames: Set = [ + "myacinfo", "itctx", "itcdq", "dqsid", "wosid", "woinst", "dssf", "dssid2", "dc", + ] + + private let environment: [String: String] + private let browsers: any BrowserCookieStores + + public init() { + self.init(environment: ProcessInfo.processInfo.environment, browsers: SweetCookieKitStores()) + } + + init(environment: [String: String], browsers: any BrowserCookieStores) { + self.environment = environment + self.browsers = browsers + } public func resolveSession() throws -> IrisSession { - let (cookies, _) = try resolve() - return IrisSession(cookies: cookies) + IrisSession(cookies: try resolve().cookies) } public func resolveStatus() throws -> IrisStatus { let (cookies, source) = try resolve() - let count = cookies.components(separatedBy: "; ").count - return IrisStatus(source: source, cookieCount: count) + return IrisStatus(source: source, cookieCount: cookies.components(separatedBy: "; ").count) } - private func resolve() throws -> (String, IrisCookieSource) { - // 1. Check environment variable - if let envCookies = ProcessInfo.processInfo.environment["ASC_IRIS_COOKIES"], - !envCookies.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty - { - return (envCookies, .environment) + private func resolve() throws -> (cookies: String, source: IrisCookieSource) { + if let fromEnvironment = environment["ASC_IRIS_COOKIES"], + !fromEnvironment.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { + return (fromEnvironment, .environment) } - - // 2. Try extracting from browser cookies - if let browserCookies = fetchFromBrowser() { - return (browserCookies, .browser) + for cookies in browsers.cookiesPerBrowser(domains: Self.domains) { + if let header = Self.irisCookieHeader(from: cookies) { + return (header, .browser) + } } - throw IrisCookieError.noCookiesFound } - private func fetchFromBrowser() -> String? { - let cookieClient = BrowserCookieClient() - - // myacinfo is set on .apple.com (parent domain) - // other cookies (itctx, dqsid, wosid) are on appstoreconnect.apple.com - let queries: [BrowserCookieQuery] = [ - BrowserCookieQuery( - domains: ["apple.com"], - domainMatch: .suffix, - includeExpired: false - ), - BrowserCookieQuery( - domains: ["appstoreconnect.apple.com"], - domainMatch: .suffix, - includeExpired: false - ), - ] - - // Cookie names relevant for iris API - let wantedNames: Set = [ - "myacinfo", "itctx", "itcdq", "dqsid", "wosid", "woinst", - "dssf", "dssid2", "dc", - ] - - for browser in Browser.allCases { - var cookieMap: [String: String] = [:] - - for query in queries { - do { - let storeRecords = try cookieClient.records(matching: query, in: browser) - for storeRecord in storeRecords { - for record in storeRecord.records where wantedNames.contains(record.name) { - cookieMap[record.name] = record.value - } - } - } catch { - continue - } - } - - // myacinfo is the essential auth cookie - if cookieMap["myacinfo"] != nil { - let cookieString = cookieMap.map { "\($0.key)=\($0.value)" }.joined(separator: "; ") - return cookieString - } + /// The iris cookies as a `cookie` header, or `nil` when the browser isn't + /// signed in (no `myacinfo`). A later cookie of the same name wins. + private static func irisCookieHeader(from cookies: [BrowserCookie]) -> String? { + var byName: [String: String] = [:] + for cookie in cookies where irisCookieNames.contains(cookie.name) { + byName[cookie.name] = cookie.value } - return nil + guard byName["myacinfo"] != nil else { return nil } + return byName.sorted { $0.key < $1.key }.map { "\($0.key)=\($0.value)" }.joined(separator: "; ") } } diff --git a/Sources/ASCKit/Iris/Internal/System/SweetCookieKitStores.swift b/Sources/ASCKit/Iris/Internal/System/SweetCookieKitStores.swift new file mode 100644 index 00000000..ae0c2a1f --- /dev/null +++ b/Sources/ASCKit/Iris/Internal/System/SweetCookieKitStores.swift @@ -0,0 +1,16 @@ +import SweetCookieKit + +/// Reads every browser's cookie store through SweetCookieKit. Only the store +/// reads live here; which cookies count is `BrowserIrisCookieProvider`'s. +struct SweetCookieKitStores: BrowserCookieStores { + func cookiesPerBrowser(domains: [String]) -> [[BrowserCookie]] { + let client = BrowserCookieClient() + return Browser.allCases.map { browser in + domains.flatMap { domain -> [BrowserCookie] in + let query = BrowserCookieQuery(domains: [domain], domainMatch: .suffix, includeExpired: false) + let stores = (try? client.records(matching: query, in: browser)) ?? [] + return stores.flatMap { store in store.records.map { BrowserCookie(name: $0.name, value: $0.value) } } + } + } + } +} diff --git a/Tests/ASCKitTests/Iris/Internal/BrowserIrisCookieProviderTests.swift b/Tests/ASCKitTests/Iris/Internal/BrowserIrisCookieProviderTests.swift new file mode 100644 index 00000000..4aad2168 --- /dev/null +++ b/Tests/ASCKitTests/Iris/Internal/BrowserIrisCookieProviderTests.swift @@ -0,0 +1,65 @@ +import Foundation +import Mockable +import Testing +@testable import ASCKit + +@Suite +struct BrowserIrisCookieProviderTests { + private func browsers(_ perBrowser: [[BrowserCookie]]) -> MockBrowserCookieStores { + let stores = MockBrowserCookieStores() + given(stores).cookiesPerBrowser(domains: .any).willReturn(perBrowser) + return stores + } + + @Test func `should use the cookies from ASC_IRIS_COOKIES before any browser`() throws { + let provider = BrowserIrisCookieProvider( + environment: ["ASC_IRIS_COOKIES": "myacinfo=from-env"], + browsers: browsers([[BrowserCookie(name: "myacinfo", value: "from-browser")]]) + ) + + #expect(try provider.resolveSession() == IrisSession(cookies: "myacinfo=from-env")) + #expect(try provider.resolveStatus() == IrisStatus(source: .environment, cookieCount: 1)) + } + + @Test func `should ignore ASC_IRIS_COOKIES when it is blank`() throws { + let provider = BrowserIrisCookieProvider( + environment: ["ASC_IRIS_COOKIES": " "], + browsers: browsers([[BrowserCookie(name: "myacinfo", value: "a")]]) + ) + + #expect(try provider.resolveSession() == IrisSession(cookies: "myacinfo=a")) + } + + @Test func `should take the iris cookies from the first browser signed in to App Store Connect`() throws { + let provider = BrowserIrisCookieProvider( + environment: [:], + browsers: browsers([ + [BrowserCookie(name: "dc", value: "not-signed-in")], + [ + BrowserCookie(name: "myacinfo", value: "a"), + BrowserCookie(name: "unrelated", value: "x"), + BrowserCookie(name: "itctx", value: "b"), + ], + [BrowserCookie(name: "myacinfo", value: "later-browser")], + ]) + ) + + #expect(try provider.resolveSession() == IrisSession(cookies: "itctx=b; myacinfo=a")) + #expect(try provider.resolveStatus() == IrisStatus(source: .browser, cookieCount: 2)) + } + + @Test func `should report no cookies when no browser is signed in to App Store Connect`() { + let provider = BrowserIrisCookieProvider( + environment: [:], + browsers: browsers([[BrowserCookie(name: "itctx", value: "b")], []]) + ) + + do { + _ = try provider.resolveSession() + Issue.record("expected no cookies") + } catch IrisCookieError.noCookiesFound { + } catch { + Issue.record("unexpected error \(error)") + } + } +} diff --git a/codecov.yml b/codecov.yml index 8c29bf6b..fabc0e92 100644 --- a/codecov.yml +++ b/codecov.yml @@ -42,9 +42,6 @@ ignore: - "Sources/ASCCommand/Commands/Web/**/*" - "Sources/ASCKit/Web/**/*" - # Iris — real browser cookie extraction and HTTP calls, not unit-testable - - "Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift" - # Iris auth — drives Apple SRP login + idmsa.apple.com HTTP, third-party-interactive - "Sources/ASCKit/Iris/Internal/Auth/**" From e8637cb0dac4146cd43f273c4046a40caa0f3129 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:28:41 +0800 Subject: [PATCH 08/18] test(iris): cover the app-bundle repository now its HTTP call is in System/ With IrisClient's URLSession call in Iris/Internal/System/, nothing in IrisSDKAppBundleRepository is untestable: its query, decoding, mapping (fallback name, en-US default) and refusals are now pinned through a stubbed URLProtocol, and codecov no longer skips AppBundles/Internal/. Co-Authored-By: Claude Opus 5.5 --- .../IrisSDKAppBundleRepositoryTests.swift | 96 +++++++++++++++++++ codecov.yml | 3 - 2 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift diff --git a/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift b/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift new file mode 100644 index 00000000..380137c5 --- /dev/null +++ b/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift @@ -0,0 +1,96 @@ +import Foundation +import Testing +@testable import ASCKit + +final class AppBundleURLProtocolStub: URLProtocol, @unchecked Sendable { + nonisolated(unsafe) static var reply: (status: Int, body: String) = (200, "{}") + nonisolated(unsafe) static var lastRequest: URLRequest? + nonisolated(unsafe) static var lastBody: Data? + + static func makeClient(status: Int, body: String) -> IrisClient { + reply = (status, body) + lastRequest = nil + lastBody = nil + let config = URLSessionConfiguration.ephemeral + config.protocolClasses = [AppBundleURLProtocolStub.self] + return IrisClient(session: URLSession(configuration: config)) + } + + override class func canInit(with request: URLRequest) -> Bool { true } + override class func canonicalRequest(for request: URLRequest) -> URLRequest { request } + override func startLoading() { + Self.lastRequest = request + Self.lastBody = request.httpBody ?? request.httpBodyStream.map { stream in + stream.open() + defer { stream.close() } + var data = Data() + var buffer = [UInt8](repeating: 0, count: 4096) + while stream.hasBytesAvailable { + let read = stream.read(&buffer, maxLength: buffer.count) + if read <= 0 { break } + data.append(buffer, count: read) + } + return data + } + let response = HTTPURLResponse(url: request.url!, statusCode: Self.reply.status, httpVersion: nil, headerFields: nil)! + client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed) + client?.urlProtocol(self, didLoad: Data(Self.reply.body.utf8)) + client?.urlProtocolDidFinishLoading(self) + } + override func stopLoading() {} +} + +@Suite(.serialized) +struct IrisSDKAppBundleRepositoryTests { + private let session = IrisSession(cookies: "myacinfo=a") + + @Test func `should list every app bundle with its versions included`() async throws { + let client = AppBundleURLProtocolStub.makeClient(status: 200, body: #""" + {"data":[ + {"id":"b1","type":"apps","attributes":{"name":"Bakery","bundleId":"com.example.bakery","sku":"BAKE","primaryLocale":"en-GB","platformNames":["IOS"]}}, + {"id":"b2","type":"apps","attributes":{}} + ]} + """#) + + let bundles = try await IrisSDKAppBundleRepository(client: client).listAppBundles(session: session) + + #expect(bundles == [ + AppBundle(id: "b1", name: "Bakery", bundleId: "com.example.bakery", sku: "BAKE", primaryLocale: "en-GB", platforms: ["IOS"]), + AppBundle(id: "b2", name: "", bundleId: "", sku: "", primaryLocale: "en-US", platforms: []), + ]) + #expect(AppBundleURLProtocolStub.lastRequest?.url?.absoluteString + == "https://appstoreconnect.apple.com/iris/v1/appBundles?include=appBundleVersions&limit=300") + } + + @Test func `should name a created app as asked when iris leaves the name out`() async throws { + let client = AppBundleURLProtocolStub.makeClient(status: 201, body: #""" + {"data":{"id":"new","type":"apps","attributes":{"bundleId":"com.example.new","sku":"NEW","primaryLocale":"en-US","platformNames":["IOS"]}}} + """#) + + let bundle = try await IrisSDKAppBundleRepository(client: client).createApp( + session: session, name: "New App", bundleId: "com.example.new", sku: "NEW", + primaryLocale: "en-US", platforms: ["IOS"], versionString: "1.0" + ) + + #expect(bundle == AppBundle(id: "new", name: "New App", bundleId: "com.example.new", sku: "NEW", primaryLocale: "en-US", platforms: ["IOS"])) + #expect(AppBundleURLProtocolStub.lastRequest?.httpMethod == "POST") + #expect(AppBundleURLProtocolStub.lastRequest?.url?.absoluteString == "https://appstoreconnect.apple.com/iris/v1/apps") + } + + @Test func `should fail with iris's status when it refuses to create the app`() async { + let client = AppBundleURLProtocolStub.makeClient(status: 409, body: "bundle id taken") + + do { + _ = try await IrisSDKAppBundleRepository(client: client).createApp( + session: session, name: "Dup", bundleId: "com.example.dup", sku: "DUP", + primaryLocale: "en-US", platforms: ["IOS"], versionString: "1.0" + ) + Issue.record("expected iris to refuse") + } catch IrisAPIError.httpError(let statusCode, let body) { + #expect(statusCode == 409) + #expect(body == "bundle id taken") + } catch { + Issue.record("unexpected error \(error)") + } + } +} diff --git a/codecov.yml b/codecov.yml index fabc0e92..15f09f09 100644 --- a/codecov.yml +++ b/codecov.yml @@ -45,9 +45,6 @@ ignore: # Iris auth — drives Apple SRP login + idmsa.apple.com HTTP, third-party-interactive - "Sources/ASCKit/Iris/Internal/Auth/**" - # Iris private app-bundle API — Apple iris HTTP adapter, third-party-interactive - - "Sources/ASCKit/Iris/AppBundles/Internal/**" - # WebKit HTML renderer — WKWebView + AppKit GUI snapshot, not unit-testable - "Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift" From 22a583184f0551991f2fa8abca47943c63c652c7 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:30:39 +0800 Subject: [PATCH 09/18] refactor(screenshots): split image inlining from the WebKit snapshot LocalImages owns which src values are local images, where to find them (absolute, working directory, .asc/app-shots/, the web server's /api/files/read URLs) and their MIME types, unit-tested with an in-memory file reader; each file is now read once. WebKitHTMLRenderer moves to Screenshots/Internal/System/ and keeps only the WKWebView load and snapshot. Co-Authored-By: Claude Opus 5.5 --- .../Screenshots/Internal/LocalImages.swift | 56 ++++++++ .../Internal/System/WebKitHTMLRenderer.swift | 82 +++++++++++ .../Internal/WebKitHTMLRenderer.swift | 128 ------------------ .../Internal/LocalImagesTests.swift | 54 ++++++++ codecov.yml | 3 - 5 files changed, 192 insertions(+), 131 deletions(-) create mode 100644 Sources/ASCKit/Screenshots/Internal/LocalImages.swift create mode 100644 Sources/ASCKit/Screenshots/Internal/System/WebKitHTMLRenderer.swift delete mode 100644 Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift create mode 100644 Tests/ASCKitTests/Screenshots/Internal/LocalImagesTests.swift diff --git a/Sources/ASCKit/Screenshots/Internal/LocalImages.swift b/Sources/ASCKit/Screenshots/Internal/LocalImages.swift new file mode 100644 index 00000000..9e4a4ca1 --- /dev/null +++ b/Sources/ASCKit/Screenshots/Internal/LocalImages.swift @@ -0,0 +1,56 @@ +import Foundation + +/// The local images a composed screenshot page points at, inlined as data URLs +/// so a renderer that loads the page from a string can still draw them. +struct LocalImages { + let workingDirectory: String + /// The bytes of the file at a path, or `nil` when there is none. + let contents: (String) -> Data? + + /// `html` with every local `src="….png|jpg|jpeg|gif|webp"` replaced by its data URL. + /// Remote images, data URLs and images that can't be found stay as they are. + func inline(into html: String) -> String { + let pattern = #"src="([^"]+\.(?:png|jpg|jpeg|gif|webp))""# + guard let regex = try? NSRegularExpression(pattern: pattern) else { return html } + let page = html as NSString + var result = html + // In reverse, so each replacement leaves the earlier ranges where they were. + for match in regex.matches(in: html, range: NSRange(location: 0, length: page.length)).reversed() { + let src = page.substring(with: match.range(at: 1)) + guard let (path, data) = file(for: src) else { continue } + let dataURL = "data:\(Self.mimeType(of: path));base64,\(data.base64EncodedString())" + result = (result as NSString).replacingCharacters(in: match.range(at: 0), with: "src=\"\(dataURL)\"") + } + return result + } + + /// The file a `src` names and its bytes, or `nil` for a data URL, a remote + /// image or a file that isn't there. + private func file(for src: String) -> (path: String, data: Data)? { + if src.hasPrefix("data:") { return nil } + if src.hasPrefix("http") { + // The web server's file URL points back at a file under the working directory. + guard src.contains("/api/files/read?path="), + let path = URLComponents(string: src)?.queryItems?.first(where: { $0.name == "path" })?.value + else { return nil } + let local = workingDirectory + "/" + path + return contents(local).map { (local, $0) } + } + let candidates = [ + src.hasPrefix("/") ? src : workingDirectory + "/" + src, + workingDirectory + "/.asc/app-shots/" + src, + ] + for candidate in candidates { + if let data = contents(candidate) { return (candidate, data) } + } + return nil + } + + private static func mimeType(of path: String) -> String { + switch (path as NSString).pathExtension.lowercased() { + case "png": "image/png" + case "jpg", "jpeg": "image/jpeg" + case let ext: "image/\(ext)" + } + } +} diff --git a/Sources/ASCKit/Screenshots/Internal/System/WebKitHTMLRenderer.swift b/Sources/ASCKit/Screenshots/Internal/System/WebKitHTMLRenderer.swift new file mode 100644 index 00000000..83a58231 --- /dev/null +++ b/Sources/ASCKit/Screenshots/Internal/System/WebKitHTMLRenderer.swift @@ -0,0 +1,82 @@ +#if canImport(WebKit) +import AppKit +import Foundation +import WebKit + +/// Renders HTML to PNG using WKWebView snapshot on macOS. Only the WebKit +/// calls live here; which images to inline is `LocalImages`'. +public final class WebKitHTMLRenderer: HTMLRenderer, @unchecked Sendable { + + public init() {} + + public func render(html: String, width: Int, height: Int) async throws -> Data { + try await renderOnMain(html: html, width: width, height: height) + } + + @MainActor + private func renderOnMain(html: String, width: Int, height: Int) async throws -> Data { + let config = WKWebViewConfiguration() + let webView = WKWebView(frame: NSRect(x: 0, y: 0, width: width, height: height), configuration: config) + + // Inline local images as data URLs so they render in loadHTMLString + let resolvedHTML = LocalImages( + workingDirectory: FileManager.default.currentDirectoryPath, + contents: { FileManager.default.contents(atPath: $0) } + ).inline(into: html) + webView.loadHTMLString(resolvedHTML, baseURL: nil) + + // Wait for navigation + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in + let delegate = NavigationDelegate(continuation: continuation) + webView.navigationDelegate = delegate + objc_setAssociatedObject(webView, "navDelegate", delegate, .OBJC_ASSOCIATION_RETAIN) + } + + // Brief pause for CSS layout (images are already inlined as data URLs) + try await Task.sleep(for: .milliseconds(100)) + + let snapshotConfig = WKSnapshotConfiguration() + snapshotConfig.snapshotWidth = NSNumber(value: width) + + let image = try await webView.takeSnapshot(configuration: snapshotConfig) + + guard let tiffData = image.tiffRepresentation, + let bitmap = NSBitmapImageRep(data: tiffData), + let pngData = bitmap.representation(using: .png, properties: [:]) else { + throw HTMLRendererError.snapshotFailed + } + + return pngData + } +} + +private final class NavigationDelegate: NSObject, WKNavigationDelegate { + private var continuation: CheckedContinuation? + + init(continuation: CheckedContinuation) { + self.continuation = continuation + } + + func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { + continuation?.resume() + continuation = nil + } + + func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { + continuation?.resume(throwing: error) + continuation = nil + } + + func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { + continuation?.resume(throwing: error) + continuation = nil + } +} + +enum HTMLRendererError: Error, CustomStringConvertible { + case snapshotFailed + var description: String { + switch self { case .snapshotFailed: "Failed to capture PNG snapshot from rendered HTML" } + } +} +#endif diff --git a/Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift b/Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift deleted file mode 100644 index 1ad7c8bd..00000000 --- a/Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift +++ /dev/null @@ -1,128 +0,0 @@ -#if canImport(WebKit) -import AppKit -import Foundation -import WebKit - -/// Renders HTML to PNG using WKWebView snapshot on macOS. -public final class WebKitHTMLRenderer: HTMLRenderer, @unchecked Sendable { - - public init() {} - - public func render(html: String, width: Int, height: Int) async throws -> Data { - try await renderOnMain(html: html, width: width, height: height) - } - - @MainActor - private func renderOnMain(html: String, width: Int, height: Int) async throws -> Data { - let config = WKWebViewConfiguration() - let webView = WKWebView(frame: NSRect(x: 0, y: 0, width: width, height: height), configuration: config) - - // Inline local images as data URLs so they render in loadHTMLString - let cwd = FileManager.default.currentDirectoryPath - let resolvedHTML = Self.inlineLocalImages(html, cwd: cwd) - webView.loadHTMLString(resolvedHTML, baseURL: nil) - - // Wait for navigation - try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in - let delegate = NavigationDelegate(continuation: continuation) - webView.navigationDelegate = delegate - objc_setAssociatedObject(webView, "navDelegate", delegate, .OBJC_ASSOCIATION_RETAIN) - } - - // Brief pause for CSS layout (images are already inlined as data URLs) - try await Task.sleep(for: .milliseconds(100)) - - let snapshotConfig = WKSnapshotConfiguration() - snapshotConfig.snapshotWidth = NSNumber(value: width) - - let image = try await webView.takeSnapshot(configuration: snapshotConfig) - - guard let tiffData = image.tiffRepresentation, - let bitmap = NSBitmapImageRep(data: tiffData), - let pngData = bitmap.representation(using: .png, properties: [:]) else { - throw HTMLRendererError.snapshotFailed - } - - return pngData - } - - /// Replace local image src paths with inline base64 data URLs. - private static func inlineLocalImages(_ html: String, cwd: String) -> String { - // Match src=".png" or src=".jpg" etc. - let pattern = #"src="([^"]+\.(?:png|jpg|jpeg|gif|webp))""# - guard let regex = try? NSRegularExpression(pattern: pattern) else { return html } - let nsHTML = html as NSString - var result = html - let matches = regex.matches(in: html, range: NSRange(location: 0, length: nsHTML.length)) - - // Process in reverse so replacements don't shift ranges - for match in matches.reversed() { - let pathRange = match.range(at: 1) - let path = nsHTML.substring(with: pathRange) - - // Skip data URIs - if path.hasPrefix("data:") { continue } - // Rewrite /api/files/read URLs back to local paths - if path.hasPrefix("http"), path.contains("/api/files/read?path=") { - if let urlComps = URLComponents(string: path), - let localPath = urlComps.queryItems?.first(where: { $0.name == "path" })?.value, - let data = FileManager.default.contents(atPath: cwd + "/" + localPath) { - let ext = (localPath as NSString).pathExtension.lowercased() - let mime = ext == "png" ? "image/png" : ext == "jpg" || ext == "jpeg" ? "image/jpeg" : "image/\(ext)" - let dataURL = "data:\(mime);base64,\(data.base64EncodedString())" - let fullRange = match.range(at: 0) - result = (result as NSString).replacingCharacters(in: fullRange, with: "src=\"\(dataURL)\"") - } - continue - } - if path.hasPrefix("http") { continue } - - // Resolve relative to cwd — try direct path then .asc/app-shots/ prefix - let candidates = [ - path.hasPrefix("/") ? path : cwd + "/" + path, - cwd + "/.asc/app-shots/" + path, - ] - guard let fullPath = candidates.first(where: { FileManager.default.fileExists(atPath: $0) }), - let data = FileManager.default.contents(atPath: fullPath) else { continue } - - let ext = (path as NSString).pathExtension.lowercased() - let mime = ext == "png" ? "image/png" : ext == "jpg" || ext == "jpeg" ? "image/jpeg" : "image/\(ext)" - let dataURL = "data:\(mime);base64,\(data.base64EncodedString())" - - let fullRange = match.range(at: 0) - result = (result as NSString).replacingCharacters(in: fullRange, with: "src=\"\(dataURL)\"") - } - return result - } -} - -private final class NavigationDelegate: NSObject, WKNavigationDelegate { - private var continuation: CheckedContinuation? - - init(continuation: CheckedContinuation) { - self.continuation = continuation - } - - func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { - continuation?.resume() - continuation = nil - } - - func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { - continuation?.resume(throwing: error) - continuation = nil - } - - func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { - continuation?.resume(throwing: error) - continuation = nil - } -} - -enum HTMLRendererError: Error, CustomStringConvertible { - case snapshotFailed - var description: String { - switch self { case .snapshotFailed: "Failed to capture PNG snapshot from rendered HTML" } - } -} -#endif diff --git a/Tests/ASCKitTests/Screenshots/Internal/LocalImagesTests.swift b/Tests/ASCKitTests/Screenshots/Internal/LocalImagesTests.swift new file mode 100644 index 00000000..73b9e7cd --- /dev/null +++ b/Tests/ASCKitTests/Screenshots/Internal/LocalImagesTests.swift @@ -0,0 +1,54 @@ +import Foundation +import Testing +@testable import ASCKit + +@Suite +struct LocalImagesTests { + private func images(_ files: [String: Data]) -> LocalImages { + LocalImages(workingDirectory: "/w", contents: { files[$0] }) + } + + @Test func `should inline an image beside the working directory as a data URL`() { + let html = images(["/w/shot.png": Data([1, 2, 3])]).inline(into: #""#) + + #expect(html == #""#) + } + + @Test func `should look in .asc/app-shots when the image is not beside the working directory`() { + let html = images(["/w/.asc/app-shots/bg.jpg": Data([1, 2, 3])]).inline(into: #""#) + + #expect(html == #""#) + } + + @Test func `should inline an image given by absolute path`() { + let html = images(["/abs/badge.gif": Data([1, 2, 3])]).inline(into: #""#) + + #expect(html == #""#) + } + + @Test func `should read the file behind a web server file URL`() { + let html = images(["/w/shots/a.webp": Data([1, 2, 3])]) + .inline(into: #""#) + + #expect(html == #""#) + } + + @Test func `should leave remote images and data URLs as they are`() { + let html = #""# + + #expect(images([:]).inline(into: html) == html) + } + + @Test func `should leave an image it cannot find as it is`() { + let html = #""# + + #expect(images([:]).inline(into: html) == html) + } + + @Test func `should inline every local image on the page`() { + let html = images(["/w/a.png": Data([1]), "/w/b.png": Data([2])]) + .inline(into: #""#) + + #expect(html == #""#) + } +} diff --git a/codecov.yml b/codecov.yml index 15f09f09..ade43b58 100644 --- a/codecov.yml +++ b/codecov.yml @@ -45,9 +45,6 @@ ignore: # Iris auth — drives Apple SRP login + idmsa.apple.com HTTP, third-party-interactive - "Sources/ASCKit/Iris/Internal/Auth/**" - # WebKit HTML renderer — WKWebView + AppKit GUI snapshot, not unit-testable - - "Sources/ASCKit/Screenshots/Internal/WebKitHTMLRenderer.swift" - # Plugin marketplace — wraps PluginLoader (filesystem) + URLSession download + unzip - "Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift" From 30047451bd4d1ae30944ebfae85fc7e5f0f1f354 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:40:20 +0800 Subject: [PATCH 10/18] refactor(iris): sign in through @Mockable roles instead of concrete HTTP clients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IrisAuthSDKRepository depends on AppleIDSignIn (idmsa) and AppStoreConnectAccounts (olympus), played by IdmsaAPIClient and OlympusClient, plus an injected clock. Its decisions — the pending two-factor state, the session it builds (team, Apple ID as fallback email, 30-day expiry) and both login paths — are now tested with MockAppleIDSignIn / MockAppStoreConnectAccounts instead of a URLProtocol stub. codecov no longer skips Iris/Internal/Auth/ (77% covered; IdmsaAPIClient's own wire at 46% is the gap). Co-Authored-By: Claude Opus 5.5 --- .../Iris/Internal/Auth/AppleIDSignIn.swift | 31 +++++ .../Internal/Auth/IrisAuthSDKRepository.swift | 23 +++- .../Auth/IrisAuthSDKRepositoryTests.swift | 112 ++++++++++++++++++ codecov.yml | 3 - 4 files changed, 160 insertions(+), 9 deletions(-) create mode 100644 Sources/ASCKit/Iris/Internal/Auth/AppleIDSignIn.swift create mode 100644 Tests/ASCKitTests/Iris/Internal/Auth/IrisAuthSDKRepositoryTests.swift diff --git a/Sources/ASCKit/Iris/Internal/Auth/AppleIDSignIn.swift b/Sources/ASCKit/Iris/Internal/Auth/AppleIDSignIn.swift new file mode 100644 index 00000000..ddf0e70d --- /dev/null +++ b/Sources/ASCKit/Iris/Internal/Auth/AppleIDSignIn.swift @@ -0,0 +1,31 @@ +import Foundation +import Mockable + +/// Apple's identity service (idmsa.apple.com): the SRP sign-in and the two-factor steps. +/// `IdmsaAPIClient` plays it over HTTP. +@Mockable +protocol AppleIDSignIn: Sendable { + func signinInit(accountName: String, A: Data) async throws -> IdmsaAPIClient.SigninInitResponse + func signinComplete( + accountName: String, c: String, m1: Data, m2: Data, + scnt: String, appleIDSessionID: String, + hashcashChallenge: String?, hashcashBits: Int?, + cookies: String + ) async throws -> IdmsaAPIClient.SigninCompleteResult + func fetchAuthOptions(scnt: String, appleIDSessionID: String, cookies: String) async throws -> String + func submitTwoFactorCode( + _ code: String, method: IdmsaAPIClient.TwoFactorMethod, + scnt: String, appleIDSessionID: String, cookies: String + ) async throws -> String + func trust(scnt: String, appleIDSessionID: String, cookies: String) async throws -> String +} + +/// The App Store Connect account a signed-in session belongs to (olympus): its +/// provider, team and email. `OlympusClient` plays it over HTTP. +@Mockable +protocol AppStoreConnectAccounts: Sendable { + func fetchSession(cookies: String) async throws -> OlympusClient.OlympusSession +} + +extension IdmsaAPIClient: AppleIDSignIn {} +extension OlympusClient: AppStoreConnectAccounts {} diff --git a/Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift b/Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift index 11aafeaa..c5be0f01 100644 --- a/Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift @@ -5,8 +5,9 @@ import Foundation /// `AppleSRPClient` for crypto, `IdmsaAPIClient` for `idmsa.apple.com`, `OlympusClient` /// for ASC team metadata. public struct IrisAuthSDKRepository: IrisAuthRepository, @unchecked Sendable { - private let idmsa: IdmsaAPIClient - private let olympus: OlympusClient + private let idmsa: any AppleIDSignIn + private let olympus: any AppStoreConnectAccounts + private let now: @Sendable () -> Date /// App Store Connect's widget key — long-stable. Apple's web UI fetches this /// dynamically; we hardcode the observed value as a constant. If Apple ever rotates @@ -15,10 +16,20 @@ public struct IrisAuthSDKRepository: IrisAuthRepository, @unchecked Sendable { public init( session: URLSession = .shared, - serviceKey: String = ascServiceKey + serviceKey: String = ascServiceKey, + now: @escaping @Sendable () -> Date = { Date() } ) { - self.idmsa = IdmsaAPIClient(session: session, serviceKey: serviceKey) - self.olympus = OlympusClient(session: session) + self.init( + signIn: IdmsaAPIClient(session: session, serviceKey: serviceKey), + accounts: OlympusClient(session: session), + now: now + ) + } + + init(signIn: any AppleIDSignIn, accounts: any AppStoreConnectAccounts, now: @escaping @Sendable () -> Date) { + self.idmsa = signIn + self.olympus = accounts + self.now = now } public func login(credentials: IrisAuthCredentials) async throws -> IrisAuthSession { @@ -102,7 +113,7 @@ public struct IrisAuthSDKRepository: IrisAuthRepository, @unchecked Sendable { let olympusSession = try await olympus.fetchSession(cookies: cookies) // Best-guess expiry — iris cookies typically last ~30 days. We rebuild on // expiry since iris exposes no refresh endpoint. - let expiresAt = Date().addingTimeInterval(30 * 24 * 60 * 60) + let expiresAt = now().addingTimeInterval(30 * 24 * 60 * 60) return IrisAuthSession( cookies: cookies, scnt: scnt, diff --git a/Tests/ASCKitTests/Iris/Internal/Auth/IrisAuthSDKRepositoryTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/IrisAuthSDKRepositoryTests.swift new file mode 100644 index 00000000..9976fc7e --- /dev/null +++ b/Tests/ASCKitTests/Iris/Internal/Auth/IrisAuthSDKRepositoryTests.swift @@ -0,0 +1,112 @@ +import Foundation +import Mockable +import Testing +@testable import ASCKit + +@Suite +struct IrisAuthSDKRepositoryTests { + private let now = Date(timeIntervalSince1970: 1_800_000_000) + private let credentials = IrisAuthCredentials(appleId: "dev@example.com", password: "secret") + private let trustedDevice = TwoFactorChallenge(method: .trustedDevice, maskedDestination: "Trusted devices", codeLength: 6) + + private var pending: PendingTwoFactorState { + PendingTwoFactorState( + credentials: credentials, scnt: "scnt-1", serviceKey: IrisAuthSDKRepository.ascServiceKey, + appleIDSessionID: "session-1", twoFactorCookieBag: "aasp=1", challenge: trustedDevice + ) + } + + private func signInStartedByApple() -> MockAppleIDSignIn { + let signIn = MockAppleIDSignIn() + given(signIn).signinInit(accountName: .any, A: .any).willReturn(IdmsaAPIClient.SigninInitResponse( + iteration: 1000, salt: Data(repeating: 7, count: 16), b: Data(repeating: 9, count: 256), c: "c-1", + protocolType: .s2k, scnt: "scnt-0", appleIDSessionID: "session-1", + hashcashChallenge: nil, hashcashBits: nil, cookies: "aasp=1" + )) + return signIn + } + + private func accounts(email: String, teamId: String?) -> MockAppStoreConnectAccounts { + let accounts = MockAppStoreConnectAccounts() + given(accounts).fetchSession(cookies: .any) + .willReturn(OlympusClient.OlympusSession(providerID: 42, teamId: teamId, userEmail: email)) + return accounts + } + + @Test func `should ask for a code from a trusted device when Apple wants two-factor`() async throws { + let signIn = signInStartedByApple() + given(signIn).signinComplete( + accountName: .any, c: .any, m1: .any, m2: .any, scnt: .any, appleIDSessionID: .any, + hashcashChallenge: .any, hashcashBits: .any, cookies: .any + ).willReturn(.twoFactorRequired(scnt: "scnt-2fa", appleIDSessionID: "session-1", cookies: "aasp=1; dslang=GB")) + let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) + + do { + _ = try await repo.login(credentials: credentials) + Issue.record("expected two-factor to be required") + } catch IrisAuthError.twoFactorRequired(let state) { + #expect(state == PendingTwoFactorState( + credentials: credentials, scnt: "scnt-2fa", serviceKey: IrisAuthSDKRepository.ascServiceKey, + appleIDSessionID: "session-1", twoFactorCookieBag: "aasp=1; dslang=GB", challenge: trustedDevice + )) + } + } + + @Test func `should sign in for thirty days when Apple needs no second factor`() async throws { + let signIn = signInStartedByApple() + given(signIn).signinComplete( + accountName: .any, c: .any, m1: .any, m2: .any, scnt: .any, appleIDSessionID: .any, + hashcashChallenge: .any, hashcashBits: .any, cookies: .any + ).willReturn(.success(scnt: "scnt-ok", cookies: "myacinfo=a")) + let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "team@example.com", teamId: "TEAM1"), now: { now }) + + let session = try await repo.login(credentials: credentials) + + #expect(session == IrisAuthSession( + cookies: "myacinfo=a", scnt: "scnt-ok", serviceKey: IrisAuthSDKRepository.ascServiceKey, + appleIDSessionID: "session-1", providerID: 42, teamId: "TEAM1", userEmail: "team@example.com", + expiresAt: now.addingTimeInterval(30 * 24 * 60 * 60) + )) + } + + @Test func `should sign in with the team olympus names after a correct code`() async throws { + let signIn = MockAppleIDSignIn() + given(signIn).fetchAuthOptions(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1") + given(signIn).submitTwoFactorCode(.any, method: .any, scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1; verified=1") + given(signIn).trust(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("myacinfo=a; trusted=1") + let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "team@example.com", teamId: "TEAM1"), now: { now }) + + let session = try await repo.submitTwoFactorCode("123456", pending: pending) + + #expect(session == IrisAuthSession( + cookies: "myacinfo=a; trusted=1", scnt: "scnt-1", serviceKey: IrisAuthSDKRepository.ascServiceKey, + appleIDSessionID: "session-1", providerID: 42, teamId: "TEAM1", userEmail: "team@example.com", + expiresAt: now.addingTimeInterval(30 * 24 * 60 * 60) + )) + } + + @Test func `should name the session after the Apple ID when olympus gives no email`() async throws { + let signIn = MockAppleIDSignIn() + given(signIn).fetchAuthOptions(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1") + given(signIn).submitTwoFactorCode(.any, method: .any, scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1") + given(signIn).trust(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("myacinfo=a") + let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) + + let session = try await repo.submitTwoFactorCode("123456", pending: pending) + + #expect(session.userEmail == "dev@example.com") + #expect(session.teamId == nil) + } + + @Test func `should not sign in when Apple rejects the code`() async { + let signIn = MockAppleIDSignIn() + given(signIn).fetchAuthOptions(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1") + given(signIn).submitTwoFactorCode(.any, method: .any, scnt: .any, appleIDSessionID: .any, cookies: .any) + .willThrow(IrisAuthError.twoFactorCodeRejected(remainingAttempts: nil)) + let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) + + await #expect(throws: IrisAuthError.twoFactorCodeRejected(remainingAttempts: nil)) { + try await repo.submitTwoFactorCode("000000", pending: pending) + } + } +} diff --git a/codecov.yml b/codecov.yml index ade43b58..bb45a710 100644 --- a/codecov.yml +++ b/codecov.yml @@ -42,9 +42,6 @@ ignore: - "Sources/ASCCommand/Commands/Web/**/*" - "Sources/ASCKit/Web/**/*" - # Iris auth — drives Apple SRP login + idmsa.apple.com HTTP, third-party-interactive - - "Sources/ASCKit/Iris/Internal/Auth/**" - # Plugin marketplace — wraps PluginLoader (filesystem) + URLSession download + unzip - "Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift" From ed7a107d0ceeb7a284a43fcc83b9c6052167aacb Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:42:01 +0800 Subject: [PATCH 11/18] refactor(iris): repositories depend on the @Mockable IrisAPI role IrisAPI (get, post, download, delete) is what the iris repositories need from iris; IrisClient in Internal/System/ plays it. The four iris repositories take any IrisAPI (defaulting to IrisClient), and the app-bundle tests stub MockIrisAPI by path, query and cookies instead of a URLProtocol stub. Co-Authored-By: Claude Opus 5.5 --- .../Internal/IrisSDKAppBundleRepository.swift | 4 +- .../IrisSDKInAppPurchaseStateRepository.swift | 4 +- ...SDKInAppPurchaseSubmissionRepository.swift | 4 +- Sources/ASCKit/Iris/Internal/IrisAPI.swift | 19 +++++ .../Iris/Internal/System/IrisClient.swift | 4 +- .../IrisSDKResolutionCenterRepository.swift | 4 +- .../IrisSDKAppBundleRepositoryTests.swift | 74 ++++++------------- 7 files changed, 52 insertions(+), 61 deletions(-) create mode 100644 Sources/ASCKit/Iris/Internal/IrisAPI.swift diff --git a/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift b/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift index 41ae4b24..08767896 100644 --- a/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift +++ b/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift @@ -2,9 +2,9 @@ import Foundation /// Implements `IrisAppBundleRepository` via the iris private API. public struct IrisSDKAppBundleRepository: IrisAppBundleRepository, @unchecked Sendable { - private let client: IrisClient + private let client: any IrisAPI - public init(client: IrisClient = IrisClient()) { + public init(client: any IrisAPI = IrisClient()) { self.client = client } diff --git a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift index 74328ef1..efed0da0 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift @@ -5,9 +5,9 @@ import Foundation /// `submitWithNextAppStoreVersion` as an attribute on each IAP — the public SDK /// does not, which is why this lives behind the iris cookie surface. public struct IrisSDKInAppPurchaseStateRepository: IrisInAppPurchaseStateRepository, @unchecked Sendable { - private let client: IrisClient + private let client: any IrisAPI - public init(client: IrisClient = IrisClient()) { + public init(client: any IrisAPI = IrisClient()) { self.client = client } diff --git a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift index ddbef382..d857e9ea 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift @@ -7,9 +7,9 @@ import Foundation /// `POST /iris/v1/inAppPurchaseSubmissions`. The public ASC SDK's /// `InAppPurchaseSubmissionCreateRequest` lacks an `attributes` field entirely. public struct IrisSDKInAppPurchaseSubmissionRepository: IrisInAppPurchaseSubmissionRepository, @unchecked Sendable { - private let client: IrisClient + private let client: any IrisAPI - public init(client: IrisClient = IrisClient()) { + public init(client: any IrisAPI = IrisClient()) { self.client = client } diff --git a/Sources/ASCKit/Iris/Internal/IrisAPI.swift b/Sources/ASCKit/Iris/Internal/IrisAPI.swift new file mode 100644 index 00000000..2e6caf70 --- /dev/null +++ b/Sources/ASCKit/Iris/Internal/IrisAPI.swift @@ -0,0 +1,19 @@ +import Foundation +import Mockable + +/// The iris private API (`appstoreconnect.apple.com/iris/v1`), as the iris +/// repositories use it. `IrisClient` plays it over HTTP. +@Mockable +public protocol IrisAPI: Sendable { + func get(path: String, queryItems: [URLQueryItem], cookies: String) async throws -> (Data, HTTPURLResponse) + func post(path: String, body: Data, cookies: String) async throws -> (Data, HTTPURLResponse) + /// Fetch an absolute URL with the session cookies. Callers validate the host first. + func download(absoluteURL: URL, cookies: String) async throws -> (Data, HTTPURLResponse) + func delete(path: String, cookies: String) async throws -> (Data, HTTPURLResponse) +} + +extension IrisAPI { + func get(path: String, cookies: String) async throws -> (Data, HTTPURLResponse) { + try await get(path: path, queryItems: [], cookies: cookies) + } +} diff --git a/Sources/ASCKit/Iris/Internal/System/IrisClient.swift b/Sources/ASCKit/Iris/Internal/System/IrisClient.swift index 3e64cae3..c703ab99 100644 --- a/Sources/ASCKit/Iris/Internal/System/IrisClient.swift +++ b/Sources/ASCKit/Iris/Internal/System/IrisClient.swift @@ -2,14 +2,14 @@ import Foundation /// HTTP client for the iris private API. Only the `URLSession` call lives here; /// the request is `IrisRequest`'s and what the reply means is `IrisResponse`'s. -public struct IrisClient: Sendable { +public struct IrisClient: IrisAPI { private let session: URLSession public init(session: URLSession = .shared) { self.session = session } - public func get(path: String, queryItems: [URLQueryItem] = [], cookies: String) async throws -> (Data, HTTPURLResponse) { + public func get(path: String, queryItems: [URLQueryItem], cookies: String) async throws -> (Data, HTTPURLResponse) { try await perform(IrisRequest.get(path: path, queryItems: queryItems, cookies: cookies)) } diff --git a/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift b/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift index d7f30501..b146f36d 100644 --- a/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift +++ b/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift @@ -9,9 +9,9 @@ import Foundation /// user-visible operation. The endpoint shapes are undocumented; this mapper /// is the absorption layer if Apple shifts a field. public struct IrisSDKResolutionCenterRepository: IrisResolutionCenterRepository, @unchecked Sendable { - private let client: IrisClient + private let client: any IrisAPI - public init(client: IrisClient = IrisClient()) { + public init(client: any IrisAPI = IrisClient()) { self.client = client } diff --git a/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift b/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift index 380137c5..9dbf63cd 100644 --- a/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift @@ -1,87 +1,59 @@ import Foundation +import Mockable import Testing @testable import ASCKit -final class AppBundleURLProtocolStub: URLProtocol, @unchecked Sendable { - nonisolated(unsafe) static var reply: (status: Int, body: String) = (200, "{}") - nonisolated(unsafe) static var lastRequest: URLRequest? - nonisolated(unsafe) static var lastBody: Data? - - static func makeClient(status: Int, body: String) -> IrisClient { - reply = (status, body) - lastRequest = nil - lastBody = nil - let config = URLSessionConfiguration.ephemeral - config.protocolClasses = [AppBundleURLProtocolStub.self] - return IrisClient(session: URLSession(configuration: config)) - } - - override class func canInit(with request: URLRequest) -> Bool { true } - override class func canonicalRequest(for request: URLRequest) -> URLRequest { request } - override func startLoading() { - Self.lastRequest = request - Self.lastBody = request.httpBody ?? request.httpBodyStream.map { stream in - stream.open() - defer { stream.close() } - var data = Data() - var buffer = [UInt8](repeating: 0, count: 4096) - while stream.hasBytesAvailable { - let read = stream.read(&buffer, maxLength: buffer.count) - if read <= 0 { break } - data.append(buffer, count: read) - } - return data - } - let response = HTTPURLResponse(url: request.url!, statusCode: Self.reply.status, httpVersion: nil, headerFields: nil)! - client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed) - client?.urlProtocol(self, didLoad: Data(Self.reply.body.utf8)) - client?.urlProtocolDidFinishLoading(self) - } - override func stopLoading() {} -} - -@Suite(.serialized) +@Suite struct IrisSDKAppBundleRepositoryTests { private let session = IrisSession(cookies: "myacinfo=a") + private func reply(_ status: Int, _ body: String) -> (Data, HTTPURLResponse) { + let url = URL(string: "https://appstoreconnect.apple.com/iris/v1")! + return (Data(body.utf8), HTTPURLResponse(url: url, statusCode: status, httpVersion: nil, headerFields: nil)!) + } + @Test func `should list every app bundle with its versions included`() async throws { - let client = AppBundleURLProtocolStub.makeClient(status: 200, body: #""" + let iris = MockIrisAPI() + given(iris).get( + path: .value("appBundles"), + queryItems: .value([URLQueryItem(name: "include", value: "appBundleVersions"), URLQueryItem(name: "limit", value: "300")]), + cookies: .value("myacinfo=a") + ).willReturn(reply(200, #""" {"data":[ {"id":"b1","type":"apps","attributes":{"name":"Bakery","bundleId":"com.example.bakery","sku":"BAKE","primaryLocale":"en-GB","platformNames":["IOS"]}}, {"id":"b2","type":"apps","attributes":{}} ]} - """#) + """#)) - let bundles = try await IrisSDKAppBundleRepository(client: client).listAppBundles(session: session) + let bundles = try await IrisSDKAppBundleRepository(client: iris).listAppBundles(session: session) #expect(bundles == [ AppBundle(id: "b1", name: "Bakery", bundleId: "com.example.bakery", sku: "BAKE", primaryLocale: "en-GB", platforms: ["IOS"]), AppBundle(id: "b2", name: "", bundleId: "", sku: "", primaryLocale: "en-US", platforms: []), ]) - #expect(AppBundleURLProtocolStub.lastRequest?.url?.absoluteString - == "https://appstoreconnect.apple.com/iris/v1/appBundles?include=appBundleVersions&limit=300") } @Test func `should name a created app as asked when iris leaves the name out`() async throws { - let client = AppBundleURLProtocolStub.makeClient(status: 201, body: #""" + let iris = MockIrisAPI() + given(iris).post(path: .value("apps"), body: .any, cookies: .value("myacinfo=a")).willReturn(reply(201, #""" {"data":{"id":"new","type":"apps","attributes":{"bundleId":"com.example.new","sku":"NEW","primaryLocale":"en-US","platformNames":["IOS"]}}} - """#) + """#)) - let bundle = try await IrisSDKAppBundleRepository(client: client).createApp( + let bundle = try await IrisSDKAppBundleRepository(client: iris).createApp( session: session, name: "New App", bundleId: "com.example.new", sku: "NEW", primaryLocale: "en-US", platforms: ["IOS"], versionString: "1.0" ) #expect(bundle == AppBundle(id: "new", name: "New App", bundleId: "com.example.new", sku: "NEW", primaryLocale: "en-US", platforms: ["IOS"])) - #expect(AppBundleURLProtocolStub.lastRequest?.httpMethod == "POST") - #expect(AppBundleURLProtocolStub.lastRequest?.url?.absoluteString == "https://appstoreconnect.apple.com/iris/v1/apps") } @Test func `should fail with iris's status when it refuses to create the app`() async { - let client = AppBundleURLProtocolStub.makeClient(status: 409, body: "bundle id taken") + let iris = MockIrisAPI() + given(iris).post(path: .any, body: .any, cookies: .any) + .willThrow(IrisAPIError.httpError(statusCode: 409, body: "bundle id taken")) do { - _ = try await IrisSDKAppBundleRepository(client: client).createApp( + _ = try await IrisSDKAppBundleRepository(client: iris).createApp( session: session, name: "Dup", bundleId: "com.example.dup", sku: "DUP", primaryLocale: "en-US", platforms: ["IOS"], versionString: "1.0" ) From 5bbc98d138a238f0eb10abf923651dde788556cc Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:44:39 +0800 Subject: [PATCH 12/18] refactor(plugins): marketplace decisions through @Mockable folder and download roles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PluginMarketRepository keeps its decisions — installed matching by slug or name-as-id, search, outdated versions, uninstall's match order, update as reinstall — now tested with MockPluginsFolder and MockPluginDownloads. LocalPluginsFolder and URLSessionPluginDownloads in Plugins/Internal/System/ hold only the PluginLoader, file system, unzip and URLSession calls. Completes step 4 of the concept-folders design. Co-Authored-By: Claude Opus 5.5 --- .../Internal/PluginMarketRepository.swift | 131 ++++-------- .../Plugins/Internal/PluginsFolder.swift | 39 ++++ .../Internal/System/LocalPluginsFolder.swift | 67 ++++++ .../PluginMarketRepositoryTests.swift | 194 ++++++++++++++++++ codecov.yml | 3 - docs/features/concept-folders/design.md | 9 +- 6 files changed, 344 insertions(+), 99 deletions(-) create mode 100644 Sources/ASCKit/Plugins/Internal/PluginsFolder.swift create mode 100644 Sources/ASCKit/Plugins/Internal/System/LocalPluginsFolder.swift create mode 100644 Tests/ASCKitTests/Plugins/Internal/PluginMarketRepositoryTests.swift diff --git a/Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift b/Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift index 7a3a6ada..14343a75 100644 --- a/Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift +++ b/Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift @@ -1,26 +1,31 @@ import Foundation -import ASCPlugin -/// Manages installed dylib plugins and fetches marketplace listings from composable sources. +/// Manages installed plugins and the marketplace listings from composable sources. public struct PluginMarketRepository: PluginRepository { private let sources: [any PluginSource] + private let folder: any PluginsFolder + private let downloads: any PluginDownloads public init(sources: [any PluginSource] = []) { + self.init(sources: sources, folder: LocalPluginsFolder(), downloads: URLSessionPluginDownloads()) + } + + init(sources: [any PluginSource], folder: any PluginsFolder, downloads: any PluginDownloads) { self.sources = sources + self.folder = folder + self.downloads = downloads } public func listInstalled() async throws -> [Plugin] { - let loaded = PluginLoader.discover() - return loaded.map { p in - let manifest = readManifest(at: p.directory) - return Plugin( + folder.installed().map { p in + Plugin( id: p.slug, name: p.name, - version: manifest?["version"] as? String ?? "1.0", - description: manifest?["description"] as? String ?? "", - author: manifest?["author"] as? String, - repositoryURL: manifest?["repositoryURL"] as? String, - categories: manifest?["categories"] as? [String] ?? [], + version: p.version ?? "1.0", + description: p.description ?? "", + author: p.author, + repositoryURL: p.repositoryURL, + categories: p.categories ?? [], isInstalled: true, slug: p.slug, uiScripts: p.uiScripts @@ -29,19 +34,15 @@ public struct PluginMarketRepository: PluginRepository { } public func listAvailable() async throws -> [Plugin] { - let installed = PluginLoader.discover() - let installedIds = Set( - installed.flatMap { p in - [p.slug, p.slug.lowercased(), p.name.lowercased().replacingOccurrences(of: " ", with: "-")] - } - ) + let installedIds = Set(folder.installed().flatMap { p in + [p.slug, p.slug.lowercased(), Self.id(forName: p.name)] + }) var all: [Plugin] = [] for source in sources { let plugins = try await source.fetchPlugins() all.append(contentsOf: plugins.map { plugin in - let matched = installedIds.contains(plugin.id) || installedIds.contains(plugin.id.lowercased()) - return Plugin( + Plugin( id: plugin.id, name: plugin.name, version: plugin.version, @@ -50,7 +51,7 @@ public struct PluginMarketRepository: PluginRepository { repositoryURL: plugin.repositoryURL, categories: plugin.categories, downloadURL: plugin.downloadURL, - isInstalled: matched + isInstalled: installedIds.contains(plugin.id) || installedIds.contains(plugin.id.lowercased()) ) }) } @@ -58,9 +59,8 @@ public struct PluginMarketRepository: PluginRepository { } public func searchAvailable(query: String) async throws -> [Plugin] { - let all = try await listAvailable() let q = query.lowercased() - return all.filter { + return try await listAvailable().filter { $0.name.lowercased().contains(q) || $0.description.lowercased().contains(q) || $0.categories.contains(where: { $0.lowercased().contains(q) }) @@ -73,34 +73,10 @@ public struct PluginMarketRepository: PluginRepository { let downloadURL = entry.downloadURL else { throw PluginMarketError.pluginNotFound(name) } - - let pluginsDir = PluginLoader.pluginsDirectory - try FileManager.default.createDirectory(at: pluginsDir, withIntermediateDirectories: true) - - let zipURL = URL(string: downloadURL)! - let (zipData, _) = try await URLSession.shared.data(from: zipURL) - - let tempDir = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString) - try FileManager.default.createDirectory(at: tempDir, withIntermediateDirectories: true) - let zipPath = tempDir.appendingPathComponent("\(name).zip") - try zipData.write(to: zipPath) - - let process = Process() - process.executableURL = URL(fileURLWithPath: "/usr/bin/unzip") - process.arguments = ["-o", zipPath.path, "-d", pluginsDir.path] - try process.run() - process.waitUntilExit() - - try? FileManager.default.removeItem(at: tempDir) - - guard process.terminationStatus == 0 else { + let archive = try await downloads.download(from: URL(string: downloadURL)!) + guard try folder.unpack(archive, named: name) else { throw PluginMarketError.installFailed(name) } - - // Drop the in-memory plugin cache so the next `listInstalled()` - // re-scans `~/.asc/plugins` and includes the new bundle. - PluginLoader.invalidateCache() - return Plugin( id: name, name: entry.name, @@ -114,48 +90,23 @@ public struct PluginMarketRepository: PluginRepository { ) } + /// Removes the plugin whose folder is `name`, or else whose folder or manifest + /// name, as an id (`"ASC Pro"` → `asc-pro`), is `name` ignoring case. public func uninstall(name: String) async throws { - let pluginsDir = PluginLoader.pluginsDirectory - // Try exact match first (slug like "ASCPro"), then scan for matching plugin - let exactPath = pluginsDir.appendingPathComponent("\(name).plugin") - if FileManager.default.fileExists(atPath: exactPath.path) { - try FileManager.default.removeItem(at: exactPath) - // Drop the in-memory plugin cache so the next `listInstalled()` - // re-scans the disk and excludes this entry. Without this the - // REST list endpoint keeps returning the just-deleted plugin. - PluginLoader.invalidateCache() - return - } - // Scan installed plugins — match by slug or name-derived id - let nameLower = name.lowercased() - let fm = FileManager.default - guard let entries = try? fm.contentsOfDirectory(atPath: pluginsDir.path) else { + let bundles = folder.bundles() + let wanted = name.lowercased() + let match = bundles.first { $0.slug == name } + ?? bundles.first { $0.slug.lowercased() == wanted || $0.manifestName.map(Self.id(forName:)) == wanted } + guard let match else { throw PluginMarketError.pluginNotFound(name) } - for entry in entries where entry.hasSuffix(".plugin") { - let slug = (entry as NSString).deletingPathExtension - let slugLower = slug.lowercased() - // Match: exact slug, lowercased slug, or name-derived id (e.g. "asc-pro" matches "ASC Pro") - let manifestURL = pluginsDir.appendingPathComponent(entry).appendingPathComponent("manifest.json") - let manifestName = (try? Data(contentsOf: manifestURL)) - .flatMap { try? JSONSerialization.jsonObject(with: $0) as? [String: Any] } - .flatMap { $0["name"] as? String } - let nameId = manifestName?.lowercased().replacingOccurrences(of: " ", with: "-") - - if slugLower == nameLower || nameId == nameLower { - try fm.removeItem(at: pluginsDir.appendingPathComponent(entry)) - PluginLoader.invalidateCache() - return - } - } - throw PluginMarketError.pluginNotFound(name) + try folder.remove(slug: match.slug) } public func listOutdated() async throws -> [PluginUpdate] { let installed = try await listInstalled() - let available = try await listAvailable() var availableByName: [String: Plugin] = [:] - for plugin in available { + for plugin in try await listAvailable() { availableByName[plugin.name] = plugin } return installed.compactMap { local in @@ -172,28 +123,20 @@ public struct PluginMarketRepository: PluginRepository { } public func update(name: String) async throws -> Plugin { - // Find the marketplace entry that matches the installed plugin's name or id. let installed = try await listInstalled() guard let local = installed.first(where: { $0.name == name || $0.slug == name || $0.id == name }) else { throw PluginMarketError.pluginNotFound(name) } - let available = try await listAvailable() - guard let remote = available.first(where: { $0.name == local.name }) else { + guard let remote = try await listAvailable().first(where: { $0.name == local.name }) else { throw PluginMarketError.pluginNotFound(local.name) } try await uninstall(name: local.slug ?? local.id) return try await install(name: remote.id) } - // MARK: - Private - - private func readManifest(at directory: URL) -> [String: Any]? { - let manifestURL = directory.appendingPathComponent("manifest.json") - guard let data = try? Data(contentsOf: manifestURL), - let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any] else { - return nil - } - return json + /// A plugin's name as a marketplace id: `"ASC Pro"` → `asc-pro`. + private static func id(forName name: String) -> String { + name.lowercased().replacingOccurrences(of: " ", with: "-") } } diff --git a/Sources/ASCKit/Plugins/Internal/PluginsFolder.swift b/Sources/ASCKit/Plugins/Internal/PluginsFolder.swift new file mode 100644 index 00000000..ac10778c --- /dev/null +++ b/Sources/ASCKit/Plugins/Internal/PluginsFolder.swift @@ -0,0 +1,39 @@ +import Foundation +import Mockable + +/// A plugin installed in `~/.asc/plugins` that loads, with what its manifest says. +struct InstalledPlugin: Equatable, Sendable { + let slug: String + let name: String + let uiScripts: [String] + let version: String? + let description: String? + let author: String? + let repositoryURL: String? + let categories: [String]? +} + +/// A `.plugin` bundle in the plugins folder, whether or not it loads. +struct PluginBundle: Equatable, Sendable { + let slug: String + let manifestName: String? +} + +/// The plugins folder, `~/.asc/plugins`. +@Mockable +protocol PluginsFolder: Sendable { + /// The plugins that load, with their manifests. + func installed() -> [InstalledPlugin] + /// Every `.plugin` bundle in the folder. + func bundles() -> [PluginBundle] + /// Unpacks a downloaded plugin archive into the folder; `false` when it doesn't unpack. + func unpack(_ archive: Data, named name: String) throws -> Bool + /// Removes the bundle `.plugin`. + func remove(slug: String) throws +} + +/// Where plugin archives are downloaded from. +@Mockable +protocol PluginDownloads: Sendable { + func download(from url: URL) async throws -> Data +} diff --git a/Sources/ASCKit/Plugins/Internal/System/LocalPluginsFolder.swift b/Sources/ASCKit/Plugins/Internal/System/LocalPluginsFolder.swift new file mode 100644 index 00000000..98949cb8 --- /dev/null +++ b/Sources/ASCKit/Plugins/Internal/System/LocalPluginsFolder.swift @@ -0,0 +1,67 @@ +import ASCPlugin +import Foundation + +/// `~/.asc/plugins` on this Mac. Only the file system, `PluginLoader` and `unzip` +/// calls live here; which plugin matches is `PluginMarketRepository`'s. +struct LocalPluginsFolder: PluginsFolder { + func installed() -> [InstalledPlugin] { + PluginLoader.discover().map { plugin in + let manifest = Self.manifest(in: plugin.directory) + return InstalledPlugin( + slug: plugin.slug, name: plugin.name, uiScripts: plugin.uiScripts, + version: manifest?["version"] as? String, + description: manifest?["description"] as? String, + author: manifest?["author"] as? String, + repositoryURL: manifest?["repositoryURL"] as? String, + categories: manifest?["categories"] as? [String] + ) + } + } + + func bundles() -> [PluginBundle] { + let folder = PluginLoader.pluginsDirectory + let entries = (try? FileManager.default.contentsOfDirectory(atPath: folder.path)) ?? [] + return entries.filter { $0.hasSuffix(".plugin") }.map { entry in + PluginBundle( + slug: (entry as NSString).deletingPathExtension, + manifestName: Self.manifest(in: folder.appendingPathComponent(entry))?["name"] as? String + ) + } + } + + func unpack(_ archive: Data, named name: String) throws -> Bool { + let folder = PluginLoader.pluginsDirectory + try FileManager.default.createDirectory(at: folder, withIntermediateDirectories: true) + let temp = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString) + try FileManager.default.createDirectory(at: temp, withIntermediateDirectories: true) + defer { try? FileManager.default.removeItem(at: temp) } + let zip = temp.appendingPathComponent("\(name).zip") + try archive.write(to: zip) + + let unzip = Process() + unzip.executableURL = URL(fileURLWithPath: "/usr/bin/unzip") + unzip.arguments = ["-o", zip.path, "-d", folder.path] + try unzip.run() + unzip.waitUntilExit() + // The next `installed()` re-scans the folder and sees the new bundle. + PluginLoader.invalidateCache() + return unzip.terminationStatus == 0 + } + + func remove(slug: String) throws { + try FileManager.default.removeItem(at: PluginLoader.pluginsDirectory.appendingPathComponent("\(slug).plugin")) + PluginLoader.invalidateCache() + } + + private static func manifest(in directory: URL) -> [String: Any]? { + guard let data = try? Data(contentsOf: directory.appendingPathComponent("manifest.json")) else { return nil } + return try? JSONSerialization.jsonObject(with: data) as? [String: Any] + } +} + +/// Downloads plugin archives with `URLSession`. +struct URLSessionPluginDownloads: PluginDownloads { + func download(from url: URL) async throws -> Data { + try await URLSession.shared.data(from: url).0 + } +} diff --git a/Tests/ASCKitTests/Plugins/Internal/PluginMarketRepositoryTests.swift b/Tests/ASCKitTests/Plugins/Internal/PluginMarketRepositoryTests.swift new file mode 100644 index 00000000..9fc2fc97 --- /dev/null +++ b/Tests/ASCKitTests/Plugins/Internal/PluginMarketRepositoryTests.swift @@ -0,0 +1,194 @@ +import Foundation +import Mockable +import Testing +@testable import ASCKit + +@Suite +struct PluginMarketRepositoryTests { + private let ascPro = InstalledPlugin( + slug: "ASCPro", name: "ASC Pro", uiScripts: ["ui/pro.js"], + version: "1.2.0", description: "Pro tools", author: "tddworks", + repositoryURL: "https://github.com/tddworks/asc-pro", categories: ["pro"] + ) + + private func market(_ plugins: [Plugin]) -> MockPluginSource { + let source = MockPluginSource() + given(source).fetchPlugins().willReturn(plugins) + return source + } + + private func folder(installed: [InstalledPlugin] = [], bundles: [PluginBundle] = []) -> MockPluginsFolder { + let folder = MockPluginsFolder() + given(folder).installed().willReturn(installed) + given(folder).bundles().willReturn(bundles) + given(folder).remove(slug: .any).willReturn(()) + given(folder).unpack(.any, named: .any).willReturn(true) + return folder + } + + private func repository( + folder: MockPluginsFolder, market: [Plugin] = [], downloads: MockPluginDownloads = MockPluginDownloads() + ) -> PluginMarketRepository { + PluginMarketRepository(sources: [self.market(market)], folder: folder, downloads: downloads) + } + + // MARK: - installed + + @Test func `should list each installed plugin with the details from its manifest`() async throws { + let plugins = try await repository(folder: folder(installed: [ascPro])).listInstalled() + + #expect(plugins == [Plugin( + id: "ASCPro", name: "ASC Pro", version: "1.2.0", description: "Pro tools", author: "tddworks", + repositoryURL: "https://github.com/tddworks/asc-pro", categories: ["pro"], + isInstalled: true, slug: "ASCPro", uiScripts: ["ui/pro.js"] + )]) + } + + @Test func `should list an installed plugin without a manifest as version 1.0`() async throws { + let bare = InstalledPlugin(slug: "Bare", name: "Bare", uiScripts: [], version: nil, description: nil, author: nil, repositoryURL: nil, categories: nil) + + let plugins = try await repository(folder: folder(installed: [bare])).listInstalled() + + #expect(plugins == [Plugin(id: "Bare", name: "Bare", version: "1.0", isInstalled: true, slug: "Bare")]) + } + + // MARK: - marketplace + + @Test func `should mark a marketplace plugin installed when its id is an installed plugin's name as an id`() async throws { + let plugins = try await repository( + folder: folder(installed: [ascPro]), + market: [ + Plugin(id: "asc-pro", name: "ASC Pro", version: "1.3.0", downloadURL: "https://example.com/pro.zip"), + Plugin(id: "hello", name: "Hello", version: "0.1.0"), + ] + ).listAvailable() + + #expect(plugins.map(\.isInstalled) == [true, false]) + } + + @Test func `should find marketplace plugins by name, description or category, ignoring case`() async throws { + let plugins = try await repository( + folder: folder(), + market: [ + Plugin(id: "a", name: "Screenshot Studio", version: "1"), + Plugin(id: "b", name: "B", version: "1", description: "Bulk SCREENSHOT upload"), + Plugin(id: "c", name: "C", version: "1", categories: ["Screenshots"]), + Plugin(id: "d", name: "D", version: "1", description: "Reviews"), + ] + ).searchAvailable(query: "screenshot") + + #expect(plugins.map(\.id) == ["a", "b", "c"]) + } + + @Test func `should list installed plugins whose marketplace version differs`() async throws { + let updates = try await repository( + folder: folder(installed: [ascPro]), + market: [Plugin(id: "asc-pro", name: "ASC Pro", version: "1.3.0", repositoryURL: "https://github.com/tddworks/asc-pro", downloadURL: "https://example.com/pro.zip")] + ).listOutdated() + + #expect(updates == [PluginUpdate( + name: "ASC Pro", installedVersion: "1.2.0", latestVersion: "1.3.0", + repositoryURL: "https://github.com/tddworks/asc-pro", downloadURL: "https://example.com/pro.zip" + )]) + } + + // MARK: - install + + @Test func `should install a marketplace plugin from its download`() async throws { + let downloads = MockPluginDownloads() + given(downloads).download(from: .value(URL(string: "https://example.com/hello.zip")!)).willReturn(Data("zip".utf8)) + let folder = folder() + + let plugin = try await repository( + folder: folder, + market: [Plugin(id: "hello", name: "Hello", version: "0.1.0", description: "Says hi", downloadURL: "https://example.com/hello.zip")], + downloads: downloads + ).install(name: "hello") + + #expect(plugin == Plugin(id: "hello", name: "Hello", version: "0.1.0", description: "Says hi", isInstalled: true, slug: "hello")) + verify(folder).unpack(.value(Data("zip".utf8)), named: .value("hello")).called(1) + } + + @Test func `should refuse to install a plugin the marketplace does not list`() async { + do { + _ = try await repository(folder: folder()).install(name: "missing") + Issue.record("expected the plugin not to be found") + } catch PluginMarketError.pluginNotFound(let name) { + #expect(name == "missing") + } catch { + Issue.record("unexpected error \(error)") + } + } + + @Test func `should report a failed install when the download does not unpack`() async { + let downloads = MockPluginDownloads() + given(downloads).download(from: .any).willReturn(Data()) + let folder = MockPluginsFolder() + given(folder).installed().willReturn([]) + given(folder).unpack(.any, named: .any).willReturn(false) + + do { + _ = try await repository( + folder: folder, + market: [Plugin(id: "hello", name: "Hello", version: "0.1.0", downloadURL: "https://example.com/hello.zip")], + downloads: downloads + ).install(name: "hello") + Issue.record("expected the install to fail") + } catch PluginMarketError.installFailed(let name) { + #expect(name == "hello") + } catch { + Issue.record("unexpected error \(error)") + } + } + + // MARK: - uninstall + + @Test func `should uninstall the plugin named by its folder`() async throws { + let folder = folder(bundles: [PluginBundle(slug: "ASCPro", manifestName: "ASC Pro")]) + + try await repository(folder: folder).uninstall(name: "ASCPro") + + verify(folder).remove(slug: .value("ASCPro")).called(1) + } + + @Test func `should uninstall the plugin whose name, as an id, is the one given`() async throws { + let folder = folder(bundles: [ + PluginBundle(slug: "Other", manifestName: "Other"), + PluginBundle(slug: "ASCPro", manifestName: "ASC Pro"), + ]) + + try await repository(folder: folder).uninstall(name: "asc-pro") + + verify(folder).remove(slug: .value("ASCPro")).called(1) + } + + @Test func `should refuse to uninstall a plugin that is not installed`() async { + do { + try await repository(folder: folder(bundles: [PluginBundle(slug: "Other", manifestName: nil)])).uninstall(name: "asc-pro") + Issue.record("expected the plugin not to be found") + } catch PluginMarketError.pluginNotFound(let name) { + #expect(name == "asc-pro") + } catch { + Issue.record("unexpected error \(error)") + } + } + + // MARK: - update + + @Test func `should update a plugin by reinstalling the marketplace version`() async throws { + let downloads = MockPluginDownloads() + given(downloads).download(from: .any).willReturn(Data("zip".utf8)) + let folder = folder(installed: [ascPro], bundles: [PluginBundle(slug: "ASCPro", manifestName: "ASC Pro")]) + + let plugin = try await repository( + folder: folder, + market: [Plugin(id: "asc-pro", name: "ASC Pro", version: "1.3.0", downloadURL: "https://example.com/pro.zip")], + downloads: downloads + ).update(name: "ASC Pro") + + #expect(plugin.version == "1.3.0") + #expect(plugin.isInstalled == true) + verify(folder).remove(slug: .value("ASCPro")).called(1) + verify(folder).unpack(.any, named: .value("asc-pro")).called(1) + } +} diff --git a/codecov.yml b/codecov.yml index bb45a710..0815ba14 100644 --- a/codecov.yml +++ b/codecov.yml @@ -43,9 +43,6 @@ ignore: - "Sources/ASCKit/Web/**/*" - # Plugin marketplace — wraps PluginLoader (filesystem) + URLSession download + unzip - - "Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift" - # Simulator stream — HTTP server, subprocess management, AXe shell integration - "Sources/Infrastructure/Simulators/DeviceStreamServer.swift" - "Sources/Infrastructure/Simulators/AXeStreamManager.swift" diff --git a/docs/features/concept-folders/design.md b/docs/features/concept-folders/design.md index df760426..a9075554 100644 --- a/docs/features/concept-folders/design.md +++ b/docs/features/concept-folders/design.md @@ -4,7 +4,7 @@ description: The source layout reworked from layers (Domain/, Infrastructure/) t # Concept folders, not layers -**Status: steps 1–3 BUILT** (one `ASCKit` module, concept folders; docs and skills follow; one composition root, held by a test); steps 4–5 not built. asc-cli is split by layer: `Sources/Domain/` +**Status: steps 1–4 BUILT** (one `ASCKit` module, concept folders; docs and skills follow; one composition root, held by a test; every adapter's decisions tested, only the bare call in `Internal/System/`); step 5 not built. asc-cli is split by layer: `Sources/Domain/` and `Sources/Infrastructure/` are two modules that mirror each other folder for folder. Every concept therefore lives in two places, and every change to one touches both trees. The goal, stated as a test: @@ -116,7 +116,7 @@ safety net; any step that moves a rule writes its test first. | 1 | **one module, concept folders** ✓ | `Domain` + `Infrastructure` targets, `DomainTests` + `InfrastructureTests` | `git mv` into `Sources/ASCKit//` and `/Internal/`; `ScreenshotPlans` → `Screenshots/Internal/`; `Client` + infra `Shared` → `Shared/Internal/`; one `ASCKit` target, one `ASCKitTests`; `import Domain`/`Infrastructure` → `import ASCKit`; `Domain.X` → `ASCKit.X`. Library users and `examples/blitz-screenshots` change two imports to one (CHANGELOG line, `docs/library.md`) | — (move only; 787+ tests stay green) | | 2 | **docs and skills follow** ✓ | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | | 3 | **one composition root** ✓ | 22 uses of 12 `Internal/` types in 14 `ASCCommand` files outside `ClientProvider`; `RESTRoutes` wires its own `ClientFactory` | `ClientProvider` gains `makeAuthStorage`, `makeEnvironmentAuthProvider`, `makeXcodeBuildRunner`, `makeProjectConfigStorage`; commands and `RESTRoutes` ask it for the public protocol | "should build every concept's Internal implementation only in the composition root" | -| 4 | **`Internal/System/` per adapter** (one commit each) | seven untested adapters mix decisions with I/O; `codecov.yml` lists each file | each adapter's decisions become a tested value or orchestrator in `Internal/`; only the call stays, ≤100 lines, in `Internal/System/`; the per-file ignores become one `**/Internal/System/**` rule. The SDK adapters stay as they are | per adapter, its decisions: e.g. "should add the given variables on top of the inherited environment" | +| 4 | **`Internal/System/` per adapter** ✓ (one commit each) | seven untested adapters mix decisions with I/O; `codecov.yml` lists each file | each adapter's decisions become a tested value or orchestrator in `Internal/`; only the call stays, ≤100 lines, in `Internal/System/`; the per-file ignores become one `**/Internal/System/**` rule. The SDK adapters stay as they are | per adapter, its decisions: e.g. "should add the given variables on top of the inherited environment" | | 5 | **names for roles** (several PRs) | 75 `XxxRepository` protocols, `XxxProvider`s | plural collection nouns (`Apps`, `Builds`), role nouns for the rest | per rename — none; behaviour unchanged | Step 1 removes most of §1's cost on its own; 3 and 4 make the fence real; 5 is @@ -137,3 +137,8 @@ cosmetic and can wait. mount routes on it? - **`MOCKING` in release builds** — the `ASCKit` target defines it unconditionally (inherited from `Domain`), so mocks ship in `asc`. +- **`IdmsaAPIClient`'s wire** — 46% covered; its own HTTP tests miss most of + sign-in-complete and verify. Its URLProtocol tests are the right tool there: + they pin the bytes Apple expects. +- **The other iris repositories' tests** still drive a real `IrisClient` through + `URLProtocol` stubs; they can move onto `MockIrisAPI` as they are touched. From 258cf4203a2478ad0d2b770403159ced52b87bfe Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:52:16 +0800 Subject: [PATCH 13/18] refactor: name protocols for what they are, not XxxRepository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 75 repository protocols become collection nouns — the plural of the aggregate they hold (Apps, Builds, AppStoreVersions, AppScreenshots) — or role nouns where they aren't collections (IrisSignIn, TestFlight, GameCenter, Reports, AppPrices, ReviewSubmissions, *ReviewAssets). Implementations say how (SDKBuilds, SimctlSimulators, MarketplacePlugins); generated mocks, make* factories and file names follow. CLAUDE.md and the implement-feature skill state the rule. No behaviour change: 2,958 tests before and after. Step 5 of the concept-folders design. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/implement-feature/SKILL.md | 10 +- .../references/architecture-diagrams.md | 38 +-- .../references/domain-models.md | 12 +- .../references/swift-concurrency.md | 14 +- .../references/swift-observable.md | 10 +- .../references/tdd-patterns.md | 8 +- CHANGELOG.md | 2 +- CLAUDE.md | 1 + Sources/ASCCommand/ClientProvider.swift | 296 +++++++++--------- .../Commands/AgeRating/AgeRatingCommand.swift | 8 +- .../AnalyticsReportsDelete.swift | 4 +- .../AnalyticsReportsInstancesList.swift | 4 +- .../AnalyticsReportsList.swift | 4 +- .../AnalyticsReportsReportsList.swift | 4 +- .../AnalyticsReportsRequest.swift | 4 +- .../AnalyticsReportsSegmentsList.swift | 4 +- .../AppCategories/AppCategoriesCommand.swift | 8 +- ...AppClipExperienceLocalizationsCreate.swift | 4 +- ...AppClipExperienceLocalizationsDelete.swift | 4 +- .../AppClipExperienceLocalizationsList.swift | 4 +- .../AppClipExperiencesCreate.swift | 4 +- .../AppClipExperiencesDelete.swift | 4 +- .../AppClipExperiencesList.swift | 4 +- .../Commands/AppClips/AppClipsList.swift | 4 +- .../AppInfoLocalizationsCommand.swift | 16 +- .../Commands/AppInfos/AppInfosCommand.swift | 8 +- .../AppPreviewSetsCommand.swift | 8 +- .../AppPreviews/AppPreviewsCommand.swift | 8 +- .../AppShots/AppShotsGalleryTemplates.swift | 8 +- .../Commands/AppShots/AppShotsTemplates.swift | 12 +- .../Commands/AppShots/AppShotsThemes.swift | 22 +- .../Commands/AppWall/AppWallSubmit.swift | 4 +- .../ASCCommand/Commands/Apps/AppsList.swift | 4 +- .../Commands/Apps/AppsPricePointsList.swift | 4 +- .../Commands/Apps/AppsPricesSet.swift | 4 +- .../ASCCommand/Commands/Apps/AppsUpdate.swift | 4 +- .../Availability/AppAvailabilityCreate.swift | 8 +- .../Availability/AppAvailabilityGet.swift | 4 +- .../AssetLibrary/AssetImagesCommand.swift | 16 +- .../AssetLibrary/AssetLibraryCommand.swift | 8 +- .../AssetLibrary/AssetPlacementsCommand.swift | 16 +- .../AssetLibrary/AssetVideosCommand.swift | 16 +- .../BetaAppLocalizationsCreate.swift | 4 +- .../BetaAppLocalizationsDelete.swift | 4 +- .../BetaAppLocalizationsGet.swift | 4 +- .../BetaAppLocalizationsList.swift | 4 +- .../BetaAppLocalizationsUpdate.swift | 4 +- .../BetaReview/BetaReviewDetailGet.swift | 4 +- .../BetaReview/BetaReviewDetailUpdate.swift | 4 +- .../BetaReviewSubmissionsCreate.swift | 4 +- .../BetaReview/BetaReviewSubmissionsGet.swift | 4 +- .../BetaReviewSubmissionsList.swift | 4 +- .../Commands/Builds/BuildsAddBetaGroup.swift | 4 +- .../Commands/Builds/BuildsArchive.swift | 4 +- .../Commands/Builds/BuildsList.swift | 4 +- .../Commands/Builds/BuildsNextNumber.swift | 4 +- .../Builds/BuildsRemoveBetaGroup.swift | 4 +- .../BuildsSetEncryptionCompliance.swift | 4 +- .../Builds/BuildsUpdateBetaNotes.swift | 4 +- .../Commands/Builds/BuildsUpload.swift | 6 +- .../Commands/Builds/BuildsUploadsDelete.swift | 4 +- .../Commands/Builds/BuildsUploadsGet.swift | 4 +- .../Commands/Builds/BuildsUploadsList.swift | 4 +- .../Commands/BundleIDs/BundleIDsCreate.swift | 4 +- .../Commands/BundleIDs/BundleIDsDelete.swift | 4 +- .../Commands/BundleIDs/BundleIDsList.swift | 4 +- .../Certificates/CertificatesCreate.swift | 4 +- .../Certificates/CertificatesList.swift | 4 +- .../Certificates/CertificatesRevoke.swift | 4 +- .../Commands/Devices/DevicesList.swift | 4 +- .../Commands/Devices/DevicesRegister.swift | 4 +- ...perimentTreatmentLocalizationsCreate.swift | 4 +- ...perimentTreatmentLocalizationsDelete.swift | 4 +- ...ExperimentTreatmentLocalizationsList.swift | 4 +- .../ExperimentTreatmentsCreate.swift | 4 +- .../ExperimentTreatmentsDelete.swift | 4 +- .../ExperimentTreatmentsList.swift | 4 +- .../ExperimentTreatmentsUpdate.swift | 4 +- .../Experiments/ExperimentsCreate.swift | 4 +- .../Experiments/ExperimentsDelete.swift | 4 +- .../Commands/Experiments/ExperimentsGet.swift | 4 +- .../Experiments/ExperimentsList.swift | 4 +- .../Experiments/ExperimentsStart.swift | 4 +- .../Experiments/ExperimentsStop.swift | 4 +- .../Experiments/ExperimentsUpdate.swift | 4 +- .../GameCenter/GameCenterCommand.swift | 28 +- .../GameCenterModerationCommand.swift | 24 +- .../Availability/IAPAvailabilityCreate.swift | 4 +- .../IAP/Availability/IAPAvailabilityGet.swift | 4 +- .../ASCCommand/Commands/IAP/IAPCreate.swift | 4 +- .../ASCCommand/Commands/IAP/IAPDelete.swift | 4 +- Sources/ASCCommand/Commands/IAP/IAPList.swift | 4 +- .../Commands/IAP/IAPPricePointsList.swift | 4 +- .../Commands/IAP/IAPPricesSet.swift | 4 +- .../ASCCommand/Commands/IAP/IAPSubmit.swift | 4 +- .../ASCCommand/Commands/IAP/IAPUnsubmit.swift | 4 +- .../ASCCommand/Commands/IAP/IAPUpdate.swift | 4 +- .../Commands/IAP/IAPVersionsList.swift | 4 +- .../IAPEqualizationsList.swift | 4 +- .../Commands/IAPImages/IAPImagesDelete.swift | 4 +- .../Commands/IAPImages/IAPImagesList.swift | 4 +- .../Commands/IAPImages/IAPImagesUpload.swift | 4 +- .../IAPLocalizationsCreate.swift | 4 +- .../IAPLocalizationsDelete.swift | 4 +- .../IAPLocalizationsList.swift | 4 +- .../IAPLocalizationsUpdate.swift | 4 +- .../IAPOfferCodeCustomCodesCreate.swift | 4 +- .../IAPOfferCodeCustomCodesList.swift | 4 +- .../IAPOfferCodeCustomCodesUpdate.swift | 4 +- .../IAPOfferCodeOneTimeCodesCreate.swift | 4 +- .../IAPOfferCodeOneTimeCodesList.swift | 4 +- .../IAPOfferCodeOneTimeCodesUpdate.swift | 4 +- .../IAPOfferCodeOneTimeCodesValues.swift | 4 +- .../IAPOfferCodes/IAPOfferCodesCreate.swift | 4 +- .../IAPOfferCodes/IAPOfferCodesList.swift | 4 +- .../IAPOfferCodesPricesList.swift | 4 +- .../IAPOfferCodes/IAPOfferCodesUpdate.swift | 4 +- .../IAPPriceScheduleGet.swift | 4 +- .../IAPReviewScreenshotDelete.swift | 4 +- .../IAPReviewScreenshotGet.swift | 4 +- .../IAPReviewScreenshotUpload.swift | 4 +- .../Commands/Init/InitCommand.swift | 4 +- .../Commands/Iris/Auth/IrisAuthLogin.swift | 8 +- .../Commands/Iris/Auth/IrisAuthLogout.swift | 2 +- .../Iris/Auth/IrisAuthVerifyCode.swift | 8 +- .../IrisIAPSubmissionsCreate.swift | 4 +- .../IrisIAPSubmissionsDelete.swift | 4 +- .../Commands/Iris/IrisAppsCreate.swift | 4 +- .../Commands/Iris/IrisAppsList.swift | 4 +- .../IrisResolutionCenterGet.swift | 4 +- .../Performance/DiagnosticLogsCommand.swift | 4 +- .../Performance/DiagnosticsCommand.swift | 4 +- .../Performance/PerfMetricsCommand.swift | 4 +- .../Performance/PerfOverviewCommand.swift | 4 +- .../Commands/Plugins/PluginsInstall.swift | 4 +- .../Commands/Plugins/PluginsList.swift | 4 +- .../Commands/Plugins/PluginsMarket.swift | 8 +- .../Commands/Plugins/PluginsUninstall.swift | 4 +- .../Commands/Plugins/PluginsUpdate.swift | 4 +- .../Commands/Plugins/PluginsUpdates.swift | 4 +- .../Commands/Profiles/ProfilesCreate.swift | 4 +- .../Commands/Profiles/ProfilesDelete.swift | 4 +- .../Commands/Profiles/ProfilesList.swift | 4 +- .../PromotedPurchasesCreate.swift | 4 +- .../PromotedPurchasesDelete.swift | 4 +- .../PromotedPurchasesList.swift | 4 +- .../PromotedPurchasesUpdate.swift | 4 +- .../Reports/FinanceReportsDownload.swift | 4 +- .../Reports/SalesReportsDownload.swift | 4 +- .../Reports/SalesReportsSummary.swift | 4 +- .../ReviewSubmissionItemsAdd.swift | 4 +- .../ReviewSubmissionItemsList.swift | 4 +- .../ReviewSubmissionItemsRemove.swift | 4 +- .../ReviewSubmissionsCreate.swift | 4 +- .../ReviewSubmissionsGet.swift | 4 +- .../ReviewSubmissionsList.swift | 4 +- .../ReviewSubmissionsSubmit.swift | 4 +- .../Reviews/ReviewResponsesCreate.swift | 4 +- .../Reviews/ReviewResponsesDelete.swift | 4 +- .../Commands/Reviews/ReviewResponsesGet.swift | 4 +- .../Commands/Reviews/ReviewsGet.swift | 4 +- .../Commands/Reviews/ReviewsList.swift | 4 +- .../ScreenshotSetsCommand.swift | 4 +- .../ScreenshotSets/ScreenshotSetsCreate.swift | 4 +- .../ScreenshotSets/ScreenshotSetsDelete.swift | 4 +- .../Screenshots/ScreenshotsCommand.swift | 4 +- .../Screenshots/ScreenshotsDelete.swift | 4 +- .../Screenshots/ScreenshotsImport.swift | 26 +- .../Screenshots/ScreenshotsUpload.swift | 4 +- .../Commands/Simulators/SimulatorsBoot.swift | 4 +- .../Commands/Simulators/SimulatorsList.swift | 4 +- .../Simulators/SimulatorsShutdown.swift | 4 +- .../Commands/Skills/SkillUpdateChecker.swift | 2 +- .../Commands/Skills/SkillsCheck.swift | 4 +- .../Commands/Skills/SkillsInstall.swift | 4 +- .../Commands/Skills/SkillsList.swift | 4 +- .../Commands/Skills/SkillsUpdate.swift | 4 +- .../SubscriptionEqualizationsList.swift | 4 +- ...SubscriptionGroupLocalizationsCreate.swift | 4 +- ...SubscriptionGroupLocalizationsDelete.swift | 4 +- .../SubscriptionGroupLocalizationsList.swift | 4 +- ...SubscriptionGroupLocalizationsUpdate.swift | 4 +- .../SubscriptionGroupVersionsList.swift | 4 +- .../SubscriptionGroupsCreate.swift | 4 +- .../SubscriptionGroupsDelete.swift | 4 +- .../SubscriptionGroupsList.swift | 4 +- .../SubscriptionGroupsUpdate.swift | 4 +- .../SubscriptionImagesDelete.swift | 4 +- .../SubscriptionImagesList.swift | 4 +- .../SubscriptionImagesUpload.swift | 4 +- .../SubscriptionLocalizationsCreate.swift | 4 +- .../SubscriptionLocalizationsDelete.swift | 4 +- .../SubscriptionLocalizationsList.swift | 4 +- .../SubscriptionLocalizationsUpdate.swift | 4 +- ...bscriptionOfferCodeCustomCodesCreate.swift | 4 +- ...SubscriptionOfferCodeCustomCodesList.swift | 4 +- ...bscriptionOfferCodeCustomCodesUpdate.swift | 4 +- ...scriptionOfferCodeOneTimeCodesCreate.swift | 4 +- ...ubscriptionOfferCodeOneTimeCodesList.swift | 4 +- ...scriptionOfferCodeOneTimeCodesUpdate.swift | 4 +- ...scriptionOfferCodeOneTimeCodesValues.swift | 4 +- .../SubscriptionOfferCodesCreate.swift | 4 +- .../SubscriptionOfferCodesList.swift | 4 +- .../SubscriptionOfferCodesPricesList.swift | 4 +- .../SubscriptionOfferCodesUpdate.swift | 4 +- .../SubscriptionOffersCreate.swift | 4 +- .../SubscriptionOffersDelete.swift | 4 +- .../SubscriptionOffersList.swift | 4 +- .../SubscriptionPriceScheduleGet.swift | 4 +- .../SubscriptionPromotionalOffersCreate.swift | 4 +- .../SubscriptionPromotionalOffersDelete.swift | 4 +- .../SubscriptionPromotionalOffersList.swift | 4 +- ...scriptionPromotionalOffersPricesList.swift | 4 +- .../SubscriptionReviewScreenshotDelete.swift | 4 +- .../SubscriptionReviewScreenshotGet.swift | 4 +- .../SubscriptionReviewScreenshotUpload.swift | 4 +- .../SubscriptionAvailabilityCreate.swift | 4 +- .../SubscriptionAvailabilityGet.swift | 4 +- .../SubscriptionPricePointsList.swift | 4 +- .../Subscriptions/SubscriptionPricesSet.swift | 4 +- .../SubscriptionPricesSetBatch.swift | 4 +- .../SubscriptionVersionsList.swift | 4 +- .../Subscriptions/SubscriptionsCreate.swift | 4 +- .../Subscriptions/SubscriptionsDelete.swift | 4 +- .../Subscriptions/SubscriptionsList.swift | 4 +- .../Subscriptions/SubscriptionsSubmit.swift | 4 +- .../Subscriptions/SubscriptionsUnsubmit.swift | 4 +- .../Subscriptions/SubscriptionsUpdate.swift | 4 +- Sources/ASCCommand/Commands/TUI/TUIApp.swift | 16 +- .../Territories/TerritoriesList.swift | 4 +- .../TestFlight/TestFlightCommand.swift | 28 +- .../Users/UserInvitationsCancel.swift | 4 +- .../Users/UserInvitationsInvite.swift | 4 +- .../Commands/Users/UserInvitationsList.swift | 4 +- .../ASCCommand/Commands/Users/UsersList.swift | 4 +- .../Commands/Users/UsersRemove.swift | 4 +- .../Commands/Users/UsersUpdate.swift | 4 +- .../VersionLocalizationsCommand.swift | 4 +- .../VersionLocalizationsCreate.swift | 4 +- .../VersionLocalizationsUpdate.swift | 4 +- .../VersionReviewDetailCommand.swift | 8 +- .../Versions/VersionsCheckReadiness.swift | 36 +-- .../Commands/Versions/VersionsCommand.swift | 4 +- .../Commands/Versions/VersionsCreate.swift | 4 +- .../Commands/Versions/VersionsSetBuild.swift | 4 +- .../Commands/Versions/VersionsSubmit.swift | 20 +- .../Commands/Versions/VersionsUpdate.swift | 4 +- .../Web/Controllers/AgeRatingController.swift | 2 +- .../AppAvailabilityController.swift | 4 +- .../Controllers/AppCategoriesController.swift | 2 +- .../Web/Controllers/AppInfosController.swift | 2 +- .../Controllers/AppPricingController.swift | 2 +- .../Web/Controllers/AppShotsController.swift | 6 +- .../Web/Controllers/AppsController.swift | 4 +- .../Controllers/AssetLibraryController.swift | 16 +- .../BetaAppLocalizationsController.swift | 2 +- .../Web/Controllers/BuildsController.swift | 2 +- .../Controllers/CodeSigningController.swift | 8 +- .../CustomerReviewsController.swift | 2 +- .../Controllers/DiagnosticsController.swift | 2 +- .../Controllers/ExperimentsController.swift | 2 +- .../Controllers/GameCenterController.swift | 8 +- .../IAPAvailabilityController.swift | 4 +- .../Web/Controllers/IAPController.swift | 2 +- .../IAPEqualizationsController.swift | 2 +- .../IAPLocalizationsController.swift | 2 +- .../IAPOfferCodeOneTimeCodesController.swift | 2 +- .../Controllers/IAPOfferCodesController.swift | 2 +- .../IAPPricePointsController.swift | 2 +- .../IAPPriceScheduleController.swift | 2 +- .../Web/Controllers/IAPPricesController.swift | 2 +- .../Web/Controllers/IAPReviewController.swift | 2 +- .../Controllers/IAPSubmissionController.swift | 2 +- .../IrisIAPSubmissionsController.swift | 2 +- .../IrisResolutionCenterController.swift | 2 +- .../OfferCodePricesController.swift | 4 +- .../Controllers/PerfMetricsController.swift | 2 +- .../Controllers/PerfOverviewController.swift | 2 +- .../Web/Controllers/PluginsController.swift | 2 +- .../ProductVersionsController.swift | 2 +- .../PromotedPurchasesController.swift | 2 +- .../ReviewSubmissionsController.swift | 2 +- .../ScreenshotImportController.swift | 10 +- .../ScreenshotSetsController.swift | 2 +- .../Controllers/ScreenshotsController.swift | 2 +- .../Controllers/SimulatorsController.swift | 2 +- .../SubscriptionAvailabilityController.swift | 4 +- .../SubscriptionEqualizationsController.swift | 2 +- ...criptionGroupLocalizationsController.swift | 2 +- .../SubscriptionGroupsController.swift | 2 +- ...criptionIntroductoryOffersController.swift | 2 +- .../SubscriptionLocalizationsController.swift | 2 +- ...ptionOfferCodeOneTimeCodesController.swift | 2 +- .../SubscriptionOfferCodesController.swift | 2 +- .../SubscriptionPricePointsController.swift | 2 +- .../SubscriptionPriceScheduleController.swift | 2 +- .../SubscriptionPricesController.swift | 2 +- ...scriptionPromotionalOffersController.swift | 2 +- .../SubscriptionReviewController.swift | 2 +- .../SubscriptionSubmissionController.swift | 2 +- .../Controllers/SubscriptionsController.swift | 4 +- .../Controllers/TerritoriesController.swift | 2 +- .../Controllers/TestFlightController.swift | 2 +- .../VersionLocalizationsController.swift | 2 +- .../VersionSubmissionController.swift | 4 +- .../Web/Controllers/VersionsController.swift | 2 +- .../Controllers/WinBackOffersController.swift | 2 +- .../ASCCommand/Commands/Web/RESTRoutes.swift | 142 ++++----- .../WinBackOffers/WinBackOffersCreate.swift | 4 +- .../WinBackOffers/WinBackOffersDelete.swift | 4 +- .../WinBackOffers/WinBackOffersList.swift | 4 +- .../WinBackOffersPricesList.swift | 4 +- .../WinBackOffers/WinBackOffersUpdate.swift | 4 +- .../XcodeCloud/XcodeCloudCommand.swift | 20 +- ...{AppWallRepository.swift => AppWall.swift} | 2 +- ...llRepository.swift => GitHubAppWall.swift} | 4 +- ...AppClipRepository.swift => AppClips.swift} | 2 +- ...ClipRepository.swift => SDKAppClips.swift} | 2 +- ...tory.swift => AgeRatingDeclarations.swift} | 2 +- .../ASCKit/Apps/AppInfos/AppCategory.swift | 2 +- ...AppInfoRepository.swift => AppInfos.swift} | 2 +- ...y.swift => SDKAgeRatingDeclarations.swift} | 2 +- ...epository.swift => SDKAppCategories.swift} | 2 +- ...InfoRepository.swift => SDKAppInfos.swift} | 2 +- .../Apps/{AppRepository.swift => Apps.swift} | 2 +- ...yRepository.swift => AssetLibraries.swift} | 2 +- ...epository.swift => SDKLibraryImages.swift} | 2 +- ...geRepository.swift => LibraryImages.swift} | 2 +- .../Import/ScreenshotImportPlan.swift | 6 +- ...pository.swift => SDKAssetLibraries.swift} | 2 +- ...Repository.swift => AssetPlacements.swift} | 2 +- ...ository.swift => SDKAssetPlacements.swift} | 2 +- ...epository.swift => SDKLibraryVideos.swift} | 2 +- ...eoRepository.swift => LibraryVideos.swift} | 2 +- ...pository.swift => AppAvailabilities.swift} | 2 +- ...itory.swift => SDKAppAvailabilities.swift} | 2 +- ...ory.swift => BetaBuildLocalizations.swift} | 2 +- ...oadRepository.swift => BuildUploads.swift} | 2 +- .../{BuildRepository.swift => Builds.swift} | 2 +- .../Internal/OpenAPIBuildRepository.swift | 2 +- ....swift => SDKBetaBuildLocalizations.swift} | 2 +- ...Repository.swift => SDKBuildUploads.swift} | 2 +- ...mentRepository.swift => Experiments.swift} | 2 +- ...tRepository.swift => SDKExperiments.swift} | 2 +- ...wift => InAppPurchaseAvailabilities.swift} | 2 +- ...t => SDKInAppPurchaseAvailabilities.swift} | 2 +- ...sitory.swift => InAppPurchasePrices.swift} | 2 +- ...y.swift => InAppPurchaseSubmissions.swift} | 2 +- ...eRepository.swift => InAppPurchases.swift} | 2 +- ...ory.swift => SDKInAppPurchasePrices.swift} | 2 +- ...wift => SDKInAppPurchaseSubmissions.swift} | 2 +- ...pository.swift => SDKInAppPurchases.swift} | 2 +- ...swift => InAppPurchaseLocalizations.swift} | 2 +- ...ft => SDKInAppPurchaseLocalizations.swift} | 2 +- ...ry.swift => InAppPurchaseOfferCodes.swift} | 2 +- ...swift => SDKInAppPurchaseOfferCodes.swift} | 2 +- ....swift => InAppPurchaseReviewAssets.swift} | 2 +- ...ift => SDKInAppPurchaseReviewAssets.swift} | 2 +- .../Apps/Internal/OpenAPIAppRepository.swift | 2 +- ...ticsRepository.swift => Diagnostics.swift} | 2 +- ...sRepository.swift => SDKDiagnostics.swift} | 2 +- ...sRepository.swift => SDKPerfMetrics.swift} | 2 +- ...epository.swift => SDKPerfOverviews.swift} | 2 +- ...ricsRepository.swift => PerfMetrics.swift} | 2 +- ...ewRepository.swift => PerfOverviews.swift} | 2 +- ...ricingRepository.swift => AppPrices.swift} | 2 +- ...ingRepository.swift => SDKAppPrices.swift} | 2 +- ...ository.swift => SDKProductVersions.swift} | 2 +- ...Repository.swift => ProductVersions.swift} | 2 +- ...itory.swift => SDKPromotedPurchases.swift} | 2 +- ...pository.swift => PromotedPurchases.swift} | 2 +- ...Repository.swift => CustomerReviews.swift} | 2 +- ...ository.swift => SDKCustomerReviews.swift} | 2 +- ...ft => SDKSubscriptionAvailabilities.swift} | 4 +- ...swift => SubscriptionAvailabilities.swift} | 4 +- ...tory.swift => SDKSubscriptionGroups.swift} | 2 +- ...tory.swift => SDKSubscriptionPrices.swift} | 2 +- ...swift => SDKSubscriptionSubmissions.swift} | 2 +- ...epository.swift => SDKSubscriptions.swift} | 2 +- ...> SDKSubscriptionIntroductoryOffers.swift} | 2 +- ...t => SubscriptionIntroductoryOffers.swift} | 2 +- ...> SDKSubscriptionGroupLocalizations.swift} | 2 +- ...ift => SDKSubscriptionLocalizations.swift} | 2 +- ...t => SubscriptionGroupLocalizations.swift} | 2 +- ....swift => SubscriptionLocalizations.swift} | 2 +- ....swift => SDKSubscriptionOfferCodes.swift} | 2 +- ...ory.swift => SubscriptionOfferCodes.swift} | 2 +- ...=> SDKSubscriptionPromotionalOffers.swift} | 2 +- ...ft => SubscriptionPromotionalOffers.swift} | 2 +- ...wift => SDKSubscriptionReviewAssets.swift} | 2 +- ...y.swift => SubscriptionReviewAssets.swift} | 2 +- ...ository.swift => SubscriptionGroups.swift} | 2 +- ...ository.swift => SubscriptionPrices.swift} | 2 +- ...ry.swift => SubscriptionSubmissions.swift} | 2 +- ...onRepository.swift => Subscriptions.swift} | 2 +- ...epository.swift => SDKWinBackOffers.swift} | 2 +- ...erRepository.swift => WinBackOffers.swift} | 2 +- ...itory.swift => BetaAppLocalizations.swift} | 2 +- ...wRepository.swift => BetaAppReviews.swift} | 2 +- .../OpenAPITestFlightRepository.swift | 2 +- ...ry.swift => SDKBetaAppLocalizations.swift} | 2 +- ...pository.swift => SDKBetaAppReviews.swift} | 2 +- ...lightRepository.swift => TestFlight.swift} | 2 +- ...epository.swift => AppStoreVersions.swift} | 2 +- ...sitory.swift => SDKAppStoreVersions.swift} | 2 +- ...epository.swift => SDKReviewDetails.swift} | 2 +- ...ry.swift => SDKVersionLocalizations.swift} | 2 +- ...viewRepository.swift => AppPreviews.swift} | 2 +- ...ository.swift => OpenAPIAppPreviews.swift} | 2 +- .../ScreenshotSets/AppScreenshotSet.swift | 4 +- ...tRepository.swift => AppScreenshots.swift} | 2 +- .../OpenAPIScreenshotRepository.swift | 2 +- ...itory.swift => VersionLocalizations.swift} | 2 +- ...ilRepository.swift => ReviewDetails.swift} | 2 +- ...ionRepository.swift => IrisSessions.swift} | 4 +- ...sAuthRepository.swift => IrisSignIn.swift} | 4 +- ...ndleIDRepository.swift => BundleIDs.swift} | 2 +- ...ateRepository.swift => Certificates.swift} | 2 +- .../{DeviceRepository.swift => Devices.swift} | 2 +- ...eIDRepository.swift => SDKBundleIDs.swift} | 2 +- ...Repository.swift => SDKCertificates.swift} | 2 +- ...eviceRepository.swift => SDKDevices.swift} | 2 +- ...fileRepository.swift => SDKProfiles.swift} | 2 +- ...ProfileRepository.swift => Profiles.swift} | 2 +- ...enterRepository.swift => GameCenter.swift} | 2 +- ...erRepository.swift => SDKGameCenter.swift} | 2 +- ...itory.swift => GameCenterModeration.swift} | 2 +- ...ry.swift => SDKGameCenterModeration.swift} | 2 +- ...pository.swift => IrisSDKAppBundles.swift} | 4 +- ...eRepository.swift => IrisAppBundles.swift} | 2 +- ...swift => IrisSDKInAppPurchaseStates.swift} | 4 +- ... => IrisSDKInAppPurchaseSubmissions.swift} | 6 +- ...ry.swift => IrisInAppPurchaseStates.swift} | 4 +- ...ift => IrisInAppPurchaseSubmissions.swift} | 4 +- ...epository.swift => FileIrisSessions.swift} | 4 +- ...DKRepository.swift => IrisSDKSignIn.swift} | 4 +- .../Auth/StoredSRPIrisCookieProvider.swift | 4 +- ...ry.swift => IrisSDKResolutionCenter.swift} | 4 +- ...itory.swift => IrisResolutionCenter.swift} | 4 +- ...ository.swift => MarketplacePlugins.swift} | 2 +- .../Internal/System/LocalPluginsFolder.swift | 2 +- Sources/ASCKit/Plugins/PluginUpdate.swift | 2 +- .../{PluginRepository.swift => Plugins.swift} | 2 +- ...epository.swift => AnalyticsReports.swift} | 2 +- ...sitory.swift => SDKAnalyticsReports.swift} | 2 +- ...eportRepository.swift => SDKReports.swift} | 2 +- .../{ReportRepository.swift => Reports.swift} | 2 +- ...epository.swift => GalleryTemplates.swift} | 2 +- ....swift => AggregateGalleryTemplates.swift} | 4 +- ...ository.swift => AggregateTemplates.swift} | 6 +- ...Repository.swift => AggregateThemes.swift} | 6 +- Sources/ASCKit/Screenshots/ScreenTheme.swift | 4 +- ...mplateRepository.swift => Templates.swift} | 2 +- .../Shared/Internal/ClientFactory.swift | 274 ++++++++-------- ...epository.swift => SimctlSimulators.swift} | 2 +- ...latorRepository.swift => Simulators.swift} | 2 +- ...llRepository.swift => ProcessSkills.swift} | 2 +- .../{SkillRepository.swift => Skills.swift} | 2 +- ...y.swift => OpenAPIReviewSubmissions.swift} | 2 +- ...pository.swift => ReviewSubmissions.swift} | 2 +- .../ASCKit/Submissions/SubmissionPlan.swift | 18 +- ...yRepository.swift => SDKTerritories.swift} | 2 +- ...toryRepository.swift => Territories.swift} | 2 +- ...SDKUserRepository.swift => SDKUsers.swift} | 2 +- .../{UserRepository.swift => Users.swift} | 2 +- ...ory.swift => SDKXcodeCloudBuildRuns.swift} | 2 +- ...tory.swift => SDKXcodeCloudProducts.swift} | 2 +- ...ory.swift => SDKXcodeCloudWorkflows.swift} | 2 +- ...sitory.swift => XcodeCloudBuildRuns.swift} | 2 +- ...ository.swift => XcodeCloudProducts.swift} | 2 +- ...sitory.swift => XcodeCloudWorkflows.swift} | 2 +- .../AgeRating/AgeRatingGetTests.swift | 4 +- .../AgeRating/AgeRatingUpdateTests.swift | 10 +- .../AnalyticsReportsTests.swift | 12 +- .../AppCategoriesListTests.swift | 4 +- .../AppClipExperienceLocalizationsTests.swift | 10 +- .../AppClipExperiencesTests.swift | 12 +- .../Commands/AppClips/AppClipsListTests.swift | 6 +- .../AppInfoLocalizationsCreateTests.swift | 4 +- .../AppInfoLocalizationsDeleteTests.swift | 2 +- .../AppInfoLocalizationsListTests.swift | 2 +- .../AppInfoLocalizationsUpdateTests.swift | 4 +- .../Commands/AppInfos/AppInfosListTests.swift | 2 +- .../AppInfos/AppInfosUpdateTests.swift | 4 +- .../AppPreviewSetsCommandTests.swift | 12 +- .../AppPreviews/AppPreviewsCommandTests.swift | 12 +- .../AppShotsGalleryTemplatesTests.swift | 10 +- .../AppShots/AppShotsTemplatesTests.swift | 16 +- .../AppShots/AppShotsThemesTests.swift | 30 +- .../Commands/AppWall/AppWallSubmitTests.swift | 12 +- .../Apps/AppPricingCommandsTests.swift | 6 +- .../Commands/Apps/AppsListTests.swift | 4 +- .../Commands/Apps/AppsUpdateTests.swift | 2 +- .../AppAvailabilityCreateTests.swift | 12 +- .../AppAvailabilityGetTests.swift | 4 +- .../AssetImagesCommandTests.swift | 14 +- .../AssetLibraryCommandTests.swift | 4 +- .../AssetPlacementsCommandTests.swift | 22 +- .../AssetVideosCommandTests.swift | 8 +- .../BetaAppLocalizationsCreateTests.swift | 2 +- .../BetaAppLocalizationsDeleteTests.swift | 2 +- .../BetaAppLocalizationsGetTests.swift | 2 +- .../BetaAppLocalizationsListTests.swift | 2 +- .../BetaAppLocalizationsUpdateTests.swift | 2 +- .../BetaReview/BetaReviewDetailGetTests.swift | 4 +- .../BetaReviewDetailUpdateTests.swift | 2 +- .../BetaReviewSubmissionsCreateTests.swift | 2 +- .../BetaReviewSubmissionsGetTests.swift | 2 +- .../BetaReviewSubmissionsListTests.swift | 4 +- .../Builds/BuildsAddBetaGroupTests.swift | 2 +- .../Commands/Builds/BuildsArchiveTests.swift | 2 +- .../Commands/Builds/BuildsListTests.swift | 10 +- .../Builds/BuildsNextNumberTests.swift | 6 +- .../Builds/BuildsRemoveBetaGroupTests.swift | 2 +- .../BuildsSetEncryptionComplianceTests.swift | 4 +- .../Builds/BuildsUpdateBetaNotesTests.swift | 4 +- .../Commands/Builds/BuildsUploadTests.swift | 16 +- .../Builds/BuildsUploadsDeleteTests.swift | 2 +- .../Builds/BuildsUploadsGetTests.swift | 4 +- .../Builds/BuildsUploadsListTests.swift | 4 +- .../BundleIDs/BundleIDsCreateTests.swift | 6 +- .../BundleIDs/BundleIDsDeleteTests.swift | 2 +- .../BundleIDs/BundleIDsListTests.swift | 6 +- .../CertificatesCreateTests.swift | 8 +- .../Certificates/CertificatesListTests.swift | 14 +- .../CertificatesRevokeTests.swift | 2 +- .../Commands/Devices/DevicesListTests.swift | 4 +- .../Devices/DevicesRegisterTests.swift | 6 +- ...xperimentTreatmentLocalizationsTests.swift | 6 +- .../ExperimentTreatmentsTests.swift | 10 +- .../Experiments/ExperimentsTests.swift | 28 +- .../GameCenter/GameCenterCommandTests.swift | 24 +- .../GameCenterModerationCommandTests.swift | 14 +- .../IAPAvailabilityCreateTests.swift | 2 +- .../IAPAvailabilityGetTests.swift | 2 +- .../Commands/IAP/IAPCreateTests.swift | 4 +- .../Commands/IAP/IAPDeleteTests.swift | 2 +- .../Commands/IAP/IAPListTests.swift | 6 +- .../IAP/IAPPricePointsListTests.swift | 4 +- .../Commands/IAP/IAPPricesSetTests.swift | 2 +- .../Commands/IAP/IAPSubmitTests.swift | 2 +- .../Commands/IAP/IAPUnsubmitTests.swift | 2 +- .../Commands/IAP/IAPUpdateTests.swift | 6 +- .../Commands/IAP/IAPVersionsListTests.swift | 2 +- .../IAPLocalizationsCreateTests.swift | 4 +- .../IAPLocalizationsDeleteTests.swift | 2 +- .../IAPLocalizationsListTests.swift | 4 +- .../IAPLocalizationsUpdateTests.swift | 4 +- .../IAPOfferCodeCustomCodesCreateTests.swift | 2 +- .../IAPOfferCodeCustomCodesListTests.swift | 4 +- .../IAPOfferCodeCustomCodesUpdateTests.swift | 4 +- .../IAPOfferCodeOneTimeCodesCreateTests.swift | 6 +- .../IAPOfferCodeOneTimeCodesListTests.swift | 4 +- .../IAPOfferCodeOneTimeCodesUpdateTests.swift | 4 +- .../IAPOfferCodeOneTimeCodesValuesTests.swift | 2 +- .../IAPOfferCodesCreateTests.swift | 10 +- .../IAPOfferCodesListTests.swift | 4 +- .../IAPOfferCodesPricesListTests.swift | 2 +- .../IAPOfferCodesUpdateTests.swift | 4 +- .../IAPReviewScreenshotTests.swift | 10 +- .../Commands/Init/InitCommandTests.swift | 16 +- .../IrisIAPSubmissionsCreateTests.swift | 4 +- .../IrisIAPSubmissionsDeleteTests.swift | 2 +- .../Commands/Iris/IrisAppsCreateTests.swift | 2 +- .../Commands/Iris/IrisAppsListTests.swift | 2 +- .../IrisResolutionCenterGetTests.swift | 6 +- .../Performance/DiagnosticLogsListTests.swift | 2 +- .../Performance/DiagnosticsListTests.swift | 4 +- .../Performance/PerfMetricsListTests.swift | 6 +- .../Performance/PerfOverviewGetTests.swift | 4 +- .../Commands/Plugins/PluginsListTests.swift | 4 +- .../Commands/Plugins/PluginsMarketTests.swift | 6 +- .../Commands/Plugins/PluginsUpdateTests.swift | 2 +- .../Plugins/PluginsUpdatesTests.swift | 4 +- .../Profiles/ProfilesCreateTests.swift | 6 +- .../Profiles/ProfilesDeleteTests.swift | 2 +- .../Commands/Profiles/ProfilesListTests.swift | 6 +- .../PromotedPurchasesTests.swift | 14 +- .../Reports/FinanceReportsDownloadTests.swift | 8 +- .../Reports/SalesReportsDownloadTests.swift | 16 +- .../Reports/SalesReportsSummaryTests.swift | 6 +- .../ReviewSubmissionItemsListTests.swift | 4 +- .../ReviewSubmissionsBuildTests.swift | 18 +- .../ReviewSubmissionsGetTests.swift | 2 +- .../ReviewSubmissionsListTests.swift | 10 +- .../Reviews/ReviewResponsesCreateTests.swift | 2 +- .../Reviews/ReviewResponsesDeleteTests.swift | 2 +- .../Reviews/ReviewResponsesGetTests.swift | 2 +- .../Commands/Reviews/ReviewsGetTests.swift | 2 +- .../Commands/Reviews/ReviewsListTests.swift | 2 +- .../ScreenshotSetsCreateTests.swift | 6 +- .../ScreenshotSetsDeleteTests.swift | 4 +- .../ScreenshotSetsListTests.swift | 2 +- .../Screenshots/ScreenshotsDeleteTests.swift | 4 +- .../Screenshots/ScreenshotsImportTests.swift | 24 +- .../ScreenshotsImportToLibraryTests.swift | 10 +- .../Screenshots/ScreenshotsListTests.swift | 6 +- .../Screenshots/ScreenshotsUploadTests.swift | 4 +- .../Simulators/SimulatorsBootTests.swift | 2 +- .../Simulators/SimulatorsListTests.swift | 12 +- .../Simulators/SimulatorsShutdownTests.swift | 2 +- .../Skills/SkillUpdateCheckerTests.swift | 14 +- .../Commands/Skills/SkillsCheckTests.swift | 6 +- .../Commands/Skills/SkillsInstallTests.swift | 6 +- .../Commands/Skills/SkillsListTests.swift | 2 +- .../Commands/Skills/SkillsUpdateTests.swift | 2 +- .../SubscriptionGroupLocalizationsTests.swift | 8 +- .../SubscriptionGroupVersionsListTests.swift | 2 +- .../SubscriptionGroupsCreateTests.swift | 2 +- .../SubscriptionGroupsDeleteTests.swift | 2 +- .../SubscriptionGroupsListTests.swift | 2 +- .../SubscriptionGroupsUpdateTests.swift | 2 +- ...SubscriptionLocalizationsCreateTests.swift | 4 +- ...SubscriptionLocalizationsDeleteTests.swift | 2 +- .../SubscriptionLocalizationsListTests.swift | 2 +- ...SubscriptionLocalizationsUpdateTests.swift | 2 +- ...ptionOfferCodeCustomCodesCreateTests.swift | 2 +- ...riptionOfferCodeCustomCodesListTests.swift | 4 +- ...ptionOfferCodeCustomCodesUpdateTests.swift | 4 +- ...tionOfferCodeOneTimeCodesCreateTests.swift | 6 +- ...iptionOfferCodeOneTimeCodesListTests.swift | 4 +- ...tionOfferCodeOneTimeCodesUpdateTests.swift | 4 +- ...tionOfferCodeOneTimeCodesValuesTests.swift | 2 +- .../SubscriptionOfferCodesCreateTests.swift | 14 +- .../SubscriptionOfferCodesListTests.swift | 4 +- ...ubscriptionOfferCodesPricesListTests.swift | 2 +- .../SubscriptionOfferCodesUpdateTests.swift | 4 +- .../SubscriptionOffersCreateTests.swift | 12 +- .../SubscriptionOffersDeleteTests.swift | 2 +- .../SubscriptionOffersListTests.swift | 4 +- .../SubscriptionPromotionalOffersTests.swift | 10 +- .../SubscriptionReviewScreenshotTests.swift | 4 +- .../SubscriptionAvailabilityCreateTests.swift | 2 +- .../SubscriptionAvailabilityGetTests.swift | 2 +- .../SubscriptionPricePointsListTests.swift | 4 +- .../SubscriptionPricesSetTests.swift | 4 +- .../SubscriptionVersionsListTests.swift | 2 +- .../SubscriptionsCreateTests.swift | 4 +- .../SubscriptionsDeleteTests.swift | 2 +- .../SubscriptionsListTests.swift | 8 +- .../SubscriptionsSubmitTests.swift | 2 +- .../SubscriptionsUnsubmitTests.swift | 2 +- .../SubscriptionsUpdateTests.swift | 10 +- .../Territories/TerritoriesListTests.swift | 2 +- .../TestFlight/TestFlightCommandTests.swift | 22 +- .../Users/UserInvitationsCancelTests.swift | 2 +- .../Users/UserInvitationsInviteTests.swift | 8 +- .../Users/UserInvitationsListTests.swift | 2 +- .../Commands/Users/UsersListTests.swift | 6 +- .../Commands/Users/UsersRemoveTests.swift | 2 +- .../Commands/Users/UsersUpdateTests.swift | 6 +- .../VersionLocalizationsCreateTests.swift | 4 +- .../VersionLocalizationsListTests.swift | 2 +- .../VersionLocalizationsUpdateTests.swift | 4 +- .../VersionReviewDetailTests.swift | 6 +- .../VersionsCheckReadinessTests.swift | 110 +++---- .../Versions/VersionsCreateTests.swift | 4 +- .../Commands/Versions/VersionsListTests.swift | 2 +- .../Versions/VersionsSetBuildTests.swift | 2 +- .../Versions/VersionsSubmitTests.swift | 22 +- .../Versions/VersionsUpdateTests.swift | 8 +- .../Web/AppShotsControllerTests.swift | 4 +- .../Commands/Web/AppsControllerTests.swift | 12 +- .../Web/AssetLibraryControllerTests.swift | 14 +- .../Controllers/AgeRatingRoutesTests.swift | 2 +- ...ustomProductPagePlacementRoutesTests.swift | 10 +- .../ScreenshotDeleteRoutesTests.swift | 4 +- .../Web/GameCenterControllerTests.swift | 14 +- .../Commands/Web/RESTRoutesTests.swift | 188 +++++------ .../Web/SubscriptionsControllerTests.swift | 4 +- .../WinBackOffers/WinBackOffersTests.swift | 12 +- .../XcodeCloud/XcodeCloudCommandTests.swift | 14 +- ...ryTests.swift => GitHubAppWallTests.swift} | 8 +- ...toryTests.swift => SDKAppClipsTests.swift} | 18 +- ...ft => SDKAgeRatingDeclarationsTests.swift} | 26 +- ...ests.swift => SDKAppCategoriesTests.swift} | 12 +- ...toryTests.swift => SDKAppInfosTests.swift} | 26 +- ...pRepositoryTests.swift => AppsTests.swift} | 12 +- ...ests.swift => SDKLibraryImagesTests.swift} | 6 +- .../Import/ScreenshotImportExecuteTests.swift | 4 +- ...sts.swift => SDKAssetLibrariesTests.swift} | 12 +- ...ts.swift => SDKAssetPlacementsTests.swift} | 26 +- ...ests.swift => SDKLibraryVideosTests.swift} | 6 +- ....swift => SDKAppAvailabilitiesTests.swift} | 14 +- ...t => SDKBetaBuildLocalizationsTests.swift} | 8 +- .../SDKBuildUploadRepositoryUploadTests.swift | 6 +- ...Tests.swift => SDKBuildUploadsTests.swift} | 16 +- ...sitoryTests.swift => SDKBuildsTests.swift} | 24 +- ...yTests.swift => SDKExperimentsTests.swift} | 36 +-- ...SDKInAppPurchaseAvailabilitiesTests.swift} | 12 +- ... SDKInAppPurchaseLocalizationsTests.swift} | 16 +- ...wift => SDKInAppPurchasePricesTests.swift} | 24 +- ...=> SDKInAppPurchaseSubmissionsTests.swift} | 6 +- ...sts.swift => SDKInAppPurchasesTests.swift} | 38 +-- ... => SDKInAppPurchaseOfferCodesTests.swift} | 34 +- ...> SDKInAppPurchaseReviewAssetsTests.swift} | 16 +- ...positoryTests.swift => SDKAppsTests.swift} | 10 +- ...yTests.swift => SDKDiagnosticsTests.swift} | 28 +- ...yTests.swift => SDKPerfMetricsTests.swift} | 30 +- ...ests.swift => SDKPerfOverviewsTests.swift} | 6 +- ...oryTests.swift => SDKAppPricesTests.swift} | 10 +- ...ts.swift => SDKProductVersionsTests.swift} | 10 +- ....swift => SDKPromotedPurchasesTests.swift} | 14 +- ...ts.swift => SDKCustomerReviewsTests.swift} | 20 +- ... SDKSubscriptionAvailabilitiesTests.swift} | 12 +- ...SubscriptionGroupLocalizationsTests.swift} | 12 +- ...swift => SDKSubscriptionGroupsTests.swift} | 12 +- ...> SDKSubscriptionLocalizationsTests.swift} | 16 +- ...swift => SDKSubscriptionPricesTests.swift} | 20 +- ...KSubscriptionPromotionalOffersTests.swift} | 16 +- ... => SDKSubscriptionSubmissionsTests.swift} | 6 +- ...ests.swift => SDKSubscriptionsTests.swift} | 30 +- ...ests.swift => SDKWinBackOffersTests.swift} | 18 +- ...SubscriptionIntroductoryOffersTests.swift} | 12 +- ...t => SDKSubscriptionOfferCodesTests.swift} | 34 +- ...=> SDKSubscriptionReviewAssetsTests.swift} | 10 +- ...scriptionReviewRepositoryUploadTests.swift | 4 +- ...ift => SDKBetaAppLocalizationsTests.swift} | 12 +- ...sts.swift => SDKBetaAppReviewsTests.swift} | 14 +- ...ryTests.swift => SDKTestFlightTests.swift} | 18 +- ...ests.swift => AppStoreVersionsTests.swift} | 6 +- ...s.swift => SDKAppStoreVersionsTests.swift} | 16 +- ...ests.swift => SDKReviewDetailsTests.swift} | 12 +- .../SDKVersionRepositoryCreateTests.swift | 8 +- ...ift => SDKVersionLocalizationsTests.swift} | 12 +- ...ts.swift => OpenAPIAppPreviewsTests.swift} | 16 +- .../OpenAPIPreviewRepositoryUploadTests.swift | 6 +- .../AppScreenshotSetTests.swift | 10 +- ...yTests.swift => AppScreenshotsTests.swift} | 8 +- ...sts.swift => SDKAppScreenshotsTests.swift} | 16 +- .../SDKScreenshotRepositoryCreateTests.swift | 6 +- .../SDKScreenshotRepositoryUploadTests.swift | 6 +- ....swift => VersionLocalizationsTests.swift} | 12 +- ...oryTests.swift => SDKBundleIDsTests.swift} | 10 +- ...Tests.swift => SDKCertificatesTests.swift} | 8 +- ...itoryTests.swift => SDKDevicesTests.swift} | 8 +- ...toryTests.swift => SDKProfilesTests.swift} | 14 +- ...ryTests.swift => SDKGameCenterTests.swift} | 18 +- ...ift => SDKGameCenterModerationTests.swift} | 22 +- ...sts.swift => IrisSDKAppBundlesTests.swift} | 8 +- ... => IrisSDKInAppPurchaseStatesTests.swift} | 10 +- ...risSDKInAppPurchaseSubmissionsTests.swift} | 10 +- ...ests.swift => FileIrisSessionsTests.swift} | 10 +- ...ryTests.swift => IrisSDKSignInTests.swift} | 20 +- .../Internal/Auth/OlympusClientTests.swift | 2 +- .../StoredSRPIrisCookieProviderTests.swift | 8 +- .../Internal/IrisResponseDecodingTests.swift | 10 +- ...ift => IrisSDKResolutionCenterTests.swift} | 6 +- ...ts.swift => MarketplacePluginsTests.swift} | 6 +- ...s.swift => SDKAnalyticsReportsTests.swift} | 14 +- ...itoryTests.swift => SDKReportsTests.swift} | 8 +- ...ests.swift => GalleryTemplatesTests.swift} | 10 +- ...t => AggregateGalleryTemplatesTests.swift} | 16 +- ...ts.swift => AggregateTemplatesTests.swift} | 14 +- ...Tests.swift => AggregateThemesTests.swift} | 18 +- ...ests.swift => SimctlSimulatorsTests.swift} | 24 +- ...ryTests.swift => ProcessSkillsTests.swift} | 20 +- .../SDKSubmissionRepositoryTests.swift | 44 +-- .../Submissions/SubmissionPlannerTests.swift | 12 +- ...yTests.swift => SDKTerritoriesTests.swift} | 6 +- .../TestHelpers/MockRepositoryFactory.swift | 2 +- ...ositoryTests.swift => SDKUsersTests.swift} | 20 +- ...wift => SDKXcodeCloudBuildRunsTests.swift} | 12 +- ...swift => SDKXcodeCloudProductsTests.swift} | 8 +- ...wift => SDKXcodeCloudWorkflowsTests.swift} | 6 +- docs/documentation-design/layout.md | 2 +- docs/features/app-shots-themes/authoring.md | 4 +- docs/features/concept-folders/design.md | 12 +- docs/features/iap-subscriptions/pricing.md | 2 +- .../iap-subscriptions/review-assets.md | 2 +- .../submission-iris-parity.md | 12 +- .../iap-subscriptions/win-back-offers.md | 2 +- docs/features/iris/iris-srp-login.md | 20 +- docs/features/screenshot-editor/design.md | 10 +- docs/library.md | 4 +- 775 files changed, 2742 insertions(+), 2739 deletions(-) rename Sources/ASCKit/AppWall/{AppWallRepository.swift => AppWall.swift} (84%) rename Sources/ASCKit/AppWall/Internal/{GitHubAppWallRepository.swift => GitHubAppWall.swift} (99%) rename Sources/ASCKit/Apps/AppClips/{AppClipRepository.swift => AppClips.swift} (93%) rename Sources/ASCKit/Apps/AppClips/Internal/{SDKAppClipRepository.swift => SDKAppClips.swift} (98%) rename Sources/ASCKit/Apps/AppInfos/{AgeRatingDeclarationRepository.swift => AgeRatingDeclarations.swift} (78%) rename Sources/ASCKit/Apps/AppInfos/{AppInfoRepository.swift => AppInfos.swift} (94%) rename Sources/ASCKit/Apps/AppInfos/Internal/{SDKAgeRatingDeclarationRepository.swift => SDKAgeRatingDeclarations.swift} (98%) rename Sources/ASCKit/Apps/AppInfos/Internal/{SDKAppCategoryRepository.swift => SDKAppCategories.swift} (95%) rename Sources/ASCKit/Apps/AppInfos/Internal/{SDKAppInfoRepository.swift => SDKAppInfos.swift} (98%) rename Sources/ASCKit/Apps/{AppRepository.swift => Apps.swift} (88%) rename Sources/ASCKit/Apps/AssetLibrary/{AssetLibraryRepository.swift => AssetLibraries.swift} (87%) rename Sources/ASCKit/Apps/AssetLibrary/Images/Internal/{SDKLibraryImageRepository.swift => SDKLibraryImages.swift} (98%) rename Sources/ASCKit/Apps/AssetLibrary/Images/{LibraryImageRepository.swift => LibraryImages.swift} (93%) rename Sources/ASCKit/Apps/AssetLibrary/Internal/{SDKAssetLibraryRepository.swift => SDKAssetLibraries.swift} (97%) rename Sources/ASCKit/Apps/AssetLibrary/Placements/{AssetPlacementRepository.swift => AssetPlacements.swift} (94%) rename Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/{SDKAssetPlacementRepository.swift => SDKAssetPlacements.swift} (99%) rename Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/{SDKLibraryVideoRepository.swift => SDKLibraryVideos.swift} (98%) rename Sources/ASCKit/Apps/AssetLibrary/Videos/{LibraryVideoRepository.swift => LibraryVideos.swift} (93%) rename Sources/ASCKit/Apps/Availability/{AppAvailabilityRepository.swift => AppAvailabilities.swift} (88%) rename Sources/ASCKit/Apps/Availability/Internal/{SDKAppAvailabilityRepository.swift => SDKAppAvailabilities.swift} (98%) rename Sources/ASCKit/Apps/Builds/{BetaBuildLocalizationRepository.swift => BetaBuildLocalizations.swift} (80%) rename Sources/ASCKit/Apps/Builds/{BuildUploadRepository.swift => BuildUploads.swift} (88%) rename Sources/ASCKit/Apps/Builds/{BuildRepository.swift => Builds.swift} (93%) rename Sources/ASCKit/Apps/Builds/Internal/{SDKBetaBuildLocalizationRepository.swift => SDKBetaBuildLocalizations.swift} (95%) rename Sources/ASCKit/Apps/Builds/Internal/{SDKBuildUploadRepository.swift => SDKBuildUploads.swift} (98%) rename Sources/ASCKit/Apps/Experiments/{ExperimentRepository.swift => Experiments.swift} (96%) rename Sources/ASCKit/Apps/Experiments/Internal/{SDKExperimentRepository.swift => SDKExperiments.swift} (99%) rename Sources/ASCKit/Apps/InAppPurchases/Availability/{InAppPurchaseAvailabilityRepository.swift => InAppPurchaseAvailabilities.swift} (87%) rename Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/{SDKInAppPurchaseAvailabilityRepository.swift => SDKInAppPurchaseAvailabilities.swift} (96%) rename Sources/ASCKit/Apps/InAppPurchases/{InAppPurchasePriceRepository.swift => InAppPurchasePrices.swift} (94%) rename Sources/ASCKit/Apps/InAppPurchases/{InAppPurchaseSubmissionRepository.swift => InAppPurchaseSubmissions.swift} (73%) rename Sources/ASCKit/Apps/InAppPurchases/{InAppPurchaseRepository.swift => InAppPurchases.swift} (91%) rename Sources/ASCKit/Apps/InAppPurchases/Internal/{SDKInAppPurchasePriceRepository.swift => SDKInAppPurchasePrices.swift} (99%) rename Sources/ASCKit/Apps/InAppPurchases/Internal/{SDKInAppPurchaseSubmissionRepository.swift => SDKInAppPurchaseSubmissions.swift} (91%) rename Sources/ASCKit/Apps/InAppPurchases/Internal/{SDKInAppPurchaseRepository.swift => SDKInAppPurchases.swift} (98%) rename Sources/ASCKit/Apps/InAppPurchases/Localizations/{InAppPurchaseLocalizationRepository.swift => InAppPurchaseLocalizations.swift} (88%) rename Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/{SDKInAppPurchaseLocalizationRepository.swift => SDKInAppPurchaseLocalizations.swift} (96%) rename Sources/ASCKit/Apps/InAppPurchases/OfferCodes/{InAppPurchaseOfferCodeRepository.swift => InAppPurchaseOfferCodes.swift} (96%) rename Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/{SDKInAppPurchaseOfferCodeRepository.swift => SDKInAppPurchaseOfferCodes.swift} (99%) rename Sources/ASCKit/Apps/InAppPurchases/Review/{InAppPurchaseReviewRepository.swift => InAppPurchaseReviewAssets.swift} (90%) rename Sources/ASCKit/Apps/InAppPurchases/Review/Internal/{SDKInAppPurchaseReviewRepository.swift => SDKInAppPurchaseReviewAssets.swift} (99%) rename Sources/ASCKit/Apps/Performance/{DiagnosticsRepository.swift => Diagnostics.swift} (81%) rename Sources/ASCKit/Apps/Performance/Internal/{SDKDiagnosticsRepository.swift => SDKDiagnostics.swift} (98%) rename Sources/ASCKit/Apps/Performance/Internal/{SDKPerfMetricsRepository.swift => SDKPerfMetrics.swift} (98%) rename Sources/ASCKit/Apps/Performance/Internal/{SDKPerfOverviewRepository.swift => SDKPerfOverviews.swift} (97%) rename Sources/ASCKit/Apps/Performance/{PerfMetricsRepository.swift => PerfMetrics.swift} (84%) rename Sources/ASCKit/Apps/Performance/{PerfOverviewRepository.swift => PerfOverviews.swift} (70%) rename Sources/ASCKit/Apps/Pricing/{PricingRepository.swift => AppPrices.swift} (90%) rename Sources/ASCKit/Apps/Pricing/Internal/{SDKPricingRepository.swift => SDKAppPrices.swift} (96%) rename Sources/ASCKit/Apps/ProductVersions/Internal/{SDKProductVersionRepository.swift => SDKProductVersions.swift} (96%) rename Sources/ASCKit/Apps/ProductVersions/{ProductVersionRepository.swift => ProductVersions.swift} (84%) rename Sources/ASCKit/Apps/PromotedPurchases/Internal/{SDKPromotedPurchaseRepository.swift => SDKPromotedPurchases.swift} (97%) rename Sources/ASCKit/Apps/PromotedPurchases/{PromotedPurchaseRepository.swift => PromotedPurchases.swift} (91%) rename Sources/ASCKit/Apps/Reviews/{CustomerReviewRepository.swift => CustomerReviews.swift} (88%) rename Sources/ASCKit/Apps/Reviews/Internal/{SDKCustomerReviewRepository.swift => SDKCustomerReviews.swift} (97%) rename Sources/ASCKit/Apps/Subscriptions/Availability/Internal/{SDKSubscriptionAvailabilityRepository.swift => SDKSubscriptionAvailabilities.swift} (95%) rename Sources/ASCKit/Apps/Subscriptions/Availability/{SubscriptionAvailabilityRepository.swift => SubscriptionAvailabilities.swift} (71%) rename Sources/ASCKit/Apps/Subscriptions/Internal/{SDKSubscriptionGroupRepository.swift => SDKSubscriptionGroups.swift} (95%) rename Sources/ASCKit/Apps/Subscriptions/Internal/{SDKSubscriptionPriceRepository.swift => SDKSubscriptionPrices.swift} (98%) rename Sources/ASCKit/Apps/Subscriptions/Internal/{SDKSubscriptionSubmissionRepository.swift => SDKSubscriptionSubmissions.swift} (91%) rename Sources/ASCKit/Apps/Subscriptions/Internal/{SDKSubscriptionRepository.swift => SDKSubscriptions.swift} (98%) rename Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/{SDKSubscriptionIntroductoryOfferRepository.swift => SDKSubscriptionIntroductoryOffers.swift} (96%) rename Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/{SubscriptionIntroductoryOfferRepository.swift => SubscriptionIntroductoryOffers.swift} (88%) rename Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/{SDKSubscriptionGroupLocalizationRepository.swift => SDKSubscriptionGroupLocalizations.swift} (95%) rename Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/{SDKSubscriptionLocalizationRepository.swift => SDKSubscriptionLocalizations.swift} (96%) rename Sources/ASCKit/Apps/Subscriptions/Localizations/{SubscriptionGroupLocalizationRepository.swift => SubscriptionGroupLocalizations.swift} (88%) rename Sources/ASCKit/Apps/Subscriptions/Localizations/{SubscriptionLocalizationRepository.swift => SubscriptionLocalizations.swift} (89%) rename Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/{SDKSubscriptionOfferCodeRepository.swift => SDKSubscriptionOfferCodes.swift} (99%) rename Sources/ASCKit/Apps/Subscriptions/OfferCodes/{SubscriptionOfferCodeRepository.swift => SubscriptionOfferCodes.swift} (97%) rename Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/{SDKSubscriptionPromotionalOfferRepository.swift => SDKSubscriptionPromotionalOffers.swift} (97%) rename Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/{SubscriptionPromotionalOfferRepository.swift => SubscriptionPromotionalOffers.swift} (90%) rename Sources/ASCKit/Apps/Subscriptions/Review/Internal/{SDKSubscriptionReviewRepository.swift => SDKSubscriptionReviewAssets.swift} (99%) rename Sources/ASCKit/Apps/Subscriptions/Review/{SubscriptionReviewRepository.swift => SubscriptionReviewAssets.swift} (90%) rename Sources/ASCKit/Apps/Subscriptions/{SubscriptionGroupRepository.swift => SubscriptionGroups.swift} (88%) rename Sources/ASCKit/Apps/Subscriptions/{SubscriptionPriceRepository.swift => SubscriptionPrices.swift} (97%) rename Sources/ASCKit/Apps/Subscriptions/{SubscriptionSubmissionRepository.swift => SubscriptionSubmissions.swift} (74%) rename Sources/ASCKit/Apps/Subscriptions/{SubscriptionRepository.swift => Subscriptions.swift} (93%) rename Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/{SDKWinBackOfferRepository.swift => SDKWinBackOffers.swift} (99%) rename Sources/ASCKit/Apps/Subscriptions/WinBackOffers/{WinBackOfferRepository.swift => WinBackOffers.swift} (96%) rename Sources/ASCKit/Apps/TestFlight/{BetaAppLocalizationRepository.swift => BetaAppLocalizations.swift} (91%) rename Sources/ASCKit/Apps/TestFlight/{BetaAppReviewRepository.swift => BetaAppReviews.swift} (89%) rename Sources/ASCKit/Apps/TestFlight/Internal/{SDKBetaAppLocalizationRepository.swift => SDKBetaAppLocalizations.swift} (97%) rename Sources/ASCKit/Apps/TestFlight/Internal/{SDKBetaAppReviewRepository.swift => SDKBetaAppReviews.swift} (97%) rename Sources/ASCKit/Apps/TestFlight/{TestFlightRepository.swift => TestFlight.swift} (92%) rename Sources/ASCKit/Apps/Versions/{VersionRepository.swift => AppStoreVersions.swift} (95%) rename Sources/ASCKit/Apps/Versions/Internal/{SDKVersionRepository.swift => SDKAppStoreVersions.swift} (98%) rename Sources/ASCKit/Apps/Versions/Internal/{SDKReviewDetailRepository.swift => SDKReviewDetails.swift} (97%) rename Sources/ASCKit/Apps/Versions/Localizations/Internal/{SDKLocalizationRepository.swift => SDKVersionLocalizations.swift} (96%) rename Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/{PreviewRepository.swift => AppPreviews.swift} (89%) rename Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/{OpenAPIPreviewRepository.swift => OpenAPIAppPreviews.swift} (98%) rename Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/{ScreenshotRepository.swift => AppScreenshots.swift} (92%) rename Sources/ASCKit/Apps/Versions/Localizations/{VersionLocalizationRepository.swift => VersionLocalizations.swift} (89%) rename Sources/ASCKit/Apps/Versions/{ReviewDetailRepository.swift => ReviewDetails.swift} (81%) rename Sources/ASCKit/Auth/Iris/{IrisSessionRepository.swift => IrisSessions.swift} (84%) rename Sources/ASCKit/Auth/Iris/{IrisAuthRepository.swift => IrisSignIn.swift} (85%) rename Sources/ASCKit/CodeSigning/BundleIDs/{BundleIDRepository.swift => BundleIDs.swift} (86%) rename Sources/ASCKit/CodeSigning/Certificates/{CertificateRepository.swift => Certificates.swift} (85%) rename Sources/ASCKit/CodeSigning/Devices/{DeviceRepository.swift => Devices.swift} (82%) rename Sources/ASCKit/CodeSigning/Internal/{SDKBundleIDRepository.swift => SDKBundleIDs.swift} (96%) rename Sources/ASCKit/CodeSigning/Internal/{SDKCertificateRepository.swift => SDKCertificates.swift} (96%) rename Sources/ASCKit/CodeSigning/Internal/{SDKDeviceRepository.swift => SDKDevices.swift} (96%) rename Sources/ASCKit/CodeSigning/Internal/{SDKProfileRepository.swift => SDKProfiles.swift} (98%) rename Sources/ASCKit/CodeSigning/Profiles/{ProfileRepository.swift => Profiles.swift} (89%) rename Sources/ASCKit/GameCenter/{GameCenterRepository.swift => GameCenter.swift} (94%) rename Sources/ASCKit/GameCenter/Internal/{SDKGameCenterRepository.swift => SDKGameCenter.swift} (98%) rename Sources/ASCKit/GameCenter/Moderation/{GameCenterModerationRepository.swift => GameCenterModeration.swift} (90%) rename Sources/ASCKit/GameCenter/Moderation/Internal/{SDKGameCenterModerationRepository.swift => SDKGameCenterModeration.swift} (97%) rename Sources/ASCKit/Iris/AppBundles/Internal/{IrisSDKAppBundleRepository.swift => IrisSDKAppBundles.swift} (94%) rename Sources/ASCKit/Iris/AppBundles/{IrisAppBundleRepository.swift => IrisAppBundles.swift} (88%) rename Sources/ASCKit/Iris/InAppPurchases/Internal/{IrisSDKInAppPurchaseStateRepository.swift => IrisSDKInAppPurchaseStates.swift} (91%) rename Sources/ASCKit/Iris/InAppPurchases/Internal/{IrisSDKInAppPurchaseSubmissionRepository.swift => IrisSDKInAppPurchaseSubmissions.swift} (92%) rename Sources/ASCKit/Iris/InAppPurchases/{IrisInAppPurchaseStateRepository.swift => IrisInAppPurchaseStates.swift} (85%) rename Sources/ASCKit/Iris/InAppPurchases/{IrisInAppPurchaseSubmissionRepository.swift => IrisInAppPurchaseSubmissions.swift} (84%) rename Sources/ASCKit/Iris/Internal/Auth/{FileIrisSessionRepository.swift => FileIrisSessions.swift} (91%) rename Sources/ASCKit/Iris/Internal/Auth/{IrisAuthSDKRepository.swift => IrisSDKSignIn.swift} (97%) rename Sources/ASCKit/Iris/ResolutionCenter/Internal/{IrisSDKResolutionCenterRepository.swift => IrisSDKResolutionCenter.swift} (97%) rename Sources/ASCKit/Iris/ResolutionCenter/{IrisResolutionCenterRepository.swift => IrisResolutionCenter.swift} (86%) rename Sources/ASCKit/Plugins/Internal/{PluginMarketRepository.swift => MarketplacePlugins.swift} (99%) rename Sources/ASCKit/Plugins/{PluginRepository.swift => Plugins.swift} (93%) rename Sources/ASCKit/Reports/Analytics/{AnalyticsReportRepository.swift => AnalyticsReports.swift} (91%) rename Sources/ASCKit/Reports/Analytics/Internal/{SDKAnalyticsReportRepository.swift => SDKAnalyticsReports.swift} (98%) rename Sources/ASCKit/Reports/Internal/{SDKReportRepository.swift => SDKReports.swift} (98%) rename Sources/ASCKit/Reports/{ReportRepository.swift => Reports.swift} (91%) rename Sources/ASCKit/Screenshots/Gallery/{GalleryTemplateRepository.swift => GalleryTemplates.swift} (89%) rename Sources/ASCKit/Screenshots/Internal/{AggregateGalleryTemplateRepository.swift => AggregateGalleryTemplates.swift} (82%) rename Sources/ASCKit/Screenshots/Internal/{AggregateTemplateRepository.swift => AggregateTemplates.swift} (83%) rename Sources/ASCKit/Screenshots/Internal/{AggregateThemeRepository.swift => AggregateThemes.swift} (92%) rename Sources/ASCKit/Screenshots/{TemplateRepository.swift => Templates.swift} (95%) rename Sources/ASCKit/Simulators/Internal/{SimctlSimulatorRepository.swift => SimctlSimulators.swift} (97%) rename Sources/ASCKit/Simulators/{SimulatorRepository.swift => Simulators.swift} (89%) rename Sources/ASCKit/Skills/Internal/{ProcessSkillRepository.swift => ProcessSkills.swift} (97%) rename Sources/ASCKit/Skills/{SkillRepository.swift => Skills.swift} (92%) rename Sources/ASCKit/Submissions/Internal/{OpenAPISubmissionRepository.swift => OpenAPIReviewSubmissions.swift} (99%) rename Sources/ASCKit/Submissions/{SubmissionRepository.swift => ReviewSubmissions.swift} (94%) rename Sources/ASCKit/Territories/Internal/{SDKTerritoryRepository.swift => SDKTerritories.swift} (87%) rename Sources/ASCKit/Territories/{TerritoryRepository.swift => Territories.swift} (63%) rename Sources/ASCKit/Users/Internal/{SDKUserRepository.swift => SDKUsers.swift} (98%) rename Sources/ASCKit/Users/{UserRepository.swift => Users.swift} (92%) rename Sources/ASCKit/XcodeCloud/Internal/{SDKXcodeCloudBuildRunRepository.swift => SDKXcodeCloudBuildRuns.swift} (96%) rename Sources/ASCKit/XcodeCloud/Internal/{SDKXcodeCloudProductRepository.swift => SDKXcodeCloudProducts.swift} (91%) rename Sources/ASCKit/XcodeCloud/Internal/{SDKXcodeCloudWorkflowRepository.swift => SDKXcodeCloudWorkflows.swift} (90%) rename Sources/ASCKit/XcodeCloud/{XcodeCloudBuildRunRepository.swift => XcodeCloudBuildRuns.swift} (82%) rename Sources/ASCKit/XcodeCloud/{XcodeCloudProductRepository.swift => XcodeCloudProducts.swift} (64%) rename Sources/ASCKit/XcodeCloud/{XcodeCloudWorkflowRepository.swift => XcodeCloudWorkflows.swift} (65%) rename Tests/ASCKitTests/AppWall/Internal/{GitHubAppWallRepositoryTests.swift => GitHubAppWallTests.swift} (97%) rename Tests/ASCKitTests/Apps/AppClips/Internal/{SDKAppClipRepositoryTests.swift => SDKAppClipsTests.swift} (92%) rename Tests/ASCKitTests/Apps/AppInfos/Internal/{SDKAgeRatingDeclarationRepositoryTests.swift => SDKAgeRatingDeclarationsTests.swift} (89%) rename Tests/ASCKitTests/Apps/AppInfos/Internal/{SDKAppCategoryRepositoryTests.swift => SDKAppCategoriesTests.swift} (90%) rename Tests/ASCKitTests/Apps/AppInfos/Internal/{SDKAppInfoRepositoryTests.swift => SDKAppInfosTests.swift} (92%) rename Tests/ASCKitTests/Apps/{AppRepositoryTests.swift => AppsTests.swift} (90%) rename Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/{SDKLibraryImageRepositoryTests.swift => SDKLibraryImagesTests.swift} (97%) rename Tests/ASCKitTests/Apps/AssetLibrary/Internal/{SDKAssetLibraryRepositoryTests.swift => SDKAssetLibrariesTests.swift} (92%) rename Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/{SDKAssetPlacementRepositoryTests.swift => SDKAssetPlacementsTests.swift} (91%) rename Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/{SDKLibraryVideoRepositoryTests.swift => SDKLibraryVideosTests.swift} (96%) rename Tests/ASCKitTests/Apps/Availability/Internal/{SDKAppAvailabilityRepositoryTests.swift => SDKAppAvailabilitiesTests.swift} (94%) rename Tests/ASCKitTests/Apps/Builds/Internal/{SDKBetaBuildLocalizationRepositoryTests.swift => SDKBetaBuildLocalizationsTests.swift} (92%) rename Tests/ASCKitTests/Apps/Builds/Internal/{SDKBuildUploadRepositoryTests.swift => SDKBuildUploadsTests.swift} (91%) rename Tests/ASCKitTests/Apps/Builds/Internal/{SDKBuildRepositoryTests.swift => SDKBuildsTests.swift} (92%) rename Tests/ASCKitTests/Apps/Experiments/Internal/{SDKExperimentRepositoryTests.swift => SDKExperimentsTests.swift} (91%) rename Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/{SDKInAppPurchaseAvailabilityRepositoryTests.swift => SDKInAppPurchaseAvailabilitiesTests.swift} (92%) rename Tests/ASCKitTests/Apps/InAppPurchases/Internal/{SDKInAppPurchaseLocalizationRepositoryTests.swift => SDKInAppPurchaseLocalizationsTests.swift} (89%) rename Tests/ASCKitTests/Apps/InAppPurchases/Internal/{SDKInAppPurchasePriceRepositoryTests.swift => SDKInAppPurchasePricesTests.swift} (94%) rename Tests/ASCKitTests/Apps/InAppPurchases/Internal/{SDKInAppPurchaseSubmissionRepositoryTests.swift => SDKInAppPurchaseSubmissionsTests.swift} (80%) rename Tests/ASCKitTests/Apps/InAppPurchases/Internal/{SDKInAppPurchaseRepositoryTests.swift => SDKInAppPurchasesTests.swift} (91%) rename Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/{SDKInAppPurchaseOfferCodeRepositoryTests.swift => SDKInAppPurchaseOfferCodesTests.swift} (92%) rename Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/{SDKInAppPurchaseReviewRepositoryTests.swift => SDKInAppPurchaseReviewAssetsTests.swift} (90%) rename Tests/ASCKitTests/Apps/Internal/{SDKAppRepositoryTests.swift => SDKAppsTests.swift} (93%) rename Tests/ASCKitTests/Apps/Performance/Internal/{SDKDiagnosticsRepositoryTests.swift => SDKDiagnosticsTests.swift} (92%) rename Tests/ASCKitTests/Apps/Performance/Internal/{SDKPerfMetricsRepositoryTests.swift => SDKPerfMetricsTests.swift} (91%) rename Tests/ASCKitTests/Apps/Performance/Internal/{SDKPerfOverviewRepositoryTests.swift => SDKPerfOverviewsTests.swift} (97%) rename Tests/ASCKitTests/Apps/Pricing/Internal/{SDKPricingRepositoryTests.swift => SDKAppPricesTests.swift} (93%) rename Tests/ASCKitTests/Apps/ProductVersions/Internal/{SDKProductVersionRepositoryTests.swift => SDKProductVersionsTests.swift} (92%) rename Tests/ASCKitTests/Apps/PromotedPurchases/Internal/{SDKPromotedPurchaseRepositoryTests.swift => SDKPromotedPurchasesTests.swift} (91%) rename Tests/ASCKitTests/Apps/Reviews/Internal/{SDKCustomerReviewRepositoryTests.swift => SDKCustomerReviewsTests.swift} (91%) rename Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/{SDKSubscriptionAvailabilityRepositoryTests.swift => SDKSubscriptionAvailabilitiesTests.swift} (91%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionGroupLocalizationRepositoryTests.swift => SDKSubscriptionGroupLocalizationsTests.swift} (89%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionGroupRepositoryTests.swift => SDKSubscriptionGroupsTests.swift} (89%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionLocalizationRepositoryTests.swift => SDKSubscriptionLocalizationsTests.swift} (90%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionPriceRepositoryTests.swift => SDKSubscriptionPricesTests.swift} (94%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionPromotionalOfferRepositoryTests.swift => SDKSubscriptionPromotionalOffersTests.swift} (91%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionSubmissionRepositoryTests.swift => SDKSubscriptionSubmissionsTests.swift} (82%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionRepositoryTests.swift => SDKSubscriptionsTests.swift} (91%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKWinBackOfferRepositoryTests.swift => SDKWinBackOffersTests.swift} (94%) rename Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/{SDKSubscriptionIntroductoryOfferRepositoryTests.swift => SDKSubscriptionIntroductoryOffersTests.swift} (90%) rename Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/{SDKSubscriptionOfferCodeRepositoryTests.swift => SDKSubscriptionOfferCodesTests.swift} (93%) rename Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/{SDKSubscriptionReviewRepositoryTests.swift => SDKSubscriptionReviewAssetsTests.swift} (91%) rename Tests/ASCKitTests/Apps/TestFlight/Internal/{SDKBetaAppLocalizationRepositoryTests.swift => SDKBetaAppLocalizationsTests.swift} (92%) rename Tests/ASCKitTests/Apps/TestFlight/Internal/{SDKBetaAppReviewRepositoryTests.swift => SDKBetaAppReviewsTests.swift} (93%) rename Tests/ASCKitTests/Apps/TestFlight/Internal/{SDKTestFlightRepositoryTests.swift => SDKTestFlightTests.swift} (92%) rename Tests/ASCKitTests/Apps/Versions/{VersionRepositoryTests.swift => AppStoreVersionsTests.swift} (89%) rename Tests/ASCKitTests/Apps/Versions/Internal/{SDKVersionRepositoryTests.swift => SDKAppStoreVersionsTests.swift} (92%) rename Tests/ASCKitTests/Apps/Versions/Internal/{SDKReviewDetailRepositoryTests.swift => SDKReviewDetailsTests.swift} (95%) rename Tests/ASCKitTests/Apps/Versions/Localizations/Internal/{SDKLocalizationRepositoryTests.swift => SDKVersionLocalizationsTests.swift} (93%) rename Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/{OpenAPIPreviewRepositoryTests.swift => OpenAPIAppPreviewsTests.swift} (92%) rename Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/{ScreenshotRepositoryTests.swift => AppScreenshotsTests.swift} (89%) rename Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/{SDKScreenshotRepositoryTests.swift => SDKAppScreenshotsTests.swift} (89%) rename Tests/ASCKitTests/Apps/Versions/Localizations/{VersionLocalizationRepositoryTests.swift => VersionLocalizationsTests.swift} (91%) rename Tests/ASCKitTests/CodeSigning/Internal/{SDKBundleIDRepositoryTests.swift => SDKBundleIDsTests.swift} (90%) rename Tests/ASCKitTests/CodeSigning/Internal/{SDKCertificateRepositoryTests.swift => SDKCertificatesTests.swift} (90%) rename Tests/ASCKitTests/CodeSigning/Internal/{SDKDeviceRepositoryTests.swift => SDKDevicesTests.swift} (93%) rename Tests/ASCKitTests/CodeSigning/Internal/{SDKProfileRepositoryTests.swift => SDKProfilesTests.swift} (92%) rename Tests/ASCKitTests/GameCenter/Internal/{SDKGameCenterRepositoryTests.swift => SDKGameCenterTests.swift} (93%) rename Tests/ASCKitTests/GameCenter/Moderation/Internal/{SDKGameCenterModerationRepositoryTests.swift => SDKGameCenterModerationTests.swift} (92%) rename Tests/ASCKitTests/Iris/AppBundles/Internal/{IrisSDKAppBundleRepositoryTests.swift => IrisSDKAppBundlesTests.swift} (90%) rename Tests/ASCKitTests/Iris/InAppPurchases/Internal/{IrisSDKInAppPurchaseStateRepositoryTests.swift => IrisSDKInAppPurchaseStatesTests.swift} (94%) rename Tests/ASCKitTests/Iris/InAppPurchases/Internal/{IrisSDKInAppPurchaseSubmissionRepositoryTests.swift => IrisSDKInAppPurchaseSubmissionsTests.swift} (94%) rename Tests/ASCKitTests/Iris/Internal/Auth/{FileIrisSessionRepositoryTests.swift => FileIrisSessionsTests.swift} (86%) rename Tests/ASCKitTests/Iris/Internal/Auth/{IrisAuthSDKRepositoryTests.swift => IrisSDKSignInTests.swift} (86%) rename Tests/ASCKitTests/Iris/ResolutionCenter/Internal/{IrisSDKResolutionCenterRepositoryTests.swift => IrisSDKResolutionCenterTests.swift} (98%) rename Tests/ASCKitTests/Plugins/Internal/{PluginMarketRepositoryTests.swift => MarketplacePluginsTests.swift} (97%) rename Tests/ASCKitTests/Reports/Internal/{SDKAnalyticsReportRepositoryTests.swift => SDKAnalyticsReportsTests.swift} (92%) rename Tests/ASCKitTests/Reports/Internal/{SDKReportRepositoryTests.swift => SDKReportsTests.swift} (96%) rename Tests/ASCKitTests/Screenshots/Gallery/{GalleryTemplateRepositoryTests.swift => GalleryTemplatesTests.swift} (86%) rename Tests/ASCKitTests/Screenshots/Internal/{AggregateGalleryTemplateRepositoryTests.swift => AggregateGalleryTemplatesTests.swift} (88%) rename Tests/ASCKitTests/Screenshots/Internal/{AggregateTemplateRepositoryTests.swift => AggregateTemplatesTests.swift} (91%) rename Tests/ASCKitTests/Screenshots/Internal/{AggregateThemeRepositoryTests.swift => AggregateThemesTests.swift} (90%) rename Tests/ASCKitTests/Simulators/Internal/{SimctlSimulatorRepositoryTests.swift => SimctlSimulatorsTests.swift} (85%) rename Tests/ASCKitTests/Skills/Internal/{ProcessSkillRepositoryTests.swift => ProcessSkillsTests.swift} (80%) rename Tests/ASCKitTests/Territories/Internal/{SDKTerritoryRepositoryTests.swift => SDKTerritoriesTests.swift} (90%) rename Tests/ASCKitTests/Users/Internal/{SDKUserRepositoryTests.swift => SDKUsersTests.swift} (93%) rename Tests/ASCKitTests/XcodeCloud/Internal/{SDKXcodeCloudBuildRunRepositoryTests.swift => SDKXcodeCloudBuildRunsTests.swift} (90%) rename Tests/ASCKitTests/XcodeCloud/Internal/{SDKXcodeCloudProductRepositoryTests.swift => SDKXcodeCloudProductsTests.swift} (88%) rename Tests/ASCKitTests/XcodeCloud/Internal/{SDKXcodeCloudWorkflowRepositoryTests.swift => SDKXcodeCloudWorkflowsTests.swift} (90%) diff --git a/.claude/skills/implement-feature/SKILL.md b/.claude/skills/implement-feature/SKILL.md index d5b223c9..2d8100bc 100644 --- a/.claude/skills/implement-feature/SKILL.md +++ b/.claude/skills/implement-feature/SKILL.md @@ -108,11 +108,13 @@ See [command-affordances.md](references/command-affordances.md) for: - `formatAgentItems` vs `formatItems` - JSON output shape `{"data":[{...,"affordances":{...}}]}` -### 4. Repository protocol — primitives only, but allow composition in adapters +### 4. The collection protocol — primitives only, but allow composition in adapters + +Name it for what it holds: the **plural of the aggregate** (`Apps`, `Builds`, `AppStoreVersions`), never `XxxRepository`. A protocol that isn't a collection takes a role noun (`IrisSignIn`, `TestFlight`, `Reports`). Its implementations are named for how they do it (`SDKBuilds`, `SimctlSimulators`). ```swift @Mockable -public protocol MyRepository: Sendable { +public protocol MyModels: Sendable { func listMyModels(parentId: String) async throws -> [MyModel] } ``` @@ -402,12 +404,12 @@ Docs follow `docs/documentation-design/README.md`: each fact has one home, and n - [ ] `Presentable` conformance (`tableHeaders`, `tableRow`) - [ ] `AffordanceProviding` via `structuredAffordances` (NOT raw `affordances`) - [ ] State enum with semantic booleans (`isLive`, `isEditable`, `isPendingReview`, etc.) -- [ ] `XRepository.swift` — `@Mockable` protocol with primitive methods only +- [ ] `Xs.swift` — `@Mockable` collection protocol named as the plural (`Builds`), primitive methods only - [ ] `make*` factory added to `MockRepositoryFactory.swift` - [ ] Public-face tests: model fields, semantic booleans, affordances, **and `apiLinks`** for the new keys ### Phase 2: Adapter (`Internal/`) -- [ ] `SDKXRepository.swift` — implements protocol, injects parent IDs in mappers +- [ ] `Internal/SDKXs.swift` — implements the protocol, injects parent IDs in mappers - [ ] Multi-call composition where needed (relationships paginate at ~10 — use dedicated endpoints with `limit:`) - [ ] Factory registered in `ClientFactory.swift` - [ ] `_xRoutes` registered AND touched in `RESTPathResolver.ensureInitialized()` diff --git a/.claude/skills/implement-feature/references/architecture-diagrams.md b/.claude/skills/implement-feature/references/architecture-diagrams.md index 9a292fed..ffb4f657 100644 --- a/.claude/skills/implement-feature/references/architecture-diagrams.md +++ b/.claude/skills/implement-feature/references/architecture-diagrams.md @@ -47,13 +47,13 @@ ``` ASCKit// (public face) App AppStoreVersion AppStoreVersionLocalization - AppRepository (+ affordances) AppScreenshotSet - BuildRepository AppStoreVersionState AppScreenshot - TestFlight repos ScreenshotRepository AffordanceProviding + Apps (+ affordances) AppScreenshotSet + Builds AppStoreVersionState AppScreenshot + TestFlight repos AppScreenshots AffordanceProviding ASCKit//Internal/ (implements the face's protocols) - SDKAppRepository SDKBuildRepository - SDKTestFlightRepository SDKScreenshotRepository + SDKApps SDKBuilds + SDKTestFlight SDKAppScreenshots ClientFactory EnvironmentAuthProvider ASCCommand (the way in) @@ -75,15 +75,15 @@ ASCCommand (the way in) ``` asc -├── apps list [--limit N] AppRepository.listApps() -├── versions list --app-id AppRepository.listVersions() -├── localizations list --version-id ScreenshotRepository.listLocalizations() -├── screenshot-sets list --localization-id ScreenshotRepository.listScreenshotSets() -├── screenshots list --set-id ScreenshotRepository.listScreenshots() -├── builds list [--app-id ] BuildRepository.listBuilds() +├── apps list [--limit N] Apps.listApps() +├── versions list --app-id Apps.listVersions() +├── localizations list --version-id AppScreenshots.listLocalizations() +├── screenshot-sets list --localization-id AppScreenshots.listScreenshotSets() +├── screenshots list --set-id AppScreenshots.listScreenshots() +├── builds list [--app-id ] Builds.listBuilds() ├── testflight -│ ├── groups [--app-id ] TestFlightRepository.listBetaGroups() -│ └── testers [--group-id ] TestFlightRepository.listBetaTesters() +│ ├── groups [--app-id ] TestFlight.listBetaGroups() +│ └── testers [--group-id ] TestFlight.listBetaTesters() ├── auth check ├── version └── tui @@ -108,7 +108,7 @@ CLI args ▼ AsyncParsableCommand.run() │ - ├─ ClientProvider.makeXRepository() + ├─ ClientProvider.makeXs() │ │ │ ▼ │ OpenAPI call → map SDK types → ASCKit structs (with parentId injected) @@ -142,14 +142,14 @@ AsyncParsableCommand.run() | File | Action | Notes | |-------------------------------------------------------------|----------|----------------------------------------------| | `Sources/ASCKit/X/XModel.swift` | Create | Struct + AffordanceProviding | -| `Sources/ASCKit/X/XRepository.swift` | Create | @Mockable protocol | -| `Sources/ASCKit/X/Internal/SDKXRepository.swift` | Create | Implements XRepository, injects parent IDs | -| `Sources/ASCKit/Shared/Internal/ClientFactory.swift` | Modify | Add `makeXRepository()` factory | +| `Sources/ASCKit/X/Xs.swift` | Create | @Mockable protocol | +| `Sources/ASCKit/X/Internal/SDKXs.swift` | Create | Implements Xs, injects parent IDs | +| `Sources/ASCKit/Shared/Internal/ClientFactory.swift` | Modify | Add `makeXs()` factory | | `Sources/ASCCommand/Commands/X/XCommand.swift` | Create | AsyncParsableCommand group + List subcommand | | `Sources/ASCCommand/ASC.swift` | Modify | Add XCommand to subcommands | -| `Sources/ASCCommand/ClientProvider.swift` | Modify | Add `makeXRepository()` static factory | +| `Sources/ASCCommand/ClientProvider.swift` | Modify | Add `makeXs()` static factory | | `Tests/ASCKitTests/X/XModelTests.swift` | Create | State, computed props, Codable | -| `Tests/ASCKitTests/X/XRepositoryTests.swift` | Create | Mock-based repository tests | +| `Tests/ASCKitTests/X/SDKXsTests.swift` | Create | Mock-based repository tests | | `Tests/ASCKitTests/Apps/AffordancesTests.swift` | Modify | Add affordance tests for new model | | `Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift`| Modify | Add `makeX(...)` factory method | diff --git a/.claude/skills/implement-feature/references/domain-models.md b/.claude/skills/implement-feature/references/domain-models.md index 9df20579..be91f4fb 100644 --- a/.claude/skills/implement-feature/references/domain-models.md +++ b/.claude/skills/implement-feature/references/domain-models.md @@ -103,13 +103,13 @@ public struct AppScreenshot: Sendable, Equatable, Identifiable, Codable { ```swift @Mockable -public protocol AppRepository: Sendable { +public protocol Apps: Sendable { func listApps(limit: Int?) async throws -> PaginatedResponse func listVersions(appId: String) async throws -> [AppStoreVersion] } @Mockable -public protocol ScreenshotRepository: Sendable { +public protocol AppScreenshots: Sendable { func listLocalizations(versionId: String) async throws -> [AppStoreVersionLocalization] func listScreenshotSets(localizationId: String) async throws -> [AppScreenshotSet] func listScreenshots(setId: String) async throws -> [AppScreenshot] @@ -152,7 +152,7 @@ Add new `make*` methods to `MockRepositoryFactory` whenever you add a new domain Use private mapper functions (not static factory methods on the domain type): ```swift -// In OpenAPIXxxRepository.swift (in the concept's Internal/) +// In Internal/SDKXxxs.swift (in the concept's Internal/) private func mapVersion( _ sdkVersion: AppStoreConnect_Swift_SDK.AppStoreVersion, appId: String @@ -182,14 +182,14 @@ public final class AppScreenshotSet: Sendable, Equatable, Identifiable, Codable public let screenshotDisplayType: ScreenshotDisplayType public let screenshotsCount: Int - private let repo: any ScreenshotRepository + private let repo: any AppScreenshots public init( id: String, localizationId: String, screenshotDisplayType: ScreenshotDisplayType, screenshotsCount: Int = 0, - repo: any ScreenshotRepository + repo: any AppScreenshots ) { self.id = id self.localizationId = localizationId @@ -240,7 +240,7 @@ public final class AppScreenshotSet: Sendable, Equatable, Identifiable, Codable ```swift @Test func `importScreenshots uploads entries sorted by order`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).uploadScreenshot(setId: .value("set-1"), fileURL: .any) .willReturn(MockRepositoryFactory.makeScreenshot(id: "img-1")) diff --git a/.claude/skills/implement-feature/references/swift-concurrency.md b/.claude/skills/implement-feature/references/swift-concurrency.md index 1078f0d6..a5c2e55c 100644 --- a/.claude/skills/implement-feature/references/swift-concurrency.md +++ b/.claude/skills/implement-feature/references/swift-concurrency.md @@ -23,16 +23,16 @@ public enum ProcessingState: String, Sendable { ## Async Repository Methods -All repository protocols use `async throws`: +All collection protocols use `async throws`: ```swift @Mockable -public protocol AppRepository: Sendable { +public protocol Apps: Sendable { func fetchApps(limit: Int?) async throws -> [App] } @Mockable -public protocol BuildRepository: Sendable { +public protocol Builds: Sendable { func fetchBuilds(appId: String?, limit: Int?) async throws -> [Build] } ``` @@ -53,7 +53,7 @@ struct AppsList: AsyncParsableCommand { var limit: Int = 50 func run() async throws { - let repo = ClientProvider.makeAppRepository(globalOptions) + let repo = ClientProvider.makeApps(globalOptions) let apps = try await repo.fetchApps(limit: limit) OutputFormatter.print(apps, format: globalOptions.output) } @@ -105,7 +105,7 @@ func run() async throws { ```swift // Use async throws in @Test functions @Test func `fetchApps returns apps`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).fetchApps(limit: .any).willReturn([ App(id: "1", name: "Test App", bundleId: "com.test.app", sku: nil, primaryLocale: "en-US") ]) @@ -116,7 +116,7 @@ func run() async throws { // Test error throwing with await #expect(throws:) @Test func `fetchApps propagates auth error`() async { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).fetchApps(limit: .any).willThrow(APIError.unauthorized) await #expect(throws: APIError.unauthorized) { @@ -128,7 +128,7 @@ func run() async throws { ## Swift 6.2 Strict Concurrency Checklist - [ ] Domain models are `struct` + `Sendable` (not `class`) -- [ ] Repository protocols conform to `Sendable` +- [ ] Collection protocols conform to `Sendable` - [ ] `Internal/` structs are stateless or explicitly `Sendable` - [ ] Commands use `AsyncParsableCommand` for async entry points - [ ] No `@unchecked Sendable` unless absolutely necessary with documented reason diff --git a/.claude/skills/implement-feature/references/swift-observable.md b/.claude/skills/implement-feature/references/swift-observable.md index a665a05c..894607b6 100644 --- a/.claude/skills/implement-feature/references/swift-observable.md +++ b/.claude/skills/implement-feature/references/swift-observable.md @@ -3,7 +3,7 @@ ## Key Rules - All domain models: `Sendable` (struct is implicitly Sendable when all stored props are Sendable) -- Repository protocols: `: Sendable` (required for `@Mockable` compatibility) +- Collection protocols: `: Sendable` (required for `@Mockable` compatibility) - `Internal/` repos: `@unchecked Sendable` (hold `APIProvider` which is a reference type) - Commands: `AsyncParsableCommand` with `async throws func run()` @@ -25,7 +25,7 @@ public struct AppStoreVersion: Sendable, Equatable, Identifiable, Codable { ```swift @Mockable -public protocol AppRepository: Sendable { +public protocol Apps: Sendable { func listApps(limit: Int?) async throws -> PaginatedResponse func listVersions(appId: String) async throws -> [AppStoreVersion] } @@ -35,7 +35,7 @@ public protocol AppRepository: Sendable { ```swift // @unchecked Sendable because APIProvider is a reference type -public struct SDKAppRepository: AppRepository, @unchecked Sendable { +public struct SDKApps: Apps, @unchecked Sendable { private let provider: APIProvider public func listVersions(appId: String) async throws -> [AppStoreVersion] { @@ -54,7 +54,7 @@ struct VersionsList: AsyncParsableCommand { @Option(name: .long) var appId: String func run() async throws { - let repo = try ClientProvider.makeAppRepository() + let repo = try ClientProvider.makeApps() let versions = try await repo.listVersions(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) let output = try formatter.formatAgentItems( @@ -74,7 +74,7 @@ struct VersionsList: AsyncParsableCommand { final class TUIApp { func loadVersions(for app: App) { Task { @MainActor in - let repo = try ClientProvider.makeAppRepository() + let repo = try ClientProvider.makeApps() let versions = try await repo.listVersions(appId: app.id) // update UI } diff --git a/.claude/skills/implement-feature/references/tdd-patterns.md b/.claude/skills/implement-feature/references/tdd-patterns.md index b4344351..95a56eaa 100644 --- a/.claude/skills/implement-feature/references/tdd-patterns.md +++ b/.claude/skills/implement-feature/references/tdd-patterns.md @@ -21,7 +21,7 @@ should [when any AppRepository { + static func makeApps() throws -> any Apps { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppRepository(authProvider: authProvider) + return try factory.makeApps(authProvider: authProvider) } - static func makeVersionRepository() throws -> any VersionRepository { + static func makeAppStoreVersions() throws -> any AppStoreVersions { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeVersionRepository(authProvider: authProvider) + return try factory.makeAppStoreVersions(authProvider: authProvider) } - static func makeBuildRepository() throws -> any BuildRepository { + static func makeBuilds() throws -> any Builds { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBuildRepository(authProvider: authProvider) + return try factory.makeBuilds(authProvider: authProvider) } - static func makeTestFlightRepository() throws -> any TestFlightRepository { + static func makeTestFlight() throws -> any TestFlight { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeTestFlightRepository(authProvider: authProvider) + return try factory.makeTestFlight(authProvider: authProvider) } - static func makeVersionLocalizationRepository() throws -> any VersionLocalizationRepository { + static func makeVersionLocalizations() throws -> any VersionLocalizations { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeVersionLocalizationRepository(authProvider: authProvider) + return try factory.makeVersionLocalizations(authProvider: authProvider) } - static func makeScreenshotRepository() throws -> any ScreenshotRepository { + static func makeAppScreenshots() throws -> any AppScreenshots { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeScreenshotRepository(authProvider: authProvider) + return try factory.makeAppScreenshots(authProvider: authProvider) } - static func makeAppInfoRepository() throws -> any AppInfoRepository { + static func makeAppInfos() throws -> any AppInfos { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppInfoRepository(authProvider: authProvider) + return try factory.makeAppInfos(authProvider: authProvider) } - static func makeAppCategoryRepository() throws -> any AppCategoryRepository { + static func makeAppCategories() throws -> any AppCategories { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppCategoryRepository(authProvider: authProvider) + return try factory.makeAppCategories(authProvider: authProvider) } - static func makeSubmissionRepository() throws -> any SubmissionRepository { + static func makeReviewSubmissions() throws -> any ReviewSubmissions { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubmissionRepository(authProvider: authProvider) + return try factory.makeReviewSubmissions(authProvider: authProvider) } - static func makeBundleIDRepository() throws -> any BundleIDRepository { + static func makeBundleIDs() throws -> any BundleIDs { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBundleIDRepository(authProvider: authProvider) + return try factory.makeBundleIDs(authProvider: authProvider) } - static func makeCertificateRepository() throws -> any CertificateRepository { + static func makeCertificates() throws -> any Certificates { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeCertificateRepository(authProvider: authProvider) + return try factory.makeCertificates(authProvider: authProvider) } - static func makeDeviceRepository() throws -> any DeviceRepository { + static func makeDevices() throws -> any Devices { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeDeviceRepository(authProvider: authProvider) + return try factory.makeDevices(authProvider: authProvider) } - static func makeProfileRepository() throws -> any ProfileRepository { + static func makeProfiles() throws -> any Profiles { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeProfileRepository(authProvider: authProvider) + return try factory.makeProfiles(authProvider: authProvider) } - static func makeBuildUploadRepository() throws -> any BuildUploadRepository { + static func makeBuildUploads() throws -> any BuildUploads { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBuildUploadRepository(authProvider: authProvider) + return try factory.makeBuildUploads(authProvider: authProvider) } - static func makeBetaBuildLocalizationRepository() throws -> any BetaBuildLocalizationRepository { + static func makeBetaBuildLocalizations() throws -> any BetaBuildLocalizations { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBetaBuildLocalizationRepository(authProvider: authProvider) + return try factory.makeBetaBuildLocalizations(authProvider: authProvider) } - static func makeReviewDetailRepository() throws -> any ReviewDetailRepository { + static func makeReviewDetails() throws -> any ReviewDetails { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeReviewDetailRepository(authProvider: authProvider) + return try factory.makeReviewDetails(authProvider: authProvider) } - static func makePricingRepository() throws -> any PricingRepository { + static func makeAppPrices() throws -> any AppPrices { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makePricingRepository(authProvider: authProvider) + return try factory.makeAppPrices(authProvider: authProvider) } - static func makePreviewRepository() throws -> any PreviewRepository { + static func makeAppPreviews() throws -> any AppPreviews { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makePreviewRepository(authProvider: authProvider) + return try factory.makeAppPreviews(authProvider: authProvider) } - static func makeInAppPurchaseRepository() throws -> any InAppPurchaseRepository { + static func makeInAppPurchases() throws -> any InAppPurchases { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseRepository(authProvider: authProvider) + return try factory.makeInAppPurchases(authProvider: authProvider) } - static func makeInAppPurchaseLocalizationRepository() throws -> any InAppPurchaseLocalizationRepository { + static func makeInAppPurchaseLocalizations() throws -> any InAppPurchaseLocalizations { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseLocalizationRepository(authProvider: authProvider) + return try factory.makeInAppPurchaseLocalizations(authProvider: authProvider) } - static func makeSubscriptionGroupRepository() throws -> any SubscriptionGroupRepository { + static func makeSubscriptionGroups() throws -> any SubscriptionGroups { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionGroupRepository(authProvider: authProvider) + return try factory.makeSubscriptionGroups(authProvider: authProvider) } - static func makeSubscriptionRepository() throws -> any SubscriptionRepository { + static func makeSubscriptions() throws -> any Subscriptions { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionRepository(authProvider: authProvider) + return try factory.makeSubscriptions(authProvider: authProvider) } - static func makeSubscriptionLocalizationRepository() throws -> any SubscriptionLocalizationRepository { + static func makeSubscriptionLocalizations() throws -> any SubscriptionLocalizations { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionLocalizationRepository(authProvider: authProvider) + return try factory.makeSubscriptionLocalizations(authProvider: authProvider) } - static func makeSubscriptionGroupLocalizationRepository() throws -> any SubscriptionGroupLocalizationRepository { + static func makeSubscriptionGroupLocalizations() throws -> any SubscriptionGroupLocalizations { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionGroupLocalizationRepository(authProvider: authProvider) + return try factory.makeSubscriptionGroupLocalizations(authProvider: authProvider) } - static func makeInAppPurchaseSubmissionRepository() throws -> any InAppPurchaseSubmissionRepository { + static func makeInAppPurchaseSubmissions() throws -> any InAppPurchaseSubmissions { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseSubmissionRepository(authProvider: authProvider) + return try factory.makeInAppPurchaseSubmissions(authProvider: authProvider) } - static func makeProductVersionRepository() throws -> any ProductVersionRepository { + static func makeProductVersions() throws -> any ProductVersions { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeProductVersionRepository(authProvider: authProvider) + return try factory.makeProductVersions(authProvider: authProvider) } - static func makeInAppPurchasePriceRepository() throws -> any InAppPurchasePriceRepository { + static func makeInAppPurchasePrices() throws -> any InAppPurchasePrices { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchasePriceRepository(authProvider: authProvider) + return try factory.makeInAppPurchasePrices(authProvider: authProvider) } - static func makeSubscriptionPriceRepository() throws -> any SubscriptionPriceRepository { + static func makeSubscriptionPrices() throws -> any SubscriptionPrices { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionPriceRepository(authProvider: authProvider) + return try factory.makeSubscriptionPrices(authProvider: authProvider) } - static func makeSubscriptionSubmissionRepository() throws -> any SubscriptionSubmissionRepository { + static func makeSubscriptionSubmissions() throws -> any SubscriptionSubmissions { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionSubmissionRepository(authProvider: authProvider) + return try factory.makeSubscriptionSubmissions(authProvider: authProvider) } - static func makeSubscriptionPromotionalOfferRepository() throws -> any SubscriptionPromotionalOfferRepository { + static func makeSubscriptionPromotionalOffers() throws -> any SubscriptionPromotionalOffers { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionPromotionalOfferRepository(authProvider: authProvider) + return try factory.makeSubscriptionPromotionalOffers(authProvider: authProvider) } - static func makeWinBackOfferRepository() throws -> any WinBackOfferRepository { + static func makeWinBackOffers() throws -> any WinBackOffers { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeWinBackOfferRepository(authProvider: authProvider) + return try factory.makeWinBackOffers(authProvider: authProvider) } - static func makeAssetLibraryRepository() throws -> any AssetLibraryRepository { - try ClientFactory().makeAssetLibraryRepository(authProvider: CompositeAuthProvider()) + static func makeAssetLibraries() throws -> any AssetLibraries { + try ClientFactory().makeAssetLibraries(authProvider: CompositeAuthProvider()) } - static func makeLibraryImageRepository() throws -> any LibraryImageRepository { - try ClientFactory().makeLibraryImageRepository(authProvider: CompositeAuthProvider()) + static func makeLibraryImages() throws -> any LibraryImages { + try ClientFactory().makeLibraryImages(authProvider: CompositeAuthProvider()) } - static func makeLibraryVideoRepository() throws -> any LibraryVideoRepository { - try ClientFactory().makeLibraryVideoRepository(authProvider: CompositeAuthProvider()) + static func makeLibraryVideos() throws -> any LibraryVideos { + try ClientFactory().makeLibraryVideos(authProvider: CompositeAuthProvider()) } - static func makeAssetPlacementRepository() throws -> any AssetPlacementRepository { - try ClientFactory().makeAssetPlacementRepository(authProvider: CompositeAuthProvider()) + static func makeAssetPlacements() throws -> any AssetPlacements { + try ClientFactory().makeAssetPlacements(authProvider: CompositeAuthProvider()) } - static func makeExperimentRepository() throws -> any ExperimentRepository { + static func makeExperiments() throws -> any Experiments { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeExperimentRepository(authProvider: authProvider) + return try factory.makeExperiments(authProvider: authProvider) } - static func makePromotedPurchaseRepository() throws -> any PromotedPurchaseRepository { + static func makePromotedPurchases() throws -> any PromotedPurchases { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makePromotedPurchaseRepository(authProvider: authProvider) + return try factory.makePromotedPurchases(authProvider: authProvider) } - static func makeInAppPurchaseReviewRepository() throws -> any InAppPurchaseReviewRepository { + static func makeInAppPurchaseReviewAssets() throws -> any InAppPurchaseReviewAssets { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseReviewRepository(authProvider: authProvider) + return try factory.makeInAppPurchaseReviewAssets(authProvider: authProvider) } - static func makeSubscriptionReviewRepository() throws -> any SubscriptionReviewRepository { + static func makeSubscriptionReviewAssets() throws -> any SubscriptionReviewAssets { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionReviewRepository(authProvider: authProvider) + return try factory.makeSubscriptionReviewAssets(authProvider: authProvider) } - static func makeSubscriptionIntroductoryOfferRepository() throws -> any SubscriptionIntroductoryOfferRepository { + static func makeSubscriptionIntroductoryOffers() throws -> any SubscriptionIntroductoryOffers { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionIntroductoryOfferRepository(authProvider: authProvider) + return try factory.makeSubscriptionIntroductoryOffers(authProvider: authProvider) } - static func makeSubscriptionOfferCodeRepository() throws -> any SubscriptionOfferCodeRepository { + static func makeSubscriptionOfferCodes() throws -> any SubscriptionOfferCodes { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionOfferCodeRepository(authProvider: authProvider) + return try factory.makeSubscriptionOfferCodes(authProvider: authProvider) } - static func makeInAppPurchaseOfferCodeRepository() throws -> any InAppPurchaseOfferCodeRepository { + static func makeInAppPurchaseOfferCodes() throws -> any InAppPurchaseOfferCodes { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseOfferCodeRepository(authProvider: authProvider) + return try factory.makeInAppPurchaseOfferCodes(authProvider: authProvider) } - static func makeAgeRatingDeclarationRepository() throws -> any AgeRatingDeclarationRepository { + static func makeAgeRatingDeclarations() throws -> any AgeRatingDeclarations { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAgeRatingDeclarationRepository(authProvider: authProvider) + return try factory.makeAgeRatingDeclarations(authProvider: authProvider) } - static func makeBetaAppReviewRepository() throws -> any BetaAppReviewRepository { + static func makeBetaAppReviews() throws -> any BetaAppReviews { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBetaAppReviewRepository(authProvider: authProvider) + return try factory.makeBetaAppReviews(authProvider: authProvider) } - static func makeBetaAppLocalizationRepository() throws -> any BetaAppLocalizationRepository { + static func makeBetaAppLocalizations() throws -> any BetaAppLocalizations { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBetaAppLocalizationRepository(authProvider: authProvider) + return try factory.makeBetaAppLocalizations(authProvider: authProvider) } - static func makeAppAvailabilityRepository() throws -> any AppAvailabilityRepository { + static func makeAppAvailabilities() throws -> any AppAvailabilities { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppAvailabilityRepository(authProvider: authProvider) + return try factory.makeAppAvailabilities(authProvider: authProvider) } - static func makeInAppPurchaseAvailabilityRepository() throws -> any InAppPurchaseAvailabilityRepository { + static func makeInAppPurchaseAvailabilities() throws -> any InAppPurchaseAvailabilities { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseAvailabilityRepository(authProvider: authProvider) + return try factory.makeInAppPurchaseAvailabilities(authProvider: authProvider) } - static func makeSubscriptionAvailabilityRepository() throws -> any SubscriptionAvailabilityRepository { + static func makeSubscriptionAvailabilities() throws -> any SubscriptionAvailabilities { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionAvailabilityRepository(authProvider: authProvider) + return try factory.makeSubscriptionAvailabilities(authProvider: authProvider) } - static func makeTerritoryRepository() throws -> any TerritoryRepository { + static func makeTerritories() throws -> any Territories { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeTerritoryRepository(authProvider: authProvider) + return try factory.makeTerritories(authProvider: authProvider) } // MARK: - Simulators - static func makeSimulatorRepository() -> any SimulatorRepository { - ClientFactory().makeSimulatorRepository() + static func makeSimulators() -> any Simulators { + ClientFactory().makeSimulators() } // SimulatorInteractionRepository moved to ASCPro (pro feature) // MARK: - Skills - static func makeSkillRepository() -> any SkillRepository { - ClientFactory().makeSkillRepository() + static func makeSkills() -> any Skills { + ClientFactory().makeSkills() } static func makeSkillConfigStorage() -> any SkillConfigStorage { @@ -308,20 +308,20 @@ struct ClientProvider { // MARK: - Plugins - static func makePluginRepository() -> any PluginRepository { - ClientFactory().makePluginRepository() + static func makePlugins() -> any Plugins { + ClientFactory().makePlugins() } - static func makeTemplateRepository() -> AggregateTemplateRepository { - AggregateTemplateRepository.shared + static func makeTemplates() -> AggregateTemplates { + AggregateTemplates.shared } - static func makeGalleryTemplateRepository() -> AggregateGalleryTemplateRepository { - AggregateGalleryTemplateRepository.shared + static func makeGalleryTemplates() -> AggregateGalleryTemplates { + AggregateGalleryTemplates.shared } - static func makeThemeRepository() -> AggregateThemeRepository { - AggregateThemeRepository.shared + static func makeThemes() -> AggregateThemes { + AggregateThemes.shared } static func makeAuthStorage() -> any AuthStorage { @@ -348,112 +348,112 @@ struct ClientProvider { FileAppShotsConfigStorage() } - static func makeAppWallRepository(token: String) -> any AppWallRepository { - GitHubAppWallRepository(token: token) + static func makeAppWall(token: String) -> any AppWall { + GitHubAppWall(token: token) } - static func makeUserRepository() throws -> any UserRepository { + static func makeUsers() throws -> any Users { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeUserRepository(authProvider: authProvider) + return try factory.makeUsers(authProvider: authProvider) } - static func makeXcodeCloudProductRepository() throws -> any XcodeCloudProductRepository { + static func makeXcodeCloudProducts() throws -> any XcodeCloudProducts { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeXcodeCloudProductRepository(authProvider: authProvider) + return try factory.makeXcodeCloudProducts(authProvider: authProvider) } - static func makeXcodeCloudWorkflowRepository() throws -> any XcodeCloudWorkflowRepository { + static func makeXcodeCloudWorkflows() throws -> any XcodeCloudWorkflows { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeXcodeCloudWorkflowRepository(authProvider: authProvider) + return try factory.makeXcodeCloudWorkflows(authProvider: authProvider) } - static func makeXcodeCloudBuildRunRepository() throws -> any XcodeCloudBuildRunRepository { + static func makeXcodeCloudBuildRuns() throws -> any XcodeCloudBuildRuns { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeXcodeCloudBuildRunRepository(authProvider: authProvider) + return try factory.makeXcodeCloudBuildRuns(authProvider: authProvider) } - static func makeGameCenterRepository() throws -> any GameCenterRepository { + static func makeGameCenter() throws -> any GameCenter { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeGameCenterRepository(authProvider: authProvider) + return try factory.makeGameCenter(authProvider: authProvider) } - static func makeGameCenterModerationRepository() throws -> any GameCenterModerationRepository { + static func makeGameCenterModeration() throws -> any GameCenterModeration { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeGameCenterModerationRepository(authProvider: authProvider) + return try factory.makeGameCenterModeration(authProvider: authProvider) } - static func makeAppClipRepository() throws -> any AppClipRepository { + static func makeAppClips() throws -> any AppClips { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppClipRepository(authProvider: authProvider) + return try factory.makeAppClips(authProvider: authProvider) } - static func makeReportRepository() throws -> any ReportRepository { + static func makeReports() throws -> any Reports { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeReportRepository(authProvider: authProvider) + return try factory.makeReports(authProvider: authProvider) } - static func makeAnalyticsReportRepository() throws -> any AnalyticsReportRepository { + static func makeAnalyticsReports() throws -> any AnalyticsReports { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAnalyticsReportRepository(authProvider: authProvider) + return try factory.makeAnalyticsReports(authProvider: authProvider) } - static func makeCustomerReviewRepository() throws -> any CustomerReviewRepository { + static func makeCustomerReviews() throws -> any CustomerReviews { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeCustomerReviewRepository(authProvider: authProvider) + return try factory.makeCustomerReviews(authProvider: authProvider) } - static func makePerfMetricsRepository() throws -> any PerfMetricsRepository { + static func makePerfMetrics() throws -> any PerfMetrics { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makePerfMetricsRepository(authProvider: authProvider) + return try factory.makePerfMetrics(authProvider: authProvider) } - static func makePerfOverviewRepository() throws -> any PerfOverviewRepository { + static func makePerfOverviews() throws -> any PerfOverviews { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makePerfOverviewRepository(authProvider: authProvider) + return try factory.makePerfOverviews(authProvider: authProvider) } - static func makeDiagnosticsRepository() throws -> any DiagnosticsRepository { + static func makeDiagnostics() throws -> any Diagnostics { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeDiagnosticsRepository(authProvider: authProvider) + return try factory.makeDiagnostics(authProvider: authProvider) } // MARK: - Iris (private API, cookie-based auth) - static func makeIrisAppBundleRepository() -> any IrisAppBundleRepository { - ClientFactory().makeIrisAppBundleRepository() + static func makeIrisAppBundles() -> any IrisAppBundles { + ClientFactory().makeIrisAppBundles() } - static func makeIrisInAppPurchaseSubmissionRepository() -> any IrisInAppPurchaseSubmissionRepository { - ClientFactory().makeIrisInAppPurchaseSubmissionRepository() + static func makeIrisInAppPurchaseSubmissions() -> any IrisInAppPurchaseSubmissions { + ClientFactory().makeIrisInAppPurchaseSubmissions() } - static func makeIrisResolutionCenterRepository() -> any IrisResolutionCenterRepository { - ClientFactory().makeIrisResolutionCenterRepository() + static func makeIrisResolutionCenter() -> any IrisResolutionCenter { + ClientFactory().makeIrisResolutionCenter() } static func makeIrisCookieProvider() -> any IrisCookieProvider { ClientFactory().makeIrisCookieProvider() } - static func makeIrisAuthRepository() -> any IrisAuthRepository { - IrisAuthSDKRepository() + static func makeIrisSignIn() -> any IrisSignIn { + IrisSDKSignIn() } - static func makeIrisSessionRepository() -> any IrisSessionRepository { - FileIrisSessionRepository() + static func makeIrisSessions() -> any IrisSessions { + FileIrisSessions() } /// File path for the half-finished login state between `login` and `verify-code`. diff --git a/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift b/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift index 0df6b8df..20710990 100644 --- a/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift +++ b/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift @@ -23,11 +23,11 @@ struct AgeRatingGet: AsyncParsableCommand { var appInfoId: String func run() async throws { - let repo = try ClientProvider.makeAgeRatingDeclarationRepository() + let repo = try ClientProvider.makeAgeRatingDeclarations() print(try await execute(repo: repo)) } - func execute(repo: any AgeRatingDeclarationRepository) async throws -> String { + func execute(repo: any AgeRatingDeclarations) async throws -> String { let declaration = try await repo.getDeclaration(appInfoId: appInfoId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -142,11 +142,11 @@ struct AgeRatingUpdate: AsyncParsableCommand { var developerAgeRatingInfoUrl: String? func run() async throws { - let repo = try ClientProvider.makeAgeRatingDeclarationRepository() + let repo = try ClientProvider.makeAgeRatingDeclarations() print(try await execute(repo: repo)) } - func execute(repo: any AgeRatingDeclarationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AgeRatingDeclarations, affordanceMode: AffordanceMode = .cli) async throws -> String { var update = AgeRatingDeclarationUpdate() update.isAdvertising = advertising update.isGambling = gambling diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift index 47bd8902..43f35c62 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift @@ -13,11 +13,11 @@ struct AnalyticsReportsDelete: AsyncParsableCommand { var requestId: String func run() async throws { - let repo = try ClientProvider.makeAnalyticsReportRepository() + let repo = try ClientProvider.makeAnalyticsReports() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReportRepository) async throws -> String { + func execute(repo: any AnalyticsReports) async throws -> String { try await repo.deleteRequest(id: requestId) return "Deleted analytics report request \(requestId)" } diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift index 739b134c..0100a49b 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift @@ -16,11 +16,11 @@ struct AnalyticsReportsInstancesList: AsyncParsableCommand { var granularity: String? func run() async throws { - let repo = try ClientProvider.makeAnalyticsReportRepository() + let repo = try ClientProvider.makeAnalyticsReports() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReportRepository) async throws -> String { + func execute(repo: any AnalyticsReports) async throws -> String { let parsed = granularity.flatMap { AnalyticsGranularity(cliArgument: $0) } let instances = try await repo.listInstances(reportId: reportId, granularity: parsed) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift index 3ff56f2f..828f2e5d 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift @@ -16,11 +16,11 @@ struct AnalyticsReportsList: AsyncParsableCommand { var accessType: String? func run() async throws { - let repo = try ClientProvider.makeAnalyticsReportRepository() + let repo = try ClientProvider.makeAnalyticsReports() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReportRepository) async throws -> String { + func execute(repo: any AnalyticsReports) async throws -> String { let parsed = accessType.flatMap { AnalyticsAccessType(cliArgument: $0) } let requests = try await repo.listRequests(appId: appId, accessType: parsed) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift index ca83d0a5..7c56ca71 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift @@ -16,11 +16,11 @@ struct AnalyticsReportsReportsList: AsyncParsableCommand { var category: String? func run() async throws { - let repo = try ClientProvider.makeAnalyticsReportRepository() + let repo = try ClientProvider.makeAnalyticsReports() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReportRepository) async throws -> String { + func execute(repo: any AnalyticsReports) async throws -> String { let parsed = category.flatMap { AnalyticsCategory(cliArgument: $0) } let reports = try await repo.listReports(requestId: requestId, category: parsed) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift index 67e1c51a..5f217479 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift @@ -16,11 +16,11 @@ struct AnalyticsReportsRequest: AsyncParsableCommand { var accessType: String func run() async throws { - let repo = try ClientProvider.makeAnalyticsReportRepository() + let repo = try ClientProvider.makeAnalyticsReports() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReportRepository) async throws -> String { + func execute(repo: any AnalyticsReports) async throws -> String { guard let parsed = AnalyticsAccessType(cliArgument: accessType) else { throw ValidationError("Invalid access type: \(accessType)") } diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift index a1c0e4e3..b3aeeb44 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift @@ -13,11 +13,11 @@ struct AnalyticsReportsSegmentsList: AsyncParsableCommand { var instanceId: String func run() async throws { - let repo = try ClientProvider.makeAnalyticsReportRepository() + let repo = try ClientProvider.makeAnalyticsReports() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReportRepository) async throws -> String { + func execute(repo: any AnalyticsReports) async throws -> String { let segments = try await repo.listSegments(instanceId: instanceId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(segments) diff --git a/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift b/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift index a875cc4a..48d400be 100644 --- a/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift +++ b/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift @@ -21,11 +21,11 @@ struct AppCategoriesGet: AsyncParsableCommand { var categoryId: String func run() async throws { - let repo = try ClientProvider.makeAppCategoryRepository() + let repo = try ClientProvider.makeAppCategories() print(try await execute(repo: repo)) } - func execute(repo: any AppCategoryRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppCategories, affordanceMode: AffordanceMode = .cli) async throws -> String { let category = try await repo.getCategory(id: categoryId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([category], affordanceMode: affordanceMode) @@ -44,11 +44,11 @@ struct AppCategoriesList: AsyncParsableCommand { var platform: String? func run() async throws { - let repo = try ClientProvider.makeAppCategoryRepository() + let repo = try ClientProvider.makeAppCategories() print(try await execute(repo: repo)) } - func execute(repo: any AppCategoryRepository) async throws -> String { + func execute(repo: any AppCategories) async throws -> String { let categories = try await repo.listCategories(platform: platform) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift index 4ab8aa6d..4f6226be 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift @@ -19,11 +19,11 @@ struct AppClipExperienceLocalizationsCreate: AsyncParsableCommand { var subtitle: String? func run() async throws { - let repo = try ClientProvider.makeAppClipRepository() + let repo = try ClientProvider.makeAppClips() print(try await execute(repo: repo)) } - func execute(repo: any AppClipRepository) async throws -> String { + func execute(repo: any AppClips) async throws -> String { let localization = try await repo.createLocalization(experienceId: experienceId, locale: locale, subtitle: subtitle) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift index 8fc3c857..9c2ee4a4 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct AppClipExperienceLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeAppClipRepository() + let repo = try ClientProvider.makeAppClips() try await execute(repo: repo) } - func execute(repo: any AppClipRepository) async throws { + func execute(repo: any AppClips) async throws { try await repo.deleteLocalization(id: localizationId) } } diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift index fbfcff2a..578687bc 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift @@ -13,11 +13,11 @@ struct AppClipExperienceLocalizationsList: AsyncParsableCommand { var experienceId: String func run() async throws { - let repo = try ClientProvider.makeAppClipRepository() + let repo = try ClientProvider.makeAppClips() print(try await execute(repo: repo)) } - func execute(repo: any AppClipRepository) async throws -> String { + func execute(repo: any AppClips) async throws -> String { let localizations = try await repo.listLocalizations(experienceId: experienceId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(localizations) diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift index 3d26ae73..834b32b2 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift @@ -16,11 +16,11 @@ struct AppClipExperiencesCreate: AsyncParsableCommand { var action: String? func run() async throws { - let repo = try ClientProvider.makeAppClipRepository() + let repo = try ClientProvider.makeAppClips() print(try await execute(repo: repo)) } - func execute(repo: any AppClipRepository) async throws -> String { + func execute(repo: any AppClips) async throws -> String { let parsedAction = try resolveAction() let experience = try await repo.createExperience(appClipId: appClipId, action: parsedAction) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift index 560d53fb..78d31a75 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift @@ -13,11 +13,11 @@ struct AppClipExperiencesDelete: AsyncParsableCommand { var experienceId: String func run() async throws { - let repo = try ClientProvider.makeAppClipRepository() + let repo = try ClientProvider.makeAppClips() try await execute(repo: repo) } - func execute(repo: any AppClipRepository) async throws { + func execute(repo: any AppClips) async throws { try await repo.deleteExperience(id: experienceId) } } diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift index eb376219..b5f21da0 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift @@ -13,11 +13,11 @@ struct AppClipExperiencesList: AsyncParsableCommand { var appClipId: String func run() async throws { - let repo = try ClientProvider.makeAppClipRepository() + let repo = try ClientProvider.makeAppClips() print(try await execute(repo: repo)) } - func execute(repo: any AppClipRepository) async throws -> String { + func execute(repo: any AppClips) async throws -> String { let experiences = try await repo.listExperiences(appClipId: appClipId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(experiences) diff --git a/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift b/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift index 53e1fe3d..239938ac 100644 --- a/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift +++ b/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift @@ -13,11 +13,11 @@ struct AppClipsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAppClipRepository() + let repo = try ClientProvider.makeAppClips() print(try await execute(repo: repo)) } - func execute(repo: any AppClipRepository) async throws -> String { + func execute(repo: any AppClips) async throws -> String { let clips = try await repo.listAppClips(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(clips) diff --git a/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift b/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift index ec37c8b0..9dfe4975 100644 --- a/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift +++ b/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift @@ -26,11 +26,11 @@ struct AppInfoLocalizationsList: AsyncParsableCommand { var appInfoId: String func run() async throws { - let repo = try ClientProvider.makeAppInfoRepository() + let repo = try ClientProvider.makeAppInfos() print(try await execute(repo: repo)) } - func execute(repo: any AppInfoRepository) async throws -> String { + func execute(repo: any AppInfos) async throws -> String { let locs = try await repo.listLocalizations(appInfoId: appInfoId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -59,11 +59,11 @@ struct AppInfoLocalizationsCreate: AsyncParsableCommand { var name: String func run() async throws { - let repo = try ClientProvider.makeAppInfoRepository() + let repo = try ClientProvider.makeAppInfos() print(try await execute(repo: repo)) } - func execute(repo: any AppInfoRepository) async throws -> String { + func execute(repo: any AppInfos) async throws -> String { let loc = try await repo.createLocalization(appInfoId: appInfoId, locale: locale, name: name) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -101,11 +101,11 @@ struct AppInfoLocalizationsUpdate: AsyncParsableCommand { var privacyPolicyText: String? func run() async throws { - let repo = try ClientProvider.makeAppInfoRepository() + let repo = try ClientProvider.makeAppInfos() print(try await execute(repo: repo)) } - func execute(repo: any AppInfoRepository) async throws -> String { + func execute(repo: any AppInfos) async throws -> String { let loc = try await repo.updateLocalization( id: localizationId, name: name, @@ -135,11 +135,11 @@ struct AppInfoLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeAppInfoRepository() + let repo = try ClientProvider.makeAppInfos() try await execute(repo: repo) } - func execute(repo: any AppInfoRepository) async throws { + func execute(repo: any AppInfos) async throws { try await repo.deleteLocalization(id: localizationId) print("{\"deleted\": \"\(localizationId)\"}") } diff --git a/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift b/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift index f9344c8b..476563cd 100644 --- a/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift +++ b/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift @@ -21,11 +21,11 @@ struct AppInfosList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAppInfoRepository() + let repo = try ClientProvider.makeAppInfos() print(try await execute(repo: repo)) } - func execute(repo: any AppInfoRepository) async throws -> String { + func execute(repo: any AppInfos) async throws -> String { let infos = try await repo.listAppInfos(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -66,11 +66,11 @@ struct AppInfosUpdate: AsyncParsableCommand { var secondarySubcategoryTwo: String? func run() async throws { - let repo = try ClientProvider.makeAppInfoRepository() + let repo = try ClientProvider.makeAppInfos() print(try await execute(repo: repo)) } - func execute(repo: any AppInfoRepository) async throws -> String { + func execute(repo: any AppInfos) async throws -> String { let info = try await repo.updateCategories( id: appInfoId, primaryCategoryId: primaryCategory, diff --git a/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift b/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift index bffbc7b1..119c1e18 100644 --- a/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift +++ b/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift @@ -22,11 +22,11 @@ struct AppPreviewSetsList: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makePreviewRepository() + let repo = try ClientProvider.makeAppPreviews() print(try await execute(repo: repo)) } - func execute(repo: any PreviewRepository) async throws -> String { + func execute(repo: any AppPreviews) async throws -> String { let sets = try await repo.listPreviewSets(localizationId: localizationId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -52,11 +52,11 @@ struct AppPreviewSetsCreate: AsyncParsableCommand { var previewType: String func run() async throws { - let repo = try ClientProvider.makePreviewRepository() + let repo = try ClientProvider.makeAppPreviews() print(try await execute(repo: repo)) } - func execute(repo: any PreviewRepository) async throws -> String { + func execute(repo: any AppPreviews) async throws -> String { guard let type = PreviewType(rawValue: previewType) else { throw ValidationError("Invalid preview type '\(previewType)'. Use a raw value like IPHONE_67, IPAD_PRO_3GEN_129, APPLE_TV, APPLE_VISION_PRO.") } diff --git a/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift b/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift index 27368ba8..306dd429 100644 --- a/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift +++ b/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift @@ -22,11 +22,11 @@ struct AppPreviewsList: AsyncParsableCommand { var setId: String func run() async throws { - let repo = try ClientProvider.makePreviewRepository() + let repo = try ClientProvider.makeAppPreviews() print(try await execute(repo: repo)) } - func execute(repo: any PreviewRepository) async throws -> String { + func execute(repo: any AppPreviews) async throws -> String { let previews = try await repo.listPreviews(setId: setId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -63,11 +63,11 @@ struct AppPreviewsUpload: AsyncParsableCommand { var previewFrameTimeCode: String? func run() async throws { - let repo = try ClientProvider.makePreviewRepository() + let repo = try ClientProvider.makeAppPreviews() print(try await execute(repo: repo)) } - func execute(repo: any PreviewRepository) async throws -> String { + func execute(repo: any AppPreviews) async throws -> String { let fileURL = URL(fileURLWithPath: file) let preview = try await repo.uploadPreview( setId: setId, diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift index d205b177..91afff41 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift @@ -21,11 +21,11 @@ struct AppShotsGalleryTemplatesList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makeGalleryTemplateRepository() + let repo = ClientProvider.makeGalleryTemplates() print(try await execute(repo: repo)) } - func execute(repo: any GalleryTemplateRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GalleryTemplates, affordanceMode: AffordanceMode = .cli) async throws -> String { let galleries = try await repo.listGalleries() let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -54,11 +54,11 @@ struct AppShotsGalleryTemplatesGet: AsyncParsableCommand { var preview: Bool = false func run() async throws { - let repo = ClientProvider.makeGalleryTemplateRepository() + let repo = ClientProvider.makeGalleryTemplates() print(try await execute(repo: repo)) } - func execute(repo: any GalleryTemplateRepository) async throws -> String { + func execute(repo: any GalleryTemplates) async throws -> String { guard let gallery = try await repo.getGallery(templateId: id) else { throw ValidationError("Gallery template '\(id)' not found. Run `asc app-shots gallery-templates list` to see available templates.") } diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift index a2d88d38..fe0845af 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift @@ -27,11 +27,11 @@ struct AppShotsTemplatesList: AsyncParsableCommand { var preview: Bool = false func run() async throws { - let repo = ClientProvider.makeTemplateRepository() + let repo = ClientProvider.makeTemplates() print(try await execute(repo: repo)) } - func execute(repo: any TemplateRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Templates, affordanceMode: AffordanceMode = .cli) async throws -> String { let templates = try await repo.listTemplates(size: size) if preview { @@ -82,11 +82,11 @@ struct AppShotsTemplatesGet: AsyncParsableCommand { var preview: Bool = false func run() async throws { - let repo = ClientProvider.makeTemplateRepository() + let repo = ClientProvider.makeTemplates() print(try await execute(repo: repo)) } - func execute(repo: any TemplateRepository) async throws -> String { + func execute(repo: any Templates) async throws -> String { guard let template = try await repo.getTemplate(id: id) else { throw ValidationError("Template '\(id)' not found. Run `asc app-shots templates list` to see available templates.") } @@ -145,7 +145,7 @@ struct AppShotsTemplatesApply: AsyncParsableCommand { var imageOutput: String? func run() async throws { - let repo = ClientProvider.makeTemplateRepository() + let repo = ClientProvider.makeTemplates() if preview == .image { let renderer = ClientProvider.makeHTMLRenderer() print(try await execute(repo: repo, renderer: renderer)) @@ -154,7 +154,7 @@ struct AppShotsTemplatesApply: AsyncParsableCommand { } } - func execute(repo: any TemplateRepository, renderer: (any HTMLRenderer)? = nil) async throws -> String { + func execute(repo: any Templates, renderer: (any HTMLRenderer)? = nil) async throws -> String { guard let template = try await repo.getTemplate(id: id) else { throw ValidationError("Template '\(id)' not found. Run `asc app-shots templates list` to see available templates.") } diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift index 409d3ca1..90966caf 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift @@ -27,11 +27,11 @@ struct AppShotsThemesList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makeThemeRepository() + let repo = ClientProvider.makeThemes() print(try await execute(repo: repo)) } - func execute(repo: any ThemeRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Themes, affordanceMode: AffordanceMode = .cli) async throws -> String { let themes = try await repo.listThemes() let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -60,11 +60,11 @@ struct AppShotsThemesGet: AsyncParsableCommand { var context: Bool = false func run() async throws { - let repo = ClientProvider.makeThemeRepository() + let repo = ClientProvider.makeThemes() print(try await execute(repo: repo)) } - func execute(repo: any ThemeRepository) async throws -> String { + func execute(repo: any Themes) async throws -> String { guard let theme = try await repo.getTheme(id: id) else { throw ValidationError("Theme '\(id)' not found. Run `asc app-shots themes list` to see available themes.") } @@ -96,11 +96,11 @@ struct AppShotsThemesDesign: AsyncParsableCommand { var id: String func run() async throws { - let repo = ClientProvider.makeThemeRepository() + let repo = ClientProvider.makeThemes() print(try await execute(themeRepo: repo)) } - func execute(themeRepo: any ThemeRepository) async throws -> String { + func execute(themeRepo: any Themes) async throws -> String { let design = try await themeRepo.design(themeId: id) let encoder = JSONEncoder() encoder.outputFormatting = [.prettyPrinted, .sortedKeys] @@ -150,7 +150,7 @@ struct AppShotsThemesApplyDesign: AsyncParsableCommand { var canvasHeight: Int = 2868 func run() async throws { - let templateRepo = ClientProvider.makeTemplateRepository() + let templateRepo = ClientProvider.makeTemplates() if preview == .image { let renderer = ClientProvider.makeHTMLRenderer() print(try await execute(templateRepo: templateRepo, renderer: renderer)) @@ -159,7 +159,7 @@ struct AppShotsThemesApplyDesign: AsyncParsableCommand { } } - func execute(templateRepo: any TemplateRepository, renderer: (any HTMLRenderer)? = nil) async throws -> String { + func execute(templateRepo: any Templates, renderer: (any HTMLRenderer)? = nil) async throws -> String { let designData = try Data(contentsOf: URL(fileURLWithPath: design)) let themeDesign = try JSONDecoder().decode(ThemeDesign.self, from: designData) @@ -236,8 +236,8 @@ struct AppShotsThemesApply: AsyncParsableCommand { var imageOutput: String? func run() async throws { - let themeRepo = ClientProvider.makeThemeRepository() - let templateRepo = ClientProvider.makeTemplateRepository() + let themeRepo = ClientProvider.makeThemes() + let templateRepo = ClientProvider.makeTemplates() if preview == .image { let renderer = ClientProvider.makeHTMLRenderer() print(try await execute(themeRepo: themeRepo, templateRepo: templateRepo, renderer: renderer)) @@ -246,7 +246,7 @@ struct AppShotsThemesApply: AsyncParsableCommand { } } - func execute(themeRepo: any ThemeRepository, templateRepo: any TemplateRepository, renderer: (any HTMLRenderer)? = nil) async throws -> String { + func execute(themeRepo: any Themes, templateRepo: any Templates, renderer: (any HTMLRenderer)? = nil) async throws -> String { guard let tmpl = try await templateRepo.getTemplate(id: template) else { throw ValidationError("Template '\(template)' not found. Run `asc app-shots templates list` to see available templates.") } diff --git a/Sources/ASCCommand/Commands/AppWall/AppWallSubmit.swift b/Sources/ASCCommand/Commands/AppWall/AppWallSubmit.swift index 6491b5ea..9029f17c 100644 --- a/Sources/ASCCommand/Commands/AppWall/AppWallSubmit.swift +++ b/Sources/ASCCommand/Commands/AppWall/AppWallSubmit.swift @@ -33,11 +33,11 @@ struct AppWallSubmit: AsyncParsableCommand { func run() async throws { let token = try resolveGitHubToken() - let repo = ClientProvider.makeAppWallRepository(token: token) + let repo = ClientProvider.makeAppWall(token: token) print(try await execute(repo: repo)) } - func execute(repo: any AppWallRepository) async throws -> String { + func execute(repo: any AppWall) async throws -> String { let appIdURLs = appId.map { "https://apps.apple.com/app/id\($0)" } let allApps = appIdURLs + app let wallApp = AppWallApp( diff --git a/Sources/ASCCommand/Commands/Apps/AppsList.swift b/Sources/ASCCommand/Commands/Apps/AppsList.swift index 712607d3..0887ac75 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsList.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsList.swift @@ -13,11 +13,11 @@ struct AppsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeAppRepository() + let repo = try ClientProvider.makeApps() print(try await execute(repo: repo)) } - func execute(repo: any AppRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Apps, affordanceMode: AffordanceMode = .cli) async throws -> String { let response = try await repo.listApps(limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift b/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift index b49c32a1..7c5b5ab4 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift @@ -16,11 +16,11 @@ struct AppsPricePointsList: AsyncParsableCommand { var territory: String = "USA" func run() async throws { - let repo = try ClientProvider.makePricingRepository() + let repo = try ClientProvider.makeAppPrices() print(try await execute(repo: repo)) } - func execute(repo: any PricingRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppPrices, affordanceMode: AffordanceMode = .cli) async throws -> String { let points = try await repo.listPricePoints(appId: appId, territory: territory) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(points, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift b/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift index d5a43977..e91d0b3b 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift @@ -19,11 +19,11 @@ struct AppsPricesSet: AsyncParsableCommand { var pricePointId: String func run() async throws { - let repo = try ClientProvider.makePricingRepository() + let repo = try ClientProvider.makeAppPrices() print(try await execute(repo: repo)) } - func execute(repo: any PricingRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppPrices, affordanceMode: AffordanceMode = .cli) async throws -> String { let schedule = try await repo.setPriceSchedule(appId: appId, baseTerritory: baseTerritory, pricePointId: pricePointId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([schedule], affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift b/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift index 80933c49..8abb22aa 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift @@ -19,11 +19,11 @@ struct AppsUpdate: AsyncParsableCommand { var contentRightsDeclaration: String? func run() async throws { - let repo = try ClientProvider.makeAppRepository() + let repo = try ClientProvider.makeApps() print(try await execute(repo: repo)) } - func execute(repo: any AppRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Apps, affordanceMode: AffordanceMode = .cli) async throws -> String { let declaration = try validateDeclaration() let updated = try await repo.updateContentRights(appId: appId, declaration: declaration) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift index 8100feb1..b735debc 100644 --- a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift @@ -23,14 +23,14 @@ struct AppAvailabilityCreate: AsyncParsableCommand { func run() async throws { print(try await execute( - repo: try ClientProvider.makeAppAvailabilityRepository(), - territoryRepo: try ClientProvider.makeTerritoryRepository() + repo: try ClientProvider.makeAppAvailabilities(), + territoryRepo: try ClientProvider.makeTerritories() )) } func execute( - repo: any AppAvailabilityRepository, - territoryRepo: any TerritoryRepository, + repo: any AppAvailabilities, + territoryRepo: any Territories, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard allTerritories != !territory.isEmpty else { diff --git a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift index 59023faa..1db3d46a 100644 --- a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift @@ -14,7 +14,7 @@ struct AppAvailabilityGet: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAppAvailabilityRepository() + let repo = try ClientProvider.makeAppAvailabilities() let output = try await execute(repo: repo) print(output) if output.contains("\"data\" : [\n\n ]") || output.contains("\"data\":[]") { @@ -25,7 +25,7 @@ struct AppAvailabilityGet: AsyncParsableCommand { } } - func execute(repo: any AppAvailabilityRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppAvailabilities, affordanceMode: AffordanceMode = .cli) async throws -> String { let availability = try await repo.getAppAvailability(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) // nil → empty data array: availability was never set up (mirrors `iap-availability get`). diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift index 9ee18d77..7a269f01 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift @@ -31,11 +31,11 @@ struct AssetImagesList: AsyncParsableCommand { var category: AssetCategory? func run() async throws { - let repo = try ClientProvider.makeLibraryImageRepository() + let repo = try ClientProvider.makeLibraryImages() print(try await execute(repo: repo)) } - func execute(repo: any LibraryImageRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any LibraryImages, affordanceMode: AffordanceMode = .cli) async throws -> String { let images = try await repo.listImages(libraryId: libraryId, imageId: imageId, state: state, category: category) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(images, affordanceMode: affordanceMode) @@ -66,12 +66,12 @@ struct AssetImagesUpload: AsyncParsableCommand { var wait: Bool = false func run() async throws { - let repo = try ClientProvider.makeLibraryImageRepository() + let repo = try ClientProvider.makeLibraryImages() print(try await execute(repo: repo)) } func execute( - repo: any LibraryImageRepository, + repo: any LibraryImages, affordanceMode: AffordanceMode = .cli, sleep: @Sendable (UInt64) async throws -> Void = { try await Task.sleep(nanoseconds: $0) } ) async throws -> String { @@ -115,11 +115,11 @@ struct AssetImagesUpdate: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeLibraryImageRepository() + let repo = try ClientProvider.makeLibraryImages() print(try await execute(repo: repo)) } - func execute(repo: any LibraryImageRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any LibraryImages, affordanceMode: AffordanceMode = .cli) async throws -> String { let image = try await repo.updateImage(libraryId: libraryId, imageId: imageId, referenceName: referenceName, isArchived: archived) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([image], affordanceMode: affordanceMode) @@ -138,11 +138,11 @@ struct AssetImagesDelete: AsyncParsableCommand { var imageId: String func run() async throws { - let repo = try ClientProvider.makeLibraryImageRepository() + let repo = try ClientProvider.makeLibraryImages() try await execute(repo: repo) } - func execute(repo: any LibraryImageRepository) async throws { + func execute(repo: any LibraryImages) async throws { try await repo.deleteImage(imageId: imageId) } } diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift index 98836752..9db60ebc 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift @@ -25,11 +25,11 @@ struct AssetLibraryGet: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAssetLibraryRepository() + let repo = try ClientProvider.makeAssetLibraries() print(try await execute(repo: repo)) } - func execute(repo: any AssetLibraryRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetLibraries, affordanceMode: AffordanceMode = .cli) async throws -> String { let library = try await repo.getAssetLibrary(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([library], affordanceMode: affordanceMode) @@ -59,11 +59,11 @@ struct AssetPlacementGroupsList: AsyncParsableCommand { var feature: String? func run() async throws { - let repo = try ClientProvider.makeAssetLibraryRepository() + let repo = try ClientProvider.makeAssetLibraries() print(try await execute(repo: repo)) } - func execute(repo: any AssetLibraryRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetLibraries, affordanceMode: AffordanceMode = .cli) async throws -> String { let groups = try await repo.listPlacementGroups(placementType: placementType, feature: feature) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(groups, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift index 73c7d085..b8b922a5 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift @@ -41,11 +41,11 @@ struct AssetPlacementsList: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeAssetPlacementRepository() + let repo = try ClientProvider.makeAssetPlacements() print(try await execute(repo: repo)) } - func execute(repo: any AssetPlacementRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetPlacements, affordanceMode: AffordanceMode = .cli) async throws -> String { let placements: [AssetPlacement] if let (surface, localizationId) = surface.selected { placements = try await repo.listPlacements( @@ -91,11 +91,11 @@ struct AssetPlacementsCreate: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeAssetPlacementRepository() + let repo = try ClientProvider.makeAssetPlacements() print(try await execute(repo: repo)) } - func execute(repo: any AssetPlacementRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetPlacements, affordanceMode: AffordanceMode = .cli) async throws -> String { guard let (surface, localizationId) = surface.selected else { throw ValidationError("Pass a localization") } let (mediaType, assetId): (AssetMediaType, String) = videoId.map { (.video, $0) } ?? (.image, imageId ?? "") let placement = try await repo.createPlacement( @@ -119,11 +119,11 @@ struct AssetPlacementsDelete: AsyncParsableCommand { var placementId: String func run() async throws { - let repo = try ClientProvider.makeAssetPlacementRepository() + let repo = try ClientProvider.makeAssetPlacements() try await execute(repo: repo) } - func execute(repo: any AssetPlacementRepository) async throws { + func execute(repo: any AssetPlacements) async throws { try await repo.deletePlacement(placementId: placementId) } } @@ -148,11 +148,11 @@ struct AssetPlacementsReorder: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeAssetPlacementRepository() + let repo = try ClientProvider.makeAssetPlacements() print(try await execute(repo: repo)) } - func execute(repo: any AssetPlacementRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetPlacements, affordanceMode: AffordanceMode = .cli) async throws -> String { let ids = placementIds.split(separator: ",").map { $0.trimmingCharacters(in: .whitespaces) }.filter { !$0.isEmpty } guard let (surface, localizationId) = surface.selected else { throw ValidationError("Pass a localization") } let placements = try await repo.reorderPlacements( diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift index 7fc08e2d..89285d43 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift @@ -31,11 +31,11 @@ struct AssetVideosList: AsyncParsableCommand { var category: AssetCategory? func run() async throws { - let repo = try ClientProvider.makeLibraryVideoRepository() + let repo = try ClientProvider.makeLibraryVideos() print(try await execute(repo: repo)) } - func execute(repo: any LibraryVideoRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any LibraryVideos, affordanceMode: AffordanceMode = .cli) async throws -> String { let videos = try await repo.listVideos(libraryId: libraryId, videoId: videoId, state: state, category: category) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(videos, affordanceMode: affordanceMode) @@ -69,12 +69,12 @@ struct AssetVideosUpload: AsyncParsableCommand { var wait: Bool = false func run() async throws { - let repo = try ClientProvider.makeLibraryVideoRepository() + let repo = try ClientProvider.makeLibraryVideos() print(try await execute(repo: repo)) } func execute( - repo: any LibraryVideoRepository, + repo: any LibraryVideos, affordanceMode: AffordanceMode = .cli, sleep: @Sendable (UInt64) async throws -> Void = { try await Task.sleep(nanoseconds: $0) } ) async throws -> String { @@ -119,11 +119,11 @@ struct AssetVideosUpdate: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeLibraryVideoRepository() + let repo = try ClientProvider.makeLibraryVideos() print(try await execute(repo: repo)) } - func execute(repo: any LibraryVideoRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any LibraryVideos, affordanceMode: AffordanceMode = .cli) async throws -> String { let video = try await repo.updateVideo(libraryId: libraryId, videoId: videoId, referenceName: referenceName, isArchived: archived) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([video], affordanceMode: affordanceMode) @@ -142,11 +142,11 @@ struct AssetVideosDelete: AsyncParsableCommand { var videoId: String func run() async throws { - let repo = try ClientProvider.makeLibraryVideoRepository() + let repo = try ClientProvider.makeLibraryVideos() try await execute(repo: repo) } - func execute(repo: any LibraryVideoRepository) async throws { + func execute(repo: any LibraryVideos) async throws { try await repo.deleteVideo(videoId: videoId) } } diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift index 8481708a..d89df7c1 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift @@ -31,12 +31,12 @@ struct BetaAppLocalizationsCreate: AsyncParsableCommand { var tvOsPrivacyPolicy: String? func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizationRepository() + let repo = try ClientProvider.makeBetaAppLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any BetaAppLocalizationRepository, + repo: any BetaAppLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let update = BetaAppLocalizationUpdate( diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift index 2162131f..36bbb68a 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct BetaAppLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizationRepository() + let repo = try ClientProvider.makeBetaAppLocalizations() try await execute(repo: repo) } - func execute(repo: any BetaAppLocalizationRepository) async throws { + func execute(repo: any BetaAppLocalizations) async throws { try await repo.deleteBetaAppLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift index 11de68b9..84cbf6a2 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift @@ -13,12 +13,12 @@ struct BetaAppLocalizationsGet: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizationRepository() + let repo = try ClientProvider.makeBetaAppLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any BetaAppLocalizationRepository, + repo: any BetaAppLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.getBetaAppLocalization(localizationId: localizationId) diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift index 5259cc6a..1eb21201 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift @@ -13,12 +13,12 @@ struct BetaAppLocalizationsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizationRepository() + let repo = try ClientProvider.makeBetaAppLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any BetaAppLocalizationRepository, + repo: any BetaAppLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listBetaAppLocalizations(appId: appId) diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift index 89002b60..b132fa74 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift @@ -28,12 +28,12 @@ struct BetaAppLocalizationsUpdate: AsyncParsableCommand { var tvOsPrivacyPolicy: String? func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizationRepository() + let repo = try ClientProvider.makeBetaAppLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any BetaAppLocalizationRepository, + repo: any BetaAppLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let update = BetaAppLocalizationUpdate( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift index 647f46c9..a55f1821 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift @@ -13,11 +13,11 @@ struct BetaReviewDetailGet: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppReviewRepository() + let repo = try ClientProvider.makeBetaAppReviews() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviewRepository) async throws -> String { + func execute(repo: any BetaAppReviews) async throws -> String { let detail = try await repo.getDetail(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift index fe5b7574..48c33946 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift @@ -37,11 +37,11 @@ struct BetaReviewDetailUpdate: AsyncParsableCommand { var notes: String? func run() async throws { - let repo = try ClientProvider.makeBetaAppReviewRepository() + let repo = try ClientProvider.makeBetaAppReviews() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviewRepository) async throws -> String { + func execute(repo: any BetaAppReviews) async throws -> String { let update = ASCKit.BetaAppReviewDetailUpdate( contactFirstName: contactFirstName, contactLastName: contactLastName, diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift index 1f1f62db..6839e273 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift @@ -13,11 +13,11 @@ struct BetaReviewSubmissionsCreate: AsyncParsableCommand { var buildId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppReviewRepository() + let repo = try ClientProvider.makeBetaAppReviews() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviewRepository) async throws -> String { + func execute(repo: any BetaAppReviews) async throws -> String { let submission = try await repo.createSubmission(buildId: buildId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift index 9637cfcf..3b351be9 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift @@ -13,11 +13,11 @@ struct BetaReviewSubmissionsGet: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppReviewRepository() + let repo = try ClientProvider.makeBetaAppReviews() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviewRepository) async throws -> String { + func execute(repo: any BetaAppReviews) async throws -> String { let submission = try await repo.getSubmission(id: submissionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift index 22002c43..c7871aeb 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift @@ -13,11 +13,11 @@ struct BetaReviewSubmissionsList: AsyncParsableCommand { var buildId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppReviewRepository() + let repo = try ClientProvider.makeBetaAppReviews() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviewRepository) async throws -> String { + func execute(repo: any BetaAppReviews) async throws -> String { let submissions = try await repo.listSubmissions(buildId: buildId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(submissions) diff --git a/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift b/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift index 32e88b12..1edf5a1d 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift @@ -16,11 +16,11 @@ struct BuildsAddBetaGroup: AsyncParsableCommand { var betaGroupId: String func run() async throws { - let repo = try ClientProvider.makeBuildRepository() + let repo = try ClientProvider.makeBuilds() try await execute(repo: repo) } - func execute(repo: any BuildRepository) async throws { + func execute(repo: any Builds) async throws { try await repo.addBetaGroups(buildId: buildId, betaGroupIds: [betaGroupId]) } } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift b/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift index 5c3bf9b4..18ed5533 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift @@ -53,13 +53,13 @@ struct BuildsArchive: AsyncParsableCommand { func run() async throws { let runner = ClientProvider.makeXcodeBuildRunner() - let uploadRepo = upload ? try ClientProvider.makeBuildUploadRepository() : nil + let uploadRepo = upload ? try ClientProvider.makeBuildUploads() : nil print(try await execute(runner: runner, uploadRepo: uploadRepo)) } func execute( runner: any XcodeBuildRunner, - uploadRepo: (any BuildUploadRepository)? = nil + uploadRepo: (any BuildUploads)? = nil ) async throws -> String { // Resolve platform let resolvedPlatform: BuildUploadPlatform diff --git a/Sources/ASCCommand/Commands/Builds/BuildsList.swift b/Sources/ASCCommand/Commands/Builds/BuildsList.swift index 015d5f21..323c540c 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsList.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsList.swift @@ -22,11 +22,11 @@ struct BuildsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeBuildRepository() + let repo = try ClientProvider.makeBuilds() print(try await execute(repo: repo)) } - func execute(repo: any BuildRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Builds, affordanceMode: AffordanceMode = .cli) async throws -> String { let platformFilter = platform.flatMap { BuildUploadPlatform(cliArgument: $0) } let response = try await repo.listBuilds(appId: appId, platform: platformFilter, version: version, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift b/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift index 5b3c42f1..d0eef3d4 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift @@ -19,11 +19,11 @@ struct BuildsNextNumber: AsyncParsableCommand { var platform: String func run() async throws { - let repo = try ClientProvider.makeBuildRepository() + let repo = try ClientProvider.makeBuilds() print(try await execute(repo: repo)) } - func execute(repo: any BuildRepository) async throws -> String { + func execute(repo: any Builds) async throws -> String { guard let platformValue = BuildUploadPlatform(cliArgument: platform) else { throw ValidationError("Invalid platform '\(platform)'. Use: ios, macos, tvos, visionos") } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift b/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift index 58192ebc..c405e18d 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift @@ -16,11 +16,11 @@ struct BuildsRemoveBetaGroup: AsyncParsableCommand { var betaGroupId: String func run() async throws { - let repo = try ClientProvider.makeBuildRepository() + let repo = try ClientProvider.makeBuilds() try await execute(repo: repo) } - func execute(repo: any BuildRepository) async throws { + func execute(repo: any Builds) async throws { try await repo.removeBetaGroups(buildId: buildId, betaGroupIds: [betaGroupId]) } } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift b/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift index f610c471..c7462a99 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift @@ -16,12 +16,12 @@ struct BuildsSetEncryptionCompliance: AsyncParsableCommand { var usesNonExemptEncryption: Bool func run() async throws { - let repo = try ClientProvider.makeBuildRepository() + let repo = try ClientProvider.makeBuilds() print(try await execute(repo: repo)) } func execute( - repo: any BuildRepository, + repo: any Builds, affordanceMode: AffordanceMode = .cli ) async throws -> String { let build = try await repo.updateBuildEncryptionCompliance( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift b/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift index c0a0145c..de131596 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift @@ -19,11 +19,11 @@ struct BuildsUpdateBetaNotes: AsyncParsableCommand { var notes: String func run() async throws { - let repo = try ClientProvider.makeBetaBuildLocalizationRepository() + let repo = try ClientProvider.makeBetaBuildLocalizations() print(try await execute(repo: repo)) } - func execute(repo: any BetaBuildLocalizationRepository) async throws -> String { + func execute(repo: any BetaBuildLocalizations) async throws -> String { let loc = try await repo.upsertBetaBuildLocalization(buildId: buildId, locale: locale, whatsNew: notes) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift b/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift index 8fe67264..13952bcb 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift @@ -29,11 +29,11 @@ struct BuildsUpload: AsyncParsableCommand { var wait: Bool = false func run() async throws { - let repo = try ClientProvider.makeBuildUploadRepository() + let repo = try ClientProvider.makeBuildUploads() print(try await execute(repo: repo)) } - func execute(repo: any BuildUploadRepository) async throws -> String { + func execute(repo: any BuildUploads) async throws -> String { let fileURL = URL(fileURLWithPath: file) let resolvedPlatform: BuildUploadPlatform @@ -66,7 +66,7 @@ struct BuildsUpload: AsyncParsableCommand { ) } - private func poll(uploadId: String, repo: any BuildUploadRepository) async throws -> BuildUpload { + private func poll(uploadId: String, repo: any BuildUploads) async throws -> BuildUpload { while true { let upload = try await repo.getBuildUpload(id: uploadId) if upload.state.hasFailed { diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift index e480fd02..175051bf 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift @@ -13,11 +13,11 @@ struct BuildsUploadsDelete: AsyncParsableCommand { var uploadId: String func run() async throws { - let repo = try ClientProvider.makeBuildUploadRepository() + let repo = try ClientProvider.makeBuildUploads() try await execute(repo: repo) } - func execute(repo: any BuildUploadRepository) async throws { + func execute(repo: any BuildUploads) async throws { try await repo.deleteBuildUpload(id: uploadId) } } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift index ee8117a0..73e3dd78 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift @@ -13,11 +13,11 @@ struct BuildsUploadsGet: AsyncParsableCommand { var uploadId: String func run() async throws { - let repo = try ClientProvider.makeBuildUploadRepository() + let repo = try ClientProvider.makeBuildUploads() print(try await execute(repo: repo)) } - func execute(repo: any BuildUploadRepository) async throws -> String { + func execute(repo: any BuildUploads) async throws -> String { let upload = try await repo.getBuildUpload(id: uploadId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift index 23464f54..fbd8b51a 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift @@ -13,11 +13,11 @@ struct BuildsUploadsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeBuildUploadRepository() + let repo = try ClientProvider.makeBuildUploads() print(try await execute(repo: repo)) } - func execute(repo: any BuildUploadRepository) async throws -> String { + func execute(repo: any BuildUploads) async throws -> String { let uploads = try await repo.listBuildUploads(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(uploads) diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift index bcb71487..59ac7b1c 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift @@ -19,11 +19,11 @@ struct BundleIDsCreate: AsyncParsableCommand { var platform: String func run() async throws { - let repo = try ClientProvider.makeBundleIDRepository() + let repo = try ClientProvider.makeBundleIDs() print(try await execute(repo: repo)) } - func execute(repo: any BundleIDRepository) async throws -> String { + func execute(repo: any BundleIDs) async throws -> String { guard let domainPlatform = BundleIDPlatform(cliArgument: platform) else { throw ValidationError("Invalid platform '\(platform)'. Use ios, macos, or universal.") } diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift index 53df1d4a..9bb782a7 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift @@ -13,11 +13,11 @@ struct BundleIDsDelete: AsyncParsableCommand { var bundleIdId: String func run() async throws { - let repo = try ClientProvider.makeBundleIDRepository() + let repo = try ClientProvider.makeBundleIDs() try await execute(repo: repo) } - func execute(repo: any BundleIDRepository) async throws { + func execute(repo: any BundleIDs) async throws { try await repo.deleteBundleID(id: bundleIdId) } } diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift index 88f94743..385896fa 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift @@ -16,11 +16,11 @@ struct BundleIDsList: AsyncParsableCommand { var identifier: String? func run() async throws { - let repo = try ClientProvider.makeBundleIDRepository() + let repo = try ClientProvider.makeBundleIDs() print(try await execute(repo: repo)) } - func execute(repo: any BundleIDRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any BundleIDs, affordanceMode: AffordanceMode = .cli) async throws -> String { let domainPlatform = platform.flatMap { BundleIDPlatform(cliArgument: $0) } let items = try await repo.listBundleIDs(platform: domainPlatform, identifier: identifier) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift index 9c4908ce..ede6f789 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift @@ -20,11 +20,11 @@ struct CertificatesCreate: AsyncParsableCommand { var csrContent: String? func run() async throws { - let repo = try ClientProvider.makeCertificateRepository() + let repo = try ClientProvider.makeCertificates() print(try await execute(repo: repo)) } - func execute(repo: any CertificateRepository) async throws -> String { + func execute(repo: any Certificates) async throws -> String { guard let certType = CertificateType(rawValue: type.uppercased()) else { throw ValidationError("Invalid certificate type '\(type)'.") } diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift index 01b01589..ed60b9dd 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift @@ -23,11 +23,11 @@ struct CertificatesList: AsyncParsableCommand { var before: String? func run() async throws { - let repo = try ClientProvider.makeCertificateRepository() + let repo = try ClientProvider.makeCertificates() print(try await execute(repo: repo)) } - func execute(repo: any CertificateRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Certificates, affordanceMode: AffordanceMode = .cli) async throws -> String { let certType = type.flatMap { CertificateType(rawValue: $0.uppercased()) } var items = try await repo.listCertificates(certificateType: certType, limit: limit) diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift index dce7e140..bf83c6c0 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift @@ -13,11 +13,11 @@ struct CertificatesRevoke: AsyncParsableCommand { var certificateId: String func run() async throws { - let repo = try ClientProvider.makeCertificateRepository() + let repo = try ClientProvider.makeCertificates() try await execute(repo: repo) } - func execute(repo: any CertificateRepository) async throws { + func execute(repo: any Certificates) async throws { try await repo.revokeCertificate(id: certificateId) } } diff --git a/Sources/ASCCommand/Commands/Devices/DevicesList.swift b/Sources/ASCCommand/Commands/Devices/DevicesList.swift index 92b3a364..0e7e1d12 100644 --- a/Sources/ASCCommand/Commands/Devices/DevicesList.swift +++ b/Sources/ASCCommand/Commands/Devices/DevicesList.swift @@ -13,11 +13,11 @@ struct DevicesList: AsyncParsableCommand { var platform: String? func run() async throws { - let repo = try ClientProvider.makeDeviceRepository() + let repo = try ClientProvider.makeDevices() print(try await execute(repo: repo)) } - func execute(repo: any DeviceRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Devices, affordanceMode: AffordanceMode = .cli) async throws -> String { let domainPlatform = platform.flatMap { BundleIDPlatform(cliArgument: $0) } let items = try await repo.listDevices(platform: domainPlatform) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift b/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift index f7e380c9..05b5f647 100644 --- a/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift +++ b/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift @@ -19,11 +19,11 @@ struct DevicesRegister: AsyncParsableCommand { var platform: String func run() async throws { - let repo = try ClientProvider.makeDeviceRepository() + let repo = try ClientProvider.makeDevices() print(try await execute(repo: repo)) } - func execute(repo: any DeviceRepository) async throws -> String { + func execute(repo: any Devices) async throws -> String { guard let domainPlatform = BundleIDPlatform(cliArgument: platform) else { throw ValidationError("Invalid platform '\(platform)'. Use ios or macos.") } diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift index 0088dd49..74a17c94 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift @@ -16,12 +16,12 @@ struct ExperimentTreatmentLocalizationsCreate: AsyncParsableCommand { var locale: String func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { let created = try await repo.createTreatmentLocalization(treatmentId: treatmentId, locale: locale) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift index e6a1c079..2cca4775 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct ExperimentTreatmentLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() try await execute(repo: repo) } - func execute(repo: any ExperimentRepository) async throws { + func execute(repo: any Experiments) async throws { try await repo.deleteTreatmentLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift index 35e84b78..ff5a7450 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift @@ -16,12 +16,12 @@ struct ExperimentTreatmentLocalizationsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listTreatmentLocalizations(treatmentId: treatmentId, limit: limit) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift index 71a47135..2b647ed1 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift @@ -19,12 +19,12 @@ struct ExperimentTreatmentsCreate: AsyncParsableCommand { var appIconName: String? func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { let created = try await repo.createTreatment(experimentId: experimentId, name: name, appIconName: appIconName) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift index 403a2a04..5e2b6bd7 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift @@ -13,11 +13,11 @@ struct ExperimentTreatmentsDelete: AsyncParsableCommand { var treatmentId: String func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() try await execute(repo: repo) } - func execute(repo: any ExperimentRepository) async throws { + func execute(repo: any Experiments) async throws { try await repo.deleteTreatment(treatmentId: treatmentId) } } diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift index e39f2458..25f67950 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift @@ -16,12 +16,12 @@ struct ExperimentTreatmentsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listTreatments(experimentId: experimentId, limit: limit) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift index 346da740..93c255b6 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift @@ -19,12 +19,12 @@ struct ExperimentTreatmentsUpdate: AsyncParsableCommand { var appIconName: String? func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard name != nil || appIconName != nil else { diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift index 5d9e4faa..c60e9192 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift @@ -22,12 +22,12 @@ struct ExperimentsCreate: AsyncParsableCommand { var trafficProportion: Int func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard let appStorePlatform = AppStorePlatform(cliArgument: platform) else { diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift index bbbba8dd..8abf0889 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift @@ -13,11 +13,11 @@ struct ExperimentsDelete: AsyncParsableCommand { var experimentId: String func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() try await execute(repo: repo) } - func execute(repo: any ExperimentRepository) async throws { + func execute(repo: any Experiments) async throws { try await repo.deleteExperiment(experimentId: experimentId) } } diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift index 41fad093..a8d7b3f1 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift @@ -13,12 +13,12 @@ struct ExperimentsGet: AsyncParsableCommand { var experimentId: String func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { let experiment = try await repo.getExperiment(experimentId: experimentId) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift index dcd28eb8..a7b80250 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift @@ -19,12 +19,12 @@ struct ExperimentsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { var stateFilter: AppStoreVersionExperimentState? diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift index 0fe823c2..3971c0ff 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift @@ -13,12 +13,12 @@ struct ExperimentsStart: AsyncParsableCommand { var experimentId: String func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { let updated = try await repo.updateExperiment( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift index 59596f0e..58a44623 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift @@ -13,12 +13,12 @@ struct ExperimentsStop: AsyncParsableCommand { var experimentId: String func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { let updated = try await repo.updateExperiment( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift index f462291d..963bf412 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift @@ -19,12 +19,12 @@ struct ExperimentsUpdate: AsyncParsableCommand { var trafficProportion: Int? func run() async throws { - let repo = try ClientProvider.makeExperimentRepository() + let repo = try ClientProvider.makeExperiments() print(try await execute(repo: repo)) } func execute( - repo: any ExperimentRepository, + repo: any Experiments, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard name != nil || trafficProportion != nil else { diff --git a/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift b/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift index 21c9e372..1efecd6f 100644 --- a/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift +++ b/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift @@ -40,11 +40,11 @@ struct GameCenterDetailGet: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterRepository() + let repo = try ClientProvider.makeGameCenter() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenter, affordanceMode: AffordanceMode = .cli) async throws -> String { let detail = try await repo.getDetail(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([detail], affordanceMode: affordanceMode) @@ -77,11 +77,11 @@ struct GameCenterAchievementsList: AsyncParsableCommand { var detailId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterRepository() + let repo = try ClientProvider.makeGameCenter() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterRepository) async throws -> String { + func execute(repo: any GameCenter) async throws -> String { let items = try await repo.listAchievements(gameCenterDetailId: detailId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -119,11 +119,11 @@ struct GameCenterAchievementsCreate: AsyncParsableCommand { var repeatable: Bool = false func run() async throws { - let repo = try ClientProvider.makeGameCenterRepository() + let repo = try ClientProvider.makeGameCenter() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterRepository) async throws -> String { + func execute(repo: any GameCenter) async throws -> String { let item = try await repo.createAchievement( gameCenterDetailId: detailId, referenceName: referenceName, @@ -153,11 +153,11 @@ struct GameCenterAchievementsDelete: AsyncParsableCommand { var achievementId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterRepository() + let repo = try ClientProvider.makeGameCenter() try await execute(repo: repo) } - func execute(repo: any GameCenterRepository) async throws { + func execute(repo: any GameCenter) async throws { try await repo.deleteAchievement(id: achievementId) } } @@ -188,11 +188,11 @@ struct GameCenterLeaderboardsList: AsyncParsableCommand { var detailId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterRepository() + let repo = try ClientProvider.makeGameCenter() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenter, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = try await repo.listLeaderboards(gameCenterDetailId: detailId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -223,11 +223,11 @@ struct GameCenterLeaderboardsCreate: AsyncParsableCommand { var submissionType: String = "BEST_SCORE" func run() async throws { - let repo = try ClientProvider.makeGameCenterRepository() + let repo = try ClientProvider.makeGameCenter() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterRepository) async throws -> String { + func execute(repo: any GameCenter) async throws -> String { guard let sortType = ScoreSortType(rawValue: scoreSortType.uppercased()) else { throw ValidationError("Invalid --score-sort-type '\(scoreSortType)'. Use: ASC or DESC") } @@ -262,11 +262,11 @@ struct GameCenterLeaderboardsDelete: AsyncParsableCommand { var leaderboardId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterRepository() + let repo = try ClientProvider.makeGameCenter() try await execute(repo: repo) } - func execute(repo: any GameCenterRepository) async throws { + func execute(repo: any GameCenter) async throws { try await repo.deleteLeaderboard(id: leaderboardId) } } diff --git a/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift b/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift index 97d637a0..b4e6c90e 100644 --- a/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift +++ b/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift @@ -30,11 +30,11 @@ struct GameCenterScoreModerationsList: AsyncParsableCommand { var blockedOnly: Bool = false func run() async throws { - let repo = try ClientProvider.makeGameCenterModerationRepository() + let repo = try ClientProvider.makeGameCenterModeration() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = try await repo.listScoreModerations(leaderboardId: leaderboardId, blockedOnly: blockedOnly) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -53,11 +53,11 @@ struct GameCenterScoreModerationsBlock: AsyncParsableCommand { var moderationId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModerationRepository() + let repo = try ClientProvider.makeGameCenterModeration() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = [try await repo.updateScoreModeration(id: moderationId, isBlocked: true)] let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -76,11 +76,11 @@ struct GameCenterScoreModerationsUnblock: AsyncParsableCommand { var moderationId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModerationRepository() + let repo = try ClientProvider.makeGameCenterModeration() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = [try await repo.updateScoreModeration(id: moderationId, isBlocked: false)] let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -109,11 +109,11 @@ struct GameCenterBlockedPlayersList: AsyncParsableCommand { var detailId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModerationRepository() + let repo = try ClientProvider.makeGameCenterModeration() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = try await repo.listBlockedPlayers(gameCenterDetailId: detailId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -142,11 +142,11 @@ struct GameCenterPlayersBlock: AsyncParsableCommand { var playerId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModerationRepository() + let repo = try ClientProvider.makeGameCenterModeration() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = [try await repo.updatePlayer(id: playerId, isBlocked: true)] let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -165,11 +165,11 @@ struct GameCenterPlayersUnblock: AsyncParsableCommand { var playerId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModerationRepository() + let repo = try ClientProvider.makeGameCenterModeration() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = [try await repo.updatePlayer(id: playerId, isBlocked: false)] let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift index e17aa1e4..a6bc2ceb 100644 --- a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift @@ -19,12 +19,12 @@ struct IAPAvailabilityCreate: AsyncParsableCommand { var territory: [String] = [] func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseAvailabilityRepository() + let repo = try ClientProvider.makeInAppPurchaseAvailabilities() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseAvailabilityRepository, + repo: any InAppPurchaseAvailabilities, affordanceMode: AffordanceMode = .cli ) async throws -> String { let availability = try await repo.createAvailability( diff --git a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift index 4181fa8e..9f28398f 100644 --- a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift @@ -13,12 +13,12 @@ struct IAPAvailabilityGet: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseAvailabilityRepository() + let repo = try ClientProvider.makeInAppPurchaseAvailabilities() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseAvailabilityRepository, + repo: any InAppPurchaseAvailabilities, affordanceMode: AffordanceMode = .cli ) async throws -> String { let availability = try await repo.getAvailability(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAP/IAPCreate.swift b/Sources/ASCCommand/Commands/IAP/IAPCreate.swift index d528a5d6..6fe33897 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPCreate.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPCreate.swift @@ -22,11 +22,11 @@ struct IAPCreate: AsyncParsableCommand { var type: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseRepository() + let repo = try ClientProvider.makeInAppPurchases() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseRepository) async throws -> String { + func execute(repo: any InAppPurchases) async throws -> String { guard let iapType = InAppPurchaseType(cliArgument: type) else { throw ValidationError("Invalid type '\(type)'. Use: consumable, non-consumable, non-renewing-subscription") } diff --git a/Sources/ASCCommand/Commands/IAP/IAPDelete.swift b/Sources/ASCCommand/Commands/IAP/IAPDelete.swift index 448f09e7..a877510f 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPDelete.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPDelete.swift @@ -13,11 +13,11 @@ struct IAPDelete: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseRepository() + let repo = try ClientProvider.makeInAppPurchases() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseRepository) async throws { + func execute(repo: any InAppPurchases) async throws { try await repo.deleteInAppPurchase(iapId: iapId) } } diff --git a/Sources/ASCCommand/Commands/IAP/IAPList.swift b/Sources/ASCCommand/Commands/IAP/IAPList.swift index d93ae9e8..93731e9a 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPList.swift @@ -16,11 +16,11 @@ struct IAPList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseRepository() + let repo = try ClientProvider.makeInAppPurchases() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any InAppPurchases, affordanceMode: AffordanceMode = .cli) async throws -> String { let response = try await repo.listInAppPurchases(appId: appId, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift b/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift index 02874deb..3f53c34b 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift @@ -22,12 +22,12 @@ struct IAPPricePointsList: AsyncParsableCommand { var cursor: String? func run() async throws { - let repo = try ClientProvider.makeInAppPurchasePriceRepository() + let repo = try ClientProvider.makeInAppPurchasePrices() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchasePriceRepository, + repo: any InAppPurchasePrices, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listPricePoints( diff --git a/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift b/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift index 42c9cf7b..9ca40b01 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift @@ -19,11 +19,11 @@ struct IAPPricesSet: AsyncParsableCommand { var pricePointId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchasePriceRepository() + let repo = try ClientProvider.makeInAppPurchasePrices() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchasePriceRepository) async throws -> String { + func execute(repo: any InAppPurchasePrices) async throws -> String { let schedule = try await repo.setPriceSchedule( iapId: iapId, baseTerritory: baseTerritory, diff --git a/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift b/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift index 03e3a020..00733726 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift @@ -13,11 +13,11 @@ struct IAPSubmit: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseSubmissionRepository() + let repo = try ClientProvider.makeInAppPurchaseSubmissions() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseSubmissionRepository) async throws -> String { + func execute(repo: any InAppPurchaseSubmissions) async throws -> String { let submission = try await repo.submitInAppPurchase(iapId: iapId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift b/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift index a6f0d269..ac48b5b3 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift @@ -13,11 +13,11 @@ struct IAPUnsubmit: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseSubmissionRepository() + let repo = try ClientProvider.makeInAppPurchaseSubmissions() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseSubmissionRepository) async throws { + func execute(repo: any InAppPurchaseSubmissions) async throws { try await repo.deleteSubmission(submissionId: submissionId) } } diff --git a/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift b/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift index 4989d987..73cf0703 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift @@ -25,11 +25,11 @@ struct IAPUpdate: AsyncParsableCommand { var notFamilySharable: Bool = false func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseRepository() + let repo = try ClientProvider.makeInAppPurchases() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseRepository) async throws -> String { + func execute(repo: any InAppPurchases) async throws -> String { let isFamilySharable: Bool? = familySharable ? true : (notFamilySharable ? false : nil) let item = try await repo.updateInAppPurchase( iapId: iapId, diff --git a/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift b/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift index 764ba9a4..9f337261 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift @@ -13,12 +13,12 @@ struct IAPVersionsList: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeProductVersionRepository() + let repo = try ClientProvider.makeProductVersions() print(try await execute(repo: repo)) } func execute( - repo: any ProductVersionRepository, + repo: any ProductVersions, affordanceMode: AffordanceMode = .cli ) async throws -> String { let versions = try await repo.listInAppPurchaseVersions(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift b/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift index 8ad5aacd..032ebe6c 100644 --- a/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift +++ b/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift @@ -16,12 +16,12 @@ struct IAPEqualizationsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeInAppPurchasePriceRepository() + let repo = try ClientProvider.makeInAppPurchasePrices() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchasePriceRepository, + repo: any InAppPurchasePrices, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listEqualizations(pricePointId: pricePointId, limit: limit) diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift index 5a3d444d..6f574e5c 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift @@ -13,11 +13,11 @@ struct IAPImagesDelete: AsyncParsableCommand { var imageId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewRepository() + let repo = try ClientProvider.makeInAppPurchaseReviewAssets() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseReviewRepository) async throws { + func execute(repo: any InAppPurchaseReviewAssets) async throws { try await repo.deleteImage(imageId: imageId) } } diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift index e74006cb..e3017df2 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift @@ -13,12 +13,12 @@ struct IAPImagesList: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewRepository() + let repo = try ClientProvider.makeInAppPurchaseReviewAssets() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseReviewRepository, + repo: any InAppPurchaseReviewAssets, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listImages(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift index 8c46a8da..71b8189d 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift @@ -17,12 +17,12 @@ struct IAPImagesUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewRepository() + let repo = try ClientProvider.makeInAppPurchaseReviewAssets() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseReviewRepository, + repo: any InAppPurchaseReviewAssets, affordanceMode: AffordanceMode = .cli ) async throws -> String { let url = URL(fileURLWithPath: file) diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift index c5a54112..7606dadc 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift @@ -22,11 +22,11 @@ struct IAPLocalizationsCreate: AsyncParsableCommand { var description: String? func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseLocalizationRepository() + let repo = try ClientProvider.makeInAppPurchaseLocalizations() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseLocalizationRepository) async throws -> String { + func execute(repo: any InAppPurchaseLocalizations) async throws -> String { let item = try await repo.createLocalization( iapId: iapId, locale: locale, diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift index bf1d8db6..0836feae 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct IAPLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseLocalizationRepository() + let repo = try ClientProvider.makeInAppPurchaseLocalizations() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseLocalizationRepository) async throws { + func execute(repo: any InAppPurchaseLocalizations) async throws { try await repo.deleteLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift index 12dd6ee6..dfa10287 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift @@ -13,12 +13,12 @@ struct IAPLocalizationsList: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseLocalizationRepository() + let repo = try ClientProvider.makeInAppPurchaseLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseLocalizationRepository, + repo: any InAppPurchaseLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listLocalizations(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift index c4f59e64..ca9d2cd9 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift @@ -19,11 +19,11 @@ struct IAPLocalizationsUpdate: AsyncParsableCommand { var description: String? func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseLocalizationRepository() + let repo = try ClientProvider.makeInAppPurchaseLocalizations() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseLocalizationRepository) async throws -> String { + func execute(repo: any InAppPurchaseLocalizations) async throws -> String { let item = try await repo.updateLocalization( localizationId: localizationId, name: name, diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift index d579b54b..d576d4cb 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift @@ -22,11 +22,11 @@ struct IAPOfferCodeCustomCodesCreate: AsyncParsableCommand { var expirationDate: String? func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { let item = try await repo.createCustomCode( offerCodeId: offerCodeId, customCode: customCode, diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift index 7ab74073..f41708b7 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift @@ -13,11 +13,11 @@ struct IAPOfferCodeCustomCodesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { let items = try await repo.listCustomCodes(offerCodeId: offerCodeId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items) diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift index 89e44883..a2bd0bec 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift @@ -16,11 +16,11 @@ struct IAPOfferCodeCustomCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { guard let isActive = Bool(active) else { throw ValidationError("Invalid value '\(active)' for --active. Use: true, false") } diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift index b1b752b6..7c2af3e5 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift @@ -32,12 +32,12 @@ struct IAPOfferCodeOneTimeCodesCreate: AsyncParsableCommand { var environment: OfferCodeEnvironment = .production func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodeRepository, + repo: any InAppPurchaseOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.createOneTimeUseCode( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift index 503d2848..ebf6b411 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift @@ -13,12 +13,12 @@ struct IAPOfferCodeOneTimeCodesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodeRepository, + repo: any InAppPurchaseOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listOneTimeUseCodes(offerCodeId: offerCodeId) diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift index 3d11201e..8b58e3d9 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift @@ -16,12 +16,12 @@ struct IAPOfferCodeOneTimeCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodeRepository, + repo: any InAppPurchaseOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard let isActive = Bool(active) else { diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift index a5a2e6d5..eb302a2a 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift @@ -13,11 +13,11 @@ struct IAPOfferCodeOneTimeCodesValues: AsyncParsableCommand { var oneTimeCodeId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { try await repo.fetchOneTimeUseCodeValues(oneTimeCodeId: oneTimeCodeId) } } diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift index b1932b14..d6664dc1 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift @@ -31,12 +31,12 @@ struct IAPOfferCodesCreate: AsyncParsableCommand { var freeTerritory: [String] = [] func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodeRepository, + repo: any InAppPurchaseOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { var customerEligibilities: [IAPCustomerEligibility] = [] diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift index 36b30481..ed06231f 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift @@ -13,12 +13,12 @@ struct IAPOfferCodesList: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodeRepository, + repo: any InAppPurchaseOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listOfferCodes(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift index 801a9e95..2474354f 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift @@ -13,12 +13,12 @@ struct IAPOfferCodesPricesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodeRepository, + repo: any InAppPurchaseOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPrices(offerCodeId: offerCodeId) diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift index 48af2c55..98554e32 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift @@ -16,11 +16,11 @@ struct IAPOfferCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() + let repo = try ClientProvider.makeInAppPurchaseOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { guard let isActive = Bool(active) else { throw ValidationError("Invalid value '\(active)' for --active. Use: true, false") } diff --git a/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift b/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift index e19fea02..c3c32e1f 100644 --- a/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift +++ b/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift @@ -13,12 +13,12 @@ struct IAPPriceScheduleGet: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchasePriceRepository() + let repo = try ClientProvider.makeInAppPurchasePrices() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchasePriceRepository, + repo: any InAppPurchasePrices, affordanceMode: AffordanceMode = .cli ) async throws -> String { let schedule = try await repo.getPriceSchedule(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift index e0c20362..e14f45c2 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift @@ -13,11 +13,11 @@ struct IAPReviewScreenshotDelete: AsyncParsableCommand { var screenshotId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewRepository() + let repo = try ClientProvider.makeInAppPurchaseReviewAssets() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseReviewRepository) async throws { + func execute(repo: any InAppPurchaseReviewAssets) async throws { try await repo.deleteReviewScreenshot(screenshotId: screenshotId) } } diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift index 9a1aa19f..5c6029d0 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift @@ -13,12 +13,12 @@ struct IAPReviewScreenshotGet: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewRepository() + let repo = try ClientProvider.makeInAppPurchaseReviewAssets() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseReviewRepository, + repo: any InAppPurchaseReviewAssets, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.getReviewScreenshot(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift index be6b84fa..bc97a18c 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift @@ -17,12 +17,12 @@ struct IAPReviewScreenshotUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewRepository() + let repo = try ClientProvider.makeInAppPurchaseReviewAssets() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseReviewRepository, + repo: any InAppPurchaseReviewAssets, affordanceMode: AffordanceMode = .cli ) async throws -> String { let url = URL(fileURLWithPath: file) diff --git a/Sources/ASCCommand/Commands/Init/InitCommand.swift b/Sources/ASCCommand/Commands/Init/InitCommand.swift index 16c220dd..127c81c6 100644 --- a/Sources/ASCCommand/Commands/Init/InitCommand.swift +++ b/Sources/ASCCommand/Commands/Init/InitCommand.swift @@ -29,13 +29,13 @@ struct InitCommand: AsyncParsableCommand { var contactEmail: String? func run() async throws { - let repo = try ClientProvider.makeAppRepository() + let repo = try ClientProvider.makeApps() let storage = ClientProvider.makeProjectConfigStorage() print(try await execute(repo: repo, storage: storage)) } func execute( - repo: any AppRepository, + repo: any Apps, storage: any ProjectConfigStorage, bundleIdScanner: (String) -> [String] = { XcodeProjectScanner.scan(directory: $0) } ) async throws -> String { diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift index e705a104..974e260e 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift @@ -22,8 +22,8 @@ struct IrisAuthLogin: AsyncParsableCommand { func run() async throws { let resolvedPassword = try password ?? promptForPassword() let creds = IrisAuthCredentials(appleId: appleId, password: resolvedPassword) - let authRepo = ClientProvider.makeIrisAuthRepository() - let sessionRepo = ClientProvider.makeIrisSessionRepository() + let authRepo = ClientProvider.makeIrisSignIn() + let sessionRepo = ClientProvider.makeIrisSessions() let pendingURL = ClientProvider.pendingTwoFactorURL() let codePrompt: (() throws -> String)? if interactive { @@ -39,8 +39,8 @@ struct IrisAuthLogin: AsyncParsableCommand { func execute( credentials: IrisAuthCredentials, - authRepo: any IrisAuthRepository, - sessionRepo: any IrisSessionRepository, + authRepo: any IrisSignIn, + sessionRepo: any IrisSessions, pendingURL: URL, interactivePromptForCode: (() throws -> String)? = nil, affordanceMode: AffordanceMode = .cli diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift index fa8e452a..d8ab9177 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift @@ -11,7 +11,7 @@ struct IrisAuthLogout: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let sessionRepo = ClientProvider.makeIrisSessionRepository() + let sessionRepo = ClientProvider.makeIrisSessions() let pendingURL = ClientProvider.pendingTwoFactorURL() try sessionRepo.delete() try? FileManager.default.removeItem(at: pendingURL) diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift index 9a19d101..5633e146 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift @@ -14,16 +14,16 @@ struct IrisAuthVerifyCode: AsyncParsableCommand { var code: String func run() async throws { - let authRepo = ClientProvider.makeIrisAuthRepository() - let sessionRepo = ClientProvider.makeIrisSessionRepository() + let authRepo = ClientProvider.makeIrisSignIn() + let sessionRepo = ClientProvider.makeIrisSessions() let pendingURL = ClientProvider.pendingTwoFactorURL() print(try await execute(code: code, authRepo: authRepo, sessionRepo: sessionRepo, pendingURL: pendingURL)) } func execute( code: String, - authRepo: any IrisAuthRepository, - sessionRepo: any IrisSessionRepository, + authRepo: any IrisSignIn, + sessionRepo: any IrisSessions, pendingURL: URL, affordanceMode: AffordanceMode = .cli ) async throws -> String { diff --git a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift index 3dd3ad80..431c77b2 100644 --- a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift @@ -25,13 +25,13 @@ struct IrisIAPSubmissionsCreate: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisInAppPurchaseSubmissionRepository() + let repo = ClientProvider.makeIrisInAppPurchaseSubmissions() print(try await execute(cookieProvider: cookieProvider, repo: repo)) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisInAppPurchaseSubmissionRepository, + repo: any IrisInAppPurchaseSubmissions, affordanceMode: AffordanceMode = .cli ) async throws -> String { let session = try cookieProvider.resolveSession() diff --git a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift index f78cda31..7dded5ee 100644 --- a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift +++ b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift @@ -18,13 +18,13 @@ struct IrisIAPSubmissionsDelete: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisInAppPurchaseSubmissionRepository() + let repo = ClientProvider.makeIrisInAppPurchaseSubmissions() try await execute(cookieProvider: cookieProvider, repo: repo) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisInAppPurchaseSubmissionRepository + repo: any IrisInAppPurchaseSubmissions ) async throws { let session = try cookieProvider.resolveSession() try await repo.deleteSubmission(session: session, submissionId: submissionId) diff --git a/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift b/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift index 41865a76..aefd933c 100644 --- a/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift +++ b/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift @@ -29,13 +29,13 @@ struct IrisAppsCreate: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisAppBundleRepository() + let repo = ClientProvider.makeIrisAppBundles() print(try await execute(cookieProvider: cookieProvider, repo: repo)) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisAppBundleRepository + repo: any IrisAppBundles ) async throws -> String { let session = try cookieProvider.resolveSession() let app = try await repo.createApp( diff --git a/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift b/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift index bb06ee14..4cee899e 100644 --- a/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift +++ b/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift @@ -11,13 +11,13 @@ struct IrisAppsList: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisAppBundleRepository() + let repo = ClientProvider.makeIrisAppBundles() print(try await execute(cookieProvider: cookieProvider, repo: repo)) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisAppBundleRepository + repo: any IrisAppBundles ) async throws -> String { let session = try cookieProvider.resolveSession() let apps = try await repo.listAppBundles(session: session) diff --git a/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift b/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift index 171625bd..70df3d7c 100644 --- a/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift +++ b/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift @@ -25,13 +25,13 @@ struct IrisResolutionCenterGet: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisResolutionCenterRepository() + let repo = ClientProvider.makeIrisResolutionCenter() print(try await execute(cookieProvider: cookieProvider, repo: repo)) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisResolutionCenterRepository, + repo: any IrisResolutionCenter, affordanceMode: AffordanceMode = .cli ) async throws -> String { let session = try cookieProvider.resolveSession() diff --git a/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift b/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift index 8f6fa34f..487e6dbb 100644 --- a/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift @@ -22,11 +22,11 @@ struct DiagnosticLogsList: AsyncParsableCommand { var signatureId: String func run() async throws { - let repo = try ClientProvider.makeDiagnosticsRepository() + let repo = try ClientProvider.makeDiagnostics() print(try await execute(repo: repo)) } - func execute(repo: any DiagnosticsRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Diagnostics, affordanceMode: AffordanceMode = .cli) async throws -> String { let logs = try await repo.listLogs(signatureId: signatureId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(logs, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift b/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift index 2ec66f0c..5fbbe9f3 100644 --- a/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift @@ -25,11 +25,11 @@ struct DiagnosticsList: AsyncParsableCommand { var diagnosticType: String? func run() async throws { - let repo = try ClientProvider.makeDiagnosticsRepository() + let repo = try ClientProvider.makeDiagnostics() print(try await execute(repo: repo)) } - func execute(repo: any DiagnosticsRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Diagnostics, affordanceMode: AffordanceMode = .cli) async throws -> String { let filter = diagnosticType.flatMap { DiagnosticType(rawValue: $0) } let signatures = try await repo.listSignatures(buildId: buildId, diagnosticType: filter) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift b/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift index c2a68dcc..0de26f82 100644 --- a/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift @@ -28,11 +28,11 @@ struct PerfMetricsList: AsyncParsableCommand { var metricType: String? func run() async throws { - let repo = try ClientProvider.makePerfMetricsRepository() + let repo = try ClientProvider.makePerfMetrics() print(try await execute(repo: repo)) } - func execute(repo: any PerfMetricsRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any PerfMetrics, affordanceMode: AffordanceMode = .cli) async throws -> String { let filter = metricType.flatMap { PerformanceMetricCategory(rawValue: $0) } let metrics: [PerformanceMetric] diff --git a/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift b/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift index a13c3fe3..72acfcde 100644 --- a/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift @@ -25,11 +25,11 @@ struct PerfOverviewGet: AsyncParsableCommand { var deviceType: String? func run() async throws { - let repo = try ClientProvider.makePerfOverviewRepository() + let repo = try ClientProvider.makePerfOverviews() print(try await execute(repo: repo)) } - func execute(repo: any PerfOverviewRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any PerfOverviews, affordanceMode: AffordanceMode = .cli) async throws -> String { let overview = try await repo.getOverview(appId: appId, deviceType: deviceType) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([overview], affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsInstall.swift b/Sources/ASCCommand/Commands/Plugins/PluginsInstall.swift index 00f24d2c..8526da94 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsInstall.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsInstall.swift @@ -13,11 +13,11 @@ struct PluginsInstall: AsyncParsableCommand { var name: String func run() async throws { - let repo = ClientProvider.makePluginRepository() + let repo = ClientProvider.makePlugins() print(try await execute(repo: repo)) } - func execute(repo: any PluginRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Plugins, affordanceMode: AffordanceMode = .cli) async throws -> String { let plugin = try await repo.install(name: name) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsList.swift b/Sources/ASCCommand/Commands/Plugins/PluginsList.swift index ca5663db..aa0fe137 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsList.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsList.swift @@ -10,11 +10,11 @@ struct PluginsList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makePluginRepository() + let repo = ClientProvider.makePlugins() print(try await execute(repo: repo)) } - func execute(repo: any PluginRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Plugins, affordanceMode: AffordanceMode = .cli) async throws -> String { let plugins = try await repo.listInstalled() let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(plugins, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsMarket.swift b/Sources/ASCCommand/Commands/Plugins/PluginsMarket.swift index 3463a029..96f3cf8d 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsMarket.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsMarket.swift @@ -22,11 +22,11 @@ struct MarketList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makePluginRepository() + let repo = ClientProvider.makePlugins() print(try await execute(repo: repo)) } - func execute(repo: any PluginRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Plugins, affordanceMode: AffordanceMode = .cli) async throws -> String { let plugins = try await repo.listAvailable() let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -50,11 +50,11 @@ struct MarketSearch: AsyncParsableCommand { var query: String func run() async throws { - let repo = ClientProvider.makePluginRepository() + let repo = ClientProvider.makePlugins() print(try await execute(repo: repo)) } - func execute(repo: any PluginRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Plugins, affordanceMode: AffordanceMode = .cli) async throws -> String { let plugins = try await repo.searchAvailable(query: query) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsUninstall.swift b/Sources/ASCCommand/Commands/Plugins/PluginsUninstall.swift index b3072234..21ebf7bd 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsUninstall.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsUninstall.swift @@ -11,11 +11,11 @@ struct PluginsUninstall: AsyncParsableCommand { var name: String func run() async throws { - let repo = ClientProvider.makePluginRepository() + let repo = ClientProvider.makePlugins() try await execute(repo: repo) } - func execute(repo: any PluginRepository) async throws { + func execute(repo: any Plugins) async throws { try await repo.uninstall(name: name) print("Plugin '\(name)' uninstalled successfully.") } diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsUpdate.swift b/Sources/ASCCommand/Commands/Plugins/PluginsUpdate.swift index 93984814..52efa9a4 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsUpdate.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsUpdate.swift @@ -13,11 +13,11 @@ struct PluginsUpdate: AsyncParsableCommand { var name: String func run() async throws { - let repo = ClientProvider.makePluginRepository() + let repo = ClientProvider.makePlugins() print(try await execute(repo: repo)) } - func execute(repo: any PluginRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Plugins, affordanceMode: AffordanceMode = .cli) async throws -> String { let plugin = try await repo.update(name: name) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Plugins/PluginsUpdates.swift b/Sources/ASCCommand/Commands/Plugins/PluginsUpdates.swift index a4d8aa7c..fcbcd76f 100644 --- a/Sources/ASCCommand/Commands/Plugins/PluginsUpdates.swift +++ b/Sources/ASCCommand/Commands/Plugins/PluginsUpdates.swift @@ -10,11 +10,11 @@ struct PluginsUpdates: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makePluginRepository() + let repo = ClientProvider.makePlugins() print(try await execute(repo: repo)) } - func execute(repo: any PluginRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Plugins, affordanceMode: AffordanceMode = .cli) async throws -> String { let updates = try await repo.listOutdated() let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift index ac17f210..63008220 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift @@ -33,11 +33,11 @@ struct ProfilesCreate: AsyncParsableCommand { var deviceIds: [String] = [] func run() async throws { - let repo = try ClientProvider.makeProfileRepository() + let repo = try ClientProvider.makeProfiles() print(try await execute(repo: repo)) } - func execute(repo: any ProfileRepository) async throws -> String { + func execute(repo: any Profiles) async throws -> String { guard let profileType = ProfileType(rawValue: type.uppercased()) else { throw ValidationError("Invalid profile type '\(type)'.") } diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift index 2e65537c..035a78cc 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift @@ -13,11 +13,11 @@ struct ProfilesDelete: AsyncParsableCommand { var profileId: String func run() async throws { - let repo = try ClientProvider.makeProfileRepository() + let repo = try ClientProvider.makeProfiles() try await execute(repo: repo) } - func execute(repo: any ProfileRepository) async throws { + func execute(repo: any Profiles) async throws { try await repo.deleteProfile(id: profileId) } } diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift index 7168cb60..081a0b4e 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift @@ -16,11 +16,11 @@ struct ProfilesList: AsyncParsableCommand { var type: String? func run() async throws { - let repo = try ClientProvider.makeProfileRepository() + let repo = try ClientProvider.makeProfiles() print(try await execute(repo: repo)) } - func execute(repo: any ProfileRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Profiles, affordanceMode: AffordanceMode = .cli) async throws -> String { let profileType = type.flatMap { ProfileType(rawValue: $0.uppercased()) } let items = try await repo.listProfiles(bundleIdId: bundleIdId, profileType: profileType) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift index 334c360d..ff57a533 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift @@ -31,11 +31,11 @@ struct PromotedPurchasesCreate: AsyncParsableCommand { var disabled: Bool = false func run() async throws { - let repo = try ClientProvider.makePromotedPurchaseRepository() + let repo = try ClientProvider.makePromotedPurchases() print(try await execute(repo: repo)) } - func execute(repo: any PromotedPurchaseRepository) async throws -> String { + func execute(repo: any PromotedPurchases) async throws -> String { guard iapId != nil || subscriptionId != nil else { throw ValidationError("Either --iap-id or --subscription-id is required") } diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift index ddcc7c1b..4a051539 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift @@ -13,11 +13,11 @@ struct PromotedPurchasesDelete: AsyncParsableCommand { var promotedId: String func run() async throws { - let repo = try ClientProvider.makePromotedPurchaseRepository() + let repo = try ClientProvider.makePromotedPurchases() try await execute(repo: repo) } - func execute(repo: any PromotedPurchaseRepository) async throws { + func execute(repo: any PromotedPurchases) async throws { try await repo.deletePromotedPurchase(promotedId: promotedId) } } diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift index 8a2453c3..9643e7b6 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift @@ -16,12 +16,12 @@ struct PromotedPurchasesList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makePromotedPurchaseRepository() + let repo = try ClientProvider.makePromotedPurchases() print(try await execute(repo: repo)) } func execute( - repo: any PromotedPurchaseRepository, + repo: any PromotedPurchases, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listPromotedPurchases(appId: appId, limit: limit) diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift index c531f309..048327d6 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift @@ -25,11 +25,11 @@ struct PromotedPurchasesUpdate: AsyncParsableCommand { var disabled: Bool = false func run() async throws { - let repo = try ClientProvider.makePromotedPurchaseRepository() + let repo = try ClientProvider.makePromotedPurchases() print(try await execute(repo: repo)) } - func execute(repo: any PromotedPurchaseRepository) async throws -> String { + func execute(repo: any PromotedPurchases) async throws -> String { let isVisible: Bool? = visible ? true : (hidden ? false : nil) let isEnabled: Bool? = enabled ? true : (disabled ? false : nil) diff --git a/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift b/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift index 1b062cc6..7be11651 100644 --- a/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift +++ b/Sources/ASCCommand/Commands/Reports/FinanceReportsDownload.swift @@ -22,12 +22,12 @@ struct FinanceReportsDownload: AsyncParsableCommand { var reportDate: String func run() async throws { - let repo = try ClientProvider.makeReportRepository() + let repo = try ClientProvider.makeReports() let storage = ClientProvider.makeAuthStorage() print(try await execute(repo: repo, storage: storage)) } - func execute(repo: any ReportRepository, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { + func execute(repo: any Reports, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { let resolvedVendorNumber = try VendorNumberResolver.resolve(explicit: vendorNumber, storage: storage) guard let parsedReportType = FinanceReportType(cliArgument: reportType) else { diff --git a/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift b/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift index 8b2083bf..cc3c973f 100644 --- a/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift +++ b/Sources/ASCCommand/Commands/Reports/SalesReportsDownload.swift @@ -28,12 +28,12 @@ struct SalesReportsDownload: AsyncParsableCommand { var version: String? func run() async throws { - let repo = try ClientProvider.makeReportRepository() + let repo = try ClientProvider.makeReports() let storage = ClientProvider.makeAuthStorage() print(try await execute(repo: repo, storage: storage)) } - func execute(repo: any ReportRepository, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { + func execute(repo: any Reports, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { let resolvedVendorNumber = try VendorNumberResolver.resolve(explicit: vendorNumber, storage: storage) guard let parsedReportType = SalesReportType(cliArgument: reportType) else { diff --git a/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift b/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift index e35cee3e..5d82cf3d 100644 --- a/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift +++ b/Sources/ASCCommand/Commands/Reports/SalesReportsSummary.swift @@ -20,12 +20,12 @@ struct SalesReportsSummary: AsyncParsableCommand { var to: String func run() async throws { - let repo = try ClientProvider.makeReportRepository() + let repo = try ClientProvider.makeReports() let storage = ClientProvider.makeAuthStorage() print(try await execute(repo: repo, storage: storage)) } - func execute(repo: any ReportRepository, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { + func execute(repo: any Reports, storage: any AuthStorage = ClientProvider.makeAuthStorage()) async throws -> String { let resolvedVendorNumber = try VendorNumberResolver.resolve(explicit: vendorNumber, storage: storage) let dates = try expandDateRange(from: from, to: to) diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift index 0c10b602..9c994ebc 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift @@ -25,11 +25,11 @@ struct ReviewSubmissionItemsAdd: AsyncParsableCommand { var subscriptionGroupVersionId: String? func run() async throws { - let repo = try ClientProvider.makeSubmissionRepository() + let repo = try ClientProvider.makeReviewSubmissions() print(try await execute(repo: repo)) } - func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { guard let target = ReviewItemTarget( versionId: versionId, iapVersionId: iapVersionId, diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift index 1c7dc168..7bbbaa5b 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift @@ -16,11 +16,11 @@ struct ReviewSubmissionItemsList: AsyncParsableCommand { var state: String? func run() async throws { - let repo = try ClientProvider.makeSubmissionRepository() + let repo = try ClientProvider.makeReviewSubmissions() print(try await execute(repo: repo)) } - func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { var items = try await repo.listSubmissionItems(submissionId: submissionId) if let filter = state.flatMap({ ReviewSubmissionItemState(rawValue: $0.uppercased()) }) { items = items.filter { $0.state == filter } diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift index 1c88551d..f89d815c 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift @@ -13,11 +13,11 @@ struct ReviewSubmissionItemsRemove: AsyncParsableCommand { var itemId: String func run() async throws { - let repo = try ClientProvider.makeSubmissionRepository() + let repo = try ClientProvider.makeReviewSubmissions() try await execute(repo: repo) } - func execute(repo: any SubmissionRepository) async throws { + func execute(repo: any ReviewSubmissions) async throws { try await repo.removeItem(itemId: itemId) } } diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift index 381bf35b..a24fcb70 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift @@ -16,11 +16,11 @@ struct ReviewSubmissionsCreate: AsyncParsableCommand { var platform: String = "ios" func run() async throws { - let repo = try ClientProvider.makeSubmissionRepository() + let repo = try ClientProvider.makeReviewSubmissions() print(try await execute(repo: repo)) } - func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { guard let appStorePlatform = AppStorePlatform(cliArgument: platform) else { throw ValidationError("Unknown platform '\(platform)'. Use: ios, macos, tvos, visionos") } diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift index c2270fb2..d23cb134 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift @@ -13,11 +13,11 @@ struct ReviewSubmissionsGet: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeSubmissionRepository() + let repo = try ClientProvider.makeReviewSubmissions() print(try await execute(repo: repo)) } - func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { let submission = try await repo.getSubmission(id: submissionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([submission], affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift index 1fa86c13..457d4562 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift @@ -20,11 +20,11 @@ struct ReviewSubmissionsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeSubmissionRepository() + let repo = try ClientProvider.makeReviewSubmissions() print(try await execute(repo: repo)) } - func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { let parsedStates = state.map { csv in csv.split(separator: ",").compactMap { ReviewSubmissionState(rawValue: String($0).trimmingCharacters(in: .whitespaces).uppercased()) diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift index cec5a855..76928039 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift @@ -13,11 +13,11 @@ struct ReviewSubmissionsSubmit: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeSubmissionRepository() + let repo = try ClientProvider.makeReviewSubmissions() print(try await execute(repo: repo)) } - func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { let submission = try await repo.submit(submissionId: submissionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([submission], affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift index 9f69b085..309442da 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift @@ -16,11 +16,11 @@ struct ReviewResponsesCreate: AsyncParsableCommand { var responseBody: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviewRepository() + let repo = try ClientProvider.makeCustomerReviews() print(try await execute(repo: repo)) } - func execute(repo: any CustomerReviewRepository) async throws -> String { + func execute(repo: any CustomerReviews) async throws -> String { let response = try await repo.createResponse(reviewId: reviewId, responseBody: responseBody) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift index c523a9d0..0ee2963a 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift @@ -13,11 +13,11 @@ struct ReviewResponsesDelete: AsyncParsableCommand { var responseId: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviewRepository() + let repo = try ClientProvider.makeCustomerReviews() try await execute(repo: repo) } - func execute(repo: any CustomerReviewRepository) async throws { + func execute(repo: any CustomerReviews) async throws { try await repo.deleteResponse(responseId: responseId) } } diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift index 6777b0a4..e5f2cea6 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift @@ -13,11 +13,11 @@ struct ReviewResponsesGet: AsyncParsableCommand { var reviewId: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviewRepository() + let repo = try ClientProvider.makeCustomerReviews() print(try await execute(repo: repo)) } - func execute(repo: any CustomerReviewRepository) async throws -> String { + func execute(repo: any CustomerReviews) async throws -> String { let response = try await repo.getResponse(reviewId: reviewId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift b/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift index a0072370..0cce8d92 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift @@ -13,11 +13,11 @@ struct ReviewsGet: AsyncParsableCommand { var reviewId: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviewRepository() + let repo = try ClientProvider.makeCustomerReviews() print(try await execute(repo: repo)) } - func execute(repo: any CustomerReviewRepository) async throws -> String { + func execute(repo: any CustomerReviews) async throws -> String { let review = try await repo.getReview(reviewId: reviewId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift b/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift index 59accf88..d8718903 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift @@ -13,11 +13,11 @@ struct ReviewsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviewRepository() + let repo = try ClientProvider.makeCustomerReviews() print(try await execute(repo: repo)) } - func execute(repo: any CustomerReviewRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any CustomerReviews, affordanceMode: AffordanceMode = .cli) async throws -> String { let reviews = try await repo.listReviews(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(reviews, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift index 7546d7d7..85ecd04a 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift @@ -21,11 +21,11 @@ struct ScreenshotSetsList: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeScreenshotRepository() + let repo = try ClientProvider.makeAppScreenshots() print(try await execute(repo: repo)) } - func execute(repo: any ScreenshotRepository) async throws -> String { + func execute(repo: any AppScreenshots) async throws -> String { let sets = try await repo.listScreenshotSets(localizationId: localizationId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift index d474b58b..a781fb00 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift @@ -16,11 +16,11 @@ struct ScreenshotSetsCreate: AsyncParsableCommand { var displayType: String func run() async throws { - let repo = try ClientProvider.makeScreenshotRepository() + let repo = try ClientProvider.makeAppScreenshots() print(try await execute(repo: repo)) } - func execute(repo: any ScreenshotRepository) async throws -> String { + func execute(repo: any AppScreenshots) async throws -> String { guard let screenshotDisplayType = ScreenshotDisplayType(rawValue: displayType) else { throw ValidationError("Unknown display type '\(displayType)'") } diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift index 79cc8c64..447de11d 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift @@ -13,11 +13,11 @@ struct ScreenshotSetsDelete: AsyncParsableCommand { var setId: String func run() async throws { - let repo = try ClientProvider.makeScreenshotRepository() + let repo = try ClientProvider.makeAppScreenshots() try await execute(repo: repo) } - func execute(repo: any ScreenshotRepository) async throws { + func execute(repo: any AppScreenshots) async throws { try await repo.deleteScreenshotSet(setId: setId) } } diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift index 1dd0f856..09c582ea 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift @@ -21,11 +21,11 @@ struct ScreenshotsList: AsyncParsableCommand { var setId: String func run() async throws { - let repo = try ClientProvider.makeScreenshotRepository() + let repo = try ClientProvider.makeAppScreenshots() print(try await execute(repo: repo)) } - func execute(repo: any ScreenshotRepository) async throws -> String { + func execute(repo: any AppScreenshots) async throws -> String { let screenshots = try await repo.listScreenshots(setId: setId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift index 06190109..a19e310b 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift @@ -13,11 +13,11 @@ struct ScreenshotsDelete: AsyncParsableCommand { var screenshotId: String func run() async throws { - let repo = try ClientProvider.makeScreenshotRepository() + let repo = try ClientProvider.makeAppScreenshots() try await execute(repo: repo) } - func execute(repo: any ScreenshotRepository) async throws { + func execute(repo: any AppScreenshots) async throws { try await repo.deleteScreenshot(screenshotId: screenshotId) } } diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift index 0ec12128..b7b655ac 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift @@ -50,14 +50,14 @@ struct ScreenshotsImport: AsyncParsableCommand { func run() async throws { let (manifest, imageURLs, tempDir) = try Self.unzipAndParse(zipURL: URL(fileURLWithPath: from)) defer { try? FileManager.default.removeItem(at: tempDir) } - let localizationRepo = try ClientProvider.makeVersionLocalizationRepository() + let localizationRepo = try ClientProvider.makeVersionLocalizations() guard toLibrary else { FileHandle.standardError.write(Data(( "Note: screenshot sets are deprecated in App Store Connect API 4.5.1 — " + "add --to-library to import into the app's asset library instead.\n" ).utf8)) - let screenshotRepo = try ClientProvider.makeScreenshotRepository() + let screenshotRepo = try ClientProvider.makeAppScreenshots() print(try await execute(localizationRepo: localizationRepo, screenshotRepo: screenshotRepo, manifest: manifest, imageURLs: imageURLs)) return } @@ -65,11 +65,11 @@ struct ScreenshotsImport: AsyncParsableCommand { let report = try await executeToLibrary( manifest: manifest, files: try ScreenshotImportFiles.read(manifest: manifest, imageURLs: imageURLs), - versionRepo: try ClientProvider.makeVersionRepository(), + versionRepo: try ClientProvider.makeAppStoreVersions(), localizationRepo: localizationRepo, - libraryRepo: try ClientProvider.makeAssetLibraryRepository(), - imageRepo: try ClientProvider.makeLibraryImageRepository(), - placementRepo: try ClientProvider.makeAssetPlacementRepository() + libraryRepo: try ClientProvider.makeAssetLibraries(), + imageRepo: try ClientProvider.makeLibraryImages(), + placementRepo: try ClientProvider.makeAssetPlacements() ) print(report.output) if !report.isSuccess { throw ExitCode.failure } @@ -78,8 +78,8 @@ struct ScreenshotsImport: AsyncParsableCommand { // MARK: - Testable core (no I/O) func execute( - localizationRepo: any VersionLocalizationRepository, - screenshotRepo: any ScreenshotRepository, + localizationRepo: any VersionLocalizations, + screenshotRepo: any AppScreenshots, manifest: ScreenshotManifest, imageURLs: [String: URL] ) async throws -> String { @@ -130,11 +130,11 @@ struct ScreenshotsImport: AsyncParsableCommand { func executeToLibrary( manifest: ScreenshotManifest, files: [ScreenshotImportFile], - versionRepo: any VersionRepository, - localizationRepo: any VersionLocalizationRepository, - libraryRepo: any AssetLibraryRepository, - imageRepo: any LibraryImageRepository, - placementRepo: any AssetPlacementRepository, + versionRepo: any AppStoreVersions, + localizationRepo: any VersionLocalizations, + libraryRepo: any AssetLibraries, + imageRepo: any LibraryImages, + placementRepo: any AssetPlacements, affordanceMode: AffordanceMode = .cli, sleep: @Sendable (UInt64) async throws -> Void = { try await Task.sleep(nanoseconds: $0) } ) async throws -> ScreenshotImportReport { diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift index 3d7ac9e8..6687b4b4 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift @@ -17,11 +17,11 @@ struct ScreenshotsUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeScreenshotRepository() + let repo = try ClientProvider.makeAppScreenshots() print(try await execute(repo: repo)) } - func execute(repo: any ScreenshotRepository) async throws -> String { + func execute(repo: any AppScreenshots) async throws -> String { let fileURL = URL(fileURLWithPath: file) let screenshot = try await repo.uploadScreenshot(setId: setId, fileURL: fileURL) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Simulators/SimulatorsBoot.swift b/Sources/ASCCommand/Commands/Simulators/SimulatorsBoot.swift index 6207cd17..bbe68af7 100644 --- a/Sources/ASCCommand/Commands/Simulators/SimulatorsBoot.swift +++ b/Sources/ASCCommand/Commands/Simulators/SimulatorsBoot.swift @@ -11,11 +11,11 @@ struct SimulatorsBoot: AsyncParsableCommand { var udid: String func run() async throws { - let repo = ClientProvider.makeSimulatorRepository() + let repo = ClientProvider.makeSimulators() print(try await execute(repo: repo)) } - func execute(repo: any SimulatorRepository) async throws -> String { + func execute(repo: any Simulators) async throws -> String { try await repo.bootSimulator(udid: udid) return "Simulator \(udid) booted successfully." } diff --git a/Sources/ASCCommand/Commands/Simulators/SimulatorsList.swift b/Sources/ASCCommand/Commands/Simulators/SimulatorsList.swift index d94c7d63..ce8590c1 100644 --- a/Sources/ASCCommand/Commands/Simulators/SimulatorsList.swift +++ b/Sources/ASCCommand/Commands/Simulators/SimulatorsList.swift @@ -13,11 +13,11 @@ struct SimulatorsList: AsyncParsableCommand { var booted: Bool = false func run() async throws { - let repo = ClientProvider.makeSimulatorRepository() + let repo = ClientProvider.makeSimulators() print(try await execute(repo: repo)) } - func execute(repo: any SimulatorRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Simulators, affordanceMode: AffordanceMode = .cli) async throws -> String { let filter: SimulatorFilter = booted ? .booted : .available let items = try await repo.listSimulators(filter: filter) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Simulators/SimulatorsShutdown.swift b/Sources/ASCCommand/Commands/Simulators/SimulatorsShutdown.swift index 760743d4..b258a2b4 100644 --- a/Sources/ASCCommand/Commands/Simulators/SimulatorsShutdown.swift +++ b/Sources/ASCCommand/Commands/Simulators/SimulatorsShutdown.swift @@ -11,11 +11,11 @@ struct SimulatorsShutdown: AsyncParsableCommand { var udid: String func run() async throws { - let repo = ClientProvider.makeSimulatorRepository() + let repo = ClientProvider.makeSimulators() print(try await execute(repo: repo)) } - func execute(repo: any SimulatorRepository) async throws -> String { + func execute(repo: any Simulators) async throws -> String { try await repo.shutdownSimulator(udid: udid) return "Simulator \(udid) shut down successfully." } diff --git a/Sources/ASCCommand/Commands/Skills/SkillUpdateChecker.swift b/Sources/ASCCommand/Commands/Skills/SkillUpdateChecker.swift index 4badcc62..ca29adb5 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillUpdateChecker.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillUpdateChecker.swift @@ -14,7 +14,7 @@ enum SkillUpdateChecker { static let checkInterval: TimeInterval = 24 * 60 * 60 // 24 hours static func checkIfNeeded( - repo: any SkillRepository, + repo: any Skills, storage: any SkillConfigStorage, environment: [String: String] = ProcessInfo.processInfo.environment, now: Date = Date() diff --git a/Sources/ASCCommand/Commands/Skills/SkillsCheck.swift b/Sources/ASCCommand/Commands/Skills/SkillsCheck.swift index 217accc3..7b72ed8a 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsCheck.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsCheck.swift @@ -11,12 +11,12 @@ struct SkillsCheck: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makeSkillRepository() + let repo = ClientProvider.makeSkills() let storage = ClientProvider.makeSkillConfigStorage() print(try await execute(repo: repo, storage: storage)) } - func execute(repo: any SkillRepository, storage: any SkillConfigStorage) async throws -> String { + func execute(repo: any Skills, storage: any SkillConfigStorage) async throws -> String { let result = try await repo.check() // Persist the check timestamp diff --git a/Sources/ASCCommand/Commands/Skills/SkillsInstall.swift b/Sources/ASCCommand/Commands/Skills/SkillsInstall.swift index caa87363..073cc5f5 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsInstall.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsInstall.swift @@ -16,11 +16,11 @@ struct SkillsInstall: AsyncParsableCommand { var all: Bool = false func run() async throws { - let repo = ClientProvider.makeSkillRepository() + let repo = ClientProvider.makeSkills() print(try await execute(repo: repo)) } - func execute(repo: any SkillRepository) async throws -> String { + func execute(repo: any Skills) async throws -> String { if all { return try await repo.installAll() } else if let name { diff --git a/Sources/ASCCommand/Commands/Skills/SkillsList.swift b/Sources/ASCCommand/Commands/Skills/SkillsList.swift index 3e8d5907..41b4a516 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsList.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsList.swift @@ -10,11 +10,11 @@ struct SkillsList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makeSkillRepository() + let repo = ClientProvider.makeSkills() print(try await execute(repo: repo)) } - func execute(repo: any SkillRepository) async throws -> String { + func execute(repo: any Skills) async throws -> String { let output = try await repo.listAvailable() return output } diff --git a/Sources/ASCCommand/Commands/Skills/SkillsUpdate.swift b/Sources/ASCCommand/Commands/Skills/SkillsUpdate.swift index 0420bf46..5e9bb353 100644 --- a/Sources/ASCCommand/Commands/Skills/SkillsUpdate.swift +++ b/Sources/ASCCommand/Commands/Skills/SkillsUpdate.swift @@ -10,11 +10,11 @@ struct SkillsUpdate: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makeSkillRepository() + let repo = ClientProvider.makeSkills() print(try await execute(repo: repo)) } - func execute(repo: any SkillRepository) async throws -> String { + func execute(repo: any Skills) async throws -> String { try await repo.update() } } diff --git a/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift index af144c5a..7395f74c 100644 --- a/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift @@ -16,12 +16,12 @@ struct SubscriptionEqualizationsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeSubscriptionPriceRepository() + let repo = try ClientProvider.makeSubscriptionPrices() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPriceRepository, + repo: any SubscriptionPrices, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listEqualizations(pricePointId: pricePointId, limit: limit) diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift index 4df0f986..0fe29d2a 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift @@ -22,12 +22,12 @@ struct SubscriptionGroupLocalizationsCreate: AsyncParsableCommand { var customAppName: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupLocalizationRepository() + let repo = try ClientProvider.makeSubscriptionGroupLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionGroupLocalizationRepository, + repo: any SubscriptionGroupLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.createLocalization( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift index 4fcfc0c0..73d32afa 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionGroupLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupLocalizationRepository() + let repo = try ClientProvider.makeSubscriptionGroupLocalizations() try await execute(repo: repo) } - func execute(repo: any SubscriptionGroupLocalizationRepository) async throws { + func execute(repo: any SubscriptionGroupLocalizations) async throws { try await repo.deleteLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift index e66fc1f9..02d9db01 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift @@ -13,12 +13,12 @@ struct SubscriptionGroupLocalizationsList: AsyncParsableCommand { var groupId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupLocalizationRepository() + let repo = try ClientProvider.makeSubscriptionGroupLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionGroupLocalizationRepository, + repo: any SubscriptionGroupLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listLocalizations(groupId: groupId) diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift index 78122687..ed7a6fdc 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift @@ -19,12 +19,12 @@ struct SubscriptionGroupLocalizationsUpdate: AsyncParsableCommand { var customAppName: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupLocalizationRepository() + let repo = try ClientProvider.makeSubscriptionGroupLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionGroupLocalizationRepository, + repo: any SubscriptionGroupLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.updateLocalization( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift index 5e7ea110..75d92add 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift @@ -13,12 +13,12 @@ struct SubscriptionGroupVersionsList: AsyncParsableCommand { var groupId: String func run() async throws { - let repo = try ClientProvider.makeProductVersionRepository() + let repo = try ClientProvider.makeProductVersions() print(try await execute(repo: repo)) } func execute( - repo: any ProductVersionRepository, + repo: any ProductVersions, affordanceMode: AffordanceMode = .cli ) async throws -> String { let versions = try await repo.listSubscriptionGroupVersions(groupId: groupId) diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift index 8c076b29..0720c6b9 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift @@ -16,11 +16,11 @@ struct SubscriptionGroupsCreate: AsyncParsableCommand { var referenceName: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupRepository() + let repo = try ClientProvider.makeSubscriptionGroups() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionGroupRepository) async throws -> String { + func execute(repo: any SubscriptionGroups) async throws -> String { let item = try await repo.createSubscriptionGroup(appId: appId, referenceName: referenceName) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift index 5da749a6..c13223f0 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionGroupsDelete: AsyncParsableCommand { var groupId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupRepository() + let repo = try ClientProvider.makeSubscriptionGroups() try await execute(repo: repo) } - func execute(repo: any SubscriptionGroupRepository) async throws { + func execute(repo: any SubscriptionGroups) async throws { try await repo.deleteSubscriptionGroup(groupId: groupId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift index 28e6553b..d599f366 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift @@ -16,11 +16,11 @@ struct SubscriptionGroupsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupRepository() + let repo = try ClientProvider.makeSubscriptionGroups() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionGroupRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any SubscriptionGroups, affordanceMode: AffordanceMode = .cli) async throws -> String { let response = try await repo.listSubscriptionGroups(appId: appId, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift index 6cd7aa23..17284e6d 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift @@ -16,11 +16,11 @@ struct SubscriptionGroupsUpdate: AsyncParsableCommand { var referenceName: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupRepository() + let repo = try ClientProvider.makeSubscriptionGroups() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionGroupRepository) async throws -> String { + func execute(repo: any SubscriptionGroups) async throws -> String { let item = try await repo.updateSubscriptionGroup(groupId: groupId, referenceName: referenceName) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift index a73b9669..e93e74cb 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionImagesDelete: AsyncParsableCommand { var imageId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewRepository() + let repo = try ClientProvider.makeSubscriptionReviewAssets() try await execute(repo: repo) } - func execute(repo: any SubscriptionReviewRepository) async throws { + func execute(repo: any SubscriptionReviewAssets) async throws { try await repo.deleteImage(imageId: imageId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift index c57c2d38..0082b350 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift @@ -13,12 +13,12 @@ struct SubscriptionImagesList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewRepository() + let repo = try ClientProvider.makeSubscriptionReviewAssets() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionReviewRepository, + repo: any SubscriptionReviewAssets, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listImages(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift index c40c5364..40281897 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift @@ -17,12 +17,12 @@ struct SubscriptionImagesUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewRepository() + let repo = try ClientProvider.makeSubscriptionReviewAssets() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionReviewRepository, + repo: any SubscriptionReviewAssets, affordanceMode: AffordanceMode = .cli ) async throws -> String { let url = URL(fileURLWithPath: file) diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift index b4c504da..950a8e2a 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift @@ -22,11 +22,11 @@ struct SubscriptionLocalizationsCreate: AsyncParsableCommand { var description: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionLocalizationRepository() + let repo = try ClientProvider.makeSubscriptionLocalizations() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionLocalizationRepository) async throws -> String { + func execute(repo: any SubscriptionLocalizations) async throws -> String { let item = try await repo.createLocalization( subscriptionId: subscriptionId, locale: locale, diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift index 00182753..772c6309 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionLocalizationRepository() + let repo = try ClientProvider.makeSubscriptionLocalizations() try await execute(repo: repo) } - func execute(repo: any SubscriptionLocalizationRepository) async throws { + func execute(repo: any SubscriptionLocalizations) async throws { try await repo.deleteLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift index 8c7da946..7f1a0bcf 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift @@ -13,12 +13,12 @@ struct SubscriptionLocalizationsList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionLocalizationRepository() + let repo = try ClientProvider.makeSubscriptionLocalizations() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionLocalizationRepository, + repo: any SubscriptionLocalizations, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listLocalizations(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift index 75e1fd8f..2533ccff 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift @@ -19,11 +19,11 @@ struct SubscriptionLocalizationsUpdate: AsyncParsableCommand { var description: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionLocalizationRepository() + let repo = try ClientProvider.makeSubscriptionLocalizations() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionLocalizationRepository) async throws -> String { + func execute(repo: any SubscriptionLocalizations) async throws -> String { let item = try await repo.updateLocalization( localizationId: localizationId, name: name, diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift index 819844a8..27b7175c 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift @@ -22,11 +22,11 @@ struct SubscriptionOfferCodeCustomCodesCreate: AsyncParsableCommand { var expirationDate: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { + func execute(repo: any SubscriptionOfferCodes) async throws -> String { let item = try await repo.createCustomCode( offerCodeId: offerCodeId, customCode: customCode, diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift index 3bef1272..0cb50172 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift @@ -13,11 +13,11 @@ struct SubscriptionOfferCodeCustomCodesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { + func execute(repo: any SubscriptionOfferCodes) async throws -> String { let items = try await repo.listCustomCodes(offerCodeId: offerCodeId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items) diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift index 790970aa..1c0b48e4 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift @@ -16,11 +16,11 @@ struct SubscriptionOfferCodeCustomCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { + func execute(repo: any SubscriptionOfferCodes) async throws -> String { guard let isActive = Bool(active) else { throw ValidationError("Invalid value '\(active)' for --active. Use: true, false") } diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift index 37b0eaae..2f0d6174 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift @@ -22,12 +22,12 @@ struct SubscriptionOfferCodeOneTimeCodesCreate: AsyncParsableCommand { var environment: OfferCodeEnvironment = .production func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodeRepository, + repo: any SubscriptionOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.createOneTimeUseCode( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift index bfdbcc9e..ffcb661f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift @@ -13,12 +13,12 @@ struct SubscriptionOfferCodeOneTimeCodesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodeRepository, + repo: any SubscriptionOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listOneTimeUseCodes(offerCodeId: offerCodeId) diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift index ae57b2b4..a9650aeb 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift @@ -16,12 +16,12 @@ struct SubscriptionOfferCodeOneTimeCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodeRepository, + repo: any SubscriptionOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard let isActive = Bool(active) else { diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift index 930d23cf..18e6026a 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift @@ -13,11 +13,11 @@ struct SubscriptionOfferCodeOneTimeCodesValues: AsyncParsableCommand { var oneTimeCodeId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { + func execute(repo: any SubscriptionOfferCodes) async throws -> String { try await repo.fetchOneTimeUseCodeValues(oneTimeCodeId: oneTimeCodeId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift index 1e4446bc..10b51579 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift @@ -47,12 +47,12 @@ struct SubscriptionOfferCodesCreate: AsyncParsableCommand { var freeTerritory: [String] = [] func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodeRepository, + repo: any SubscriptionOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard let offerDuration = SubscriptionOfferDuration(rawValue: duration) else { diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift index b6c25f1d..4acf6999 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift @@ -13,12 +13,12 @@ struct SubscriptionOfferCodesList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodeRepository, + repo: any SubscriptionOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listOfferCodes(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift index 0e816cd8..25b05f33 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift @@ -13,12 +13,12 @@ struct SubscriptionOfferCodesPricesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodeRepository, + repo: any SubscriptionOfferCodes, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPrices(offerCodeId: offerCodeId) diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift index 640343ba..f31bd932 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift @@ -16,11 +16,11 @@ struct SubscriptionOfferCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() + let repo = try ClientProvider.makeSubscriptionOfferCodes() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { + func execute(repo: any SubscriptionOfferCodes) async throws -> String { guard let isActive = Bool(active) else { throw ValidationError("Invalid value '\(active)' for --active. Use: true, false") } diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift index 56de892d..21862b46 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift @@ -34,11 +34,11 @@ struct SubscriptionOffersCreate: AsyncParsableCommand { var endDate: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionIntroductoryOfferRepository() + let repo = try ClientProvider.makeSubscriptionIntroductoryOffers() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionIntroductoryOfferRepository) async throws -> String { + func execute(repo: any SubscriptionIntroductoryOffers) async throws -> String { guard let offerDuration = SubscriptionOfferDuration(rawValue: duration) else { throw ValidationError("Invalid duration '\(duration)'. Use: THREE_DAYS, ONE_WEEK, TWO_WEEKS, ONE_MONTH, TWO_MONTHS, THREE_MONTHS, SIX_MONTHS, ONE_YEAR") } diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift index 86b4926d..b3e51344 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionOffersDelete: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionIntroductoryOfferRepository() + let repo = try ClientProvider.makeSubscriptionIntroductoryOffers() try await execute(repo: repo) } - func execute(repo: any SubscriptionIntroductoryOfferRepository) async throws { + func execute(repo: any SubscriptionIntroductoryOffers) async throws { try await repo.deleteIntroductoryOffer(offerId: offerId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift index 3431672f..05168544 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift @@ -13,12 +13,12 @@ struct SubscriptionOffersList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionIntroductoryOfferRepository() + let repo = try ClientProvider.makeSubscriptionIntroductoryOffers() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionIntroductoryOfferRepository, + repo: any SubscriptionIntroductoryOffers, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listIntroductoryOffers(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift b/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift index 44413a7f..8ab256f5 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift @@ -13,12 +13,12 @@ struct SubscriptionPriceScheduleGet: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionPriceRepository() + let repo = try ClientProvider.makeSubscriptionPrices() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPriceRepository, + repo: any SubscriptionPrices, affordanceMode: AffordanceMode = .cli ) async throws -> String { let schedule = try await repo.getPriceSchedule(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift index e7e66b93..27ef57d8 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift @@ -33,11 +33,11 @@ struct SubscriptionPromotionalOffersCreate: AsyncParsableCommand { var price: [String] = [] func run() async throws { - let repo = try ClientProvider.makeSubscriptionPromotionalOfferRepository() + let repo = try ClientProvider.makeSubscriptionPromotionalOffers() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionPromotionalOfferRepository) async throws -> String { + func execute(repo: any SubscriptionPromotionalOffers) async throws -> String { guard let durationEnum = SubscriptionOfferDuration(rawValue: duration) else { throw ValidationError("Invalid duration: \(duration)") } diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift index ed42e06e..ac894490 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionPromotionalOffersDelete: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionPromotionalOfferRepository() + let repo = try ClientProvider.makeSubscriptionPromotionalOffers() try await execute(repo: repo) } - func execute(repo: any SubscriptionPromotionalOfferRepository) async throws { + func execute(repo: any SubscriptionPromotionalOffers) async throws { try await repo.deletePromotionalOffer(offerId: offerId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift index 6d425915..13bf68cf 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift @@ -13,12 +13,12 @@ struct SubscriptionPromotionalOffersList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionPromotionalOfferRepository() + let repo = try ClientProvider.makeSubscriptionPromotionalOffers() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPromotionalOfferRepository, + repo: any SubscriptionPromotionalOffers, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPromotionalOffers(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift index a1c86865..38a3c938 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift @@ -13,12 +13,12 @@ struct SubscriptionPromotionalOffersPricesList: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionPromotionalOfferRepository() + let repo = try ClientProvider.makeSubscriptionPromotionalOffers() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPromotionalOfferRepository, + repo: any SubscriptionPromotionalOffers, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPrices(offerId: offerId) diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift index f6469565..478aa69e 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionReviewScreenshotDelete: AsyncParsableCommand { var screenshotId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewRepository() + let repo = try ClientProvider.makeSubscriptionReviewAssets() try await execute(repo: repo) } - func execute(repo: any SubscriptionReviewRepository) async throws { + func execute(repo: any SubscriptionReviewAssets) async throws { try await repo.deleteReviewScreenshot(screenshotId: screenshotId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift index dc0da55f..664bfbe2 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift @@ -13,12 +13,12 @@ struct SubscriptionReviewScreenshotGet: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewRepository() + let repo = try ClientProvider.makeSubscriptionReviewAssets() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionReviewRepository, + repo: any SubscriptionReviewAssets, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.getReviewScreenshot(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift index 1808eee6..37e90fe4 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift @@ -17,12 +17,12 @@ struct SubscriptionReviewScreenshotUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewRepository() + let repo = try ClientProvider.makeSubscriptionReviewAssets() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionReviewRepository, + repo: any SubscriptionReviewAssets, affordanceMode: AffordanceMode = .cli ) async throws -> String { let url = URL(fileURLWithPath: file) diff --git a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift index d22f19f7..6a679c43 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift @@ -19,11 +19,11 @@ struct SubscriptionAvailabilityCreate: AsyncParsableCommand { var territory: [String] = [] func run() async throws { - let repo = try ClientProvider.makeSubscriptionAvailabilityRepository() + let repo = try ClientProvider.makeSubscriptionAvailabilities() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionAvailabilityRepository) async throws -> String { + func execute(repo: any SubscriptionAvailabilities) async throws -> String { let availability = try await repo.createAvailability( subscriptionId: subscriptionId, isAvailableInNewTerritories: availableInNewTerritories, diff --git a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift index e578904e..068544c2 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift @@ -13,12 +13,12 @@ struct SubscriptionAvailabilityGet: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionAvailabilityRepository() + let repo = try ClientProvider.makeSubscriptionAvailabilities() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionAvailabilityRepository, + repo: any SubscriptionAvailabilities, affordanceMode: AffordanceMode = .cli ) async throws -> String { let availability = try await repo.getAvailability(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift index 7fa946ff..bed24288 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift @@ -22,12 +22,12 @@ struct SubscriptionPricePointsList: AsyncParsableCommand { var cursor: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionPriceRepository() + let repo = try ClientProvider.makeSubscriptionPrices() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPriceRepository, + repo: any SubscriptionPrices, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listPricePoints( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift index 418368be..f2bd2622 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift @@ -25,11 +25,11 @@ struct SubscriptionPricesSet: AsyncParsableCommand { var preserveCurrentPrice: Bool = false func run() async throws { - let repo = try ClientProvider.makeSubscriptionPriceRepository() + let repo = try ClientProvider.makeSubscriptionPrices() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionPriceRepository) async throws -> String { + func execute(repo: any SubscriptionPrices) async throws -> String { let preserveFlag: Bool? = preserveCurrentPrice ? true : nil let item = try await repo.setPrice( subscriptionId: subscriptionId, diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift index 5f6b4301..152f0514 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift @@ -25,12 +25,12 @@ struct SubscriptionPricesSetBatch: AsyncParsableCommand { var preserveCurrentPrice: Bool = false func run() async throws { - let repo = try ClientProvider.makeSubscriptionPriceRepository() + let repo = try ClientProvider.makeSubscriptionPrices() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPriceRepository, + repo: any SubscriptionPrices, affordanceMode: AffordanceMode = .cli ) async throws -> String { let inputs = try price.map { entry -> SubscriptionPriceInput in diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift index 1fd9d37a..281951c2 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift @@ -13,12 +13,12 @@ struct SubscriptionVersionsList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeProductVersionRepository() + let repo = try ClientProvider.makeProductVersions() print(try await execute(repo: repo)) } func execute( - repo: any ProductVersionRepository, + repo: any ProductVersions, affordanceMode: AffordanceMode = .cli ) async throws -> String { let versions = try await repo.listSubscriptionVersions(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift index b1a1cdcf..2dfd93f9 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift @@ -28,11 +28,11 @@ struct SubscriptionsCreate: AsyncParsableCommand { var groupLevel: Int? func run() async throws { - let repo = try ClientProvider.makeSubscriptionRepository() + let repo = try ClientProvider.makeSubscriptions() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionRepository) async throws -> String { + func execute(repo: any Subscriptions) async throws -> String { guard let subscriptionPeriod = SubscriptionPeriod(rawValue: period) else { throw ValidationError("Invalid period '\(period)'. Use: ONE_WEEK, ONE_MONTH, TWO_MONTHS, THREE_MONTHS, SIX_MONTHS, ONE_YEAR") } diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift index b1be83f8..371f359a 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionsDelete: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionRepository() + let repo = try ClientProvider.makeSubscriptions() try await execute(repo: repo) } - func execute(repo: any SubscriptionRepository) async throws { + func execute(repo: any Subscriptions) async throws { try await repo.deleteSubscription(subscriptionId: subscriptionId) } } diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift index 935185eb..c80ccfb6 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift @@ -16,12 +16,12 @@ struct SubscriptionsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeSubscriptionRepository() + let repo = try ClientProvider.makeSubscriptions() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionRepository, + repo: any Subscriptions, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listSubscriptions(groupId: groupId, limit: limit) diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift index e8a203b4..d17689a1 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift @@ -13,11 +13,11 @@ struct SubscriptionsSubmit: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionSubmissionRepository() + let repo = try ClientProvider.makeSubscriptionSubmissions() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionSubmissionRepository) async throws -> String { + func execute(repo: any SubscriptionSubmissions) async throws -> String { let submission = try await repo.submitSubscription(subscriptionId: subscriptionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift index f7b6abd8..fd363838 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift @@ -13,11 +13,11 @@ struct SubscriptionsUnsubmit: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionSubmissionRepository() + let repo = try ClientProvider.makeSubscriptionSubmissions() try await execute(repo: repo) } - func execute(repo: any SubscriptionSubmissionRepository) async throws { + func execute(repo: any SubscriptionSubmissions) async throws { try await repo.deleteSubmission(submissionId: submissionId) } } diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift index 1dbee4e5..73abb6c1 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift @@ -41,11 +41,11 @@ struct SubscriptionsUpdate: AsyncParsableCommand { var marketSetting: [SubscriptionMarketSetting] = [] func run() async throws { - let repo = try ClientProvider.makeSubscriptionRepository() + let repo = try ClientProvider.makeSubscriptions() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionRepository) async throws -> String { + func execute(repo: any Subscriptions) async throws -> String { let isFamilySharable: Bool? = familySharable ? true : (notFamilySharable ? false : nil) let item = try await repo.updateSubscription( subscriptionId: subscriptionId, diff --git a/Sources/ASCCommand/Commands/TUI/TUIApp.swift b/Sources/ASCCommand/Commands/TUI/TUIApp.swift index 0b1bfea3..b5f85c86 100644 --- a/Sources/ASCCommand/Commands/TUI/TUIApp.swift +++ b/Sources/ASCCommand/Commands/TUI/TUIApp.swift @@ -171,7 +171,7 @@ final class TUIApp { private func loadApps() async { do { - let repo = try ClientProvider.makeAppRepository() + let repo = try ClientProvider.makeApps() let response = try await repo.listApps(limit: nil) let items = response.data.map { app in SelectItem(value: app.id, label: app.displayName, description: app.bundleId) @@ -233,7 +233,7 @@ final class TUIApp { private func loadVersions(for app: App) async { do { - let repo = try ClientProvider.makeVersionRepository() + let repo = try ClientProvider.makeAppStoreVersions() let versions = try await repo.listVersions(appId: app.id) guard !versions.isEmpty else { @@ -267,7 +267,7 @@ final class TUIApp { private func loadLocalizations(for version: AppStoreVersion) async { do { - let repo = try ClientProvider.makeVersionLocalizationRepository() + let repo = try ClientProvider.makeVersionLocalizations() let localizations = try await repo.listLocalizations(versionId: version.id) guard !localizations.isEmpty else { @@ -307,7 +307,7 @@ final class TUIApp { private func loadScreenshotSets(for localization: AppStoreVersionLocalization) async { do { - let repo = try ClientProvider.makeScreenshotRepository() + let repo = try ClientProvider.makeAppScreenshots() let sets = try await repo.listScreenshotSets(localizationId: localization.id) guard !sets.isEmpty else { @@ -343,7 +343,7 @@ final class TUIApp { private func loadScreenshots(for set: AppScreenshotSet) async { do { - let repo = try ClientProvider.makeScreenshotRepository() + let repo = try ClientProvider.makeAppScreenshots() let screenshots = try await repo.listScreenshots(setId: set.id) let header = [ @@ -372,7 +372,7 @@ final class TUIApp { private func loadBuilds() async { do { - let repo = try ClientProvider.makeBuildRepository() + let repo = try ClientProvider.makeBuilds() let response = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) let items = response.data.map { build in let state = build.processingState.rawValue @@ -441,7 +441,7 @@ final class TUIApp { private func loadBetaGroups() async { do { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() let response = try await repo.listBetaGroups(appId: nil, limit: nil) let items = response.data.map { group in let type = group.isInternalGroup ? "Internal" : "External" @@ -476,7 +476,7 @@ final class TUIApp { return } do { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() let response = try await repo.listBetaTesters(groupId: groupId, limit: nil) let items = response.data.map { tester in SelectItem( diff --git a/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift b/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift index 9e1f6281..7a978d76 100644 --- a/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift +++ b/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift @@ -10,11 +10,11 @@ struct TerritoriesList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = try ClientProvider.makeTerritoryRepository() + let repo = try ClientProvider.makeTerritories() print(try await execute(repo: repo)) } - func execute(repo: any TerritoryRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any Territories, affordanceMode: AffordanceMode = .cli) async throws -> String { let territories = try await repo.listTerritories() let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(territories, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift b/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift index bf550d2a..88384046 100644 --- a/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift +++ b/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift @@ -35,11 +35,11 @@ struct BetaGroupsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() print(try await execute(repo: repo)) } - func execute(repo: any TestFlightRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any TestFlight, affordanceMode: AffordanceMode = .cli) async throws -> String { let response = try await repo.listBetaGroups(appId: appId, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data, affordanceMode: affordanceMode) @@ -70,11 +70,11 @@ struct BetaGroupsCreate: AsyncParsableCommand { var feedbackEnabled: Bool = false func run() async throws { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() print(try await execute(repo: repo)) } - func execute(repo: any TestFlightRepository) async throws -> String { + func execute(repo: any TestFlight) async throws -> String { let group = try await repo.createBetaGroup( appId: appId, name: name, @@ -118,11 +118,11 @@ struct BetaTestersList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() print(try await execute(repo: repo)) } - func execute(repo: any TestFlightRepository) async throws -> String { + func execute(repo: any TestFlight) async throws -> String { let response = try await repo.listBetaTesters(groupId: betaGroupId, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data) @@ -150,11 +150,11 @@ struct BetaTestersAdd: AsyncParsableCommand { var lastName: String? func run() async throws { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() print(try await execute(repo: repo)) } - func execute(repo: any TestFlightRepository) async throws -> String { + func execute(repo: any TestFlight) async throws -> String { let tester = try await repo.addBetaTester(groupId: betaGroupId, email: email, firstName: firstName, lastName: lastName) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([tester]) @@ -176,11 +176,11 @@ struct BetaTestersRemove: AsyncParsableCommand { var testerId: String func run() async throws { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() print(try await execute(repo: repo)) } - func execute(repo: any TestFlightRepository) async throws -> String { + func execute(repo: any TestFlight) async throws -> String { try await repo.removeBetaTester(groupId: betaGroupId, testerId: testerId) return "Removed tester \(testerId) from group \(betaGroupId)" } @@ -201,12 +201,12 @@ struct BetaTestersImport: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() let content = try String(contentsOfFile: file, encoding: .utf8) print(try await execute(repo: repo, csvContent: content)) } - func execute(repo: any TestFlightRepository, csvContent: String) async throws -> String { + func execute(repo: any TestFlight, csvContent: String) async throws -> String { let entries = parseCSV(csvContent) var added: [BetaTester] = [] @@ -263,11 +263,11 @@ struct BetaTestersExport: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeTestFlightRepository() + let repo = try ClientProvider.makeTestFlight() print(try await execute(repo: repo)) } - func execute(repo: any TestFlightRepository) async throws -> String { + func execute(repo: any TestFlight) async throws -> String { let response = try await repo.listBetaTesters(groupId: betaGroupId, limit: limit) return formatCSV(response.data) } diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift index a0780d8a..7bac2829 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift @@ -13,11 +13,11 @@ struct UserInvitationsCancel: AsyncParsableCommand { var invitationId: String func run() async throws { - let repo = try ClientProvider.makeUserRepository() + let repo = try ClientProvider.makeUsers() try await execute(repo: repo) } - func execute(repo: any UserRepository) async throws { + func execute(repo: any Users) async throws { try await repo.cancelUserInvitation(id: invitationId) } } diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift index 2fd2a5ef..ba77b11f 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift @@ -25,11 +25,11 @@ struct UserInvitationsInvite: AsyncParsableCommand { var allAppsVisible: Bool = false func run() async throws { - let repo = try ClientProvider.makeUserRepository() + let repo = try ClientProvider.makeUsers() print(try await execute(repo: repo)) } - func execute(repo: any UserRepository) async throws -> String { + func execute(repo: any Users) async throws -> String { let domainRoles = try role.map { raw -> UserRole in guard let r = UserRole(cliArgument: raw) else { throw ValidationError("Invalid role '\(raw)'. Valid values: \(UserRole.allCases.map(\.rawValue).joined(separator: ", "))") diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift index 97f64c9d..46a4dce3 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift @@ -13,11 +13,11 @@ struct UserInvitationsList: AsyncParsableCommand { var role: String? func run() async throws { - let repo = try ClientProvider.makeUserRepository() + let repo = try ClientProvider.makeUsers() print(try await execute(repo: repo)) } - func execute(repo: any UserRepository) async throws -> String { + func execute(repo: any Users) async throws -> String { let domainRole = role.flatMap { UserRole(cliArgument: $0) } let items = try await repo.listUserInvitations(role: domainRole) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Users/UsersList.swift b/Sources/ASCCommand/Commands/Users/UsersList.swift index 13f1e8af..5c276dfe 100644 --- a/Sources/ASCCommand/Commands/Users/UsersList.swift +++ b/Sources/ASCCommand/Commands/Users/UsersList.swift @@ -13,11 +13,11 @@ struct UsersList: AsyncParsableCommand { var role: String? func run() async throws { - let repo = try ClientProvider.makeUserRepository() + let repo = try ClientProvider.makeUsers() print(try await execute(repo: repo)) } - func execute(repo: any UserRepository) async throws -> String { + func execute(repo: any Users) async throws -> String { let domainRole = role.flatMap { UserRole(cliArgument: $0) } let items = try await repo.listUsers(role: domainRole) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Users/UsersRemove.swift b/Sources/ASCCommand/Commands/Users/UsersRemove.swift index 963a3af5..b841d1e3 100644 --- a/Sources/ASCCommand/Commands/Users/UsersRemove.swift +++ b/Sources/ASCCommand/Commands/Users/UsersRemove.swift @@ -13,11 +13,11 @@ struct UsersRemove: AsyncParsableCommand { var userId: String func run() async throws { - let repo = try ClientProvider.makeUserRepository() + let repo = try ClientProvider.makeUsers() try await execute(repo: repo) } - func execute(repo: any UserRepository) async throws { + func execute(repo: any Users) async throws { try await repo.removeUser(id: userId) } } diff --git a/Sources/ASCCommand/Commands/Users/UsersUpdate.swift b/Sources/ASCCommand/Commands/Users/UsersUpdate.swift index 99586232..1336c0fd 100644 --- a/Sources/ASCCommand/Commands/Users/UsersUpdate.swift +++ b/Sources/ASCCommand/Commands/Users/UsersUpdate.swift @@ -16,11 +16,11 @@ struct UsersUpdate: AsyncParsableCommand { var role: [String] func run() async throws { - let repo = try ClientProvider.makeUserRepository() + let repo = try ClientProvider.makeUsers() print(try await execute(repo: repo)) } - func execute(repo: any UserRepository) async throws -> String { + func execute(repo: any Users) async throws -> String { let domainRoles = try role.map { raw -> UserRole in guard let r = UserRole(cliArgument: raw) else { throw ValidationError("Invalid role '\(raw)'. Valid values: \(UserRole.allCases.map(\.rawValue).joined(separator: ", "))") diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift index a59ebc88..dba1b07b 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift @@ -21,11 +21,11 @@ struct VersionLocalizationsList: AsyncParsableCommand { var versionId: String func run() async throws { - let repo = try ClientProvider.makeVersionLocalizationRepository() + let repo = try ClientProvider.makeVersionLocalizations() print(try await execute(repo: repo)) } - func execute(repo: any VersionLocalizationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any VersionLocalizations, affordanceMode: AffordanceMode = .cli) async throws -> String { let localizations = try await repo.listLocalizations(versionId: versionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(localizations, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift index 9fde0ec5..24c057c7 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift @@ -16,11 +16,11 @@ struct VersionLocalizationsCreate: AsyncParsableCommand { var locale: String func run() async throws { - let repo = try ClientProvider.makeVersionLocalizationRepository() + let repo = try ClientProvider.makeVersionLocalizations() print(try await execute(repo: repo)) } - func execute(repo: any VersionLocalizationRepository) async throws -> String { + func execute(repo: any VersionLocalizations) async throws -> String { let created = try await repo.createLocalization(versionId: versionId, locale: locale) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift index 94bc83d6..595c811e 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift @@ -31,11 +31,11 @@ struct VersionLocalizationsUpdate: AsyncParsableCommand { var promotionalText: String? func run() async throws { - let repo = try ClientProvider.makeVersionLocalizationRepository() + let repo = try ClientProvider.makeVersionLocalizations() print(try await execute(repo: repo)) } - func execute(repo: any VersionLocalizationRepository) async throws -> String { + func execute(repo: any VersionLocalizations) async throws -> String { let updated = try await repo.updateLocalization( localizationId: localizationId, whatsNew: whatsNew, diff --git a/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift b/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift index 79436c7e..eb3000d4 100644 --- a/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift +++ b/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift @@ -23,11 +23,11 @@ struct VersionReviewDetailGet: AsyncParsableCommand { var versionId: String func run() async throws { - let repo = try ClientProvider.makeReviewDetailRepository() + let repo = try ClientProvider.makeReviewDetails() print(try await execute(repo: repo)) } - func execute(repo: any ReviewDetailRepository) async throws -> String { + func execute(repo: any ReviewDetails) async throws -> String { let detail = try await repo.getReviewDetail(versionId: versionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -81,11 +81,11 @@ struct VersionReviewDetailUpdate: AsyncParsableCommand { var notes: String? func run() async throws { - let repo = try ClientProvider.makeReviewDetailRepository() + let repo = try ClientProvider.makeReviewDetails() print(try await execute(repo: repo)) } - func execute(repo: any ReviewDetailRepository) async throws -> String { + func execute(repo: any ReviewDetails) async throws -> String { let update = ReviewDetailUpdate( contactFirstName: contactFirstName, contactLastName: contactLastName, diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift b/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift index bf4dbfc5..99fa1496 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift @@ -13,15 +13,15 @@ struct VersionsCheckReadiness: AsyncParsableCommand { var versionId: String func run() async throws { - let versionRepo = try ClientProvider.makeVersionRepository() - let appRepo = try ClientProvider.makeAppRepository() - let buildRepo = try ClientProvider.makeBuildRepository() - let reviewDetailRepo = try ClientProvider.makeReviewDetailRepository() - let localizationRepo = try ClientProvider.makeVersionLocalizationRepository() - let screenshotRepo = try ClientProvider.makeScreenshotRepository() - let pricingRepo = try ClientProvider.makePricingRepository() - let appInfoRepo = try ClientProvider.makeAppInfoRepository() - let ageRatingRepo = try ClientProvider.makeAgeRatingDeclarationRepository() + let versionRepo = try ClientProvider.makeAppStoreVersions() + let appRepo = try ClientProvider.makeApps() + let buildRepo = try ClientProvider.makeBuilds() + let reviewDetailRepo = try ClientProvider.makeReviewDetails() + let localizationRepo = try ClientProvider.makeVersionLocalizations() + let screenshotRepo = try ClientProvider.makeAppScreenshots() + let pricingRepo = try ClientProvider.makeAppPrices() + let appInfoRepo = try ClientProvider.makeAppInfos() + let ageRatingRepo = try ClientProvider.makeAgeRatingDeclarations() print(try await execute( versionRepo: versionRepo, appRepo: appRepo, @@ -36,15 +36,15 @@ struct VersionsCheckReadiness: AsyncParsableCommand { } func execute( - versionRepo: any VersionRepository, - appRepo: any AppRepository, - buildRepo: any BuildRepository, - reviewDetailRepo: any ReviewDetailRepository, - localizationRepo: any VersionLocalizationRepository, - screenshotRepo: any ScreenshotRepository, - pricingRepo: any PricingRepository, - appInfoRepo: any AppInfoRepository, - ageRatingRepo: any AgeRatingDeclarationRepository + versionRepo: any AppStoreVersions, + appRepo: any Apps, + buildRepo: any Builds, + reviewDetailRepo: any ReviewDetails, + localizationRepo: any VersionLocalizations, + screenshotRepo: any AppScreenshots, + pricingRepo: any AppPrices, + appInfoRepo: any AppInfos, + ageRatingRepo: any AgeRatingDeclarations ) async throws -> String { // 1. Fetch version (includes appId + buildId) let version = try await versionRepo.getVersion(id: versionId) diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift b/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift index 145d26de..7835da16 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift @@ -21,11 +21,11 @@ struct VersionsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeVersionRepository() + let repo = try ClientProvider.makeAppStoreVersions() print(try await execute(repo: repo)) } - func execute(repo: any VersionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppStoreVersions, affordanceMode: AffordanceMode = .cli) async throws -> String { let versions = try await repo.listVersions(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift b/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift index 201dfb8d..e1fa5048 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift @@ -19,11 +19,11 @@ struct VersionsCreate: AsyncParsableCommand { var platform: String func run() async throws { - let repo = try ClientProvider.makeVersionRepository() + let repo = try ClientProvider.makeAppStoreVersions() print(try await execute(repo: repo)) } - func execute(repo: any VersionRepository) async throws -> String { + func execute(repo: any AppStoreVersions) async throws -> String { guard let appStorePlatform = AppStorePlatform(cliArgument: platform) else { throw ValidationError("Unknown platform '\(platform)'. Use: ios, macos, tvos, watchos, visionos") } diff --git a/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift b/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift index ac3eab01..0165d916 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift @@ -16,11 +16,11 @@ struct VersionsSetBuild: AsyncParsableCommand { var buildId: String func run() async throws { - let repo = try ClientProvider.makeVersionRepository() + let repo = try ClientProvider.makeAppStoreVersions() try await execute(repo: repo) } - func execute(repo: any VersionRepository) async throws { + func execute(repo: any AppStoreVersions) async throws { try await repo.setBuild(versionId: versionId, buildId: buildId) } } diff --git a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift index 62db8fdb..9b9a2ad1 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift @@ -27,22 +27,22 @@ struct VersionsSubmit: AsyncParsableCommand { func run() async throws { if withProducts || dryRun { let planner = SubmissionPlanner( - iapRepo: try ClientProvider.makeInAppPurchaseRepository(), - groupRepo: try ClientProvider.makeSubscriptionGroupRepository(), - subscriptionRepo: try ClientProvider.makeSubscriptionRepository(), - productVersionRepo: try ClientProvider.makeProductVersionRepository() + iapRepo: try ClientProvider.makeInAppPurchases(), + groupRepo: try ClientProvider.makeSubscriptionGroups(), + subscriptionRepo: try ClientProvider.makeSubscriptions(), + productVersionRepo: try ClientProvider.makeProductVersions() ) print(try await executeWithProducts( - submissionRepo: try ClientProvider.makeSubmissionRepository(), - versionRepo: try ClientProvider.makeVersionRepository(), + submissionRepo: try ClientProvider.makeReviewSubmissions(), + versionRepo: try ClientProvider.makeAppStoreVersions(), planner: planner )) } else { - print(try await execute(repo: try ClientProvider.makeSubmissionRepository())) + print(try await execute(repo: try ClientProvider.makeReviewSubmissions())) } } - func execute(repo: any SubmissionRepository) async throws -> String { + func execute(repo: any ReviewSubmissions) async throws -> String { let submission = try await repo.submitVersion(versionId: versionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) @@ -54,8 +54,8 @@ struct VersionsSubmit: AsyncParsableCommand { } func executeWithProducts( - submissionRepo: any SubmissionRepository, - versionRepo: any VersionRepository, + submissionRepo: any ReviewSubmissions, + versionRepo: any AppStoreVersions, planner: SubmissionPlanner, affordanceMode: AffordanceMode = .cli ) async throws -> String { diff --git a/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift b/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift index c421935d..553e74fa 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift @@ -25,11 +25,11 @@ struct VersionsUpdate: AsyncParsableCommand { var earliestReleaseDate: String? func run() async throws { - let repo = try ClientProvider.makeVersionRepository() + let repo = try ClientProvider.makeAppStoreVersions() print(try await execute(repo: repo)) } - func execute(repo: any VersionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppStoreVersions, affordanceMode: AffordanceMode = .cli) async throws -> String { let updated = try await repo.updateVersion( id: versionId, versionString: version, diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift index dc3bc158..eae770fa 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `AgeRatingDeclaration` resources. struct AgeRatingController: Sendable { - let repo: any AgeRatingDeclarationRepository + let repo: any AgeRatingDeclarations func addRoutes(to group: RouterGroup) { // Canonical nested path matches the resolver's `_links.getAgeRating`. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift index b92c9fb6..0ebcb9f4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift @@ -8,8 +8,8 @@ import HummingbirdWebSocket /// `{"territory": ["USA", "JPN"]}` or `{"all-territories": true}`, plus optional /// `"available-in-new-territories": true`. struct AppAvailabilityController: Sendable { - let repo: any AppAvailabilityRepository - let territoryRepo: any TerritoryRepository + let repo: any AppAvailabilities + let territoryRepo: any Territories func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/availability") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift index 5560b1bc..ef16d1d8 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `AppCategory` resources. struct AppCategoriesController: Sendable { - let repo: any AppCategoryRepository + let repo: any AppCategories func addRoutes(to group: RouterGroup) { group.get("/app-categories") { request, _ -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift index 1baacdc4..84926bc6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift @@ -12,7 +12,7 @@ private func optionalString(_ value: Any?) -> String? { /// Routes that return `AppInfo` and `AppInfoLocalization` resources. struct AppInfosController: Sendable { - let repo: any AppInfoRepository + let repo: any AppInfos func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/app-infos") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift index 49b4b0c6..069b4086 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// `GET /apps/:appId/price-points?territory=USA` and `POST /apps/:appId/prices/set` /// with body `{"base-territory": "USA", "price-point-id": "…"}` (camelCase keys also accepted). struct AppPricingController: Sendable { - let repo: any PricingRepository + let repo: any AppPrices func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/price-points") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift index 0e1fb2fc..e4ead6c7 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift @@ -7,11 +7,11 @@ import Foundation /// /api/v1/app-shots — Screenshot template, theme, export, and AI generation. struct AppShotsController: Sendable { - let templateRepo: any TemplateRepository - let themeRepo: any ThemeRepository + let templateRepo: any Templates + let themeRepo: any Themes let htmlRenderer: any HTMLRenderer let configStorage: any AppShotsConfigStorage - let galleryTemplateRepo: any GalleryTemplateRepository + let galleryTemplateRepo: any GalleryTemplates func addRoutes(to group: RouterGroup) { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift index 4f63bfd5..0143e34a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `App` resources. struct AppsController: Sendable { - let repo: any AppRepository + let repo: any Apps func addRoutes(to group: RouterGroup) { group.get("/apps") { request, _ -> Response in @@ -43,7 +43,7 @@ struct AppsController: Sendable { /// Load apps and, when requested, enrich each one with its icon asset. /// Icon fetch is parallel across apps; nil icons are tolerated. - static func loadApps(repo: any AppRepository, includeIcon: Bool) async throws -> [App] { + static func loadApps(repo: any Apps, includeIcon: Bool) async throws -> [App] { let apps = try await repo.listApps(limit: nil).data guard includeIcon else { return apps } diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift index f7ec7ebe..c3314e60 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift @@ -9,10 +9,10 @@ import HummingbirdWebSocket /// JSON bodies use the flags in camelCase (`imageId`/`videoId`, `placementType`, `placementGroup`, /// `placementIds`, `libraryId`, `referenceName`, `archived`). struct AssetLibraryController: Sendable { - let libraryRepo: any AssetLibraryRepository - let imageRepo: any LibraryImageRepository - let videoRepo: any LibraryVideoRepository - let placementRepo: any AssetPlacementRepository + let libraryRepo: any AssetLibraries + let imageRepo: any LibraryImages + let videoRepo: any LibraryVideos + let placementRepo: any AssetPlacements struct BadRequest: Error, Equatable { let message: String @@ -222,7 +222,7 @@ struct AssetLibraryController: Sendable { surface: PlacementSurface, localizationId: String, json: [String: Any], - repo: any AssetPlacementRepository + repo: any AssetPlacements ) async throws -> AssetPlacement { let asset: (AssetMediaType, String)? = (json["videoId"] as? String).map { (.video, $0) } ?? (json["imageId"] as? String).map { (.image, $0) } @@ -237,7 +237,7 @@ struct AssetLibraryController: Sendable { } /// Body: `{"libraryId", "referenceName"?, "archived"?}` — the `asset-images update` flags. - static func updateImage(imageId: String, json: [String: Any], repo: any LibraryImageRepository) async throws -> LibraryImage { + static func updateImage(imageId: String, json: [String: Any], repo: any LibraryImages) async throws -> LibraryImage { let (referenceName, archived) = try updateFields(json) return try await repo.updateImage( libraryId: json["libraryId"] as? String ?? "", imageId: imageId, referenceName: referenceName, isArchived: archived @@ -245,7 +245,7 @@ struct AssetLibraryController: Sendable { } /// Body: `{"libraryId", "referenceName"?, "archived"?}` — the `asset-videos update` flags. - static func updateVideo(videoId: String, json: [String: Any], repo: any LibraryVideoRepository) async throws -> LibraryVideo { + static func updateVideo(videoId: String, json: [String: Any], repo: any LibraryVideos) async throws -> LibraryVideo { let (referenceName, archived) = try updateFields(json) return try await repo.updateVideo( libraryId: json["libraryId"] as? String ?? "", videoId: videoId, referenceName: referenceName, isArchived: archived @@ -264,7 +264,7 @@ struct AssetLibraryController: Sendable { surface: PlacementSurface, localizationId: String, json: [String: Any], - repo: any AssetPlacementRepository + repo: any AssetPlacements ) async throws -> [AssetPlacement] { guard let placementGroup = json["placementGroup"] as? String, let placementIds = json["placementIds"] as? [String], !placementIds.isEmpty diff --git a/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift index 038dc5db..7cc258c6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `BetaAppLocalization` resources. struct BetaAppLocalizationsController: Sendable { - let repo: any BetaAppLocalizationRepository + let repo: any BetaAppLocalizations func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/beta-app-localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift index 7e227c99..60bb2a70 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `Build` resources (both fleet and per-app listings). struct BuildsController: Sendable { - let repo: any BuildRepository + let repo: any Builds func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/builds") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift b/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift index 58af6aaa..9b59b9dc 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift @@ -6,10 +6,10 @@ import ASCKit /// /api/v1/certificates, bundle-ids, devices, profiles — Code signing routes. struct CodeSigningController: Sendable { - let certRepo: any CertificateRepository - let bundleIDRepo: any BundleIDRepository - let deviceRepo: any DeviceRepository - let profileRepo: any ProfileRepository + let certRepo: any Certificates + let bundleIDRepo: any BundleIDs + let deviceRepo: any Devices + let profileRepo: any Profiles func addRoutes(to group: RouterGroup) { group.get("/certificates") { request, _ -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift index d56bad33..a56a0456 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `CustomerReview` resources. struct CustomerReviewsController: Sendable { - let repo: any CustomerReviewRepository + let repo: any CustomerReviews func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/reviews") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift index b7562711..d418b444 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// `GET /diagnostics/:signatureId/logs` — the logs behind one signature. /// The query param matches the CLI flag `--diagnostic-type`. struct DiagnosticsController: Sendable { - let repo: any DiagnosticsRepository + let repo: any Diagnostics func addRoutes(to group: RouterGroup) { group.get("/builds/:buildId/diagnostics") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift index a8895e9d..cb0c7684 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift @@ -8,7 +8,7 @@ import HummingbirdWebSocket /// /// Query-param names match the CLI flags: `?state=&limit=`. struct ExperimentsController: Sendable { - let repo: any ExperimentRepository + let repo: any Experiments func addRoutes(to group: RouterGroup) { // MARK: Experiments diff --git a/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift b/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift index 0197a514..6972dc0c 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift @@ -8,8 +8,8 @@ import HummingbirdWebSocket /// /// Query-param names match the CLI flags: `?blocked-only=true`. struct GameCenterController: Sendable { - let repo: any GameCenterRepository - let moderationRepo: any GameCenterModerationRepository + let repo: any GameCenter + let moderationRepo: any GameCenterModeration /// A request body missing a required field; surfaced to the client as a 400. struct BadRequest: Error, Equatable { @@ -110,7 +110,7 @@ struct GameCenterController: Sendable { static func createAchievement( detailId: String, json: [String: Any], - repo: any GameCenterRepository + repo: any GameCenter ) async throws -> GameCenterAchievement { guard let referenceName = json["referenceName"] as? String, let vendorIdentifier = json["vendorIdentifier"] as? String, @@ -131,7 +131,7 @@ struct GameCenterController: Sendable { static func createLeaderboard( detailId: String, json: [String: Any], - repo: any GameCenterRepository + repo: any GameCenter ) async throws -> GameCenterLeaderboard { guard let referenceName = json["referenceName"] as? String, let vendorIdentifier = json["vendorIdentifier"] as? String, diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift index 76e7fdb4..5f431d15 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift @@ -5,11 +5,11 @@ import HummingbirdWebSocket /// Routes that return the per-territory availability of an in-app purchase. struct IAPAvailabilityController: Sendable { - let repo: any InAppPurchaseAvailabilityRepository + let repo: any InAppPurchaseAvailabilities /// Used to seed a synthetic "all 175 territories available" response when ASC has no /// availability resource yet — matches the iOS app's default UX for fresh IAPs (the /// view defaults `selectedIds = Set(app.territories.map(\.id))`). - let territoryRepo: any TerritoryRepository + let territoryRepo: any Territories func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/availability") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift index 3ed9407a..a0168014 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `InAppPurchase` resources. struct IAPController: Sendable { - let repo: any InAppPurchaseRepository + let repo: any InAppPurchases func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/iap") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift index 8dda8a05..9b0ea884 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return Apple's auto-equalized territory prices for an IAP price point. struct IAPEqualizationsController: Sendable { - let repo: any InAppPurchasePriceRepository + let repo: any InAppPurchasePrices func addRoutes(to group: RouterGroup) { group.get("/iap-price-points/:pricePointId/equalizations") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift index eda48c00..48ad31a3 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift @@ -18,7 +18,7 @@ private func clamp(_ value: String, to limit: Int) -> String { /// Routes that return `InAppPurchaseLocalization` resources. struct IAPLocalizationsController: Sendable { - let repo: any InAppPurchaseLocalizationRepository + let repo: any InAppPurchaseLocalizations func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift index e7126be8..331f6d08 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift @@ -8,7 +8,7 @@ import HummingbirdWebSocket /// Mirrors `asc iap-offer-code-one-time-codes list/create/update` so REST clients can /// generate sandbox or production redemption batches and toggle individual batches active. struct IAPOfferCodeOneTimeCodesController: Sendable { - let repo: any InAppPurchaseOfferCodeRepository + let repo: any InAppPurchaseOfferCodes func addRoutes(to group: RouterGroup) { group.get("/iap-offer-codes/:offerCodeId/one-time-codes") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift index 9732dbcd..0596183c 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `InAppPurchaseOfferCode` resources. struct IAPOfferCodesController: Sendable { - let repo: any InAppPurchaseOfferCodeRepository + let repo: any InAppPurchaseOfferCodes func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/offer-codes") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift index 52296638..b7087ef1 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `InAppPurchasePricePoint` resources. struct IAPPricePointsController: Sendable { - let repo: any InAppPurchasePriceRepository + let repo: any InAppPurchasePrices func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/price-points") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift index 8e2f1052..72bb7e21 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return the manual price schedule for an in-app purchase. struct IAPPriceScheduleController: Sendable { - let repo: any InAppPurchasePriceRepository + let repo: any InAppPurchasePrices func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/price-schedule") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift index 5d97799b..a6ce62f9 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// `baseTerritory` is how the iOS app implements "Change Base Territory" — ASC replaces /// the previous schedule with a new one and equalizes other territories from the new base. struct IAPPricesController: Sendable { - let repo: any InAppPurchasePriceRepository + let repo: any InAppPurchasePrices func addRoutes(to group: RouterGroup) { group.post("/iap/:iapId/prices/set") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift index 7010cf4e..7619d28f 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return IAP review screenshot + promotional images. struct IAPReviewController: Sendable { - let repo: any InAppPurchaseReviewRepository + let repo: any InAppPurchaseReviewAssets func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/review-screenshot") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift index ac92bad4..b82d91cd 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift @@ -10,7 +10,7 @@ import HummingbirdWebSocket /// We surface ASC's error verbatim — no client-side gating yet (see readiness-checklist /// design note in CHANGELOG). struct IAPSubmissionController: Sendable { - let repo: any InAppPurchaseSubmissionRepository + let repo: any InAppPurchaseSubmissions func addRoutes(to group: RouterGroup) { group.post("/iap/:iapId/submit") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift index 4eccbf28..90ce3a18 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift @@ -12,7 +12,7 @@ import HummingbirdWebSocket /// IrisAPIError stack from the repository. struct IrisIAPSubmissionsController: Sendable { let cookieProvider: any IrisCookieProvider - let repo: any IrisInAppPurchaseSubmissionRepository + let repo: any IrisInAppPurchaseSubmissions func addRoutes(to group: RouterGroup) { group.post("/iris/iap/:iapId/submissions") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift index 1ca59c0e..138bf67d 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift @@ -11,7 +11,7 @@ import HummingbirdWebSocket /// `?plain-text=true` mirrors the CLI's `--plain-text` flag (HTML → text). struct IrisResolutionCenterController: Sendable { let cookieProvider: any IrisCookieProvider - let repo: any IrisResolutionCenterRepository + let repo: any IrisResolutionCenter func addRoutes(to group: RouterGroup) { group.get("/iris/review-submissions/:submissionId/resolution-center") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift index 5d861ad7..e2e3e31a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift @@ -4,8 +4,8 @@ import HummingbirdWebSocket /// Routes that return per-territory prices attached to IAP and subscription offer codes. struct OfferCodePricesController: Sendable { - let iapRepo: any InAppPurchaseOfferCodeRepository - let subRepo: any SubscriptionOfferCodeRepository + let iapRepo: any InAppPurchaseOfferCodes + let subRepo: any SubscriptionOfferCodes func addRoutes(to group: RouterGroup) { group.get("/iap-offer-codes/:offerCodeId/prices") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift index 552dab76..94a49692 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift @@ -6,7 +6,7 @@ import HummingbirdWebSocket /// `GET /apps/:appId/perf-metrics` and `GET /builds/:buildId/perf-metrics` — power and /// performance metrics. The `metric-type` query param matches the CLI flag `--metric-type`. struct PerfMetricsController: Sendable { - let repo: any PerfMetricsRepository + let repo: any PerfMetrics func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/perf-metrics") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift index f8959bef..f271b34a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift @@ -6,7 +6,7 @@ import HummingbirdWebSocket /// `GET /apps/:appId/perf-overview?device-type=…` — the app's Xcode Organizer overview. /// The query param matches the CLI flag `--device-type`. struct PerfOverviewController: Sendable { - let repo: any PerfOverviewRepository + let repo: any PerfOverviews func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/perf-overview") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PluginsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PluginsController.swift index 2091bb20..513b1699 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PluginsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PluginsController.swift @@ -13,7 +13,7 @@ import HummingbirdWebSocket /// GET /plugins/market ↔ asc plugins market list /// GET /plugins/market?q=… ↔ asc plugins market search --query … struct PluginsController: Sendable { - let repo: any PluginRepository + let repo: any Plugins func addRoutes(to group: RouterGroup) { group.get("/plugins") { _, _ -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift index 154659c1..7ef14fe2 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Review versions of in-app purchases, subscriptions and subscription groups. /// A submittable version is sent to review by adding it to a review submission. struct ProductVersionsController: Sendable { - let repo: any ProductVersionRepository + let repo: any ProductVersions func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/versions") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift index db70d4b0..9aa418a5 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `PromotedPurchase` resources (App Store product page promoted slots). struct PromotedPurchasesController: Sendable { - let repo: any PromotedPurchaseRepository + let repo: any PromotedPurchases func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/promoted-purchases") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift index 2a875bdb..d57665a5 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift @@ -10,7 +10,7 @@ import ASCKit /// `filter[app]` as required, so fleet listing isn't possible without /// aggregating per-app on the client side. struct ReviewSubmissionsController: Sendable { - let submissionRepo: any SubmissionRepository + let submissionRepo: any ReviewSubmissions func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/review-submissions") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift index a7694c58..47978f47 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift @@ -8,11 +8,11 @@ import HummingbirdWebSocket /// export ZIP. Query params match the CLI flags (`existing`, `dry-run`, repeated /// `placement-group`). Synchronous: the response arrives once every group is placed. struct ScreenshotImportController: Sendable { - let versionRepo: any VersionRepository - let localizationRepo: any VersionLocalizationRepository - let libraryRepo: any AssetLibraryRepository - let imageRepo: any LibraryImageRepository - let placementRepo: any AssetPlacementRepository + let versionRepo: any AppStoreVersions + let localizationRepo: any VersionLocalizations + let libraryRepo: any AssetLibraries + let imageRepo: any LibraryImages + let placementRepo: any AssetPlacements /// Export ZIPs hold every locale's screenshots. static let maxZipBytes = 500 * 1024 * 1024 diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift index 818b7984..e664db3d 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `AppScreenshotSet` resources. struct ScreenshotSetsController: Sendable { - let repo: any ScreenshotRepository + let repo: any AppScreenshots func addRoutes(to group: RouterGroup) { group.get("/version-localizations/:localizationId/screenshot-sets") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift index 4fdec0a4..44a37f08 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `AppScreenshot` resources. struct ScreenshotsController: Sendable { - let repo: any ScreenshotRepository + let repo: any AppScreenshots func addRoutes(to group: RouterGroup) { group.get("/screenshot-sets/:setId/screenshots") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SimulatorsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SimulatorsController.swift index 5dc6cf8f..583c91cb 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SimulatorsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SimulatorsController.swift @@ -5,7 +5,7 @@ import ASCKit /// /api/v1/simulators — Simulator routes. struct SimulatorsController: Sendable { - let repo: any SimulatorRepository + let repo: any Simulators func addRoutes(to group: RouterGroup) { group.get("/simulators") { _, _ -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift index 457fcf1c..12f46ea3 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift @@ -4,9 +4,9 @@ import HummingbirdWebSocket /// Routes that return the per-territory availability of a subscription. struct SubscriptionAvailabilityController: Sendable { - let repo: any SubscriptionAvailabilityRepository + let repo: any SubscriptionAvailabilities /// Same synthetic-default rationale as `IAPAvailabilityController.territoryRepo`. - let territoryRepo: any TerritoryRepository + let territoryRepo: any Territories func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/availability") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift index 5dc25e5a..43da3a7c 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return Apple's auto-equalized territory prices for a subscription price point. struct SubscriptionEqualizationsController: Sendable { - let repo: any SubscriptionPriceRepository + let repo: any SubscriptionPrices func addRoutes(to group: RouterGroup) { group.get("/subscription-price-points/:pricePointId/equalizations") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift index 05032d8f..0f66df15 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionGroupLocalization` resources. struct SubscriptionGroupLocalizationsController: Sendable { - let repo: any SubscriptionGroupLocalizationRepository + let repo: any SubscriptionGroupLocalizations func addRoutes(to group: RouterGroup) { group.get("/subscription-groups/:groupId/subscription-group-localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift index ec8aaeba..4de6a855 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionGroup` resources. struct SubscriptionGroupsController: Sendable { - let repo: any SubscriptionGroupRepository + let repo: any SubscriptionGroups func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/subscription-groups") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift index 0854f765..24c28e0a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionIntroductoryOffer` resources. struct SubscriptionIntroductoryOffersController: Sendable { - let repo: any SubscriptionIntroductoryOfferRepository + let repo: any SubscriptionIntroductoryOffers func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/introductory-offers") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift index 72c0cfae..3cca6c89 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionLocalization` resources. struct SubscriptionLocalizationsController: Sendable { - let repo: any SubscriptionLocalizationRepository + let repo: any SubscriptionLocalizations func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift index a158b7aa..1921ab5b 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// /// Mirrors `asc subscription-offer-code-one-time-codes list/create/update`. struct SubscriptionOfferCodeOneTimeCodesController: Sendable { - let repo: any SubscriptionOfferCodeRepository + let repo: any SubscriptionOfferCodes func addRoutes(to group: RouterGroup) { group.get("/subscription-offer-codes/:offerCodeId/one-time-codes") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift index b240465d..d65ad501 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionOfferCode` resources. struct SubscriptionOfferCodesController: Sendable { - let repo: any SubscriptionOfferCodeRepository + let repo: any SubscriptionOfferCodes func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/offer-codes") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift index 151b294f..ae8ed36b 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionPricePoint` resources. struct SubscriptionPricePointsController: Sendable { - let repo: any SubscriptionPriceRepository + let repo: any SubscriptionPrices func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/price-points") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift index d46d0f02..cb13a90b 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return the per-territory price schedule for a subscription. struct SubscriptionPriceScheduleController: Sendable { - let repo: any SubscriptionPriceRepository + let repo: any SubscriptionPrices func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/price-schedule") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift index ffeff1e0..fe17fe88 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes for batch-setting per-territory prices on a subscription. struct SubscriptionPricesController: Sendable { - let repo: any SubscriptionPriceRepository + let repo: any SubscriptionPrices func addRoutes(to group: RouterGroup) { group.post("/subscriptions/:subscriptionId/prices/set-batch") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift index 457928de..f022f4c2 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionPromotionalOffer` resources and their per-territory prices. struct SubscriptionPromotionalOffersController: Sendable { - let repo: any SubscriptionPromotionalOfferRepository + let repo: any SubscriptionPromotionalOffers func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/subscription-promotional-offers") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift index 3baff3fb..f5052d71 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return the subscription review screenshot and promotional images. struct SubscriptionReviewController: Sendable { - let repo: any SubscriptionReviewRepository + let repo: any SubscriptionReviewAssets func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/review-screenshot") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift index 7ac587d6..594e8949 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift @@ -8,7 +8,7 @@ import HummingbirdWebSocket /// Apple constraint: the first subscription within a group must be submitted with a /// new app version; subsequent submissions are standalone. ASC enforces this. struct SubscriptionSubmissionController: Sendable { - let repo: any SubscriptionSubmissionRepository + let repo: any SubscriptionSubmissions func addRoutes(to group: RouterGroup) { group.post("/subscriptions/:subscriptionId/submit") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift index 9a346430..5d77a896 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `Subscription` resources nested under a subscription group. struct SubscriptionsController: Sendable { - let repo: any SubscriptionRepository + let repo: any Subscriptions func addRoutes(to group: RouterGroup) { group.get("/subscription-groups/:groupId/subscriptions") { request, context -> Response in @@ -27,7 +27,7 @@ struct SubscriptionsController: Sendable { static func update( subscriptionId: String, json: [String: Any], - repo: any SubscriptionRepository + repo: any Subscriptions ) async throws -> Subscription { let marketSettings = (json["marketSetting"] as? [String])?.compactMap(SubscriptionMarketSetting.init(rawValue:)) return try await repo.updateSubscription( diff --git a/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift index f0509d58..1259081a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift @@ -5,7 +5,7 @@ import ASCKit /// /api/v1/territories — Territory routes. struct TerritoriesController: Sendable { - let repo: any TerritoryRepository + let repo: any Territories func addRoutes(to group: RouterGroup) { group.get("/territories") { _, _ -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift b/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift index b8071ba7..303c0da4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return TestFlight `BetaGroup` resources. struct TestFlightController: Sendable { - let repo: any TestFlightRepository + let repo: any TestFlight func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/testflight") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift index 183273c6..1fd8bd40 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `AppStoreVersionLocalization` resources. struct VersionLocalizationsController: Sendable { - let repo: any VersionLocalizationRepository + let repo: any VersionLocalizations func addRoutes(to group: RouterGroup) { group.get("/versions/:versionId/localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift index 0016cc3e..2a7d1b01 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift @@ -7,8 +7,8 @@ import HummingbirdWebSocket /// version in the same review submission; `?dry-run=true` lists those items and /// submits nothing. Query names match the CLI's `--with-products` / `--dry-run`. struct VersionSubmissionController: Sendable { - let submissionRepo: any SubmissionRepository - let versionRepo: any VersionRepository + let submissionRepo: any ReviewSubmissions + let versionRepo: any AppStoreVersions let planner: SubmissionPlanner func addRoutes(to group: RouterGroup) { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift index 23cfd7ac..c5d6d9e3 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `AppStoreVersion` resources. struct VersionsController: Sendable { - let repo: any VersionRepository + let repo: any AppStoreVersions func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/versions") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift index 9baf0039..8a6060ae 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `WinBackOffer` resources and their per-territory prices. struct WinBackOffersController: Sendable { - let repo: any WinBackOfferRepository + let repo: any WinBackOffers func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/win-back-offers") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift index 5caadd13..048cbec4 100644 --- a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift +++ b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift @@ -19,72 +19,72 @@ enum RESTRoutes { // App resource hierarchy — one focused controller per resource type. // Order is incidental; each controller registers its own routes. - if let appRepo = try? ClientProvider.makeAppRepository() { + if let appRepo = try? ClientProvider.makeApps() { AppsController(repo: appRepo).addRoutes(to: v1) } - if let versionRepo = try? ClientProvider.makeVersionRepository() { + if let versionRepo = try? ClientProvider.makeAppStoreVersions() { VersionsController(repo: versionRepo).addRoutes(to: v1) } - if let localizationRepo = try? ClientProvider.makeVersionLocalizationRepository() { + if let localizationRepo = try? ClientProvider.makeVersionLocalizations() { VersionLocalizationsController(repo: localizationRepo).addRoutes(to: v1) } - if let screenshotRepo = try? ClientProvider.makeScreenshotRepository() { + if let screenshotRepo = try? ClientProvider.makeAppScreenshots() { ScreenshotSetsController(repo: screenshotRepo).addRoutes(to: v1) ScreenshotsController(repo: screenshotRepo).addRoutes(to: v1) } - if let libraryRepo = try? ClientProvider.makeAssetLibraryRepository(), - let imageRepo = try? ClientProvider.makeLibraryImageRepository(), - let videoRepo = try? ClientProvider.makeLibraryVideoRepository(), - let placementRepo = try? ClientProvider.makeAssetPlacementRepository() { + if let libraryRepo = try? ClientProvider.makeAssetLibraries(), + let imageRepo = try? ClientProvider.makeLibraryImages(), + let videoRepo = try? ClientProvider.makeLibraryVideos(), + let placementRepo = try? ClientProvider.makeAssetPlacements() { AssetLibraryController( libraryRepo: libraryRepo, imageRepo: imageRepo, videoRepo: videoRepo, placementRepo: placementRepo ).addRoutes(to: v1) - if let versionRepo = try? ClientProvider.makeVersionRepository(), - let localizationRepo = try? ClientProvider.makeVersionLocalizationRepository() { + if let versionRepo = try? ClientProvider.makeAppStoreVersions(), + let localizationRepo = try? ClientProvider.makeVersionLocalizations() { ScreenshotImportController( versionRepo: versionRepo, localizationRepo: localizationRepo, libraryRepo: libraryRepo, imageRepo: imageRepo, placementRepo: placementRepo ).addRoutes(to: v1) } } - if let buildRepo = try? ClientProvider.makeBuildRepository() { + if let buildRepo = try? ClientProvider.makeBuilds() { BuildsController(repo: buildRepo).addRoutes(to: v1) } - if let testFlightRepo = try? ClientProvider.makeTestFlightRepository() { + if let testFlightRepo = try? ClientProvider.makeTestFlight() { TestFlightController(repo: testFlightRepo).addRoutes(to: v1) } - if let betaAppLocRepo = try? ClientProvider.makeBetaAppLocalizationRepository() { + if let betaAppLocRepo = try? ClientProvider.makeBetaAppLocalizations() { BetaAppLocalizationsController(repo: betaAppLocRepo).addRoutes(to: v1) } - if let reviewRepo = try? ClientProvider.makeCustomerReviewRepository() { + if let reviewRepo = try? ClientProvider.makeCustomerReviews() { CustomerReviewsController(repo: reviewRepo).addRoutes(to: v1) } - if let iapRepo = try? ClientProvider.makeInAppPurchaseRepository() { + if let iapRepo = try? ClientProvider.makeInAppPurchases() { IAPController(repo: iapRepo).addRoutes(to: v1) } - if let subscriptionGroupRepo = try? ClientProvider.makeSubscriptionGroupRepository() { + if let subscriptionGroupRepo = try? ClientProvider.makeSubscriptionGroups() { SubscriptionGroupsController(repo: subscriptionGroupRepo).addRoutes(to: v1) } - if let subscriptionRepo = try? ClientProvider.makeSubscriptionRepository() { + if let subscriptionRepo = try? ClientProvider.makeSubscriptions() { SubscriptionsController(repo: subscriptionRepo).addRoutes(to: v1) } - if let promotedRepo = try? ClientProvider.makePromotedPurchaseRepository() { + if let promotedRepo = try? ClientProvider.makePromotedPurchases() { PromotedPurchasesController(repo: promotedRepo).addRoutes(to: v1) } - if let availabilityRepo = try? ClientProvider.makeAppAvailabilityRepository(), - let territoryRepo = try? ClientProvider.makeTerritoryRepository() { + if let availabilityRepo = try? ClientProvider.makeAppAvailabilities(), + let territoryRepo = try? ClientProvider.makeTerritories() { AppAvailabilityController(repo: availabilityRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let pricingRepo = try? ClientProvider.makePricingRepository() { + if let pricingRepo = try? ClientProvider.makeAppPrices() { AppPricingController(repo: pricingRepo).addRoutes(to: v1) } - if let productVersionRepo = try? ClientProvider.makeProductVersionRepository() { + if let productVersionRepo = try? ClientProvider.makeProductVersions() { ProductVersionsController(repo: productVersionRepo).addRoutes(to: v1) - if let submissionRepo = try? ClientProvider.makeSubmissionRepository(), - let versionRepo = try? ClientProvider.makeVersionRepository(), - let iapRepo = try? ClientProvider.makeInAppPurchaseRepository(), - let groupRepo = try? ClientProvider.makeSubscriptionGroupRepository(), - let subscriptionRepo = try? ClientProvider.makeSubscriptionRepository() { + if let submissionRepo = try? ClientProvider.makeReviewSubmissions(), + let versionRepo = try? ClientProvider.makeAppStoreVersions(), + let iapRepo = try? ClientProvider.makeInAppPurchases(), + let groupRepo = try? ClientProvider.makeSubscriptionGroups(), + let subscriptionRepo = try? ClientProvider.makeSubscriptions() { VersionSubmissionController( submissionRepo: submissionRepo, versionRepo: versionRepo, @@ -93,80 +93,80 @@ enum RESTRoutes { ).addRoutes(to: v1) } } - if let perfOverviewRepo = try? ClientProvider.makePerfOverviewRepository() { + if let perfOverviewRepo = try? ClientProvider.makePerfOverviews() { PerfOverviewController(repo: perfOverviewRepo).addRoutes(to: v1) } - if let perfMetricsRepo = try? ClientProvider.makePerfMetricsRepository() { + if let perfMetricsRepo = try? ClientProvider.makePerfMetrics() { PerfMetricsController(repo: perfMetricsRepo).addRoutes(to: v1) } - if let diagnosticsRepo = try? ClientProvider.makeDiagnosticsRepository() { + if let diagnosticsRepo = try? ClientProvider.makeDiagnostics() { DiagnosticsController(repo: diagnosticsRepo).addRoutes(to: v1) } - if let experimentRepo = try? ClientProvider.makeExperimentRepository() { + if let experimentRepo = try? ClientProvider.makeExperiments() { ExperimentsController(repo: experimentRepo).addRoutes(to: v1) } - if let gameCenterRepo = try? ClientProvider.makeGameCenterRepository(), - let moderationRepo = try? ClientProvider.makeGameCenterModerationRepository() { + if let gameCenterRepo = try? ClientProvider.makeGameCenter(), + let moderationRepo = try? ClientProvider.makeGameCenterModeration() { GameCenterController(repo: gameCenterRepo, moderationRepo: moderationRepo).addRoutes(to: v1) } - if let groupLocRepo = try? ClientProvider.makeSubscriptionGroupLocalizationRepository() { + if let groupLocRepo = try? ClientProvider.makeSubscriptionGroupLocalizations() { SubscriptionGroupLocalizationsController(repo: groupLocRepo).addRoutes(to: v1) } - if let promoRepo = try? ClientProvider.makeSubscriptionPromotionalOfferRepository() { + if let promoRepo = try? ClientProvider.makeSubscriptionPromotionalOffers() { SubscriptionPromotionalOffersController(repo: promoRepo).addRoutes(to: v1) } - if let winBackRepo = try? ClientProvider.makeWinBackOfferRepository() { + if let winBackRepo = try? ClientProvider.makeWinBackOffers() { WinBackOffersController(repo: winBackRepo).addRoutes(to: v1) } - if let subPriceRepo = try? ClientProvider.makeSubscriptionPriceRepository() { + if let subPriceRepo = try? ClientProvider.makeSubscriptionPrices() { SubscriptionPricePointsController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionPriceScheduleController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionEqualizationsController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionPricesController(repo: subPriceRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository(), - let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodes(), + let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodes() { OfferCodePricesController(iapRepo: iapOfferCodeRepo, subRepo: subOfferCodeRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository() { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodes() { IAPOfferCodeOneTimeCodesController(repo: iapOfferCodeRepo).addRoutes(to: v1) } - if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { + if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodes() { SubscriptionOfferCodeOneTimeCodesController(repo: subOfferCodeRepo).addRoutes(to: v1) } - if let iapReviewRepo = try? ClientProvider.makeInAppPurchaseReviewRepository() { + if let iapReviewRepo = try? ClientProvider.makeInAppPurchaseReviewAssets() { IAPReviewController(repo: iapReviewRepo).addRoutes(to: v1) } - if let subReviewRepo = try? ClientProvider.makeSubscriptionReviewRepository() { + if let subReviewRepo = try? ClientProvider.makeSubscriptionReviewAssets() { SubscriptionReviewController(repo: subReviewRepo).addRoutes(to: v1) } - if let iapSubmissionRepo = try? ClientProvider.makeInAppPurchaseSubmissionRepository() { + if let iapSubmissionRepo = try? ClientProvider.makeInAppPurchaseSubmissions() { IAPSubmissionController(repo: iapSubmissionRepo).addRoutes(to: v1) } IrisIAPSubmissionsController( cookieProvider: ClientProvider.makeIrisCookieProvider(), - repo: ClientProvider.makeIrisInAppPurchaseSubmissionRepository() + repo: ClientProvider.makeIrisInAppPurchaseSubmissions() ).addRoutes(to: v1) IrisResolutionCenterController( cookieProvider: ClientProvider.makeIrisCookieProvider(), - repo: ClientProvider.makeIrisResolutionCenterRepository() + repo: ClientProvider.makeIrisResolutionCenter() ).addRoutes(to: v1) - if let subSubmissionRepo = try? ClientProvider.makeSubscriptionSubmissionRepository() { + if let subSubmissionRepo = try? ClientProvider.makeSubscriptionSubmissions() { SubscriptionSubmissionController(repo: subSubmissionRepo).addRoutes(to: v1) } // IAP detail listings - if let iapLocRepo = try? ClientProvider.makeInAppPurchaseLocalizationRepository() { + if let iapLocRepo = try? ClientProvider.makeInAppPurchaseLocalizations() { IAPLocalizationsController(repo: iapLocRepo).addRoutes(to: v1) } - if let iapAvailRepo = try? ClientProvider.makeInAppPurchaseAvailabilityRepository(), - let territoryRepo = try? ClientProvider.makeTerritoryRepository() { + if let iapAvailRepo = try? ClientProvider.makeInAppPurchaseAvailabilities(), + let territoryRepo = try? ClientProvider.makeTerritories() { IAPAvailabilityController(repo: iapAvailRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository() { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodes() { IAPOfferCodesController(repo: iapOfferCodeRepo).addRoutes(to: v1) } - if let iapPriceRepo = try? ClientProvider.makeInAppPurchasePriceRepository() { + if let iapPriceRepo = try? ClientProvider.makeInAppPurchasePrices() { IAPPricePointsController(repo: iapPriceRepo).addRoutes(to: v1) IAPPriceScheduleController(repo: iapPriceRepo).addRoutes(to: v1) IAPEqualizationsController(repo: iapPriceRepo).addRoutes(to: v1) @@ -174,60 +174,60 @@ enum RESTRoutes { } // Subscription detail listings - if let subLocRepo = try? ClientProvider.makeSubscriptionLocalizationRepository() { + if let subLocRepo = try? ClientProvider.makeSubscriptionLocalizations() { SubscriptionLocalizationsController(repo: subLocRepo).addRoutes(to: v1) } - if let subAvailRepo = try? ClientProvider.makeSubscriptionAvailabilityRepository(), - let territoryRepo = try? ClientProvider.makeTerritoryRepository() { + if let subAvailRepo = try? ClientProvider.makeSubscriptionAvailabilities(), + let territoryRepo = try? ClientProvider.makeTerritories() { SubscriptionAvailabilityController(repo: subAvailRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { + if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodes() { SubscriptionOfferCodesController(repo: subOfferCodeRepo).addRoutes(to: v1) } - if let subIntroRepo = try? ClientProvider.makeSubscriptionIntroductoryOfferRepository() { + if let subIntroRepo = try? ClientProvider.makeSubscriptionIntroductoryOffers() { SubscriptionIntroductoryOffersController(repo: subIntroRepo).addRoutes(to: v1) } - if let appInfoRepo = try? ClientProvider.makeAppInfoRepository() { + if let appInfoRepo = try? ClientProvider.makeAppInfos() { AppInfosController(repo: appInfoRepo).addRoutes(to: v1) } - if let appCategoryRepo = try? ClientProvider.makeAppCategoryRepository() { + if let appCategoryRepo = try? ClientProvider.makeAppCategories() { AppCategoriesController(repo: appCategoryRepo).addRoutes(to: v1) } - if let ageRatingRepo = try? ClientProvider.makeAgeRatingDeclarationRepository() { + if let ageRatingRepo = try? ClientProvider.makeAgeRatingDeclarations() { AgeRatingController(repo: ageRatingRepo).addRoutes(to: v1) } // Code signing if let signing = try? CodeSigningController( - certRepo: ClientProvider.makeCertificateRepository(), - bundleIDRepo: ClientProvider.makeBundleIDRepository(), - deviceRepo: ClientProvider.makeDeviceRepository(), - profileRepo: ClientProvider.makeProfileRepository() + certRepo: ClientProvider.makeCertificates(), + bundleIDRepo: ClientProvider.makeBundleIDs(), + deviceRepo: ClientProvider.makeDevices(), + profileRepo: ClientProvider.makeProfiles() ) { signing.addRoutes(to: v1) } // Review submissions if let submissions = try? ReviewSubmissionsController( - submissionRepo: ClientProvider.makeSubmissionRepository() + submissionRepo: ClientProvider.makeReviewSubmissions() ) { submissions.addRoutes(to: v1) } // Auth — manages the credential store the rest of the controllers consume. AuthController(storage: ClientProvider.makeAuthStorage()).addRoutes(to: v1) // Non-authenticated resources - SimulatorsController(repo: ClientProvider.makeSimulatorRepository()).addRoutes(to: v1) - PluginsController(repo: ClientProvider.makePluginRepository()).addRoutes(to: v1) + SimulatorsController(repo: ClientProvider.makeSimulators()).addRoutes(to: v1) + PluginsController(repo: ClientProvider.makePlugins()).addRoutes(to: v1) if let territories = try? TerritoriesController( - repo: ClientProvider.makeTerritoryRepository() + repo: ClientProvider.makeTerritories() ) { territories.addRoutes(to: v1) } // App Shots AppShotsController( - templateRepo: ClientProvider.makeTemplateRepository(), - themeRepo: ClientProvider.makeThemeRepository(), + templateRepo: ClientProvider.makeTemplates(), + themeRepo: ClientProvider.makeThemes(), htmlRenderer: ClientProvider.makeHTMLRenderer(), configStorage: ClientProvider.makeAppShotsConfigStorage(), - galleryTemplateRepo: ClientProvider.makeGalleryTemplateRepository() + galleryTemplateRepo: ClientProvider.makeGalleryTemplates() ).addRoutes(to: v1) } } diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift index 367bf709..e309126f 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift @@ -56,11 +56,11 @@ struct WinBackOffersCreate: AsyncParsableCommand { var price: [String] = [] func run() async throws { - let repo = try ClientProvider.makeWinBackOfferRepository() + let repo = try ClientProvider.makeWinBackOffers() print(try await execute(repo: repo)) } - func execute(repo: any WinBackOfferRepository) async throws -> String { + func execute(repo: any WinBackOffers) async throws -> String { guard let durationEnum = SubscriptionOfferDuration(rawValue: duration) else { throw ValidationError("Invalid duration: \(duration)") } diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift index 26e6fb6a..3c0442ec 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift @@ -13,11 +13,11 @@ struct WinBackOffersDelete: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeWinBackOfferRepository() + let repo = try ClientProvider.makeWinBackOffers() try await execute(repo: repo) } - func execute(repo: any WinBackOfferRepository) async throws { + func execute(repo: any WinBackOffers) async throws { try await repo.deleteWinBackOffer(offerId: offerId) } } diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift index 856973f1..56721ad8 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift @@ -13,12 +13,12 @@ struct WinBackOffersList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeWinBackOfferRepository() + let repo = try ClientProvider.makeWinBackOffers() print(try await execute(repo: repo)) } func execute( - repo: any WinBackOfferRepository, + repo: any WinBackOffers, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listWinBackOffers(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift index 942680a7..c0183560 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift @@ -13,12 +13,12 @@ struct WinBackOffersPricesList: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeWinBackOfferRepository() + let repo = try ClientProvider.makeWinBackOffers() print(try await execute(repo: repo)) } func execute( - repo: any WinBackOfferRepository, + repo: any WinBackOffers, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPrices(offerId: offerId) diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift index cd542e18..526ac541 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift @@ -37,11 +37,11 @@ struct WinBackOffersUpdate: AsyncParsableCommand { var waitMonths: Int? func run() async throws { - let repo = try ClientProvider.makeWinBackOfferRepository() + let repo = try ClientProvider.makeWinBackOffers() print(try await execute(repo: repo)) } - func execute(repo: any WinBackOfferRepository) async throws -> String { + func execute(repo: any WinBackOffers) async throws -> String { let priorityEnum: WinBackOfferPriority? = try priority.map { raw in guard let v = WinBackOfferPriority(rawValue: raw) else { throw ValidationError("Invalid priority: \(raw)") diff --git a/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift b/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift index 4cc56a55..df37792a 100644 --- a/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift +++ b/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift @@ -36,11 +36,11 @@ struct XcodeCloudProductsList: AsyncParsableCommand { var appId: String? func run() async throws { - let repo = try ClientProvider.makeXcodeCloudProductRepository() + let repo = try ClientProvider.makeXcodeCloudProducts() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudProductRepository) async throws -> String { + func execute(repo: any XcodeCloudProducts) async throws -> String { let products = try await repo.listProducts(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -73,11 +73,11 @@ struct XcodeCloudWorkflowsList: AsyncParsableCommand { var productId: String func run() async throws { - let repo = try ClientProvider.makeXcodeCloudWorkflowRepository() + let repo = try ClientProvider.makeXcodeCloudWorkflows() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudWorkflowRepository) async throws -> String { + func execute(repo: any XcodeCloudWorkflows) async throws -> String { let workflows = try await repo.listWorkflows(productId: productId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -114,11 +114,11 @@ struct XcodeCloudBuildsList: AsyncParsableCommand { var workflowId: String func run() async throws { - let repo = try ClientProvider.makeXcodeCloudBuildRunRepository() + let repo = try ClientProvider.makeXcodeCloudBuildRuns() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudBuildRunRepository) async throws -> String { + func execute(repo: any XcodeCloudBuildRuns) async throws -> String { let runs = try await repo.listBuildRuns(workflowId: workflowId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -141,11 +141,11 @@ struct XcodeCloudBuildsGet: AsyncParsableCommand { var buildRunId: String func run() async throws { - let repo = try ClientProvider.makeXcodeCloudBuildRunRepository() + let repo = try ClientProvider.makeXcodeCloudBuildRuns() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudBuildRunRepository) async throws -> String { + func execute(repo: any XcodeCloudBuildRuns) async throws -> String { let run = try await repo.getBuildRun(id: buildRunId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -171,11 +171,11 @@ struct XcodeCloudBuildsStart: AsyncParsableCommand { var clean: Bool = false func run() async throws { - let repo = try ClientProvider.makeXcodeCloudBuildRunRepository() + let repo = try ClientProvider.makeXcodeCloudBuildRuns() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudBuildRunRepository) async throws -> String { + func execute(repo: any XcodeCloudBuildRuns) async throws -> String { let run = try await repo.startBuildRun(workflowId: workflowId, clean: clean) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCKit/AppWall/AppWallRepository.swift b/Sources/ASCKit/AppWall/AppWall.swift similarity index 84% rename from Sources/ASCKit/AppWall/AppWallRepository.swift rename to Sources/ASCKit/AppWall/AppWall.swift index 6c4490b3..a4291e6b 100644 --- a/Sources/ASCKit/AppWall/AppWallRepository.swift +++ b/Sources/ASCKit/AppWall/AppWall.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppWallRepository: Sendable { +public protocol AppWall: Sendable { /// Forks the upstream repo, adds `app` to `homepage/apps.json`, and opens a pull request. /// - Returns: The created pull request details. func submit(app: AppWallApp) async throws -> AppWallSubmission diff --git a/Sources/ASCKit/AppWall/Internal/GitHubAppWallRepository.swift b/Sources/ASCKit/AppWall/Internal/GitHubAppWall.swift similarity index 99% rename from Sources/ASCKit/AppWall/Internal/GitHubAppWallRepository.swift rename to Sources/ASCKit/AppWall/Internal/GitHubAppWall.swift index a211d81d..972a76a2 100644 --- a/Sources/ASCKit/AppWall/Internal/GitHubAppWallRepository.swift +++ b/Sources/ASCKit/AppWall/Internal/GitHubAppWall.swift @@ -1,6 +1,6 @@ import Foundation -public struct GitHubAppWallRepository: AppWallRepository { +public struct GitHubAppWall: AppWall { private let token: String private let httpClient: any HTTPPerforming private let upstreamOwner: String @@ -24,7 +24,7 @@ public struct GitHubAppWallRepository: AppWallRepository { self.sleep = sleep ?? { try await Task.sleep(for: $0) } } - // MARK: - AppWallRepository + // MARK: - AppWall public func submit(app: AppWallApp) async throws -> AppWallSubmission { // 1. Resolve authenticated GitHub username diff --git a/Sources/ASCKit/Apps/AppClips/AppClipRepository.swift b/Sources/ASCKit/Apps/AppClips/AppClips.swift similarity index 93% rename from Sources/ASCKit/Apps/AppClips/AppClipRepository.swift rename to Sources/ASCKit/Apps/AppClips/AppClips.swift index 06d4bdd9..3a1389e9 100644 --- a/Sources/ASCKit/Apps/AppClips/AppClipRepository.swift +++ b/Sources/ASCKit/Apps/AppClips/AppClips.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppClipRepository: Sendable { +public protocol AppClips: Sendable { func listAppClips(appId: String) async throws -> [AppClip] func listExperiences(appClipId: String) async throws -> [AppClipDefaultExperience] func createExperience(appClipId: String, action: AppClipAction?) async throws -> AppClipDefaultExperience diff --git a/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift b/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClips.swift similarity index 98% rename from Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift rename to Sources/ASCKit/Apps/AppClips/Internal/SDKAppClips.swift index 553a1d34..4eae7ada 100644 --- a/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift +++ b/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClips.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { +public struct SDKAppClips: AppClips, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarationRepository.swift b/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarations.swift similarity index 78% rename from Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarationRepository.swift rename to Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarations.swift index e290f01b..4521219c 100644 --- a/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarationRepository.swift +++ b/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarations.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AgeRatingDeclarationRepository: Sendable { +public protocol AgeRatingDeclarations: Sendable { func getDeclaration(appInfoId: String) async throws -> AgeRatingDeclaration func updateDeclaration(id: String, update: AgeRatingDeclarationUpdate) async throws -> AgeRatingDeclaration } diff --git a/Sources/ASCKit/Apps/AppInfos/AppCategory.swift b/Sources/ASCKit/Apps/AppInfos/AppCategory.swift index fada2004..4fc3e962 100644 --- a/Sources/ASCKit/Apps/AppInfos/AppCategory.swift +++ b/Sources/ASCKit/Apps/AppInfos/AppCategory.swift @@ -32,7 +32,7 @@ extension AppCategory: AffordanceProviding { } @Mockable -public protocol AppCategoryRepository: Sendable { +public protocol AppCategories: Sendable { func listCategories(platform: String?) async throws -> [AppCategory] func getCategory(id: String) async throws -> AppCategory } diff --git a/Sources/ASCKit/Apps/AppInfos/AppInfoRepository.swift b/Sources/ASCKit/Apps/AppInfos/AppInfos.swift similarity index 94% rename from Sources/ASCKit/Apps/AppInfos/AppInfoRepository.swift rename to Sources/ASCKit/Apps/AppInfos/AppInfos.swift index 7912626d..c26fa07b 100644 --- a/Sources/ASCKit/Apps/AppInfos/AppInfoRepository.swift +++ b/Sources/ASCKit/Apps/AppInfos/AppInfos.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppInfoRepository: Sendable { +public protocol AppInfos: Sendable { func listAppInfos(appId: String) async throws -> [AppInfo] func listLocalizations(appInfoId: String) async throws -> [AppInfoLocalization] func createLocalization(appInfoId: String, locale: String, name: String) async throws -> AppInfoLocalization diff --git a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarations.swift similarity index 98% rename from Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarations.swift index b40a1c3e..2e99cb21 100644 --- a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarations.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAgeRatingDeclarationRepository: AgeRatingDeclarationRepository, @unchecked Sendable { +public struct SDKAgeRatingDeclarations: AgeRatingDeclarations, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategories.swift similarity index 95% rename from Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategories.swift index 2382553d..70de5039 100644 --- a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategories.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppCategoryRepository: AppCategoryRepository, @unchecked Sendable { +public struct SDKAppCategories: AppCategories, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfos.swift similarity index 98% rename from Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfos.swift index 2117245a..9044176d 100644 --- a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfos.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { +public struct SDKAppInfos: AppInfos, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AppRepository.swift b/Sources/ASCKit/Apps/Apps.swift similarity index 88% rename from Sources/ASCKit/Apps/AppRepository.swift rename to Sources/ASCKit/Apps/Apps.swift index fb166860..4019009b 100644 --- a/Sources/ASCKit/Apps/AppRepository.swift +++ b/Sources/ASCKit/Apps/Apps.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppRepository: Sendable { +public protocol Apps: Sendable { func listApps(limit: Int?) async throws -> PaginatedResponse func getApp(id: String) async throws -> App func fetchAppIcon(appId: String) async throws -> ImageAsset? diff --git a/Sources/ASCKit/Apps/AssetLibrary/AssetLibraryRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/AssetLibraries.swift similarity index 87% rename from Sources/ASCKit/Apps/AssetLibrary/AssetLibraryRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/AssetLibraries.swift index 214a3163..939d0a87 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/AssetLibraryRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/AssetLibraries.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AssetLibraryRepository: Sendable { +public protocol AssetLibraries: Sendable { /// The app's one asset library. func getAssetLibrary(appId: String) async throws -> AppAssetLibrary /// Placement groups from App Store Connect's reference data, one row per placement type and group. diff --git a/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImages.swift similarity index 98% rename from Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImages.swift index 2d25f56d..b9841a46 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImages.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKLibraryImageRepository: LibraryImageRepository, @unchecked Sendable { +public struct SDKLibraryImages: LibraryImages, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImageRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImages.swift similarity index 93% rename from Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImageRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImages.swift index 7bf92bf2..e400c1df 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImageRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImages.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol LibraryImageRepository: Sendable { +public protocol LibraryImages: Sendable { /// Images in the library, optionally narrowed to one image, a state or a category. func listImages(libraryId: String, imageId: String?, state: LibraryAssetState?, category: AssetCategory?) async throws -> [LibraryImage] /// Reserves, uploads and commits the file; returns the image as App Store Connect sees it after the commit. diff --git a/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift b/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift index 558bb675..a5eab8c5 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift @@ -162,8 +162,8 @@ extension ScreenshotImportPlan { /// reported as `failed`; the others carry on. public func execute( libraryId: String, - imageRepo: any LibraryImageRepository, - placementRepo: any AssetPlacementRepository, + imageRepo: any LibraryImages, + placementRepo: any AssetPlacements, sleep: @Sendable (UInt64) async throws -> Void ) async -> [ScreenshotImportGroupResult] { var imageIds: [String: String] = [:] @@ -218,7 +218,7 @@ extension ScreenshotImportPlan { _ group: PlannedGroup, imageIds: [String: String], failures: [String: String], - placementRepo: any AssetPlacementRepository + placementRepo: any AssetPlacements ) async -> ScreenshotImportGroupResult { func failed(_ message: String) -> ScreenshotImportGroupResult { ScreenshotImportGroupResult( diff --git a/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraries.swift similarity index 97% rename from Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraries.swift index bcc09963..571e2f3e 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraries.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAssetLibraryRepository: AssetLibraryRepository, @unchecked Sendable { +public struct SDKAssetLibraries: AssetLibraries, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacements.swift similarity index 94% rename from Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacements.swift index 9f1e42c0..8d65ac6f 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacements.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AssetPlacementRepository: Sendable { +public protocol AssetPlacements: Sendable { /// Placements on one localization, in display order within each group. func listPlacements(surface: PlacementSurface, localizationId: String, placementType: AssetPlacementType?, placementGroup: String?) async throws -> [AssetPlacement] /// Every placement that shows one asset, across all localizations. diff --git a/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacements.swift similarity index 99% rename from Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacements.swift index 54b44d0d..bca8cb4e 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacements.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAssetPlacementRepository: AssetPlacementRepository, @unchecked Sendable { +public struct SDKAssetPlacements: AssetPlacements, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideos.swift similarity index 98% rename from Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideos.swift index ebfeb464..fda6b13b 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideos.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKLibraryVideoRepository: LibraryVideoRepository, @unchecked Sendable { +public struct SDKLibraryVideos: LibraryVideos, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift b/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideos.swift similarity index 93% rename from Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift rename to Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideos.swift index c0b243be..05450857 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideos.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol LibraryVideoRepository: Sendable { +public protocol LibraryVideos: Sendable { /// Videos in the library, optionally narrowed to one video, a state or a category. func listVideos(libraryId: String, videoId: String?, state: LibraryAssetState?, category: AssetCategory?) async throws -> [LibraryVideo] /// Reserves, uploads (streamed from disk) and commits the file. diff --git a/Sources/ASCKit/Apps/Availability/AppAvailabilityRepository.swift b/Sources/ASCKit/Apps/Availability/AppAvailabilities.swift similarity index 88% rename from Sources/ASCKit/Apps/Availability/AppAvailabilityRepository.swift rename to Sources/ASCKit/Apps/Availability/AppAvailabilities.swift index dec72c0e..136d4457 100644 --- a/Sources/ASCKit/Apps/Availability/AppAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/Availability/AppAvailabilities.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppAvailabilityRepository: Sendable { +public protocol AppAvailabilities: Sendable { /// `nil` when the app's availability hasn't been set up yet. func getAppAvailability(appId: String) async throws -> AppAvailability? /// Sets up the app's availability: available in `territoryIds`. diff --git a/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift b/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilities.swift similarity index 98% rename from Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift rename to Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilities.swift index 6fc45449..d319eef0 100644 --- a/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilities.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppAvailabilityRepository: AppAvailabilityRepository, @unchecked Sendable { +public struct SDKAppAvailabilities: AppAvailabilities, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Builds/BetaBuildLocalizationRepository.swift b/Sources/ASCKit/Apps/Builds/BetaBuildLocalizations.swift similarity index 80% rename from Sources/ASCKit/Apps/Builds/BetaBuildLocalizationRepository.swift rename to Sources/ASCKit/Apps/Builds/BetaBuildLocalizations.swift index 3a6c37e2..8ca6aa1f 100644 --- a/Sources/ASCKit/Apps/Builds/BetaBuildLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Builds/BetaBuildLocalizations.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BetaBuildLocalizationRepository: Sendable { +public protocol BetaBuildLocalizations: Sendable { func listBetaBuildLocalizations(buildId: String) async throws -> [BetaBuildLocalization] func upsertBetaBuildLocalization(buildId: String, locale: String, whatsNew: String) async throws -> BetaBuildLocalization } diff --git a/Sources/ASCKit/Apps/Builds/BuildUploadRepository.swift b/Sources/ASCKit/Apps/Builds/BuildUploads.swift similarity index 88% rename from Sources/ASCKit/Apps/Builds/BuildUploadRepository.swift rename to Sources/ASCKit/Apps/Builds/BuildUploads.swift index d339b8e2..42e5897d 100644 --- a/Sources/ASCKit/Apps/Builds/BuildUploadRepository.swift +++ b/Sources/ASCKit/Apps/Builds/BuildUploads.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol BuildUploadRepository: Sendable { +public protocol BuildUploads: Sendable { func uploadBuild(appId: String, version: String, buildNumber: String, platform: BuildUploadPlatform, fileURL: URL) async throws -> BuildUpload func listBuildUploads(appId: String) async throws -> [BuildUpload] func getBuildUpload(id: String) async throws -> BuildUpload diff --git a/Sources/ASCKit/Apps/Builds/BuildRepository.swift b/Sources/ASCKit/Apps/Builds/Builds.swift similarity index 93% rename from Sources/ASCKit/Apps/Builds/BuildRepository.swift rename to Sources/ASCKit/Apps/Builds/Builds.swift index 815f0fdc..14bb4a11 100644 --- a/Sources/ASCKit/Apps/Builds/BuildRepository.swift +++ b/Sources/ASCKit/Apps/Builds/Builds.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BuildRepository: Sendable { +public protocol Builds: Sendable { func listBuilds(appId: String?, platform: BuildUploadPlatform?, version: String?, limit: Int?) async throws -> PaginatedResponse func getBuild(id: String) async throws -> Build func addBetaGroups(buildId: String, betaGroupIds: [String]) async throws diff --git a/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift b/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift index 8f2adc0c..9381389c 100644 --- a/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBuildRepository: BuildRepository, @unchecked Sendable { +public struct SDKBuilds: Builds, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift b/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizations.swift similarity index 95% rename from Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift rename to Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizations.swift index 89741ff3..8589322c 100644 --- a/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizations.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBetaBuildLocalizationRepository: BetaBuildLocalizationRepository, @unchecked Sendable { +public struct SDKBetaBuildLocalizations: BetaBuildLocalizations, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift b/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploads.swift similarity index 98% rename from Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift rename to Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploads.swift index 7a274264..4945b22d 100644 --- a/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploads.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendable { +public struct SDKBuildUploads: BuildUploads, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/Experiments/ExperimentRepository.swift b/Sources/ASCKit/Apps/Experiments/Experiments.swift similarity index 96% rename from Sources/ASCKit/Apps/Experiments/ExperimentRepository.swift rename to Sources/ASCKit/Apps/Experiments/Experiments.swift index 10e693c9..2c62558e 100644 --- a/Sources/ASCKit/Apps/Experiments/ExperimentRepository.swift +++ b/Sources/ASCKit/Apps/Experiments/Experiments.swift @@ -2,7 +2,7 @@ import Mockable /// Product Page Optimization tests, treatments and treatment localizations. @Mockable -public protocol ExperimentRepository: Sendable { +public protocol Experiments: Sendable { // Experiments (app-scoped) func listExperiments(appId: String, state: AppStoreVersionExperimentState?, limit: Int?) async throws -> PaginatedResponse func getExperiment(experimentId: String) async throws -> AppStoreVersionExperiment diff --git a/Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift b/Sources/ASCKit/Apps/Experiments/Internal/SDKExperiments.swift similarity index 99% rename from Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift rename to Sources/ASCKit/Apps/Experiments/Internal/SDKExperiments.swift index fb1ae744..54db28ba 100644 --- a/Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift +++ b/Sources/ASCKit/Apps/Experiments/Internal/SDKExperiments.swift @@ -3,7 +3,7 @@ import Foundation /// Adapts the App Store Connect "product page optimization" endpoints /// (`appStoreVersionExperiments` v2 + treatments + treatment localizations). -public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable { +public struct SDKExperiments: Experiments, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilities.swift similarity index 87% rename from Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilities.swift index 9770e5c5..40ebd2d3 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilities.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseAvailabilityRepository: Sendable { +public protocol InAppPurchaseAvailabilities: Sendable { /// Returns nil when the IAP has no availability resource yet (404 from ASC) — typical /// for newly-created IAPs. Frontends treat nil as "no availability set; default UI". func getAvailability(iapId: String) async throws -> InAppPurchaseAvailability? diff --git a/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilities.swift similarity index 96% rename from Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilities.swift index 9066676f..6c1dd7ff 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilities.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseAvailabilityRepository: InAppPurchaseAvailabilityRepository, @unchecked Sendable { +public struct SDKInAppPurchaseAvailabilities: InAppPurchaseAvailabilities, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePrices.swift similarity index 94% rename from Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePrices.swift index 22721d3c..0f20d558 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePrices.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchasePriceRepository: Sendable { +public protocol InAppPurchasePrices: Sendable { /// Cursor-paginated. `cursor` is the opaque value from the previous response's /// `nextCursor`. `limit` defaults to ASC's page size (~50) when nil. func listPricePoints( diff --git a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissions.swift similarity index 73% rename from Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissions.swift index a57198d4..63963152 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissions.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseSubmissionRepository: Sendable { +public protocol InAppPurchaseSubmissions: Sendable { func submitInAppPurchase(iapId: String) async throws -> InAppPurchaseSubmission func deleteSubmission(submissionId: String) async throws } diff --git a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchases.swift similarity index 91% rename from Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchases.swift index 0a7d6e4a..2f21de6d 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchases.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseRepository: Sendable { +public protocol InAppPurchases: Sendable { func listInAppPurchases(appId: String, limit: Int?) async throws -> PaginatedResponse func createInAppPurchase( appId: String, diff --git a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePrices.swift similarity index 99% rename from Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePrices.swift index 609e4fd4..03b06a83 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePrices.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @unchecked Sendable { +public struct SDKInAppPurchasePrices: InAppPurchasePrices, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissions.swift similarity index 91% rename from Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissions.swift index 4f348d2b..e4e44b22 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissions.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseSubmissionRepository: InAppPurchaseSubmissionRepository, @unchecked Sendable { +public struct SDKInAppPurchaseSubmissions: InAppPurchaseSubmissions, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchases.swift similarity index 98% rename from Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchases.swift index f6911df1..574cb689 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchases.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Sendable { +public struct SDKInAppPurchases: InAppPurchases, @unchecked Sendable { private let client: any APIClient /// Optional enricher that asks iris for `submitWithNextAppStoreVersion` per IAP /// (the public SDK has no path that exposes that bit). Wired by the factory when diff --git a/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizations.swift similarity index 88% rename from Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizations.swift index e8b7a1ea..36c62b95 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizations.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseLocalizationRepository: Sendable { +public protocol InAppPurchaseLocalizations: Sendable { func listLocalizations(iapId: String) async throws -> [InAppPurchaseLocalization] func createLocalization( iapId: String, diff --git a/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizations.swift similarity index 96% rename from Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizations.swift index 0d472495..43a226a8 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizations.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseLocalizationRepository: InAppPurchaseLocalizationRepository, @unchecked Sendable { +public struct SDKInAppPurchaseLocalizations: InAppPurchaseLocalizations, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodes.swift similarity index 96% rename from Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodes.swift index 607a9e21..7b4f0364 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodes.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseOfferCodeRepository: Sendable { +public protocol InAppPurchaseOfferCodes: Sendable { func listOfferCodes(iapId: String) async throws -> [InAppPurchaseOfferCode] /// Creates an offer code with full per-territory pricing. /// diff --git a/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodes.swift similarity index 99% rename from Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodes.swift index ee4d06a9..a4f9d2eb 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodes.swift @@ -1,7 +1,7 @@ import Foundation @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeRepository, @unchecked Sendable { +public struct SDKInAppPurchaseOfferCodes: InAppPurchaseOfferCodes, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewAssets.swift similarity index 90% rename from Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewAssets.swift index 817d6d02..db4ceab2 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewAssets.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol InAppPurchaseReviewRepository: Sendable { +public protocol InAppPurchaseReviewAssets: Sendable { func getReviewScreenshot(iapId: String) async throws -> InAppPurchaseReviewScreenshot? func uploadReviewScreenshot(iapId: String, fileURL: URL) async throws -> InAppPurchaseReviewScreenshot func deleteReviewScreenshot(screenshotId: String) async throws diff --git a/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift b/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssets.swift similarity index 99% rename from Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift rename to Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssets.swift index eb5fd9e0..78fc2804 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssets.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @unchecked Sendable { +public struct SDKInAppPurchaseReviewAssets: InAppPurchaseReviewAssets, @unchecked Sendable { private let client: any APIClient /// Per-attempt sleep when polling for `imageAsset` readiness post-upload. /// Mirrors the iOS SDK's 2s default; tests override to 0 to keep the suite fast. diff --git a/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift b/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift index 33d7f7dd..4fe0283a 100644 --- a/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift +++ b/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppRepository: AppRepository, @unchecked Sendable { +public struct SDKApps: Apps, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Performance/DiagnosticsRepository.swift b/Sources/ASCKit/Apps/Performance/Diagnostics.swift similarity index 81% rename from Sources/ASCKit/Apps/Performance/DiagnosticsRepository.swift rename to Sources/ASCKit/Apps/Performance/Diagnostics.swift index e384661c..2380eede 100644 --- a/Sources/ASCKit/Apps/Performance/DiagnosticsRepository.swift +++ b/Sources/ASCKit/Apps/Performance/Diagnostics.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol DiagnosticsRepository: Sendable { +public protocol Diagnostics: Sendable { func listSignatures(buildId: String, diagnosticType: DiagnosticType?) async throws -> [DiagnosticSignatureInfo] func listLogs(signatureId: String) async throws -> [DiagnosticLogEntry] } diff --git a/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnostics.swift similarity index 98% rename from Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKDiagnostics.swift index d8a8ffff..3d7f8c24 100644 --- a/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnostics.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKDiagnosticsRepository: DiagnosticsRepository, @unchecked Sendable { +public struct SDKDiagnostics: Diagnostics, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetrics.swift similarity index 98% rename from Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetrics.swift index af0e2eec..c6d3adf6 100644 --- a/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetrics.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKPerfMetricsRepository: PerfMetricsRepository, @unchecked Sendable { +public struct SDKPerfMetrics: PerfMetrics, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviews.swift similarity index 97% rename from Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviews.swift index fcb92c30..61173516 100644 --- a/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviews.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKPerfOverviewRepository: PerfOverviewRepository, @unchecked Sendable { +public struct SDKPerfOverviews: PerfOverviews, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Performance/PerfMetricsRepository.swift b/Sources/ASCKit/Apps/Performance/PerfMetrics.swift similarity index 84% rename from Sources/ASCKit/Apps/Performance/PerfMetricsRepository.swift rename to Sources/ASCKit/Apps/Performance/PerfMetrics.swift index b1c5347a..f94eba85 100644 --- a/Sources/ASCKit/Apps/Performance/PerfMetricsRepository.swift +++ b/Sources/ASCKit/Apps/Performance/PerfMetrics.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol PerfMetricsRepository: Sendable { +public protocol PerfMetrics: Sendable { func listAppMetrics(appId: String, metricType: PerformanceMetricCategory?) async throws -> [PerformanceMetric] func listBuildMetrics(buildId: String, metricType: PerformanceMetricCategory?) async throws -> [PerformanceMetric] } diff --git a/Sources/ASCKit/Apps/Performance/PerfOverviewRepository.swift b/Sources/ASCKit/Apps/Performance/PerfOverviews.swift similarity index 70% rename from Sources/ASCKit/Apps/Performance/PerfOverviewRepository.swift rename to Sources/ASCKit/Apps/Performance/PerfOverviews.swift index d1f9e69a..c8ed24d8 100644 --- a/Sources/ASCKit/Apps/Performance/PerfOverviewRepository.swift +++ b/Sources/ASCKit/Apps/Performance/PerfOverviews.swift @@ -1,6 +1,6 @@ import Mockable @Mockable -public protocol PerfOverviewRepository: Sendable { +public protocol PerfOverviews: Sendable { func getOverview(appId: String, deviceType: String?) async throws -> PerformanceOverview } diff --git a/Sources/ASCKit/Apps/Pricing/PricingRepository.swift b/Sources/ASCKit/Apps/Pricing/AppPrices.swift similarity index 90% rename from Sources/ASCKit/Apps/Pricing/PricingRepository.swift rename to Sources/ASCKit/Apps/Pricing/AppPrices.swift index 5b93e66f..a7e41dec 100644 --- a/Sources/ASCKit/Apps/Pricing/PricingRepository.swift +++ b/Sources/ASCKit/Apps/Pricing/AppPrices.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol PricingRepository: Sendable { +public protocol AppPrices: Sendable { func hasPricing(appId: String) async throws -> Bool /// The prices the app can be sold at in `territory`. func listPricePoints(appId: String, territory: String) async throws -> [AppPricePoint] diff --git a/Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift b/Sources/ASCKit/Apps/Pricing/Internal/SDKAppPrices.swift similarity index 96% rename from Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift rename to Sources/ASCKit/Apps/Pricing/Internal/SDKAppPrices.swift index 42eb497e..35ecc500 100644 --- a/Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift +++ b/Sources/ASCKit/Apps/Pricing/Internal/SDKAppPrices.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKPricingRepository: PricingRepository, @unchecked Sendable { +public struct SDKAppPrices: AppPrices, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift b/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersions.swift similarity index 96% rename from Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift rename to Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersions.swift index bf287dce..3775e4c6 100644 --- a/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift +++ b/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersions.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKProductVersionRepository: ProductVersionRepository, @unchecked Sendable { +public struct SDKProductVersions: ProductVersions, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/ProductVersions/ProductVersionRepository.swift b/Sources/ASCKit/Apps/ProductVersions/ProductVersions.swift similarity index 84% rename from Sources/ASCKit/Apps/ProductVersions/ProductVersionRepository.swift rename to Sources/ASCKit/Apps/ProductVersions/ProductVersions.swift index a749e2b1..5760cf46 100644 --- a/Sources/ASCKit/Apps/ProductVersions/ProductVersionRepository.swift +++ b/Sources/ASCKit/Apps/ProductVersions/ProductVersions.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol ProductVersionRepository: Sendable { +public protocol ProductVersions: Sendable { func listInAppPurchaseVersions(iapId: String) async throws -> [ProductVersion] func listSubscriptionVersions(subscriptionId: String) async throws -> [ProductVersion] func listSubscriptionGroupVersions(groupId: String) async throws -> [ProductVersion] diff --git a/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift b/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchases.swift similarity index 97% rename from Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift rename to Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchases.swift index fc18c2c2..2b69ee97 100644 --- a/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift +++ b/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchases.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKPromotedPurchaseRepository: PromotedPurchaseRepository, @unchecked Sendable { +public struct SDKPromotedPurchases: PromotedPurchases, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchaseRepository.swift b/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchases.swift similarity index 91% rename from Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchaseRepository.swift rename to Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchases.swift index 22aed9db..d77598b6 100644 --- a/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchaseRepository.swift +++ b/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchases.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol PromotedPurchaseRepository: Sendable { +public protocol PromotedPurchases: Sendable { func listPromotedPurchases(appId: String, limit: Int?) async throws -> PaginatedResponse func createPromotedPurchase( appId: String, diff --git a/Sources/ASCKit/Apps/Reviews/CustomerReviewRepository.swift b/Sources/ASCKit/Apps/Reviews/CustomerReviews.swift similarity index 88% rename from Sources/ASCKit/Apps/Reviews/CustomerReviewRepository.swift rename to Sources/ASCKit/Apps/Reviews/CustomerReviews.swift index 6da363e0..f82c9881 100644 --- a/Sources/ASCKit/Apps/Reviews/CustomerReviewRepository.swift +++ b/Sources/ASCKit/Apps/Reviews/CustomerReviews.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol CustomerReviewRepository: Sendable { +public protocol CustomerReviews: Sendable { func listReviews(appId: String) async throws -> [CustomerReview] func getReview(reviewId: String) async throws -> CustomerReview func getResponse(reviewId: String) async throws -> CustomerReviewResponse diff --git a/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift b/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviews.swift similarity index 97% rename from Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift rename to Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviews.swift index 7c6a7e3a..cf62ca7f 100644 --- a/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift +++ b/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviews.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKCustomerReviewRepository: CustomerReviewRepository, @unchecked Sendable { +public struct SDKCustomerReviews: CustomerReviews, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilities.swift similarity index 95% rename from Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilities.swift index 4a33786c..ef70e0de 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilities.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionAvailabilityRepository: SubscriptionAvailabilityRepository, @unchecked Sendable { +public struct SDKSubscriptionAvailabilities: SubscriptionAvailabilities, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { @@ -8,7 +8,7 @@ public struct SDKSubscriptionAvailabilityRepository: SubscriptionAvailabilityRep } public func getAvailability(subscriptionId: String) async throws -> ASCKit.SubscriptionAvailability? { - // Two parallel calls — see SDKInAppPurchaseAvailabilityRepository for rationale. + // Two parallel calls — see SDKInAppPurchaseAvailabilities for rationale. // 404 → nil (no availability configured yet on a fresh subscription). do { async let availResponse = client.request( diff --git a/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilities.swift similarity index 71% rename from Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilities.swift index 3b667003..eaa39d69 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilities.swift @@ -1,9 +1,9 @@ import Mockable @Mockable -public protocol SubscriptionAvailabilityRepository: Sendable { +public protocol SubscriptionAvailabilities: Sendable { /// Returns nil when the subscription has no availability resource yet (404 from ASC). - /// Mirrors `InAppPurchaseAvailabilityRepository.getAvailability` 404 tolerance. + /// Mirrors `InAppPurchaseAvailabilities.getAvailability` 404 tolerance. func getAvailability(subscriptionId: String) async throws -> SubscriptionAvailability? func createAvailability(subscriptionId: String, isAvailableInNewTerritories: Bool, territoryIds: [String]) async throws -> SubscriptionAvailability } diff --git a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroups.swift similarity index 95% rename from Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroups.swift index 591b52c4..2d4da141 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroups.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionGroupRepository: SubscriptionGroupRepository, @unchecked Sendable { +public struct SDKSubscriptionGroups: SubscriptionGroups, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPrices.swift similarity index 98% rename from Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPrices.swift index 055afa0c..e023b61b 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPrices.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unchecked Sendable { +public struct SDKSubscriptionPrices: SubscriptionPrices, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissions.swift similarity index 91% rename from Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissions.swift index 67728f8d..30ec15a8 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissions.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionSubmissionRepository: SubscriptionSubmissionRepository, @unchecked Sendable { +public struct SDKSubscriptionSubmissions: SubscriptionSubmissions, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptions.swift similarity index 98% rename from Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptions.swift index e12e3c66..feda622c 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptions.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionRepository: SubscriptionRepository, @unchecked Sendable { +public struct SDKSubscriptions: Subscriptions, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffers.swift similarity index 96% rename from Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffers.swift index 6f28309b..8ef79038 100644 --- a/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffers.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionIntroductoryOfferRepository: SubscriptionIntroductoryOfferRepository, @unchecked Sendable { +public struct SDKSubscriptionIntroductoryOffers: SubscriptionIntroductoryOffers, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffers.swift similarity index 88% rename from Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffers.swift index 4029734a..255c4bca 100644 --- a/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffers.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionIntroductoryOfferRepository: Sendable { +public protocol SubscriptionIntroductoryOffers: Sendable { func listIntroductoryOffers(subscriptionId: String) async throws -> [SubscriptionIntroductoryOffer] func createIntroductoryOffer( subscriptionId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizations.swift similarity index 95% rename from Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizations.swift index d948093d..5ff74eca 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizations.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionGroupLocalizationRepository: SubscriptionGroupLocalizationRepository, @unchecked Sendable { +public struct SDKSubscriptionGroupLocalizations: SubscriptionGroupLocalizations, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizations.swift similarity index 96% rename from Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizations.swift index 8923fa7a..ea16f2c6 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizations.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionLocalizationRepository: SubscriptionLocalizationRepository, @unchecked Sendable { +public struct SDKSubscriptionLocalizations: SubscriptionLocalizations, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizations.swift similarity index 88% rename from Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizations.swift index 065cd91e..b6833639 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizations.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionGroupLocalizationRepository: Sendable { +public protocol SubscriptionGroupLocalizations: Sendable { func listLocalizations(groupId: String) async throws -> [SubscriptionGroupLocalization] func createLocalization( groupId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizations.swift similarity index 89% rename from Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizations.swift index 33761959..81611669 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizations.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionLocalizationRepository: Sendable { +public protocol SubscriptionLocalizations: Sendable { func listLocalizations(subscriptionId: String) async throws -> [SubscriptionLocalization] func createLocalization( subscriptionId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodes.swift similarity index 99% rename from Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodes.swift index fc44ed93..79cd2b7a 100644 --- a/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodes.swift @@ -1,7 +1,7 @@ import Foundation @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepository, @unchecked Sendable { +public struct SDKSubscriptionOfferCodes: SubscriptionOfferCodes, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodes.swift similarity index 97% rename from Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodes.swift index 24ce183e..1f1e7473 100644 --- a/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodes.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionOfferCodeRepository: Sendable { +public protocol SubscriptionOfferCodes: Sendable { func listOfferCodes(subscriptionId: String) async throws -> [SubscriptionOfferCode] /// Creates a subscription offer code. /// diff --git a/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOffers.swift similarity index 97% rename from Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOffers.swift index 48750260..cf80bf6e 100644 --- a/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOffers.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionPromotionalOfferRepository: SubscriptionPromotionalOfferRepository, @unchecked Sendable { +public struct SDKSubscriptionPromotionalOffers: SubscriptionPromotionalOffers, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffers.swift similarity index 90% rename from Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffers.swift index 0064cbd3..86d0022e 100644 --- a/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffers.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionPromotionalOfferRepository: Sendable { +public protocol SubscriptionPromotionalOffers: Sendable { func listPromotionalOffers(subscriptionId: String) async throws -> [SubscriptionPromotionalOffer] func createPromotionalOffer( subscriptionId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssets.swift similarity index 99% rename from Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssets.swift index d2ac535c..4621c1b7 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssets.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @unchecked Sendable { +public struct SDKSubscriptionReviewAssets: SubscriptionReviewAssets, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor /// Per-attempt sleep when polling for `imageAsset` readiness post-upload. diff --git a/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewAssets.swift similarity index 90% rename from Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewAssets.swift index f850dd49..0235056e 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewAssets.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol SubscriptionReviewRepository: Sendable { +public protocol SubscriptionReviewAssets: Sendable { func getReviewScreenshot(subscriptionId: String) async throws -> SubscriptionReviewScreenshot? func uploadReviewScreenshot(subscriptionId: String, fileURL: URL) async throws -> SubscriptionReviewScreenshot func deleteReviewScreenshot(screenshotId: String) async throws diff --git a/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroupRepository.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroups.swift similarity index 88% rename from Sources/ASCKit/Apps/Subscriptions/SubscriptionGroupRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionGroups.swift index 26dd09f1..72e13f16 100644 --- a/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroupRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroups.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionGroupRepository: Sendable { +public protocol SubscriptionGroups: Sendable { func listSubscriptionGroups(appId: String, limit: Int?) async throws -> PaginatedResponse func createSubscriptionGroup(appId: String, referenceName: String) async throws -> SubscriptionGroup func updateSubscriptionGroup(groupId: String, referenceName: String) async throws -> SubscriptionGroup diff --git a/Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceRepository.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionPrices.swift similarity index 97% rename from Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionPrices.swift index 99393f75..18291c25 100644 --- a/Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/SubscriptionPrices.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionPriceRepository: Sendable { +public protocol SubscriptionPrices: Sendable { /// Cursor-paginated. `cursor` is the opaque value from the previous response's /// `nextCursor`. `limit` defaults to ASC's page size (~50) when nil. func listPricePoints( diff --git a/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissionRepository.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissions.swift similarity index 74% rename from Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissionRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissions.swift index ecacd854..fcff79db 100644 --- a/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissionRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissions.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionSubmissionRepository: Sendable { +public protocol SubscriptionSubmissions: Sendable { func submitSubscription(subscriptionId: String) async throws -> SubscriptionSubmission func deleteSubmission(submissionId: String) async throws } diff --git a/Sources/ASCKit/Apps/Subscriptions/SubscriptionRepository.swift b/Sources/ASCKit/Apps/Subscriptions/Subscriptions.swift similarity index 93% rename from Sources/ASCKit/Apps/Subscriptions/SubscriptionRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/Subscriptions.swift index 534b6c72..de757acd 100644 --- a/Sources/ASCKit/Apps/Subscriptions/SubscriptionRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Subscriptions.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionRepository: Sendable { +public protocol Subscriptions: Sendable { func listSubscriptions(groupId: String, limit: Int?) async throws -> PaginatedResponse func createSubscription( groupId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOffers.swift similarity index 99% rename from Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOffers.swift index 78b9bc9c..c82c77ee 100644 --- a/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOffers.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Sendable { +public struct SDKWinBackOffers: WinBackOffers, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOffers.swift similarity index 96% rename from Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift rename to Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOffers.swift index dfc580fe..2287d65c 100644 --- a/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift +++ b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOffers.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol WinBackOfferRepository: Sendable { +public protocol WinBackOffers: Sendable { func listWinBackOffers(subscriptionId: String) async throws -> [WinBackOffer] func createWinBackOffer( subscriptionId: String, diff --git a/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizationRepository.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizations.swift similarity index 91% rename from Sources/ASCKit/Apps/TestFlight/BetaAppLocalizationRepository.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppLocalizations.swift index 37a52701..0df9fcb5 100644 --- a/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizations.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BetaAppLocalizationRepository: Sendable { +public protocol BetaAppLocalizations: Sendable { func listBetaAppLocalizations(appId: String) async throws -> [BetaAppLocalization] func getBetaAppLocalization(localizationId: String) async throws -> BetaAppLocalization func createBetaAppLocalization( diff --git a/Sources/ASCKit/Apps/TestFlight/BetaAppReviewRepository.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppReviews.swift similarity index 89% rename from Sources/ASCKit/Apps/TestFlight/BetaAppReviewRepository.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppReviews.swift index 922a9992..088bfc46 100644 --- a/Sources/ASCKit/Apps/TestFlight/BetaAppReviewRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/BetaAppReviews.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BetaAppReviewRepository: Sendable { +public protocol BetaAppReviews: Sendable { func listSubmissions(buildId: String) async throws -> [BetaAppReviewSubmission] func createSubmission(buildId: String) async throws -> BetaAppReviewSubmission func getSubmission(id: String) async throws -> BetaAppReviewSubmission diff --git a/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift b/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift index 22c5a182..86276cc6 100644 --- a/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable { +public struct SDKTestFlight: TestFlight, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizations.swift similarity index 97% rename from Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift rename to Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizations.swift index f7aa86c6..8f94613a 100644 --- a/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizations.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBetaAppLocalizationRepository: BetaAppLocalizationRepository, @unchecked Sendable { +public struct SDKBetaAppLocalizations: BetaAppLocalizations, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviews.swift similarity index 97% rename from Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift rename to Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviews.swift index 1ee9352f..0fec5f9c 100644 --- a/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviews.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Sendable { +public struct SDKBetaAppReviews: BetaAppReviews, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/TestFlight/TestFlightRepository.swift b/Sources/ASCKit/Apps/TestFlight/TestFlight.swift similarity index 92% rename from Sources/ASCKit/Apps/TestFlight/TestFlightRepository.swift rename to Sources/ASCKit/Apps/TestFlight/TestFlight.swift index 93413dbf..52ce6f8e 100644 --- a/Sources/ASCKit/Apps/TestFlight/TestFlightRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/TestFlight.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol TestFlightRepository: Sendable { +public protocol TestFlight: Sendable { func listBetaGroups(appId: String?, limit: Int?) async throws -> PaginatedResponse func createBetaGroup( appId: String, diff --git a/Sources/ASCKit/Apps/Versions/VersionRepository.swift b/Sources/ASCKit/Apps/Versions/AppStoreVersions.swift similarity index 95% rename from Sources/ASCKit/Apps/Versions/VersionRepository.swift rename to Sources/ASCKit/Apps/Versions/AppStoreVersions.swift index 2614df65..83d79efe 100644 --- a/Sources/ASCKit/Apps/Versions/VersionRepository.swift +++ b/Sources/ASCKit/Apps/Versions/AppStoreVersions.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol VersionRepository: Sendable { +public protocol AppStoreVersions: Sendable { func listVersions(appId: String) async throws -> [AppStoreVersion] func getVersion(id: String) async throws -> AppStoreVersion func createVersion(appId: String, versionString: String, platform: AppStorePlatform) async throws -> AppStoreVersion diff --git a/Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift b/Sources/ASCKit/Apps/Versions/Internal/SDKAppStoreVersions.swift similarity index 98% rename from Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift rename to Sources/ASCKit/Apps/Versions/Internal/SDKAppStoreVersions.swift index c5e31531..0aeff44e 100644 --- a/Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Internal/SDKAppStoreVersions.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { +public struct SDKAppStoreVersions: AppStoreVersions, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift b/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetails.swift similarity index 97% rename from Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift rename to Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetails.swift index b116c6aa..22814a3e 100644 --- a/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetails.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKReviewDetailRepository: ReviewDetailRepository, @unchecked Sendable { +public struct SDKReviewDetails: ReviewDetails, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKVersionLocalizations.swift similarity index 96% rename from Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKVersionLocalizations.swift index d77d7ebb..460e36ee 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKVersionLocalizations.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKLocalizationRepository: VersionLocalizationRepository, @unchecked Sendable { +public struct SDKVersionLocalizations: VersionLocalizations, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviews.swift similarity index 89% rename from Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviews.swift index 468d44a1..0efe53ce 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviews.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol PreviewRepository: Sendable { +public protocol AppPreviews: Sendable { func listPreviewSets(localizationId: String) async throws -> [AppPreviewSet] func createPreviewSet(localizationId: String, previewType: PreviewType) async throws -> AppPreviewSet func listPreviews(setId: String) async throws -> [AppPreview] diff --git a/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviews.swift similarity index 98% rename from Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviews.swift index 4cc76a48..bb7db985 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviews.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { +public struct OpenAPIAppPreviews: AppPreviews, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift index c3653ca5..d23e18e2 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift @@ -7,14 +7,14 @@ public final class AppScreenshotSet: Identifiable, @unchecked Sendable { public let screenshotDisplayType: ScreenshotDisplayType public let screenshotsCount: Int - private let repo: (any ScreenshotRepository)? + private let repo: (any AppScreenshots)? public init( id: String, localizationId: String, screenshotDisplayType: ScreenshotDisplayType, screenshotsCount: Int = 0, - repo: (any ScreenshotRepository)? = nil + repo: (any AppScreenshots)? = nil ) { self.id = id self.localizationId = localizationId diff --git a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshots.swift similarity index 92% rename from Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshots.swift index c33fde4d..ad229e3d 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshots.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol ScreenshotRepository: Sendable { +public protocol AppScreenshots: Sendable { /// List screenshot sets for a specific localization. func listScreenshotSets(localizationId: String) async throws -> [AppScreenshotSet] diff --git a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift index 4431e625..38f6b556 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable { +public struct SDKAppScreenshots: AppScreenshots, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizationRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizations.swift similarity index 89% rename from Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizationRepository.swift rename to Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizations.swift index b93553a6..d1b21a27 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizationRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizations.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol VersionLocalizationRepository: Sendable { +public protocol VersionLocalizations: Sendable { func listLocalizations(versionId: String) async throws -> [AppStoreVersionLocalization] func createLocalization(versionId: String, locale: String) async throws -> AppStoreVersionLocalization func updateLocalization( diff --git a/Sources/ASCKit/Apps/Versions/ReviewDetailRepository.swift b/Sources/ASCKit/Apps/Versions/ReviewDetails.swift similarity index 81% rename from Sources/ASCKit/Apps/Versions/ReviewDetailRepository.swift rename to Sources/ASCKit/Apps/Versions/ReviewDetails.swift index d274021a..dc21e4b9 100644 --- a/Sources/ASCKit/Apps/Versions/ReviewDetailRepository.swift +++ b/Sources/ASCKit/Apps/Versions/ReviewDetails.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol ReviewDetailRepository: Sendable { +public protocol ReviewDetails: Sendable { func getReviewDetail(versionId: String) async throws -> AppStoreReviewDetail func upsertReviewDetail(versionId: String, update: ReviewDetailUpdate) async throws -> AppStoreReviewDetail } diff --git a/Sources/ASCKit/Auth/Iris/IrisSessionRepository.swift b/Sources/ASCKit/Auth/Iris/IrisSessions.swift similarity index 84% rename from Sources/ASCKit/Auth/Iris/IrisSessionRepository.swift rename to Sources/ASCKit/Auth/Iris/IrisSessions.swift index 276e5519..c7742505 100644 --- a/Sources/ASCKit/Auth/Iris/IrisSessionRepository.swift +++ b/Sources/ASCKit/Auth/Iris/IrisSessions.swift @@ -4,10 +4,10 @@ import Mockable /// Persists `IrisAuthSession` for reuse across `asc` invocations. /// /// One session at a time — the protocol is CRUD on a singleton resource. Implementations -/// live in Infrastructure (`KeychainIrisSessionRepository` on macOS, `FileIrisSessionRepository` +/// live in Infrastructure (`KeychainIrisSessionRepository` on macOS, `FileIrisSessions` /// for the disk fallback, `CompositeIrisSessionRepository` to chain them). @Mockable -public protocol IrisSessionRepository: Sendable { +public protocol IrisSessions: Sendable { func save(_ session: IrisAuthSession) throws func current() throws -> IrisAuthSession? func delete() throws diff --git a/Sources/ASCKit/Auth/Iris/IrisAuthRepository.swift b/Sources/ASCKit/Auth/Iris/IrisSignIn.swift similarity index 85% rename from Sources/ASCKit/Auth/Iris/IrisAuthRepository.swift rename to Sources/ASCKit/Auth/Iris/IrisSignIn.swift index e669d197..27ba45c6 100644 --- a/Sources/ASCKit/Auth/Iris/IrisAuthRepository.swift +++ b/Sources/ASCKit/Auth/Iris/IrisSignIn.swift @@ -3,10 +3,10 @@ import Mockable /// Drives the iris SRP login + 2FA flow against `idmsa.apple.com`. /// -/// Implementations live in Infrastructure (`IrisAuthSDKRepository`). The protocol stays +/// Implementations live in Infrastructure (`IrisSDKSignIn`). The protocol stays /// here so commands and tests don't have to know about Apple's HTTP shape. @Mockable -public protocol IrisAuthRepository: Sendable { +public protocol IrisSignIn: Sendable { /// Drives `signin/init` + `signin/complete`. /// - Returns: a fully-formed `IrisAuthSession` when no 2FA is required. /// - Throws: `IrisAuthError.twoFactorRequired(_)` carrying the state needed to resume, diff --git a/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDRepository.swift b/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDs.swift similarity index 86% rename from Sources/ASCKit/CodeSigning/BundleIDs/BundleIDRepository.swift rename to Sources/ASCKit/CodeSigning/BundleIDs/BundleIDs.swift index f5ffc37d..e009ec7f 100644 --- a/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDRepository.swift +++ b/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDs.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BundleIDRepository: Sendable { +public protocol BundleIDs: Sendable { func listBundleIDs(platform: BundleIDPlatform?, identifier: String?) async throws -> [BundleID] func createBundleID(name: String, identifier: String, platform: BundleIDPlatform) async throws -> BundleID func deleteBundleID(id: String) async throws diff --git a/Sources/ASCKit/CodeSigning/Certificates/CertificateRepository.swift b/Sources/ASCKit/CodeSigning/Certificates/Certificates.swift similarity index 85% rename from Sources/ASCKit/CodeSigning/Certificates/CertificateRepository.swift rename to Sources/ASCKit/CodeSigning/Certificates/Certificates.swift index 156126b9..5d7ebe26 100644 --- a/Sources/ASCKit/CodeSigning/Certificates/CertificateRepository.swift +++ b/Sources/ASCKit/CodeSigning/Certificates/Certificates.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol CertificateRepository: Sendable { +public protocol Certificates: Sendable { func listCertificates(certificateType: CertificateType?, limit: Int?) async throws -> [Certificate] func createCertificate(certificateType: CertificateType, csrContent: String) async throws -> Certificate func revokeCertificate(id: String) async throws diff --git a/Sources/ASCKit/CodeSigning/Devices/DeviceRepository.swift b/Sources/ASCKit/CodeSigning/Devices/Devices.swift similarity index 82% rename from Sources/ASCKit/CodeSigning/Devices/DeviceRepository.swift rename to Sources/ASCKit/CodeSigning/Devices/Devices.swift index 98825abe..981f75de 100644 --- a/Sources/ASCKit/CodeSigning/Devices/DeviceRepository.swift +++ b/Sources/ASCKit/CodeSigning/Devices/Devices.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol DeviceRepository: Sendable { +public protocol Devices: Sendable { func listDevices(platform: BundleIDPlatform?) async throws -> [Device] func registerDevice(name: String, udid: String, platform: BundleIDPlatform) async throws -> Device } diff --git a/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift b/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDs.swift similarity index 96% rename from Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKBundleIDs.swift index 2f666abc..0a791e81 100644 --- a/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDs.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBundleIDRepository: BundleIDRepository, @unchecked Sendable { +public struct SDKBundleIDs: BundleIDs, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift b/Sources/ASCKit/CodeSigning/Internal/SDKCertificates.swift similarity index 96% rename from Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKCertificates.swift index 81c685f0..bf47abe9 100644 --- a/Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKCertificates.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKCertificateRepository: CertificateRepository, @unchecked Sendable { +public struct SDKCertificates: Certificates, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift b/Sources/ASCKit/CodeSigning/Internal/SDKDevices.swift similarity index 96% rename from Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKDevices.swift index 5af1044a..d6d1d149 100644 --- a/Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKDevices.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKDeviceRepository: DeviceRepository, @unchecked Sendable { +public struct SDKDevices: Devices, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift b/Sources/ASCKit/CodeSigning/Internal/SDKProfiles.swift similarity index 98% rename from Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKProfiles.swift index c9783b83..79b9d2a5 100644 --- a/Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKProfiles.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKProfileRepository: ProfileRepository, @unchecked Sendable { +public struct SDKProfiles: Profiles, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/CodeSigning/Profiles/ProfileRepository.swift b/Sources/ASCKit/CodeSigning/Profiles/Profiles.swift similarity index 89% rename from Sources/ASCKit/CodeSigning/Profiles/ProfileRepository.swift rename to Sources/ASCKit/CodeSigning/Profiles/Profiles.swift index 3597acf3..eb63da4d 100644 --- a/Sources/ASCKit/CodeSigning/Profiles/ProfileRepository.swift +++ b/Sources/ASCKit/CodeSigning/Profiles/Profiles.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol ProfileRepository: Sendable { +public protocol Profiles: Sendable { func listProfiles(bundleIdId: String?, profileType: ProfileType?) async throws -> [Profile] func createProfile( name: String, diff --git a/Sources/ASCKit/GameCenter/GameCenterRepository.swift b/Sources/ASCKit/GameCenter/GameCenter.swift similarity index 94% rename from Sources/ASCKit/GameCenter/GameCenterRepository.swift rename to Sources/ASCKit/GameCenter/GameCenter.swift index bbbf98db..ff934395 100644 --- a/Sources/ASCKit/GameCenter/GameCenterRepository.swift +++ b/Sources/ASCKit/GameCenter/GameCenter.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol GameCenterRepository: Sendable { +public protocol GameCenter: Sendable { func getDetail(appId: String) async throws -> GameCenterDetail func listAchievements(gameCenterDetailId: String) async throws -> [GameCenterAchievement] diff --git a/Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift b/Sources/ASCKit/GameCenter/Internal/SDKGameCenter.swift similarity index 98% rename from Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift rename to Sources/ASCKit/GameCenter/Internal/SDKGameCenter.swift index de9fa1bb..a16b560e 100644 --- a/Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift +++ b/Sources/ASCKit/GameCenter/Internal/SDKGameCenter.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable { +public struct SDKGameCenter: GameCenter, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/GameCenter/Moderation/GameCenterModerationRepository.swift b/Sources/ASCKit/GameCenter/Moderation/GameCenterModeration.swift similarity index 90% rename from Sources/ASCKit/GameCenter/Moderation/GameCenterModerationRepository.swift rename to Sources/ASCKit/GameCenter/Moderation/GameCenterModeration.swift index 4274cf4c..1e085165 100644 --- a/Sources/ASCKit/GameCenter/Moderation/GameCenterModerationRepository.swift +++ b/Sources/ASCKit/GameCenter/Moderation/GameCenterModeration.swift @@ -3,7 +3,7 @@ import Mockable /// Moderates what players submit to Game Center: individual leaderboard scores /// and the players themselves. @Mockable -public protocol GameCenterModerationRepository: Sendable { +public protocol GameCenterModeration: Sendable { func listScoreModerations(leaderboardId: String, blockedOnly: Bool) async throws -> [GameCenterScoreModeration] func updateScoreModeration(id: String, isBlocked: Bool) async throws -> GameCenterScoreModeration func listBlockedPlayers(gameCenterDetailId: String) async throws -> [GameCenterPlayer] diff --git a/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift b/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModeration.swift similarity index 97% rename from Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift rename to Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModeration.swift index 5621d4a0..b9ddcbd7 100644 --- a/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift +++ b/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModeration.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, @unchecked Sendable { +public struct SDKGameCenterModeration: GameCenterModeration, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift b/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundles.swift similarity index 94% rename from Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift rename to Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundles.swift index 08767896..bf85b365 100644 --- a/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift +++ b/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundles.swift @@ -1,7 +1,7 @@ import Foundation -/// Implements `IrisAppBundleRepository` via the iris private API. -public struct IrisSDKAppBundleRepository: IrisAppBundleRepository, @unchecked Sendable { +/// Implements `IrisAppBundles` via the iris private API. +public struct IrisSDKAppBundles: IrisAppBundles, @unchecked Sendable { private let client: any IrisAPI public init(client: any IrisAPI = IrisClient()) { diff --git a/Sources/ASCKit/Iris/AppBundles/IrisAppBundleRepository.swift b/Sources/ASCKit/Iris/AppBundles/IrisAppBundles.swift similarity index 88% rename from Sources/ASCKit/Iris/AppBundles/IrisAppBundleRepository.swift rename to Sources/ASCKit/Iris/AppBundles/IrisAppBundles.swift index 5100b282..272982dc 100644 --- a/Sources/ASCKit/Iris/AppBundles/IrisAppBundleRepository.swift +++ b/Sources/ASCKit/Iris/AppBundles/IrisAppBundles.swift @@ -2,7 +2,7 @@ import Mockable /// Repository for iris app bundle operations (private API). @Mockable -public protocol IrisAppBundleRepository: Sendable { +public protocol IrisAppBundles: Sendable { func listAppBundles(session: IrisSession) async throws -> [AppBundle] func createApp( session: IrisSession, diff --git a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStates.swift similarity index 91% rename from Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift rename to Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStates.swift index efed0da0..23788814 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStates.swift @@ -1,10 +1,10 @@ import Foundation -/// Implements `IrisInAppPurchaseStateRepository` against +/// Implements `IrisInAppPurchaseStates` against /// `GET /iris/v1/apps/:appId/inAppPurchasesV2`. Apple's iris listing exposes /// `submitWithNextAppStoreVersion` as an attribute on each IAP — the public SDK /// does not, which is why this lives behind the iris cookie surface. -public struct IrisSDKInAppPurchaseStateRepository: IrisInAppPurchaseStateRepository, @unchecked Sendable { +public struct IrisSDKInAppPurchaseStates: IrisInAppPurchaseStates, @unchecked Sendable { private let client: any IrisAPI public init(client: any IrisAPI = IrisClient()) { diff --git a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissions.swift similarity index 92% rename from Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift rename to Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissions.swift index d857e9ea..903df151 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissions.swift @@ -1,12 +1,12 @@ import Foundation -/// Implements `IrisInAppPurchaseSubmissionRepository` via the iris private API. +/// Implements `IrisInAppPurchaseSubmissions` via the iris private API. /// -/// The user-visible difference from `SDKInAppPurchaseSubmissionRepository` (public SDK) +/// The user-visible difference from `SDKInAppPurchaseSubmissions` (public SDK) /// is `attributes.submitWithNextAppStoreVersion` — the only place it is accepted is /// `POST /iris/v1/inAppPurchaseSubmissions`. The public ASC SDK's /// `InAppPurchaseSubmissionCreateRequest` lacks an `attributes` field entirely. -public struct IrisSDKInAppPurchaseSubmissionRepository: IrisInAppPurchaseSubmissionRepository, @unchecked Sendable { +public struct IrisSDKInAppPurchaseSubmissions: IrisInAppPurchaseSubmissions, @unchecked Sendable { private let client: any IrisAPI public init(client: any IrisAPI = IrisClient()) { diff --git a/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStates.swift similarity index 85% rename from Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift rename to Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStates.swift index 9794795a..100f45f1 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStates.swift @@ -5,12 +5,12 @@ import Mockable /// version. The public ASC SDK has no path that exposes this field, so the iris /// listing endpoint is the source of truth. /// -/// Used by `SDKInAppPurchaseRepository.listInAppPurchases` as a best-effort enrichment: +/// Used by `SDKInAppPurchases.listInAppPurchases` as a best-effort enrichment: /// when iris cookies are available the resulting `InAppPurchase.submitWithNextAppStoreVersion` /// drives the `removeFromNextVersion` affordance; without iris cookies the field /// stays `false` and CI scripts using API-key auth keep their existing JSON output. @Mockable -public protocol IrisInAppPurchaseStateRepository: Sendable { +public protocol IrisInAppPurchaseStates: Sendable { /// Returns a map of `iapId → submitWithNextAppStoreVersion`. Filtered server-side /// to IAPs in `READY_TO_SUBMIT` (the only state where the queue flag is actionable). func fetchSubmitFlags(session: IrisSession, appId: String) async throws -> [String: Bool] diff --git a/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissions.swift similarity index 84% rename from Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift rename to Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissions.swift index 8e10ca2f..6c6388b0 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissions.swift @@ -2,11 +2,11 @@ import Mockable /// Repository for the iris-only IAP submission endpoint. /// -/// Distinct from `InAppPurchaseSubmissionRepository` (public SDK, key-auth) so the two +/// Distinct from `InAppPurchaseSubmissions` (public SDK, key-auth) so the two /// auth surfaces don't tangle: `asc iap submit` keeps zero-iris dependency, while this /// path is reachable only when iris cookies are available. @Mockable -public protocol IrisInAppPurchaseSubmissionRepository: Sendable { +public protocol IrisInAppPurchaseSubmissions: Sendable { func submitInAppPurchase( session: IrisSession, iapId: String, diff --git a/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift b/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessions.swift similarity index 91% rename from Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift rename to Sources/ASCKit/Iris/Internal/Auth/FileIrisSessions.swift index 1ba190c0..c9679b6f 100644 --- a/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessions.swift @@ -3,7 +3,7 @@ import Foundation /// Persists `IrisAuthSession` to `~/.asc/iris/session.json` with `0600` permissions. /// Cross-platform fallback for Linux and a default on macOS until `KeychainIrisSessionRepository` /// lands; the composite repository tries keychain first and falls back here. -public struct FileIrisSessionRepository: IrisSessionRepository, @unchecked Sendable { +public struct FileIrisSessions: IrisSessions, @unchecked Sendable { private let fileURL: URL public static let defaultSessionURL: URL = { @@ -14,7 +14,7 @@ public struct FileIrisSessionRepository: IrisSessionRepository, @unchecked Senda .appendingPathComponent("session.json") }() - public init(fileURL: URL = FileIrisSessionRepository.defaultSessionURL) { + public init(fileURL: URL = FileIrisSessions.defaultSessionURL) { self.fileURL = fileURL } diff --git a/Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift b/Sources/ASCKit/Iris/Internal/Auth/IrisSDKSignIn.swift similarity index 97% rename from Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift rename to Sources/ASCKit/Iris/Internal/Auth/IrisSDKSignIn.swift index c5be0f01..31fd96a4 100644 --- a/Sources/ASCKit/Iris/Internal/Auth/IrisAuthSDKRepository.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/IrisSDKSignIn.swift @@ -1,10 +1,10 @@ import Foundation /// Drives the full Apple ID SRP login + olympus session lookup, conforming to -/// `ASCKit.IrisAuthRepository`. Composition root for all the Apple-specific bits: +/// `ASCKit.IrisSignIn`. Composition root for all the Apple-specific bits: /// `AppleSRPClient` for crypto, `IdmsaAPIClient` for `idmsa.apple.com`, `OlympusClient` /// for ASC team metadata. -public struct IrisAuthSDKRepository: IrisAuthRepository, @unchecked Sendable { +public struct IrisSDKSignIn: IrisSignIn, @unchecked Sendable { private let idmsa: any AppleIDSignIn private let olympus: any AppStoreConnectAccounts private let now: @Sendable () -> Date diff --git a/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift b/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift index 897a5957..d644de49 100644 --- a/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift @@ -8,9 +8,9 @@ import Foundation /// is present or the session has expired. Composition with browser/env cookies is the /// composite's job, not this provider's. public struct StoredSRPIrisCookieProvider: IrisCookieProvider { - private let sessionRepository: any IrisSessionRepository + private let sessionRepository: any IrisSessions - public init(sessionRepository: any IrisSessionRepository = FileIrisSessionRepository()) { + public init(sessionRepository: any IrisSessions = FileIrisSessions()) { self.sessionRepository = sessionRepository } diff --git a/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift b/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenter.swift similarity index 97% rename from Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift rename to Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenter.swift index b146f36d..631435ec 100644 --- a/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift +++ b/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenter.swift @@ -1,6 +1,6 @@ import Foundation -/// Implements `IrisResolutionCenterRepository` via the iris private API. +/// Implements `IrisResolutionCenter` via the iris private API. /// /// The Resolution Center (App Review's rejection message text and guideline /// citations) has no official App Store Connect API surface — Apple's OpenAPI @@ -8,7 +8,7 @@ import Foundation /// UI reads it from these three iris endpoints, composed here into one /// user-visible operation. The endpoint shapes are undocumented; this mapper /// is the absorption layer if Apple shifts a field. -public struct IrisSDKResolutionCenterRepository: IrisResolutionCenterRepository, @unchecked Sendable { +public struct IrisSDKResolutionCenter: IrisResolutionCenter, @unchecked Sendable { private let client: any IrisAPI public init(client: any IrisAPI = IrisClient()) { diff --git a/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift b/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenter.swift similarity index 86% rename from Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift rename to Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenter.swift index 88a851d1..3f00c5c9 100644 --- a/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift +++ b/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenter.swift @@ -3,12 +3,12 @@ import Mockable /// Repository for reading Resolution Center data via the iris private API. /// -/// Separate from `SubmissionRepository` (public SDK, key-auth) so the two auth +/// Separate from `ReviewSubmissions` (public SDK, key-auth) so the two auth /// surfaces don't tangle: `asc review-submissions *` keeps zero-iris /// dependency, while this path is reachable only when iris cookies are /// available. @Mockable -public protocol IrisResolutionCenterRepository: Sendable { +public protocol IrisResolutionCenter: Sendable { /// One user-visible operation — "read the Resolution Center for this /// submission". The adapter composes the thread → messages → rejections /// iris calls behind it. diff --git a/Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift b/Sources/ASCKit/Plugins/Internal/MarketplacePlugins.swift similarity index 99% rename from Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift rename to Sources/ASCKit/Plugins/Internal/MarketplacePlugins.swift index 14343a75..3c793a1f 100644 --- a/Sources/ASCKit/Plugins/Internal/PluginMarketRepository.swift +++ b/Sources/ASCKit/Plugins/Internal/MarketplacePlugins.swift @@ -1,7 +1,7 @@ import Foundation /// Manages installed plugins and the marketplace listings from composable sources. -public struct PluginMarketRepository: PluginRepository { +public struct MarketplacePlugins: Plugins { private let sources: [any PluginSource] private let folder: any PluginsFolder private let downloads: any PluginDownloads diff --git a/Sources/ASCKit/Plugins/Internal/System/LocalPluginsFolder.swift b/Sources/ASCKit/Plugins/Internal/System/LocalPluginsFolder.swift index 98949cb8..a42c6928 100644 --- a/Sources/ASCKit/Plugins/Internal/System/LocalPluginsFolder.swift +++ b/Sources/ASCKit/Plugins/Internal/System/LocalPluginsFolder.swift @@ -2,7 +2,7 @@ import ASCPlugin import Foundation /// `~/.asc/plugins` on this Mac. Only the file system, `PluginLoader` and `unzip` -/// calls live here; which plugin matches is `PluginMarketRepository`'s. +/// calls live here; which plugin matches is `MarketplacePlugins`'s. struct LocalPluginsFolder: PluginsFolder { func installed() -> [InstalledPlugin] { PluginLoader.discover().map { plugin in diff --git a/Sources/ASCKit/Plugins/PluginUpdate.swift b/Sources/ASCKit/Plugins/PluginUpdate.swift index ee8fc7bc..76549c8f 100644 --- a/Sources/ASCKit/Plugins/PluginUpdate.swift +++ b/Sources/ASCKit/Plugins/PluginUpdate.swift @@ -1,6 +1,6 @@ /// An available update for an installed plugin. /// -/// Returned by `PluginRepository.listOutdated()`. Represents the diff between +/// Returned by `Plugins.listOutdated()`. Represents the diff between /// what's installed locally and what the marketplace offers. public struct PluginUpdate: Sendable, Equatable, Identifiable, Codable { public var id: String { name } diff --git a/Sources/ASCKit/Plugins/PluginRepository.swift b/Sources/ASCKit/Plugins/Plugins.swift similarity index 93% rename from Sources/ASCKit/Plugins/PluginRepository.swift rename to Sources/ASCKit/Plugins/Plugins.swift index 51d4bc74..2a7d4578 100644 --- a/Sources/ASCKit/Plugins/PluginRepository.swift +++ b/Sources/ASCKit/Plugins/Plugins.swift @@ -2,7 +2,7 @@ import Mockable /// Manages installed dylib plugins and the plugin marketplace. @Mockable -public protocol PluginRepository: Sendable { +public protocol Plugins: Sendable { func listInstalled() async throws -> [Plugin] func listAvailable() async throws -> [Plugin] func searchAvailable(query: String) async throws -> [Plugin] diff --git a/Sources/ASCKit/Reports/Analytics/AnalyticsReportRepository.swift b/Sources/ASCKit/Reports/Analytics/AnalyticsReports.swift similarity index 91% rename from Sources/ASCKit/Reports/Analytics/AnalyticsReportRepository.swift rename to Sources/ASCKit/Reports/Analytics/AnalyticsReports.swift index b81c3f13..e15da455 100644 --- a/Sources/ASCKit/Reports/Analytics/AnalyticsReportRepository.swift +++ b/Sources/ASCKit/Reports/Analytics/AnalyticsReports.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AnalyticsReportRepository: Sendable { +public protocol AnalyticsReports: Sendable { func createRequest(appId: String, accessType: AnalyticsAccessType) async throws -> AnalyticsReportRequest func listRequests(appId: String, accessType: AnalyticsAccessType?) async throws -> [AnalyticsReportRequest] func deleteRequest(id: String) async throws diff --git a/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift b/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReports.swift similarity index 98% rename from Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift rename to Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReports.swift index 38e11fb7..ee10fec3 100644 --- a/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift +++ b/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReports.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecked Sendable { +public struct SDKAnalyticsReports: AnalyticsReports, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Reports/Internal/SDKReportRepository.swift b/Sources/ASCKit/Reports/Internal/SDKReports.swift similarity index 98% rename from Sources/ASCKit/Reports/Internal/SDKReportRepository.swift rename to Sources/ASCKit/Reports/Internal/SDKReports.swift index 28cb1fa7..bc24c463 100644 --- a/Sources/ASCKit/Reports/Internal/SDKReportRepository.swift +++ b/Sources/ASCKit/Reports/Internal/SDKReports.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKReportRepository: ReportRepository, @unchecked Sendable { +public struct SDKReports: Reports, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Reports/ReportRepository.swift b/Sources/ASCKit/Reports/Reports.swift similarity index 91% rename from Sources/ASCKit/Reports/ReportRepository.swift rename to Sources/ASCKit/Reports/Reports.swift index 2b47dce4..053a8ab2 100644 --- a/Sources/ASCKit/Reports/ReportRepository.swift +++ b/Sources/ASCKit/Reports/Reports.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol ReportRepository: Sendable { +public protocol Reports: Sendable { func downloadSalesReport( vendorNumber: String, reportType: SalesReportType, diff --git a/Sources/ASCKit/Screenshots/Gallery/GalleryTemplateRepository.swift b/Sources/ASCKit/Screenshots/Gallery/GalleryTemplates.swift similarity index 89% rename from Sources/ASCKit/Screenshots/Gallery/GalleryTemplateRepository.swift rename to Sources/ASCKit/Screenshots/Gallery/GalleryTemplates.swift index ac0d84b5..67d57d1a 100644 --- a/Sources/ASCKit/Screenshots/Gallery/GalleryTemplateRepository.swift +++ b/Sources/ASCKit/Screenshots/Gallery/GalleryTemplates.swift @@ -10,7 +10,7 @@ public protocol GalleryTemplateProvider: Sendable { /// Repository for querying gallery templates. @Mockable -public protocol GalleryTemplateRepository: Sendable { +public protocol GalleryTemplates: Sendable { func listGalleries() async throws -> [Gallery] func getGallery(templateId: String) async throws -> Gallery? } diff --git a/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift b/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplates.swift similarity index 82% rename from Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift rename to Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplates.swift index 990b93f3..cd01e68e 100644 --- a/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift +++ b/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplates.swift @@ -1,8 +1,8 @@ import Foundation /// Aggregates gallery templates from all registered providers. -public final actor AggregateGalleryTemplateRepository: GalleryTemplateRepository { - public static let shared = AggregateGalleryTemplateRepository() +public final actor AggregateGalleryTemplates: GalleryTemplates { + public static let shared = AggregateGalleryTemplates() private var providers: [any GalleryTemplateProvider] = [] diff --git a/Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift b/Sources/ASCKit/Screenshots/Internal/AggregateTemplates.swift similarity index 83% rename from Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift rename to Sources/ASCKit/Screenshots/Internal/AggregateTemplates.swift index 5f91762d..3aa85f27 100644 --- a/Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift +++ b/Sources/ASCKit/Screenshots/Internal/AggregateTemplates.swift @@ -5,10 +5,10 @@ import Foundation /// The platform ships with no built-in templates. Plugins register /// providers to supply their own templates. /// -/// Use `AggregateTemplateRepository.shared` as the global registry. -public final actor AggregateTemplateRepository: TemplateRepository { +/// Use `AggregateTemplates.shared` as the global registry. +public final actor AggregateTemplates: Templates { /// Global shared instance — plugins register providers here. - public static let shared = AggregateTemplateRepository() + public static let shared = AggregateTemplates() private var providers: [any TemplateProvider] = [] diff --git a/Sources/ASCKit/Screenshots/Internal/AggregateThemeRepository.swift b/Sources/ASCKit/Screenshots/Internal/AggregateThemes.swift similarity index 92% rename from Sources/ASCKit/Screenshots/Internal/AggregateThemeRepository.swift rename to Sources/ASCKit/Screenshots/Internal/AggregateThemes.swift index 78782a5d..480a46e8 100644 --- a/Sources/ASCKit/Screenshots/Internal/AggregateThemeRepository.swift +++ b/Sources/ASCKit/Screenshots/Internal/AggregateThemes.swift @@ -5,10 +5,10 @@ import Foundation /// The platform ships with no built-in themes. Plugins register /// providers to supply their own themes with their own AI solutions. /// -/// Use `AggregateThemeRepository.shared` as the global registry. -public final actor AggregateThemeRepository: ThemeRepository { +/// Use `AggregateThemes.shared` as the global registry. +public final actor AggregateThemes: Themes { /// Global shared instance — plugins register providers here. - public static let shared = AggregateThemeRepository() + public static let shared = AggregateThemes() private var providers: [any ThemeProvider] = [] diff --git a/Sources/ASCKit/Screenshots/ScreenTheme.swift b/Sources/ASCKit/Screenshots/ScreenTheme.swift index 16388fca..7e1c693a 100644 --- a/Sources/ASCKit/Screenshots/ScreenTheme.swift +++ b/Sources/ASCKit/Screenshots/ScreenTheme.swift @@ -166,7 +166,7 @@ public struct ThemeAIHints: Sendable, Equatable, Codable { } } -// MARK: - ThemeProvider & ThemeRepository +// MARK: - ThemeProvider & Themes /// A provider that supplies visual themes. /// @@ -215,7 +215,7 @@ public enum ThemeDesignError: Error, CustomStringConvertible { /// Repository for querying visual themes across all providers. @Mockable -public protocol ThemeRepository: Sendable { +public protocol Themes: Sendable { /// List all themes from all providers. func listThemes() async throws -> [ScreenTheme] diff --git a/Sources/ASCKit/Screenshots/TemplateRepository.swift b/Sources/ASCKit/Screenshots/Templates.swift similarity index 95% rename from Sources/ASCKit/Screenshots/TemplateRepository.swift rename to Sources/ASCKit/Screenshots/Templates.swift index 13ce3930..dd93b770 100644 --- a/Sources/ASCKit/Screenshots/TemplateRepository.swift +++ b/Sources/ASCKit/Screenshots/Templates.swift @@ -19,7 +19,7 @@ public protocol TemplateProvider: Sendable { /// The platform ships with no built-in templates. Plugins register /// `TemplateProvider` implementations to supply templates. @Mockable -public protocol TemplateRepository: Sendable { +public protocol Templates: Sendable { /// List all templates from all providers, optionally filtered by screen size. func listTemplates(size: ScreenSize?) async throws -> [AppShotTemplate] diff --git a/Sources/ASCKit/Shared/Internal/ClientFactory.swift b/Sources/ASCKit/Shared/Internal/ClientFactory.swift index ab1359fe..f2566752 100644 --- a/Sources/ASCKit/Shared/Internal/ClientFactory.swift +++ b/Sources/ASCKit/Shared/Internal/ClientFactory.swift @@ -5,338 +5,338 @@ public struct ClientFactory: Sendable { public init() {} - public func makeAppRepository(authProvider: any AuthProvider) throws -> any AppRepository { + public func makeApps(authProvider: any AuthProvider) throws -> any Apps { let provider = try makeProvider(authProvider: authProvider) - return SDKAppRepository(client: provider) + return SDKApps(client: provider) } - public func makeVersionRepository(authProvider: any AuthProvider) throws -> any VersionRepository { + public func makeAppStoreVersions(authProvider: any AuthProvider) throws -> any AppStoreVersions { let provider = try makeProvider(authProvider: authProvider) - return SDKVersionRepository(client: provider) + return SDKAppStoreVersions(client: provider) } - public func makeBuildRepository(authProvider: any AuthProvider) throws -> any BuildRepository { + public func makeBuilds(authProvider: any AuthProvider) throws -> any Builds { let provider = try makeProvider(authProvider: authProvider) - return SDKBuildRepository(client: provider) + return SDKBuilds(client: provider) } - public func makeTestFlightRepository(authProvider: any AuthProvider) throws -> any TestFlightRepository { + public func makeTestFlight(authProvider: any AuthProvider) throws -> any TestFlight { let provider = try makeProvider(authProvider: authProvider) - return SDKTestFlightRepository(client: provider) + return SDKTestFlight(client: provider) } - public func makeVersionLocalizationRepository(authProvider: any AuthProvider) throws -> any VersionLocalizationRepository { + public func makeVersionLocalizations(authProvider: any AuthProvider) throws -> any VersionLocalizations { let provider = try makeProvider(authProvider: authProvider) - return SDKLocalizationRepository(client: provider) + return SDKVersionLocalizations(client: provider) } - public func makeScreenshotRepository(authProvider: any AuthProvider) throws -> any ScreenshotRepository { + public func makeAppScreenshots(authProvider: any AuthProvider) throws -> any AppScreenshots { let provider = try makeProvider(authProvider: authProvider) - return SDKScreenshotRepository(client: provider) + return SDKAppScreenshots(client: provider) } - public func makeAppInfoRepository(authProvider: any AuthProvider) throws -> any AppInfoRepository { + public func makeAppInfos(authProvider: any AuthProvider) throws -> any AppInfos { let provider = try makeProvider(authProvider: authProvider) - return SDKAppInfoRepository(client: provider) + return SDKAppInfos(client: provider) } - public func makeAppCategoryRepository(authProvider: any AuthProvider) throws -> any AppCategoryRepository { + public func makeAppCategories(authProvider: any AuthProvider) throws -> any AppCategories { let provider = try makeProvider(authProvider: authProvider) - return SDKAppCategoryRepository(client: provider) + return SDKAppCategories(client: provider) } - public func makeSubmissionRepository(authProvider: any AuthProvider) throws -> any SubmissionRepository { + public func makeReviewSubmissions(authProvider: any AuthProvider) throws -> any ReviewSubmissions { let provider = try makeProvider(authProvider: authProvider) - return OpenAPISubmissionRepository(client: provider) + return OpenAPIReviewSubmissions(client: provider) } - public func makeBundleIDRepository(authProvider: any AuthProvider) throws -> any BundleIDRepository { + public func makeBundleIDs(authProvider: any AuthProvider) throws -> any BundleIDs { let provider = try makeProvider(authProvider: authProvider) - return SDKBundleIDRepository(client: provider) + return SDKBundleIDs(client: provider) } - public func makeCertificateRepository(authProvider: any AuthProvider) throws -> any CertificateRepository { + public func makeCertificates(authProvider: any AuthProvider) throws -> any Certificates { let provider = try makeProvider(authProvider: authProvider) - return SDKCertificateRepository(client: provider) + return SDKCertificates(client: provider) } - public func makeDeviceRepository(authProvider: any AuthProvider) throws -> any DeviceRepository { + public func makeDevices(authProvider: any AuthProvider) throws -> any Devices { let provider = try makeProvider(authProvider: authProvider) - return SDKDeviceRepository(client: provider) + return SDKDevices(client: provider) } - public func makeProfileRepository(authProvider: any AuthProvider) throws -> any ProfileRepository { + public func makeProfiles(authProvider: any AuthProvider) throws -> any Profiles { let provider = try makeProvider(authProvider: authProvider) - return SDKProfileRepository(client: provider) + return SDKProfiles(client: provider) } - public func makeBuildUploadRepository(authProvider: any AuthProvider) throws -> any BuildUploadRepository { + public func makeBuildUploads(authProvider: any AuthProvider) throws -> any BuildUploads { let provider = try makeProvider(authProvider: authProvider) - return SDKBuildUploadRepository(client: provider) + return SDKBuildUploads(client: provider) } - public func makeBetaBuildLocalizationRepository(authProvider: any AuthProvider) throws -> any BetaBuildLocalizationRepository { + public func makeBetaBuildLocalizations(authProvider: any AuthProvider) throws -> any BetaBuildLocalizations { let provider = try makeProvider(authProvider: authProvider) - return SDKBetaBuildLocalizationRepository(client: provider) + return SDKBetaBuildLocalizations(client: provider) } - public func makeReviewDetailRepository(authProvider: any AuthProvider) throws -> any ReviewDetailRepository { + public func makeReviewDetails(authProvider: any AuthProvider) throws -> any ReviewDetails { let provider = try makeProvider(authProvider: authProvider) - return SDKReviewDetailRepository(client: provider) + return SDKReviewDetails(client: provider) } - public func makePricingRepository(authProvider: any AuthProvider) throws -> any PricingRepository { + public func makeAppPrices(authProvider: any AuthProvider) throws -> any AppPrices { let provider = try makeProvider(authProvider: authProvider) - return SDKPricingRepository(client: provider) + return SDKAppPrices(client: provider) } - public func makePreviewRepository(authProvider: any AuthProvider) throws -> any PreviewRepository { + public func makeAppPreviews(authProvider: any AuthProvider) throws -> any AppPreviews { let provider = try makeProvider(authProvider: authProvider) - return OpenAPIPreviewRepository(client: provider) + return OpenAPIAppPreviews(client: provider) } - public func makeInAppPurchaseRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseRepository { + public func makeInAppPurchases(authProvider: any AuthProvider) throws -> any InAppPurchases { let provider = try makeProvider(authProvider: authProvider) // Best-effort iris enrichment for `submitWithNextAppStoreVersion`. The closure // resolves iris cookies on every list call (so freshly-logged-in sessions are // picked up); any failure — no cookies, network error, malformed response — // returns an empty map and the SDK list still succeeds with the flag = false. let cookieProvider = makeIrisCookieProvider() - let stateRepo = IrisSDKInAppPurchaseStateRepository() + let stateRepo = IrisSDKInAppPurchaseStates() let irisFlagsProvider: @Sendable (String) async -> [String: Bool] = { appId in guard let session = try? cookieProvider.resolveSession() else { return [:] } return (try? await stateRepo.fetchSubmitFlags(session: session, appId: appId)) ?? [:] } - return SDKInAppPurchaseRepository(client: provider, irisFlagsProvider: irisFlagsProvider) + return SDKInAppPurchases(client: provider, irisFlagsProvider: irisFlagsProvider) } - public func makeInAppPurchaseLocalizationRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseLocalizationRepository { + public func makeInAppPurchaseLocalizations(authProvider: any AuthProvider) throws -> any InAppPurchaseLocalizations { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseLocalizationRepository(client: provider) + return SDKInAppPurchaseLocalizations(client: provider) } - public func makeSubscriptionGroupRepository(authProvider: any AuthProvider) throws -> any SubscriptionGroupRepository { + public func makeSubscriptionGroups(authProvider: any AuthProvider) throws -> any SubscriptionGroups { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionGroupRepository(client: provider) + return SDKSubscriptionGroups(client: provider) } - public func makeSubscriptionRepository(authProvider: any AuthProvider) throws -> any SubscriptionRepository { + public func makeSubscriptions(authProvider: any AuthProvider) throws -> any Subscriptions { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionRepository(client: provider) + return SDKSubscriptions(client: provider) } - public func makeSubscriptionLocalizationRepository(authProvider: any AuthProvider) throws -> any SubscriptionLocalizationRepository { + public func makeSubscriptionLocalizations(authProvider: any AuthProvider) throws -> any SubscriptionLocalizations { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionLocalizationRepository(client: provider) + return SDKSubscriptionLocalizations(client: provider) } - public func makeSubscriptionGroupLocalizationRepository(authProvider: any AuthProvider) throws -> any SubscriptionGroupLocalizationRepository { + public func makeSubscriptionGroupLocalizations(authProvider: any AuthProvider) throws -> any SubscriptionGroupLocalizations { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionGroupLocalizationRepository(client: provider) + return SDKSubscriptionGroupLocalizations(client: provider) } - public func makeInAppPurchaseSubmissionRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseSubmissionRepository { + public func makeInAppPurchaseSubmissions(authProvider: any AuthProvider) throws -> any InAppPurchaseSubmissions { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseSubmissionRepository(client: provider) + return SDKInAppPurchaseSubmissions(client: provider) } - public func makeProductVersionRepository(authProvider: any AuthProvider) throws -> any ProductVersionRepository { + public func makeProductVersions(authProvider: any AuthProvider) throws -> any ProductVersions { let provider = try makeProvider(authProvider: authProvider) - return SDKProductVersionRepository(client: provider) + return SDKProductVersions(client: provider) } - public func makeInAppPurchasePriceRepository(authProvider: any AuthProvider) throws -> any InAppPurchasePriceRepository { + public func makeInAppPurchasePrices(authProvider: any AuthProvider) throws -> any InAppPurchasePrices { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchasePriceRepository(client: provider) + return SDKInAppPurchasePrices(client: provider) } - public func makeSubscriptionPriceRepository(authProvider: any AuthProvider) throws -> any SubscriptionPriceRepository { + public func makeSubscriptionPrices(authProvider: any AuthProvider) throws -> any SubscriptionPrices { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionPriceRepository(client: provider) + return SDKSubscriptionPrices(client: provider) } - public func makeSubscriptionSubmissionRepository(authProvider: any AuthProvider) throws -> any SubscriptionSubmissionRepository { + public func makeSubscriptionSubmissions(authProvider: any AuthProvider) throws -> any SubscriptionSubmissions { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionSubmissionRepository(client: provider) + return SDKSubscriptionSubmissions(client: provider) } - public func makeSubscriptionIntroductoryOfferRepository(authProvider: any AuthProvider) throws -> any SubscriptionIntroductoryOfferRepository { + public func makeSubscriptionIntroductoryOffers(authProvider: any AuthProvider) throws -> any SubscriptionIntroductoryOffers { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionIntroductoryOfferRepository(client: provider) + return SDKSubscriptionIntroductoryOffers(client: provider) } - public func makeSubscriptionPromotionalOfferRepository(authProvider: any AuthProvider) throws -> any SubscriptionPromotionalOfferRepository { + public func makeSubscriptionPromotionalOffers(authProvider: any AuthProvider) throws -> any SubscriptionPromotionalOffers { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionPromotionalOfferRepository(client: provider) + return SDKSubscriptionPromotionalOffers(client: provider) } - public func makeWinBackOfferRepository(authProvider: any AuthProvider) throws -> any WinBackOfferRepository { + public func makeWinBackOffers(authProvider: any AuthProvider) throws -> any WinBackOffers { let provider = try makeProvider(authProvider: authProvider) - return SDKWinBackOfferRepository(client: provider) + return SDKWinBackOffers(client: provider) } - public func makeAssetLibraryRepository(authProvider: any AuthProvider) throws -> any AssetLibraryRepository { + public func makeAssetLibraries(authProvider: any AuthProvider) throws -> any AssetLibraries { let provider = try makeProvider(authProvider: authProvider) - return SDKAssetLibraryRepository(client: provider) + return SDKAssetLibraries(client: provider) } - public func makeLibraryImageRepository(authProvider: any AuthProvider) throws -> any LibraryImageRepository { + public func makeLibraryImages(authProvider: any AuthProvider) throws -> any LibraryImages { let provider = try makeProvider(authProvider: authProvider) - return SDKLibraryImageRepository(client: provider) + return SDKLibraryImages(client: provider) } - public func makeLibraryVideoRepository(authProvider: any AuthProvider) throws -> any LibraryVideoRepository { + public func makeLibraryVideos(authProvider: any AuthProvider) throws -> any LibraryVideos { let provider = try makeProvider(authProvider: authProvider) - return SDKLibraryVideoRepository(client: provider) + return SDKLibraryVideos(client: provider) } - public func makeAssetPlacementRepository(authProvider: any AuthProvider) throws -> any AssetPlacementRepository { + public func makeAssetPlacements(authProvider: any AuthProvider) throws -> any AssetPlacements { let provider = try makeProvider(authProvider: authProvider) - return SDKAssetPlacementRepository(client: provider) + return SDKAssetPlacements(client: provider) } - public func makeExperimentRepository(authProvider: any AuthProvider) throws -> any ExperimentRepository { + public func makeExperiments(authProvider: any AuthProvider) throws -> any Experiments { let provider = try makeProvider(authProvider: authProvider) - return SDKExperimentRepository(client: provider) + return SDKExperiments(client: provider) } - public func makePromotedPurchaseRepository(authProvider: any AuthProvider) throws -> any PromotedPurchaseRepository { + public func makePromotedPurchases(authProvider: any AuthProvider) throws -> any PromotedPurchases { let provider = try makeProvider(authProvider: authProvider) - return SDKPromotedPurchaseRepository(client: provider) + return SDKPromotedPurchases(client: provider) } - public func makeInAppPurchaseReviewRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseReviewRepository { + public func makeInAppPurchaseReviewAssets(authProvider: any AuthProvider) throws -> any InAppPurchaseReviewAssets { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseReviewRepository(client: provider) + return SDKInAppPurchaseReviewAssets(client: provider) } - public func makeSubscriptionReviewRepository(authProvider: any AuthProvider) throws -> any SubscriptionReviewRepository { + public func makeSubscriptionReviewAssets(authProvider: any AuthProvider) throws -> any SubscriptionReviewAssets { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionReviewRepository(client: provider) + return SDKSubscriptionReviewAssets(client: provider) } - public func makeSubscriptionOfferCodeRepository(authProvider: any AuthProvider) throws -> any SubscriptionOfferCodeRepository { + public func makeSubscriptionOfferCodes(authProvider: any AuthProvider) throws -> any SubscriptionOfferCodes { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionOfferCodeRepository(client: provider) + return SDKSubscriptionOfferCodes(client: provider) } - public func makeInAppPurchaseOfferCodeRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseOfferCodeRepository { + public func makeInAppPurchaseOfferCodes(authProvider: any AuthProvider) throws -> any InAppPurchaseOfferCodes { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseOfferCodeRepository(client: provider) + return SDKInAppPurchaseOfferCodes(client: provider) } - public func makeAgeRatingDeclarationRepository(authProvider: any AuthProvider) throws -> any AgeRatingDeclarationRepository { + public func makeAgeRatingDeclarations(authProvider: any AuthProvider) throws -> any AgeRatingDeclarations { let provider = try makeProvider(authProvider: authProvider) - return SDKAgeRatingDeclarationRepository(client: provider) + return SDKAgeRatingDeclarations(client: provider) } - public func makeUserRepository(authProvider: any AuthProvider) throws -> any UserRepository { + public func makeUsers(authProvider: any AuthProvider) throws -> any Users { let provider = try makeProvider(authProvider: authProvider) - return SDKUserRepository(client: provider) + return SDKUsers(client: provider) } - public func makeXcodeCloudProductRepository(authProvider: any AuthProvider) throws -> any XcodeCloudProductRepository { + public func makeXcodeCloudProducts(authProvider: any AuthProvider) throws -> any XcodeCloudProducts { let provider = try makeProvider(authProvider: authProvider) - return SDKXcodeCloudProductRepository(client: provider) + return SDKXcodeCloudProducts(client: provider) } - public func makeXcodeCloudWorkflowRepository(authProvider: any AuthProvider) throws -> any XcodeCloudWorkflowRepository { + public func makeXcodeCloudWorkflows(authProvider: any AuthProvider) throws -> any XcodeCloudWorkflows { let provider = try makeProvider(authProvider: authProvider) - return SDKXcodeCloudWorkflowRepository(client: provider) + return SDKXcodeCloudWorkflows(client: provider) } - public func makeXcodeCloudBuildRunRepository(authProvider: any AuthProvider) throws -> any XcodeCloudBuildRunRepository { + public func makeXcodeCloudBuildRuns(authProvider: any AuthProvider) throws -> any XcodeCloudBuildRuns { let provider = try makeProvider(authProvider: authProvider) - return SDKXcodeCloudBuildRunRepository(client: provider) + return SDKXcodeCloudBuildRuns(client: provider) } - public func makeGameCenterRepository(authProvider: any AuthProvider) throws -> any GameCenterRepository { + public func makeGameCenter(authProvider: any AuthProvider) throws -> any GameCenter { let provider = try makeProvider(authProvider: authProvider) - return SDKGameCenterRepository(client: provider) + return SDKGameCenter(client: provider) } - public func makeGameCenterModerationRepository(authProvider: any AuthProvider) throws -> any GameCenterModerationRepository { + public func makeGameCenterModeration(authProvider: any AuthProvider) throws -> any GameCenterModeration { let provider = try makeProvider(authProvider: authProvider) - return SDKGameCenterModerationRepository(client: provider) + return SDKGameCenterModeration(client: provider) } - public func makeAppClipRepository(authProvider: any AuthProvider) throws -> any AppClipRepository { + public func makeAppClips(authProvider: any AuthProvider) throws -> any AppClips { let provider = try makeProvider(authProvider: authProvider) - return SDKAppClipRepository(client: provider) + return SDKAppClips(client: provider) } - public func makeReportRepository(authProvider: any AuthProvider) throws -> any ReportRepository { + public func makeReports(authProvider: any AuthProvider) throws -> any Reports { let provider = try makeProvider(authProvider: authProvider) - return SDKReportRepository(client: provider) + return SDKReports(client: provider) } - public func makeAnalyticsReportRepository(authProvider: any AuthProvider) throws -> any AnalyticsReportRepository { + public func makeAnalyticsReports(authProvider: any AuthProvider) throws -> any AnalyticsReports { let provider = try makeProvider(authProvider: authProvider) - return SDKAnalyticsReportRepository(client: provider) + return SDKAnalyticsReports(client: provider) } - public func makeCustomerReviewRepository(authProvider: any AuthProvider) throws -> any CustomerReviewRepository { + public func makeCustomerReviews(authProvider: any AuthProvider) throws -> any CustomerReviews { let provider = try makeProvider(authProvider: authProvider) - return SDKCustomerReviewRepository(client: provider) + return SDKCustomerReviews(client: provider) } - public func makePerfMetricsRepository(authProvider: any AuthProvider) throws -> any PerfMetricsRepository { + public func makePerfMetrics(authProvider: any AuthProvider) throws -> any PerfMetrics { let provider = try makeProvider(authProvider: authProvider) - return SDKPerfMetricsRepository(client: provider) + return SDKPerfMetrics(client: provider) } - public func makePerfOverviewRepository(authProvider: any AuthProvider) throws -> any PerfOverviewRepository { + public func makePerfOverviews(authProvider: any AuthProvider) throws -> any PerfOverviews { let provider = try makeProvider(authProvider: authProvider) - return SDKPerfOverviewRepository(client: provider) + return SDKPerfOverviews(client: provider) } - public func makeDiagnosticsRepository(authProvider: any AuthProvider) throws -> any DiagnosticsRepository { + public func makeDiagnostics(authProvider: any AuthProvider) throws -> any Diagnostics { let provider = try makeProvider(authProvider: authProvider) - return SDKDiagnosticsRepository(client: provider) + return SDKDiagnostics(client: provider) } - public func makeBetaAppReviewRepository(authProvider: any AuthProvider) throws -> any BetaAppReviewRepository { + public func makeBetaAppReviews(authProvider: any AuthProvider) throws -> any BetaAppReviews { let provider = try makeProvider(authProvider: authProvider) - return SDKBetaAppReviewRepository(client: provider) + return SDKBetaAppReviews(client: provider) } - public func makeBetaAppLocalizationRepository(authProvider: any AuthProvider) throws -> any BetaAppLocalizationRepository { + public func makeBetaAppLocalizations(authProvider: any AuthProvider) throws -> any BetaAppLocalizations { let provider = try makeProvider(authProvider: authProvider) - return SDKBetaAppLocalizationRepository(client: provider) + return SDKBetaAppLocalizations(client: provider) } - public func makeInAppPurchaseAvailabilityRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseAvailabilityRepository { + public func makeInAppPurchaseAvailabilities(authProvider: any AuthProvider) throws -> any InAppPurchaseAvailabilities { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseAvailabilityRepository(client: provider) + return SDKInAppPurchaseAvailabilities(client: provider) } - public func makeSubscriptionAvailabilityRepository(authProvider: any AuthProvider) throws -> any SubscriptionAvailabilityRepository { + public func makeSubscriptionAvailabilities(authProvider: any AuthProvider) throws -> any SubscriptionAvailabilities { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionAvailabilityRepository(client: provider) + return SDKSubscriptionAvailabilities(client: provider) } - public func makeAppAvailabilityRepository(authProvider: any AuthProvider) throws -> any AppAvailabilityRepository { + public func makeAppAvailabilities(authProvider: any AuthProvider) throws -> any AppAvailabilities { let provider = try makeProvider(authProvider: authProvider) - return SDKAppAvailabilityRepository(client: provider) + return SDKAppAvailabilities(client: provider) } - public func makeTerritoryRepository(authProvider: any AuthProvider) throws -> any TerritoryRepository { + public func makeTerritories(authProvider: any AuthProvider) throws -> any Territories { let provider = try makeProvider(authProvider: authProvider) - return SDKTerritoryRepository(client: provider) + return SDKTerritories(client: provider) } // MARK: - Simulators (no ASC auth needed — local xcrun simctl) - public func makeSimulatorRepository() -> any SimulatorRepository { - SimctlSimulatorRepository() + public func makeSimulators() -> any Simulators { + SimctlSimulators() } // SimulatorInteractionRepository moved to ASCPro (pro feature) // MARK: - Skills (no ASC auth needed — subprocess + local filesystem) - public func makeSkillRepository() -> any SkillRepository { - ProcessSkillRepository() + public func makeSkills() -> any Skills { + ProcessSkills() } public func makeSkillConfigStorage() -> any SkillConfigStorage { @@ -345,24 +345,24 @@ public struct ClientFactory: Sendable { // MARK: - Plugins (no ASC auth needed — local filesystem + GitHub registry) - public func makePluginRepository() -> any PluginRepository { - PluginMarketRepository(sources: [ + public func makePlugins() -> any Plugins { + MarketplacePlugins(sources: [ GitHubPluginSource(owner: "tddworks", repo: "asc-registry"), ]) } // MARK: - Iris (private API, cookie-based auth) - public func makeIrisAppBundleRepository() -> any IrisAppBundleRepository { - IrisSDKAppBundleRepository() + public func makeIrisAppBundles() -> any IrisAppBundles { + IrisSDKAppBundles() } - public func makeIrisInAppPurchaseSubmissionRepository() -> any IrisInAppPurchaseSubmissionRepository { - IrisSDKInAppPurchaseSubmissionRepository() + public func makeIrisInAppPurchaseSubmissions() -> any IrisInAppPurchaseSubmissions { + IrisSDKInAppPurchaseSubmissions() } - public func makeIrisResolutionCenterRepository() -> any IrisResolutionCenterRepository { - IrisSDKResolutionCenterRepository() + public func makeIrisResolutionCenter() -> any IrisResolutionCenter { + IrisSDKResolutionCenter() } public func makeIrisCookieProvider() -> any IrisCookieProvider { diff --git a/Sources/ASCKit/Simulators/Internal/SimctlSimulatorRepository.swift b/Sources/ASCKit/Simulators/Internal/SimctlSimulators.swift similarity index 97% rename from Sources/ASCKit/Simulators/Internal/SimctlSimulatorRepository.swift rename to Sources/ASCKit/Simulators/Internal/SimctlSimulators.swift index 86665e34..8381f9c2 100644 --- a/Sources/ASCKit/Simulators/Internal/SimctlSimulatorRepository.swift +++ b/Sources/ASCKit/Simulators/Internal/SimctlSimulators.swift @@ -1,6 +1,6 @@ import Foundation -public struct SimctlSimulatorRepository: SimulatorRepository, @unchecked Sendable { +public struct SimctlSimulators: Simulators, @unchecked Sendable { private let shellRunner: ShellRunner public init(shellRunner: ShellRunner = SystemShellRunner()) { diff --git a/Sources/ASCKit/Simulators/SimulatorRepository.swift b/Sources/ASCKit/Simulators/Simulators.swift similarity index 89% rename from Sources/ASCKit/Simulators/SimulatorRepository.swift rename to Sources/ASCKit/Simulators/Simulators.swift index 2c8d55ad..0b263afd 100644 --- a/Sources/ASCKit/Simulators/SimulatorRepository.swift +++ b/Sources/ASCKit/Simulators/Simulators.swift @@ -8,7 +8,7 @@ public enum SimulatorFilter: Sendable, Equatable { } @Mockable -public protocol SimulatorRepository: Sendable { +public protocol Simulators: Sendable { func listSimulators(filter: SimulatorFilter) async throws -> [Simulator] func bootSimulator(udid: String) async throws func shutdownSimulator(udid: String) async throws diff --git a/Sources/ASCKit/Skills/Internal/ProcessSkillRepository.swift b/Sources/ASCKit/Skills/Internal/ProcessSkills.swift similarity index 97% rename from Sources/ASCKit/Skills/Internal/ProcessSkillRepository.swift rename to Sources/ASCKit/Skills/Internal/ProcessSkills.swift index aa1d8240..d862eb32 100644 --- a/Sources/ASCKit/Skills/Internal/ProcessSkillRepository.swift +++ b/Sources/ASCKit/Skills/Internal/ProcessSkills.swift @@ -4,7 +4,7 @@ import Foundation /// /// Strategy A: Find `skills` binary on PATH (skip if inside current git repo). /// Strategy B: Fallback to `npx --yes skills ...`. -public struct ProcessSkillRepository: SkillRepository { +public struct ProcessSkills: Skills { private static let repoSlug = "tddworks/asc-cli-skills" private let runner: any ShellRunner diff --git a/Sources/ASCKit/Skills/SkillRepository.swift b/Sources/ASCKit/Skills/Skills.swift similarity index 92% rename from Sources/ASCKit/Skills/SkillRepository.swift rename to Sources/ASCKit/Skills/Skills.swift index a35718a7..25914a16 100644 --- a/Sources/ASCKit/Skills/SkillRepository.swift +++ b/Sources/ASCKit/Skills/Skills.swift @@ -2,7 +2,7 @@ import Mockable /// Manages skill installation, updates, and discovery via the skills CLI. @Mockable -public protocol SkillRepository: Sendable { +public protocol Skills: Sendable { /// List available skills from the repository. func listAvailable() async throws -> String diff --git a/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift b/Sources/ASCKit/Submissions/Internal/OpenAPIReviewSubmissions.swift similarity index 99% rename from Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift rename to Sources/ASCKit/Submissions/Internal/OpenAPIReviewSubmissions.swift index 0b4b6900..31dc1813 100644 --- a/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift +++ b/Sources/ASCKit/Submissions/Internal/OpenAPIReviewSubmissions.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Sendable { +public struct OpenAPIReviewSubmissions: ReviewSubmissions, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Submissions/SubmissionRepository.swift b/Sources/ASCKit/Submissions/ReviewSubmissions.swift similarity index 94% rename from Sources/ASCKit/Submissions/SubmissionRepository.swift rename to Sources/ASCKit/Submissions/ReviewSubmissions.swift index 61401aeb..db32b28b 100644 --- a/Sources/ASCKit/Submissions/SubmissionRepository.swift +++ b/Sources/ASCKit/Submissions/ReviewSubmissions.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubmissionRepository: Sendable { +public protocol ReviewSubmissions: Sendable { func submitVersion(versionId: String) async throws -> ReviewSubmission func listSubmissions(appId: String, states: [ReviewSubmissionState]?, limit: Int?) async throws -> [ReviewSubmission] func getSubmission(id: String) async throws -> ReviewSubmission diff --git a/Sources/ASCKit/Submissions/SubmissionPlan.swift b/Sources/ASCKit/Submissions/SubmissionPlan.swift index 7a6724f8..406ef58b 100644 --- a/Sources/ASCKit/Submissions/SubmissionPlan.swift +++ b/Sources/ASCKit/Submissions/SubmissionPlan.swift @@ -15,7 +15,7 @@ public struct SubmissionPlan: Sendable, Equatable { /// Opens (or reuses) the app's draft, adds the items in order and submits it. /// Stops at the first item Apple refuses, before anything is submitted — the /// items added so far stay in the draft. - public func submit(repo: some SubmissionRepository) async throws -> ReviewSubmission { + public func submit(repo: some ReviewSubmissions) async throws -> ReviewSubmission { let draft = try await repo.createSubmission(appId: appId, platform: platform) for item in items { _ = try await repo.addItem(submissionId: draft.id, target: item.target) @@ -75,16 +75,16 @@ extension PlannedReviewItem: Presentable { /// subscription that is `READY_TO_SUBMIT` and has a submittable version, plus /// the version of each subscription group one of them belongs to. public struct SubmissionPlanner: Sendable { - let iapRepo: any InAppPurchaseRepository - let groupRepo: any SubscriptionGroupRepository - let subscriptionRepo: any SubscriptionRepository - let productVersionRepo: any ProductVersionRepository + let iapRepo: any InAppPurchases + let groupRepo: any SubscriptionGroups + let subscriptionRepo: any Subscriptions + let productVersionRepo: any ProductVersions public init( - iapRepo: any InAppPurchaseRepository, - groupRepo: any SubscriptionGroupRepository, - subscriptionRepo: any SubscriptionRepository, - productVersionRepo: any ProductVersionRepository + iapRepo: any InAppPurchases, + groupRepo: any SubscriptionGroups, + subscriptionRepo: any Subscriptions, + productVersionRepo: any ProductVersions ) { self.iapRepo = iapRepo self.groupRepo = groupRepo diff --git a/Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift b/Sources/ASCKit/Territories/Internal/SDKTerritories.swift similarity index 87% rename from Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift rename to Sources/ASCKit/Territories/Internal/SDKTerritories.swift index 376fb5e9..223c4513 100644 --- a/Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift +++ b/Sources/ASCKit/Territories/Internal/SDKTerritories.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKTerritoryRepository: TerritoryRepository, @unchecked Sendable { +public struct SDKTerritories: Territories, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Territories/TerritoryRepository.swift b/Sources/ASCKit/Territories/Territories.swift similarity index 63% rename from Sources/ASCKit/Territories/TerritoryRepository.swift rename to Sources/ASCKit/Territories/Territories.swift index 31d0e0b1..329f88f0 100644 --- a/Sources/ASCKit/Territories/TerritoryRepository.swift +++ b/Sources/ASCKit/Territories/Territories.swift @@ -1,6 +1,6 @@ import Mockable @Mockable -public protocol TerritoryRepository: Sendable { +public protocol Territories: Sendable { func listTerritories() async throws -> [Territory] } diff --git a/Sources/ASCKit/Users/Internal/SDKUserRepository.swift b/Sources/ASCKit/Users/Internal/SDKUsers.swift similarity index 98% rename from Sources/ASCKit/Users/Internal/SDKUserRepository.swift rename to Sources/ASCKit/Users/Internal/SDKUsers.swift index 62a7def4..43d08a6f 100644 --- a/Sources/ASCKit/Users/Internal/SDKUserRepository.swift +++ b/Sources/ASCKit/Users/Internal/SDKUsers.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKUserRepository: UserRepository, @unchecked Sendable { +public struct SDKUsers: Users, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Users/UserRepository.swift b/Sources/ASCKit/Users/Users.swift similarity index 92% rename from Sources/ASCKit/Users/UserRepository.swift rename to Sources/ASCKit/Users/Users.swift index 2529dd46..3dc975f1 100644 --- a/Sources/ASCKit/Users/UserRepository.swift +++ b/Sources/ASCKit/Users/Users.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol UserRepository: Sendable { +public protocol Users: Sendable { func listUsers(role: UserRole?) async throws -> [TeamMember] func updateUser(id: String, roles: [UserRole]) async throws -> TeamMember func removeUser(id: String) async throws diff --git a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRuns.swift similarity index 96% rename from Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRuns.swift index 7033ec92..6cd3c05b 100644 --- a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRuns.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKXcodeCloudBuildRunRepository: XcodeCloudBuildRunRepository, @unchecked Sendable { +public struct SDKXcodeCloudBuildRuns: XcodeCloudBuildRuns, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProducts.swift similarity index 91% rename from Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProducts.swift index 58448e90..d7600c09 100644 --- a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProducts.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKXcodeCloudProductRepository: XcodeCloudProductRepository, @unchecked Sendable { +public struct SDKXcodeCloudProducts: XcodeCloudProducts, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflows.swift similarity index 90% rename from Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflows.swift index 93fa21dd..17bff5a4 100644 --- a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflows.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKXcodeCloudWorkflowRepository: XcodeCloudWorkflowRepository, @unchecked Sendable { +public struct SDKXcodeCloudWorkflows: XcodeCloudWorkflows, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRunRepository.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRuns.swift similarity index 82% rename from Sources/ASCKit/XcodeCloud/XcodeCloudBuildRunRepository.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudBuildRuns.swift index df3cbd1a..2030b01c 100644 --- a/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRunRepository.swift +++ b/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRuns.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol XcodeCloudBuildRunRepository: Sendable { +public protocol XcodeCloudBuildRuns: Sendable { func listBuildRuns(workflowId: String) async throws -> [XcodeCloudBuildRun] func getBuildRun(id: String) async throws -> XcodeCloudBuildRun func startBuildRun(workflowId: String, clean: Bool) async throws -> XcodeCloudBuildRun diff --git a/Sources/ASCKit/XcodeCloud/XcodeCloudProductRepository.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudProducts.swift similarity index 64% rename from Sources/ASCKit/XcodeCloud/XcodeCloudProductRepository.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudProducts.swift index 02c06e07..ec7095da 100644 --- a/Sources/ASCKit/XcodeCloud/XcodeCloudProductRepository.swift +++ b/Sources/ASCKit/XcodeCloud/XcodeCloudProducts.swift @@ -1,6 +1,6 @@ import Mockable @Mockable -public protocol XcodeCloudProductRepository: Sendable { +public protocol XcodeCloudProducts: Sendable { func listProducts(appId: String?) async throws -> [XcodeCloudProduct] } diff --git a/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflowRepository.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflows.swift similarity index 65% rename from Sources/ASCKit/XcodeCloud/XcodeCloudWorkflowRepository.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudWorkflows.swift index fe58ce6c..9c9719a8 100644 --- a/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflowRepository.swift +++ b/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflows.swift @@ -1,6 +1,6 @@ import Mockable @Mockable -public protocol XcodeCloudWorkflowRepository: Sendable { +public protocol XcodeCloudWorkflows: Sendable { func listWorkflows(productId: String) async throws -> [XcodeCloudWorkflow] } diff --git a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift index 5a0066d1..1cb8c774 100644 --- a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift +++ b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift @@ -7,7 +7,7 @@ import Testing struct AgeRatingGetTests { @Test func `age-rating get returns declaration with id and affordances`() async throws { - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() given(mockRepo).getDeclaration(appInfoId: .any) .willReturn(AgeRatingDeclaration(id: "decl-1", appInfoId: "info-42")) @@ -31,7 +31,7 @@ struct AgeRatingGetTests { } @Test func `age-rating get includes non-nil content fields in output`() async throws { - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() given(mockRepo).getDeclaration(appInfoId: .any) .willReturn(AgeRatingDeclaration( id: "decl-2", diff --git a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift index 214a6274..ce7ff44c 100644 --- a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct AgeRatingUpdateTests { @Test func `age-rating update returns updated declaration with exact JSON`() async throws { - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() given(mockRepo).updateDeclaration(id: .any, update: .any) .willReturn(AgeRatingDeclaration( id: "decl-1", @@ -43,7 +43,7 @@ struct AgeRatingUpdateTests { } @Test func `age-rating update passes only specified flags`() async throws { - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() var capturedUpdate: AgeRatingDeclarationUpdate? given(mockRepo).updateDeclaration(id: .any, update: .any) @@ -70,7 +70,7 @@ struct AgeRatingUpdateTests { @Test func `should set a Korea override of twelve plus`() async throws { // Given - App Store Connect applies the override it is sent - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() given(mockRepo).updateDeclaration(id: .any, update: .any) .willProduce { id, update in AgeRatingDeclaration(id: id, appInfoId: "info-42", koreaAgeRatingOverride: update.koreaAgeRatingOverride) @@ -104,7 +104,7 @@ struct AgeRatingUpdateTests { @Test func `should set Korea's GRAC classification number`() async throws { // Given - App Store Connect applies the number it is sent - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() given(mockRepo).updateDeclaration(id: .any, update: .any) .willProduce { id, update in AgeRatingDeclaration(id: id, appInfoId: "info-42", gracRatingClassificationNumber: update.gracRatingClassificationNumber) @@ -137,7 +137,7 @@ struct AgeRatingUpdateTests { } @Test func `should save and show the social media answers`() async throws { - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() given(mockRepo).updateDeclaration(id: .any, update: .any) .willProduce { id, update in AgeRatingDeclaration( diff --git a/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift b/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift index 135a1172..b95be71b 100644 --- a/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift +++ b/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift @@ -7,7 +7,7 @@ import Testing struct AnalyticsReportsRequestTests { @Test func `creates a one-time snapshot request with affordances`() async throws { - let mockRepo = MockAnalyticsReportRepository() + let mockRepo = MockAnalyticsReports() given(mockRepo).createRequest(appId: .any, accessType: .any).willReturn( AnalyticsReportRequest(id: "req-1", appId: "app-1", accessType: .oneTimeSnapshot, isStoppedDueToInactivity: nil) ) @@ -38,7 +38,7 @@ struct AnalyticsReportsRequestTests { struct AnalyticsReportsListTests { @Test func `lists requests with affordances`() async throws { - let mockRepo = MockAnalyticsReportRepository() + let mockRepo = MockAnalyticsReports() given(mockRepo).listRequests(appId: .any, accessType: .any).willReturn([ AnalyticsReportRequest(id: "req-1", appId: "app-1", accessType: .ongoing, isStoppedDueToInactivity: nil) ]) @@ -74,7 +74,7 @@ struct AnalyticsReportsDeleteTests { } @Test func `deletes request and outputs confirmation`() async throws { - let mockRepo = MockAnalyticsReportRepository() + let mockRepo = MockAnalyticsReports() given(mockRepo).deleteRequest(id: .any).willReturn(()) let cmd = try AnalyticsReportsDelete.parse(["--request-id", "req-1"]) @@ -88,7 +88,7 @@ struct AnalyticsReportsDeleteTests { struct AnalyticsReportsReportsListTests { @Test func `lists reports with affordances`() async throws { - let mockRepo = MockAnalyticsReportRepository() + let mockRepo = MockAnalyticsReports() given(mockRepo).listReports(requestId: .any, category: .any).willReturn([ AnalyticsReport(id: "rpt-1", requestId: "req-1", name: "App Downloads", category: .appStoreEngagement) ]) @@ -119,7 +119,7 @@ struct AnalyticsReportsReportsListTests { struct AnalyticsReportsInstancesListTests { @Test func `lists instances with affordances`() async throws { - let mockRepo = MockAnalyticsReportRepository() + let mockRepo = MockAnalyticsReports() given(mockRepo).listInstances(reportId: .any, granularity: .any).willReturn([ AnalyticsReportInstance(id: "inst-1", reportId: "rpt-1", granularity: .daily, processingDate: "2024-01-15") ]) @@ -150,7 +150,7 @@ struct AnalyticsReportsInstancesListTests { struct AnalyticsReportsSegmentsListTests { @Test func `lists segments with affordances`() async throws { - let mockRepo = MockAnalyticsReportRepository() + let mockRepo = MockAnalyticsReports() given(mockRepo).listSegments(instanceId: .any).willReturn([ AnalyticsReportSegment(id: "seg-1", instanceId: "inst-1", checksum: "abc123", sizeInBytes: 2048, url: "https://example.com/data.tsv") ]) diff --git a/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift b/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift index 94a71d5f..823074d4 100644 --- a/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppCategoriesListTests { @Test func `listed categories include id platforms and affordances`() async throws { - let mockRepo = MockAppCategoryRepository() + let mockRepo = MockAppCategories() given(mockRepo).listCategories(platform: .any).willReturn([ AppCategory(id: "6014", platforms: ["IOS"], parentId: nil), ]) @@ -33,7 +33,7 @@ struct AppCategoriesListTests { } @Test func `listed subcategory includes parent id`() async throws { - let mockRepo = MockAppCategoryRepository() + let mockRepo = MockAppCategories() given(mockRepo).listCategories(platform: .any).willReturn([ AppCategory(id: "6014-action", platforms: ["IOS"], parentId: "6014"), ]) diff --git a/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift index 32594968..1f1525d3 100644 --- a/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift @@ -7,7 +7,7 @@ import Testing struct AppClipExperienceLocalizationsListTests { @Test func `listed localizations include experienceId locale subtitle and affordances`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listLocalizations(experienceId: .any).willReturn([ AppClipDefaultExperienceLocalization(id: "loc-1", experienceId: "exp-1", locale: "en-US", subtitle: "Quick access") ]) @@ -34,7 +34,7 @@ struct AppClipExperienceLocalizationsListTests { } @Test func `listed localizations omit nil subtitle from JSON`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listLocalizations(experienceId: .any).willReturn([ AppClipDefaultExperienceLocalization(id: "loc-1", experienceId: "exp-1", locale: "en-US", subtitle: nil) ]) @@ -60,7 +60,7 @@ struct AppClipExperienceLocalizationsListTests { } @Test func `table output includes localization id locale and subtitle`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listLocalizations(experienceId: .any).willReturn([ AppClipDefaultExperienceLocalization(id: "loc-1", experienceId: "exp-1", locale: "en-US", subtitle: "Quick access") ]) @@ -78,7 +78,7 @@ struct AppClipExperienceLocalizationsListTests { struct AppClipExperienceLocalizationsCreateTests { @Test func `create localization returns created localization with affordances`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).createLocalization(experienceId: .any, locale: .any, subtitle: .any).willReturn( AppClipDefaultExperienceLocalization(id: "loc-new", experienceId: "exp-1", locale: "fr-FR", subtitle: "Accès rapide") ) @@ -119,7 +119,7 @@ struct AppClipExperienceLocalizationsDeleteTests { } @Test func `delete localization calls repo with localization id`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).deleteLocalization(id: .any).willReturn(()) let cmd = try AppClipExperienceLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift b/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift index 496ddb74..248ba40a 100644 --- a/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift @@ -7,7 +7,7 @@ import Testing struct AppClipExperiencesListTests { @Test func `listed experiences include appClipId action and affordances`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listExperiences(appClipId: .any).willReturn([ AppClipDefaultExperience(id: "exp-1", appClipId: "clip-1", action: .open) ]) @@ -34,7 +34,7 @@ struct AppClipExperiencesListTests { } @Test func `listed experiences omit nil action from JSON`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listExperiences(appClipId: .any).willReturn([ AppClipDefaultExperience(id: "exp-1", appClipId: "clip-1", action: nil) ]) @@ -60,7 +60,7 @@ struct AppClipExperiencesListTests { } @Test func `table output includes experience id and action`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listExperiences(appClipId: .any).willReturn([ AppClipDefaultExperience(id: "exp-1", appClipId: "clip-1", action: .open) ]) @@ -78,7 +78,7 @@ struct AppClipExperiencesListTests { struct AppClipExperiencesCreateTests { @Test func `create experience returns created experience with affordances`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).createExperience(appClipId: .any, action: .any).willReturn( AppClipDefaultExperience(id: "exp-new", appClipId: "clip-1", action: .view) ) @@ -105,7 +105,7 @@ struct AppClipExperiencesCreateTests { } @Test func `create experience without action creates with nil action`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).createExperience(appClipId: .any, action: .any).willReturn( AppClipDefaultExperience(id: "exp-new", appClipId: "clip-1", action: nil) ) @@ -140,7 +140,7 @@ struct AppClipExperiencesDeleteTests { } @Test func `delete experience calls repo with experience id`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).deleteExperience(id: .any).willReturn(()) let cmd = try AppClipExperiencesDelete.parse(["--experience-id", "exp-1"]) diff --git a/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift b/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift index 9aa60653..4f8a3bca 100644 --- a/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppClipsListTests { @Test func `listed app clips include appId bundleId and affordances`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listAppClips(appId: .any).willReturn([ AppClip(id: "clip-1", appId: "app-1", bundleId: "com.example.clip") ]) @@ -33,7 +33,7 @@ struct AppClipsListTests { } @Test func `listed app clips omit nil bundleId from JSON`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listAppClips(appId: .any).willReturn([ AppClip(id: "clip-1", appId: "app-1", bundleId: nil) ]) @@ -58,7 +58,7 @@ struct AppClipsListTests { } @Test func `table output includes clip id appId and bundleId`() async throws { - let mockRepo = MockAppClipRepository() + let mockRepo = MockAppClips() given(mockRepo).listAppClips(appId: .any).willReturn([ AppClip(id: "clip-1", appId: "app-1", bundleId: "com.example.clip") ]) diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift index 95d0a5bb..6b236bc9 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfoLocalizationsCreateTests { @Test func `created localization is returned with id and locale`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo) .createLocalization(appInfoId: .any, locale: .any, name: .any) .willReturn(AppInfoLocalization(id: "loc-1", appInfoId: "info-1", locale: "en-US", name: "My App")) @@ -40,7 +40,7 @@ struct AppInfoLocalizationsCreateTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo) .createLocalization(appInfoId: .any, locale: .any, name: .any) .willReturn(AppInfoLocalization(id: "loc-2", appInfoId: "info-1", locale: "zh-Hans", name: "我的应用", subtitle: "副标题")) diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift index fb5d31d8..1fc12e36 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfoLocalizationsDeleteTests { @Test func `delete calls repository and prints deleted id`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo) .deleteLocalization(id: .any) .willReturn(()) diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift index dc5be0b2..0158d7a6 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfoLocalizationsListTests { @Test func `listed app info localizations include affordances for navigation`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo).listLocalizations(appInfoId: .any).willReturn([ AppInfoLocalization(id: "loc-1", appInfoId: "info-1", locale: "en-US", name: "My App", subtitle: "Do things"), ]) diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift index 163c3760..dcfb575c 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfoLocalizationsUpdateTests { @Test func `updated app info localization is returned with affordances`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo) .updateLocalization(id: .any, name: .any, subtitle: .any, privacyPolicyUrl: .any, privacyChoicesUrl: .any, privacyPolicyText: .any) .willReturn(AppInfoLocalization(id: "loc-1", appInfoId: "info-1", locale: "en-US", name: "New Name", subtitle: "New Sub")) @@ -41,7 +41,7 @@ struct AppInfoLocalizationsUpdateTests { } @Test func `update with privacy choices url and privacy policy text passes them through`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() var capturedChoicesUrl: String?? var capturedPolicyText: String?? given(mockRepo) diff --git a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift index 58333c84..261d132f 100644 --- a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfosListTests { @Test func `listed app infos include affordances for navigation`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo).listAppInfos(appId: .any).willReturn([ AppInfo(id: "info-1", appId: "app-1"), ]) diff --git a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift index 1de87ebe..8bcd0738 100644 --- a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfosUpdateTests { @Test func `updated app info with primary category is returned with affordances`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo) .updateCategories( id: .any, @@ -49,7 +49,7 @@ struct AppInfosUpdateTests { } @Test func `update passes all category flags to repository`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() var capturedPrimary: String?? var capturedSecondary: String?? given(mockRepo) diff --git a/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift b/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift index 43677f8e..8206289c 100644 --- a/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift @@ -9,7 +9,7 @@ struct AppPreviewSetsCommandTests { // MARK: - list @Test func `listed preview sets include affordances for navigation`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).listPreviewSets(localizationId: .any).willReturn([ AppPreviewSet(id: "set-1", localizationId: "loc-1", previewType: .iphone67, previewsCount: 3), ]) @@ -36,7 +36,7 @@ struct AppPreviewSetsCommandTests { } @Test func `listed preview sets returns empty data array when none exist`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).listPreviewSets(localizationId: .any).willReturn([]) let cmd = try AppPreviewSetsList.parse(["--localization-id", "loc-1", "--pretty"]) @@ -52,7 +52,7 @@ struct AppPreviewSetsCommandTests { } @Test func `table output for preview sets includes all row fields`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).listPreviewSets(localizationId: .any).willReturn([ AppPreviewSet(id: "set-1", localizationId: "loc-1", previewType: .iphone67, previewsCount: 2), ]) @@ -69,7 +69,7 @@ struct AppPreviewSetsCommandTests { // MARK: - create @Test func `created preview set is returned with affordances`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).createPreviewSet(localizationId: .any, previewType: .any).willReturn( AppPreviewSet(id: "set-new", localizationId: "loc-1", previewType: .iphone67, previewsCount: 0) ) @@ -96,7 +96,7 @@ struct AppPreviewSetsCommandTests { } @Test func `unknown preview type throws validation error`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() let cmd = try AppPreviewSetsCreate.parse(["--localization-id", "loc-1", "--preview-type", "INVALID_TYPE"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -104,7 +104,7 @@ struct AppPreviewSetsCommandTests { } @Test func `created Apple TV preview set returns correct preview type`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).createPreviewSet(localizationId: .any, previewType: .any).willReturn( AppPreviewSet(id: "set-1", localizationId: "loc-42", previewType: .appleTV, previewsCount: 0) ) diff --git a/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift b/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift index 870a21fa..21ddb925 100644 --- a/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift @@ -9,7 +9,7 @@ struct AppPreviewsCommandTests { // MARK: - list @Test func `listed previews include file metadata and affordances`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).listPreviews(setId: .any).willReturn([ AppPreview( id: "prev-1", @@ -46,7 +46,7 @@ struct AppPreviewsCommandTests { } @Test func `previews without optional fields omit them from json`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).listPreviews(setId: .any).willReturn([ AppPreview( id: "prev-1", @@ -77,7 +77,7 @@ struct AppPreviewsCommandTests { } @Test func `previews in processing state include video delivery state`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).listPreviews(setId: .any).willReturn([ AppPreview( id: "prev-1", @@ -114,7 +114,7 @@ struct AppPreviewsCommandTests { } @Test func `table output for previews includes all row fields`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).listPreviews(setId: .any).willReturn([ AppPreview( id: "prev-1", @@ -138,7 +138,7 @@ struct AppPreviewsCommandTests { // MARK: - upload @Test func `uploaded preview is returned with file metadata and affordances`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).uploadPreview(setId: .any, fileURL: .any, previewFrameTimeCode: .any).willReturn( AppPreview( id: "prev-new", @@ -175,7 +175,7 @@ struct AppPreviewsCommandTests { } @Test func `upload with preview frame timecode passes timecode to repository`() async throws { - let mockRepo = MockPreviewRepository() + let mockRepo = MockAppPreviews() given(mockRepo).uploadPreview(setId: .any, fileURL: .any, previewFrameTimeCode: .any).willReturn( AppPreview( id: "prev-1", diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift index a1fc83b2..4a61419d 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift @@ -10,7 +10,7 @@ struct AppShotsGalleryTemplatesTests { // MARK: - List @Test func `list gallery templates returns galleries with affordances`() async throws { - let mockRepo = MockGalleryTemplateRepository() + let mockRepo = MockGalleryTemplates() let gallery = Gallery(appName: "TestApp", screenshots: ["s0.png", "s1.png"]) gallery.template = GalleryTemplate(id: "neon-pop", name: "Neon Pop", screens: [ .hero: ScreenLayout(headline: TextSlot(y: 0.07, size: 0.08)), @@ -28,7 +28,7 @@ struct AppShotsGalleryTemplatesTests { } @Test func `list gallery templates table format`() async throws { - let mockRepo = MockGalleryTemplateRepository() + let mockRepo = MockGalleryTemplates() let gallery = Gallery(appName: "TestApp", screenshots: ["s0.png"]) gallery.template = GalleryTemplate(id: "neon", name: "Neon", screens: [:]) gallery.palette = GalleryPalette(id: "p", name: "P", background: "#000") @@ -43,7 +43,7 @@ struct AppShotsGalleryTemplatesTests { // MARK: - Get @Test func `get gallery template returns specific gallery`() async throws { - let mockRepo = MockGalleryTemplateRepository() + let mockRepo = MockGalleryTemplates() let gallery = Gallery(appName: "BezelBlend", screenshots: ["s0.png"]) gallery.template = GalleryTemplate(id: "neon-pop", name: "Neon Pop", screens: [:]) gallery.palette = GalleryPalette(id: "p", name: "P", background: "#000") @@ -56,7 +56,7 @@ struct AppShotsGalleryTemplatesTests { } @Test func `get gallery template returns error when not found`() async throws { - let mockRepo = MockGalleryTemplateRepository() + let mockRepo = MockGalleryTemplates() given(mockRepo).getGallery(templateId: .value("nope")).willReturn(nil) let cmd = try AppShotsGalleryTemplatesGet.parse(["--id", "nope"]) @@ -69,7 +69,7 @@ struct AppShotsGalleryTemplatesTests { } @Test func `get gallery template with preview flag returns HTML`() async throws { - let mockRepo = MockGalleryTemplateRepository() + let mockRepo = MockGalleryTemplates() let gallery = Gallery(appName: "TestApp", screenshots: ["s0.png"]) gallery.template = GalleryTemplate(id: "neon-pop", name: "Neon Pop", screens: [ .hero: ScreenLayout(headline: TextSlot(y: 0.07, size: 0.08)), diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift index 4e95dd0c..843e2057 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift @@ -10,7 +10,7 @@ struct AppShotsTemplatesTests { // MARK: - List @Test func `list templates shows all templates with affordances`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).listTemplates(size: .value(nil)).willReturn([ makeTemplate(id: "top-hero", name: "Top Hero"), makeTemplate(id: "minimal-light", name: "Minimal Light"), @@ -25,7 +25,7 @@ struct AppShotsTemplatesTests { } @Test func `list templates filters by size`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).listTemplates(size: .value(.landscape)).willReturn([ makeTemplate(id: "triple-fan", name: "Triple Fan"), ]) @@ -38,7 +38,7 @@ struct AppShotsTemplatesTests { // MARK: - Get @Test func `get template by id returns template detail`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -51,7 +51,7 @@ struct AppShotsTemplatesTests { } @Test func `get template returns error when not found`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).getTemplate(id: .value("nope")).willReturn(nil) let cmd = try AppShotsTemplatesGet.parse(["--id", "nope"]) @@ -65,7 +65,7 @@ struct AppShotsTemplatesTests { // MARK: - Apply @Test func `apply template returns screen design with preview`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -84,7 +84,7 @@ struct AppShotsTemplatesTests { } @Test func `apply with preview image renders HTML to PNG and writes file`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -112,7 +112,7 @@ struct AppShotsTemplatesTests { } @Test func `apply with preview html outputs HTML page`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -129,7 +129,7 @@ struct AppShotsTemplatesTests { } @Test func `apply returns error when template not found`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).getTemplate(id: .value("nope")).willReturn(nil) let cmd = try AppShotsTemplatesApply.parse([ diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift index 87d52a71..cce2ce49 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift @@ -28,7 +28,7 @@ struct AppShotsThemesTests { // MARK: - List @Test func `list themes returns all themes with affordances`() async throws { - let mockRepo = MockThemeRepository() + let mockRepo = MockThemes() given(mockRepo).listThemes().willReturn([ makeTheme(id: "space", name: "Space"), makeTheme(id: "neon", name: "Neon"), @@ -43,7 +43,7 @@ struct AppShotsThemesTests { } @Test func `list themes table format shows name and icon`() async throws { - let mockRepo = MockThemeRepository() + let mockRepo = MockThemes() given(mockRepo).listThemes().willReturn([ makeTheme(id: "space", name: "Space"), ]) @@ -56,7 +56,7 @@ struct AppShotsThemesTests { // MARK: - Get @Test func `get theme returns specific theme with AI hints`() async throws { - let mockRepo = MockThemeRepository() + let mockRepo = MockThemes() given(mockRepo).getTheme(id: .value("space")).willReturn(makeTheme()) let cmd = try AppShotsThemesGet.parse(["--id", "space", "--pretty"]) @@ -68,7 +68,7 @@ struct AppShotsThemesTests { } @Test func `get theme returns error when not found`() async throws { - let mockRepo = MockThemeRepository() + let mockRepo = MockThemes() given(mockRepo).getTheme(id: .value("nonexistent")).willReturn(nil) let cmd = try AppShotsThemesGet.parse(["--id", "nonexistent"]) @@ -81,7 +81,7 @@ struct AppShotsThemesTests { } @Test func `get theme with context flag outputs buildContext string`() async throws { - let mockRepo = MockThemeRepository() + let mockRepo = MockThemes() given(mockRepo).getTheme(id: .value("space")).willReturn(makeTheme()) let cmd = try AppShotsThemesGet.parse(["--id", "space", "--context"]) @@ -94,11 +94,11 @@ struct AppShotsThemesTests { // MARK: - Apply @Test func `apply renders template then composes with theme`() async throws { - let mockThemeRepo = MockThemeRepository() + let mockThemeRepo = MockThemes() given(mockThemeRepo).compose(themeId: .value("space"), html: .any, canvasWidth: .any, canvasHeight: .any) .willReturn("
themed output
") - let mockTemplateRepo = MockTemplateRepository() + let mockTemplateRepo = MockTemplates() given(mockTemplateRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -114,11 +114,11 @@ struct AppShotsThemesTests { } @Test func `apply with preview image renders HTML to PNG and writes file`() async throws { - let mockThemeRepo = MockThemeRepository() + let mockThemeRepo = MockThemes() given(mockThemeRepo).compose(themeId: .value("space"), html: .any, canvasWidth: .any, canvasHeight: .any) .willReturn("
themed output
") - let mockTemplateRepo = MockTemplateRepository() + let mockTemplateRepo = MockTemplates() given(mockTemplateRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -147,11 +147,11 @@ struct AppShotsThemesTests { } @Test func `apply defaults to html output when no preview flag`() async throws { - let mockThemeRepo = MockThemeRepository() + let mockThemeRepo = MockThemes() given(mockThemeRepo).compose(themeId: .value("space"), html: .any, canvasWidth: .any, canvasHeight: .any) .willReturn("
themed
") - let mockTemplateRepo = MockTemplateRepository() + let mockTemplateRepo = MockTemplates() given(mockTemplateRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -168,7 +168,7 @@ struct AppShotsThemesTests { // MARK: - Design (separate subcommand) @Test func `design outputs ThemeDesign JSON from AI`() async throws { - let mockThemeRepo = MockThemeRepository() + let mockThemeRepo = MockThemes() let design = ThemeDesign( palette: GalleryPalette(id: "space", name: "Space", background: "linear-gradient(135deg, #0f172a, #7c3aed)", @@ -199,7 +199,7 @@ struct AppShotsThemesTests { let data = try JSONEncoder().encode(design) try data.write(to: URL(fileURLWithPath: designPath)) - let mockTemplateRepo = MockTemplateRepository() + let mockTemplateRepo = MockTemplates() given(mockTemplateRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -218,8 +218,8 @@ struct AppShotsThemesTests { } @Test func `apply fails when template not found`() async throws { - let mockThemeRepo = MockThemeRepository() - let mockTemplateRepo = MockTemplateRepository() + let mockThemeRepo = MockThemes() + let mockTemplateRepo = MockTemplates() given(mockTemplateRepo).getTemplate(id: .value("nope")).willReturn(nil) let cmd = try AppShotsThemesApply.parse([ diff --git a/Tests/ASCCommandTests/Commands/AppWall/AppWallSubmitTests.swift b/Tests/ASCCommandTests/Commands/AppWall/AppWallSubmitTests.swift index fbd7b2a1..61a8733c 100644 --- a/Tests/ASCCommandTests/Commands/AppWall/AppWallSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/AppWall/AppWallSubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct AppWallSubmitTests { @Test func `submit with all flags returns PR details`() async throws { - let mockRepo = MockAppWallRepository() + let mockRepo = MockAppWall() given(mockRepo).submit(app: .any).willReturn( AppWallSubmission( prNumber: 42, @@ -32,7 +32,7 @@ struct AppWallSubmitTests { } @Test func `submit with just app-id works`() async throws { - let mockRepo = MockAppWallRepository() + let mockRepo = MockAppWall() given(mockRepo).submit(app: .any).willReturn( AppWallSubmission( prNumber: 20, @@ -51,7 +51,7 @@ struct AppWallSubmitTests { } @Test func `submit with app-id and developer works`() async throws { - let mockRepo = MockAppWallRepository() + let mockRepo = MockAppWall() given(mockRepo).submit(app: .any).willReturn( AppWallSubmission( prNumber: 15, @@ -71,7 +71,7 @@ struct AppWallSubmitTests { } @Test func `submit without any app source throws validation error`() async throws { - let mockRepo = MockAppWallRepository() + let mockRepo = MockAppWall() var cmd = try AppWallSubmit.parse([ "--developer", "tddworks", @@ -84,7 +84,7 @@ struct AppWallSubmitTests { } @Test func `submit with specific app URLs passes apps array`() async throws { - let mockRepo = MockAppWallRepository() + let mockRepo = MockAppWall() given(mockRepo).submit(app: .any).willReturn( AppWallSubmission( prNumber: 10, @@ -105,7 +105,7 @@ struct AppWallSubmitTests { } @Test func `submit with developer-id alone works`() async throws { - let mockRepo = MockAppWallRepository() + let mockRepo = MockAppWall() given(mockRepo).submit(app: .any).willReturn( AppWallSubmission( prNumber: 7, diff --git a/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift index a6ec193d..b179a61f 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift @@ -7,7 +7,7 @@ import Testing struct AppPricingCommandsTests { @Test func `listed price points show the price and the command to set it`() async throws { - let mockRepo = MockPricingRepository() + let mockRepo = MockAppPrices() given(mockRepo).listPricePoints(appId: .value("app-1"), territory: .value("USA")).willReturn([ AppPricePoint(id: "pp-1", appId: "app-1", territory: "USA", customerPrice: "4.99", proceeds: "4.24"), ]) @@ -35,7 +35,7 @@ struct AppPricingCommandsTests { } @Test func `price points can be listed for another territory`() async throws { - let mockRepo = MockPricingRepository() + let mockRepo = MockAppPrices() given(mockRepo).listPricePoints(appId: .any, territory: .any).willReturn([]) _ = try await AppsPricePointsList.parse(["--app-id", "app-1", "--territory", "JPN"]).execute(repo: mockRepo) @@ -44,7 +44,7 @@ struct AppPricingCommandsTests { } @Test func `setting the price shows the new schedule`() async throws { - let mockRepo = MockPricingRepository() + let mockRepo = MockAppPrices() given(mockRepo).setPriceSchedule(appId: .value("app-1"), baseTerritory: .value("USA"), pricePointId: .value("pp-1")) .willReturn(AppPriceSchedule(id: "sched-1", appId: "app-1", baseTerritory: "USA")) diff --git a/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift index 7ccf36b8..bbef93cc 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppsListTests { @Test func `listed apps include name bundleId and affordances`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ App(id: "app-1", name: "My App", bundleId: "com.example.app", sku: "SKU1"), @@ -43,7 +43,7 @@ struct AppsListTests { } @Test func `sku is omitted from output when not set`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ App(id: "app-1", name: "No SKU App", bundleId: "com.example"), diff --git a/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift index 1d8e3bd5..2de4cc3e 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct AppsUpdateTests { @Test func `updated content rights declaration returns app with declaration set`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).updateContentRights(appId: .any, declaration: .any).willReturn( App(id: "app-9", name: "Bakery", bundleId: "com.example.bakery", contentRightsDeclaration: .doesNotUseThirdPartyContent) ) diff --git a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift index ae5a6edd..0ee4dcec 100644 --- a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift @@ -13,12 +13,12 @@ struct AppAvailabilityCreateTests { ]) @Test func `creating availability for chosen territories shows the result`() async throws { - let repo = MockAppAvailabilityRepository() + let repo = MockAppAvailabilities() given(repo).createAppAvailability(appId: .any, isAvailableInNewTerritories: .any, territoryIds: .any).willReturn(created) let cmd = try AppAvailabilityCreate.parse(["--app-id", "app-1", "--territory", "USA", "--territory", "JPN", "--available-in-new-territories", "--pretty"]) - let output = try await cmd.execute(repo: repo, territoryRepo: MockTerritoryRepository()) + let output = try await cmd.execute(repo: repo, territoryRepo: MockTerritories()) verify(repo).createAppAvailability(appId: .value("app-1"), isAvailableInNewTerritories: .value(true), territoryIds: .value(["USA", "JPN"])).called(1) @@ -51,9 +51,9 @@ struct AppAvailabilityCreateTests { } @Test func `all territories makes the app available everywhere Apple sells`() async throws { - let repo = MockAppAvailabilityRepository() + let repo = MockAppAvailabilities() given(repo).createAppAvailability(appId: .any, isAvailableInNewTerritories: .any, territoryIds: .any).willReturn(created) - let territories = MockTerritoryRepository() + let territories = MockTerritories() given(territories).listTerritories().willReturn([ Territory(id: "USA", currency: "USD"), Territory(id: "JPN", currency: "JPY"), Territory(id: "FRA", currency: "EUR"), ]) @@ -68,11 +68,11 @@ struct AppAvailabilityCreateTests { @Test func `creating availability needs either territories or all territories`() async throws { let neither = try AppAvailabilityCreate.parse(["--app-id", "app-1"]) await #expect(throws: ValidationError.self) { - _ = try await neither.execute(repo: MockAppAvailabilityRepository(), territoryRepo: MockTerritoryRepository()) + _ = try await neither.execute(repo: MockAppAvailabilities(), territoryRepo: MockTerritories()) } let both = try AppAvailabilityCreate.parse(["--app-id", "app-1", "--territory", "USA", "--all-territories"]) await #expect(throws: ValidationError.self) { - _ = try await both.execute(repo: MockAppAvailabilityRepository(), territoryRepo: MockTerritoryRepository()) + _ = try await both.execute(repo: MockAppAvailabilities(), territoryRepo: MockTerritories()) } } } diff --git a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift index 0e22be16..e205ea10 100644 --- a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift @@ -7,7 +7,7 @@ import Testing struct AppAvailabilityGetTests { @Test func `get app availability shows per-territory status with content reasons`() async throws { - let mockRepo = MockAppAvailabilityRepository() + let mockRepo = MockAppAvailabilities() given(mockRepo).getAppAvailability(appId: .any) .willReturn(AppAvailability( id: "avail-1", @@ -74,7 +74,7 @@ struct AppAvailabilityGetTests { } @Test func `an app with no availability set up shows no data`() async throws { - let mockRepo = MockAppAvailabilityRepository() + let mockRepo = MockAppAvailabilities() given(mockRepo).getAppAvailability(appId: .any).willReturn(nil) let output = try await AppAvailabilityGet.parse(["--app-id", "app-42", "--pretty"]).execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift index 69081862..92529cf9 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift @@ -10,7 +10,7 @@ struct AssetImagesCommandTests { // MARK: - list @Test func `should list the library's images with their state and what can be done with each`() async throws { - let mockRepo = MockLibraryImageRepository() + let mockRepo = MockLibraryImages() given(mockRepo).listImages(libraryId: .value("lib-1"), imageId: .value(nil), state: .value(.prepareForSubmission), category: .value(nil)).willReturn([ LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 14619, category: .appScreenshotsAndPreviews, state: .prepareForSubmission, referenceName: "Home", specId: "spec-1", @@ -47,7 +47,7 @@ struct AssetImagesCommandTests { } @Test func `should show just one image when asked for it by id`() async throws { - let mockRepo = MockLibraryImageRepository() + let mockRepo = MockLibraryImages() given(mockRepo).listImages(libraryId: .value("lib-1"), imageId: .value("img-2"), state: .value(nil), category: .value(.creativeAssets)).willReturn([ LibraryImage(id: "img-2", libraryId: "lib-1", fileName: "card.png", fileSize: 10, category: .creativeAssets, state: .uploadComplete), ]) @@ -80,7 +80,7 @@ struct AssetImagesCommandTests { // MARK: - upload @Test func `should show the uploaded image while App Store Connect processes it`() async throws { - let mockRepo = MockLibraryImageRepository() + let mockRepo = MockLibraryImages() given(mockRepo).uploadImage(libraryId: .value("lib-1"), fileURL: .any, category: .value(.appScreenshotsAndPreviews), referenceName: .value("Home")) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 7, category: .appScreenshotsAndPreviews, state: .uploadComplete, referenceName: "Home")) @@ -112,7 +112,7 @@ struct AssetImagesCommandTests { } @Test func `should wait until App Store Connect has processed the image when asked to wait`() async throws { - let mockRepo = MockLibraryImageRepository() + let mockRepo = MockLibraryImages() given(mockRepo).uploadImage(libraryId: .any, fileURL: .any, category: .value(.creativeAssets), referenceName: .value(nil)) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "card.png", fileSize: 7, category: .creativeAssets, state: .uploadComplete)) given(mockRepo).listImages(libraryId: .value("lib-1"), imageId: .value("img-1"), state: .value(nil), category: .value(nil)) @@ -150,7 +150,7 @@ struct AssetImagesCommandTests { } @Test func `should stop waiting and show why when processing fails`() async throws { - let mockRepo = MockLibraryImageRepository() + let mockRepo = MockLibraryImages() given(mockRepo).uploadImage(libraryId: .any, fileURL: .any, category: .any, referenceName: .any) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "bad.png", fileSize: 7, category: .appScreenshotsAndPreviews, state: .uploadComplete)) given(mockRepo).listImages(libraryId: .any, imageId: .any, state: .any, category: .any) @@ -166,7 +166,7 @@ struct AssetImagesCommandTests { // MARK: - update @Test func `should rename the image and show it under its new name`() async throws { - let mockRepo = MockLibraryImageRepository() + let mockRepo = MockLibraryImages() given(mockRepo).updateImage(libraryId: .value("lib-1"), imageId: .value("img-1"), referenceName: .value("Home (Fall)"), isArchived: .value(nil)) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 7, category: .appScreenshotsAndPreviews, state: .approved, referenceName: "Home (Fall)")) @@ -186,7 +186,7 @@ struct AssetImagesCommandTests { // MARK: - delete @Test func `should report App Store Connect's refusal to delete an image that is still placed`() async throws { - let mockRepo = MockLibraryImageRepository() + let mockRepo = MockLibraryImages() given(mockRepo).deleteImage(imageId: .value("img-1")).willThrow(APIError.unknown("STATE_ERROR.ASSET_HAS_PLACEMENTS")) let cmd = try AssetImagesDelete.parse(["--image-id", "img-1"]) diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift index f4a87166..8a540cca 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift @@ -7,7 +7,7 @@ import Testing struct AssetLibraryCommandTests { @Test func `should show the app's asset library with where to go next`() async throws { - let mockRepo = MockAssetLibraryRepository() + let mockRepo = MockAssetLibraries() given(mockRepo).getAssetLibrary(appId: .value("app-1")).willReturn(AppAssetLibrary(id: "lib-1", appId: "app-1")) let cmd = try AssetLibraryGet.parse(["--app-id", "app-1", "--pretty"]) @@ -32,7 +32,7 @@ struct AssetLibraryCommandTests { } @Test func `should list placement groups of the requested type and feature with how to place into them`() async throws { - let mockRepo = MockAssetLibraryRepository() + let mockRepo = MockAssetLibraries() given(mockRepo).listPlacementGroups(placementType: .value(.appScreenshot), feature: .value("APP_STORE_VERSIONS")).willReturn([ AssetPlacementGroup(id: "IPHONE_DUO_PROFILE", placementType: .appScreenshot, platform: "IPHONE_APP_STORE", displayClass: "IPHONE_DUO", feature: "APP_STORE_VERSIONS", sizes: ["1290x2796"], maxCount: 10), diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift index ca6ce0f7..a59b7ce4 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift @@ -9,7 +9,7 @@ struct AssetPlacementsCommandTests { // MARK: - list @Test func `should list a localization's placements in display order with what can be done next`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).listPlacements( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), placementType: .value(.appScreenshot), placementGroup: .value("IPHONE_67") @@ -50,7 +50,7 @@ struct AssetPlacementsCommandTests { } @Test func `should list everywhere an image is placed`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).listAssetPlacements(mediaType: .value(.image), assetId: .value("img-1")).willReturn([ AssetPlacement(id: "pl-1", surface: .appStoreVersionLocalization, localizationId: "loc-1", mediaType: .image, assetId: "img-1", placementType: .appScreenshot, placementGroup: "IPHONE_67", state: .parentApproved), @@ -70,7 +70,7 @@ struct AssetPlacementsCommandTests { } @Test func `should list a treatment localization's placements`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).listPlacements( surface: .value(.experimentTreatmentLocalization), localizationId: .value("tl-1"), placementType: .value(nil), placementGroup: .value(nil) ).willReturn([ @@ -85,7 +85,7 @@ struct AssetPlacementsCommandTests { } @Test func `should list everywhere a video is placed`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).listAssetPlacements(mediaType: .value(.video), assetId: .value("vid-1")).willReturn([ AssetPlacement(id: "pl-1", surface: .appStoreVersionLocalization, localizationId: "loc-1", mediaType: .video, assetId: "vid-1", placementType: .appPreview, placementGroup: "IPHONE_67", state: .parentApproved), @@ -100,7 +100,7 @@ struct AssetPlacementsCommandTests { // MARK: - create @Test func `should place the image on the localization and show the new placement`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).createPlacement( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), mediaType: .value(.image), assetId: .value("img-1"), placementType: .value(.appScreenshot), placementGroup: .value("IPHONE_67") @@ -118,7 +118,7 @@ struct AssetPlacementsCommandTests { } @Test func `should place a video on a treatment localization`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).createPlacement( surface: .value(.experimentTreatmentLocalization), localizationId: .value("tl-1"), mediaType: .value(.video), assetId: .value("vid-1"), placementType: .value(.appPreview), placementGroup: .value("IPHONE_67") @@ -136,7 +136,7 @@ struct AssetPlacementsCommandTests { } @Test func `should place a header image on a custom product page localization`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).createPlacement( surface: .value(.customProductPageLocalization), localizationId: .value("cpl-1"), mediaType: .value(.image), assetId: .value("img-1"), placementType: .value(.productPageHeaderAsset), placementGroup: .value("DEFAULT_PROFILE") @@ -155,7 +155,7 @@ struct AssetPlacementsCommandTests { } @Test func `should list a custom product page localization's placements`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).listPlacements( surface: .value(.customProductPageLocalization), localizationId: .value("cpl-1"), placementType: .value(.appStoreSearchResultsAsset), placementGroup: .value(nil) @@ -202,7 +202,7 @@ struct AssetPlacementsCommandTests { // MARK: - reorder @Test func `should reorder a group on a treatment localization`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).reorderPlacements( surface: .value(.experimentTreatmentLocalization), localizationId: .value("tl-1"), placementGroup: .value("IPHONE_67"), placementIds: .value(["pl-1"]) @@ -219,7 +219,7 @@ struct AssetPlacementsCommandTests { @Test func `should show the group in the order it was given`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).reorderPlacements( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), placementGroup: .value("IPHONE_67"), placementIds: .value(["pl-2", "pl-1"]) @@ -241,7 +241,7 @@ struct AssetPlacementsCommandTests { // MARK: - delete @Test func `should report App Store Connect's refusal to delete a placement once the version is in review`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).deletePlacement(placementId: .value("pl-1")).willThrow(APIError.unknown("STATE_ERROR.INVALID_STATE")) let cmd = try AssetPlacementsDelete.parse(["--placement-id", "pl-1"]) diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift index 5537ff7e..03445477 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift @@ -8,7 +8,7 @@ import Testing struct AssetVideosCommandTests { @Test func `should list the library's videos with their preview frame and what can be done with each`() async throws { - let mockRepo = MockLibraryVideoRepository() + let mockRepo = MockLibraryVideos() given(mockRepo).listVideos(libraryId: .value("lib-1"), videoId: .value(nil), state: .value(nil), category: .value(nil)).willReturn([ LibraryVideo(id: "vid-1", libraryId: "lib-1", fileName: "preview.mp4", fileSize: 10, category: .appScreenshotsAndPreviews, state: .prepareForSubmission, @@ -43,7 +43,7 @@ struct AssetVideosCommandTests { } @Test func `should upload the video with its preview frame and wait until App Store Connect has processed it`() async throws { - let mockRepo = MockLibraryVideoRepository() + let mockRepo = MockLibraryVideos() given(mockRepo).uploadVideo(libraryId: .value("lib-1"), fileURL: .any, category: .value(.appScreenshotsAndPreviews), referenceName: .value("Fall"), previewFrameTimeCode: .value("00:00:05:00")) .willReturn(LibraryVideo(id: "vid-1", libraryId: "lib-1", fileName: "p.mp4", fileSize: 9, category: .appScreenshotsAndPreviews, state: .uploadComplete)) @@ -60,7 +60,7 @@ struct AssetVideosCommandTests { } @Test func `should archive an approved video`() async throws { - let mockRepo = MockLibraryVideoRepository() + let mockRepo = MockLibraryVideos() given(mockRepo).updateVideo(libraryId: .value("lib-1"), videoId: .value("vid-1"), referenceName: .value(nil), isArchived: .value(true)) .willReturn(LibraryVideo(id: "vid-1", libraryId: "lib-1", fileName: "p.mp4", fileSize: 9, category: .appScreenshotsAndPreviews, state: .archived)) @@ -77,7 +77,7 @@ struct AssetVideosCommandTests { } @Test func `should report App Store Connect's refusal to delete a video that is still placed`() async throws { - let mockRepo = MockLibraryVideoRepository() + let mockRepo = MockLibraryVideos() given(mockRepo).deleteVideo(videoId: .value("vid-1")).willThrow(APIError.unknown("STATE_ERROR.ASSET_HAS_PLACEMENTS")) let cmd = try AssetVideosDelete.parse(["--video-id", "vid-1"]) diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift index 3fce3490..454f8592 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsCreateTests { @Test func `creates beta app localization with description and feedback email`() async throws { - let mockRepo = MockBetaAppLocalizationRepository() + let mockRepo = MockBetaAppLocalizations() given(mockRepo).createBetaAppLocalization(appId: .any, locale: .any, update: .any) .willReturn(BetaAppLocalization( id: "bal-new", diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift index 480b3423..3b1c879f 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsDeleteTests { @Test func `delete beta app localization calls repo with localization id`() async throws { - let mockRepo = MockBetaAppLocalizationRepository() + let mockRepo = MockBetaAppLocalizations() given(mockRepo).deleteBetaAppLocalization(localizationId: .any).willReturn(()) let cmd = try BetaAppLocalizationsDelete.parse(["--localization-id", "bal-1"]) diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift index f814dfd9..4530b5d0 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsGetTests { @Test func `get returns single beta app localization with all fields and affordances`() async throws { - let mockRepo = MockBetaAppLocalizationRepository() + let mockRepo = MockBetaAppLocalizations() given(mockRepo).getBetaAppLocalization(localizationId: .any) .willReturn(BetaAppLocalization( id: "bal-1", diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift index 4ef0a425..43620eed 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsListTests { @Test func `listed beta app localizations show appId, locale, description and affordances`() async throws { - let mockRepo = MockBetaAppLocalizationRepository() + let mockRepo = MockBetaAppLocalizations() given(mockRepo).listBetaAppLocalizations(appId: .any) .willReturn([ BetaAppLocalization( diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift index d1409006..0d42c9a8 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsUpdateTests { @Test func `update returns the updated beta app localization with affordances`() async throws { - let mockRepo = MockBetaAppLocalizationRepository() + let mockRepo = MockBetaAppLocalizations() given(mockRepo).updateBetaAppLocalization(localizationId: .any, update: .any) .willReturn(BetaAppLocalization( id: "bal-1", diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift index a92edd95..09dc4dbe 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewDetailGetTests { @Test func `get detail shows contact info and affordances`() async throws { - let mockRepo = MockBetaAppReviewRepository() + let mockRepo = MockBetaAppReviews() given(mockRepo).getDetail(appId: .value("app-1")) .willReturn( BetaAppReviewDetail( @@ -45,7 +45,7 @@ struct BetaReviewDetailGetTests { } @Test func `get detail omits nil optional fields`() async throws { - let mockRepo = MockBetaAppReviewRepository() + let mockRepo = MockBetaAppReviews() given(mockRepo).getDetail(appId: .value("app-1")) .willReturn( BetaAppReviewDetail(id: "d-1", appId: "app-1") diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift index d57f9766..3d71ecbe 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewDetailUpdateTests { @Test func `update detail shows updated contact info`() async throws { - let mockRepo = MockBetaAppReviewRepository() + let mockRepo = MockBetaAppReviews() given(mockRepo).updateDetail(id: .value("d-1"), update: .any) .willReturn( BetaAppReviewDetail( diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift index 75838909..941a8436 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewSubmissionsCreateTests { @Test func `created submission shows waiting for review state`() async throws { - let mockRepo = MockBetaAppReviewRepository() + let mockRepo = MockBetaAppReviews() given(mockRepo).createSubmission(buildId: .value("build-1")) .willReturn( BetaAppReviewSubmission(id: "sub-new", buildId: "build-1", state: .waitingForReview) diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift index 9931a98b..f8dd6b96 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewSubmissionsGetTests { @Test func `get submission shows details with affordances`() async throws { - let mockRepo = MockBetaAppReviewRepository() + let mockRepo = MockBetaAppReviews() given(mockRepo).getSubmission(id: .value("sub-1")) .willReturn( BetaAppReviewSubmission(id: "sub-1", buildId: "build-42", state: .approved) diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift index b2095e1b..15fa7895 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewSubmissionsListTests { @Test func `listed submissions show id, buildId, state, and affordances`() async throws { - let mockRepo = MockBetaAppReviewRepository() + let mockRepo = MockBetaAppReviews() given(mockRepo).listSubmissions(buildId: .value("build-1")) .willReturn([ BetaAppReviewSubmission(id: "sub-1", buildId: "build-1", state: .waitingForReview), @@ -34,7 +34,7 @@ struct BetaReviewSubmissionsListTests { } @Test func `listed submissions show approved state`() async throws { - let mockRepo = MockBetaAppReviewRepository() + let mockRepo = MockBetaAppReviews() given(mockRepo).listSubmissions(buildId: .value("build-1")) .willReturn([ BetaAppReviewSubmission(id: "sub-1", buildId: "build-1", state: .approved), diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift index 7c4f6734..b0c55252 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift @@ -12,7 +12,7 @@ struct BuildsAddBetaGroupTests { } @Test func `execute adds beta group to build`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).addBetaGroups(buildId: .any, betaGroupIds: .any).willReturn() let cmd = try BuildsAddBetaGroup.parse(["--build-id", "build-1", "--beta-group-id", "bg-42"]) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift index ff0f61be..298ada07 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift @@ -106,7 +106,7 @@ struct BuildsArchiveTests { given(mockRunner).exportArchive(request: .any) .willReturn(ExportResult(ipaPath: "/tmp/export/MyApp.ipa", exportPath: "/tmp/export")) - let mockUploadRepo = MockBuildUploadRepository() + let mockUploadRepo = MockBuildUploads() given(mockUploadRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .any, fileURL: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "1.0.0", buildNumber: "42", platform: .iOS, state: .complete)) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift index 63d6c040..826d1f8d 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsListTests { @Test func `valid build includes TestFlight affordances`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "42", expired: false, processingState: .valid), @@ -37,7 +37,7 @@ struct BuildsListTests { } @Test func `build with platform and buildNumber shows all fields in JSON`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1.2.0", expired: false, processingState: .valid, buildNumber: "42", platform: .iOS), @@ -69,7 +69,7 @@ struct BuildsListTests { } @Test func `table output includes build number and platform columns`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1.0", expired: false, processingState: .valid, buildNumber: "10", platform: .iOS), @@ -87,7 +87,7 @@ struct BuildsListTests { } @Test func `platform and version options are passed to repository`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .any, platform: .value(.iOS), version: .value("1.0"), limit: .any).willReturn( PaginatedResponse(data: [], nextCursor: nil) ) @@ -105,7 +105,7 @@ struct BuildsListTests { } @Test func `expired build has no affordances`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1", expired: true, processingState: .valid), diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift index 61c5e214..fefd4a72 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsNextNumberTests { @Test func `next number is 4 when highest build is 3`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .value("app-1"), platform: .value(.iOS), version: .value("1.0.1"), limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1.0.1", buildNumber: "3", platform: .iOS), @@ -36,7 +36,7 @@ struct BuildsNextNumberTests { } @Test func `next number is 1 when no builds exist`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .value("app-1"), platform: .value(.iOS), version: .value("2.0"), limit: .any).willReturn( PaginatedResponse(data: [], nextCursor: nil) ) @@ -61,7 +61,7 @@ struct BuildsNextNumberTests { } @Test func `plain output shows just the number`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1.0", buildNumber: "7"), diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift index 0c41dde4..c710fc0c 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift @@ -12,7 +12,7 @@ struct BuildsRemoveBetaGroupTests { } @Test func `execute removes beta group from build`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).removeBetaGroups(buildId: .any, betaGroupIds: .any).willReturn() let cmd = try BuildsRemoveBetaGroup.parse(["--build-id", "build-1", "--beta-group-id", "bg-42"]) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift index b5048e98..cf349936 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsSetEncryptionComplianceTests { @Test func `set-encryption-compliance returns the updated build with affordances`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).updateBuildEncryptionCompliance(buildId: .any, usesNonExemptEncryption: .any) .willReturn(Build( id: "b-1", version: "1.0", expired: false, @@ -43,7 +43,7 @@ struct BuildsSetEncryptionComplianceTests { } @Test func `set-encryption-compliance accepts true to declare non-exempt encryption`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).updateBuildEncryptionCompliance(buildId: .any, usesNonExemptEncryption: .any) .willReturn(Build( id: "b-1", version: "1.0", buildNumber: "42", diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift index 502ae79c..3c7322f8 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsUpdateBetaNotesTests { @Test func `execute returns localization with notes`() async throws { - let mockRepo = MockBetaBuildLocalizationRepository() + let mockRepo = MockBetaBuildLocalizations() given(mockRepo).upsertBetaBuildLocalization(buildId: .any, locale: .any, whatsNew: .any) .willReturn(BetaBuildLocalization(id: "bbl-1", buildId: "build-1", locale: "en-US", whatsNew: "Bug fixes")) @@ -32,7 +32,7 @@ struct BuildsUpdateBetaNotesTests { } @Test func `table output includes locale and notes fields`() async throws { - let mockRepo = MockBetaBuildLocalizationRepository() + let mockRepo = MockBetaBuildLocalizations() given(mockRepo).upsertBetaBuildLocalization(buildId: .any, locale: .any, whatsNew: .any) .willReturn(BetaBuildLocalization(id: "bbl-1", buildId: "build-1", locale: "en-US", whatsNew: "New feature")) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift index 3a82d6e6..b481ecc1 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift @@ -9,7 +9,7 @@ struct BuildsUploadCommandTests { // MARK: - Platform resolution @Test func `auto-detects iOS platform from ipa extension`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .value(.iOS), fileURL: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .complete)) @@ -37,7 +37,7 @@ struct BuildsUploadCommandTests { } @Test func `auto-detects macOS platform from pkg extension`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .value(.macOS), fileURL: .any) .willReturn(BuildUpload(id: "up-2", appId: "app-1", version: "1.0", buildNumber: "1", platform: .macOS, state: .complete)) @@ -65,7 +65,7 @@ struct BuildsUploadCommandTests { } @Test func `uses explicit platform when provided`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .value(.tvOS), fileURL: .any) .willReturn(BuildUpload(id: "up-3", appId: "app-1", version: "1.0", buildNumber: "1", platform: .tvOS, state: .complete)) @@ -93,7 +93,7 @@ struct BuildsUploadCommandTests { } @Test func `throws for unknown explicit platform`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() let cmd = try BuildsUpload.parse(["--app-id", "app-1", "--file", "/tmp/App.ipa", "--version", "1.0", "--build-number", "1", "--platform", "watchos"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -103,7 +103,7 @@ struct BuildsUploadCommandTests { // MARK: - Wait flag @Test func `wait returns upload when immediately complete`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() let completed = BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .complete) given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .any, fileURL: .any).willReturn(completed) given(mockRepo).getBuildUpload(id: .any).willReturn(completed) @@ -132,7 +132,7 @@ struct BuildsUploadCommandTests { } @Test func `wait throws when upload fails with no details`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() let failed = BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .failed) given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .any, fileURL: .any).willReturn(failed) given(mockRepo).getBuildUpload(id: .any).willReturn(failed) @@ -144,7 +144,7 @@ struct BuildsUploadCommandTests { } @Test func `wait throws with error details when upload fails`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() let failed = BuildUpload( id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .failed, errors: [BuildUploadStateDetail(code: "INVALID_BINARY", description: "Binary rejected")] @@ -161,7 +161,7 @@ struct BuildsUploadCommandTests { // MARK: - Table output @Test func `table output includes all row fields`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .any, fileURL: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "2.0", buildNumber: "42", platform: .iOS, state: .complete)) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift index 3d4cb535..7fa9a1de 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift @@ -12,7 +12,7 @@ struct BuildsUploadsDeleteTests { } @Test func `execute deletes upload record`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).deleteBuildUpload(id: .any).willReturn() let cmd = try BuildsUploadsDelete.parse(["--upload-id", "up-42"]) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift index 319be93f..c81b02c5 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsUploadsGetTests { @Test func `execute returns upload with affordances`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).getBuildUpload(id: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "2.0", buildNumber: "55", platform: .iOS, state: .complete)) @@ -35,7 +35,7 @@ struct BuildsUploadsGetTests { } @Test func `table output includes id version build and state`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).getBuildUpload(id: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "10", platform: .macOS, state: .processing)) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift index 027aa14e..ef3f811e 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsUploadsListTests { @Test func `execute returns list of uploads`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).listBuildUploads(appId: .any).willReturn([ BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .complete), BuildUpload(id: "up-2", appId: "app-1", version: "1.1", buildNumber: "2", platform: .iOS, state: .processing), @@ -23,7 +23,7 @@ struct BuildsUploadsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockBuildUploadRepository() + let mockRepo = MockBuildUploads() given(mockRepo).listBuildUploads(appId: .any).willReturn([ BuildUpload(id: "up-1", appId: "app-1", version: "2.0", buildNumber: "99", platform: .iOS, state: .failed), ]) diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift index 3619f308..e890acac 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct BundleIDsCreateTests { @Test func `execute creates bundle id and returns it`() async throws { - let mockRepo = MockBundleIDRepository() + let mockRepo = MockBundleIDs() given(mockRepo).createBundleID(name: .any, identifier: .any, platform: .any) .willReturn(BundleID(id: "bid-new", name: "My App", identifier: "com.example.app", platform: .iOS)) @@ -33,7 +33,7 @@ struct BundleIDsCreateTests { } @Test func `execute throws for invalid platform`() async throws { - let mockRepo = MockBundleIDRepository() + let mockRepo = MockBundleIDs() let cmd = try BundleIDsCreate.parse(["--name", "My App", "--identifier", "com.example.app", "--platform", "unknown"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -41,7 +41,7 @@ struct BundleIDsCreateTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockBundleIDRepository() + let mockRepo = MockBundleIDs() given(mockRepo).createBundleID(name: .any, identifier: .any, platform: .any) .willReturn(BundleID(id: "bid-1", name: "Test App", identifier: "com.test.app", platform: .macOS)) diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift index 3ff0e1f2..dfcf97d2 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct BundleIDsDeleteTests { @Test func `execute deletes bundle id`() async throws { - let mockRepo = MockBundleIDRepository() + let mockRepo = MockBundleIDs() given(mockRepo).deleteBundleID(id: .any).willReturn() let cmd = try BundleIDsDelete.parse(["--bundle-id-id", "bid-42"]) diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift index f6a25afe..ffa72d0b 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BundleIDsListTests { @Test func `listed bundle ids include identifier platform and affordances`() async throws { - let mockRepo = MockBundleIDRepository() + let mockRepo = MockBundleIDs() given(mockRepo).listBundleIDs(platform: .any, identifier: .any).willReturn([ BundleID(id: "bid-1", name: "My App", identifier: "com.example.app", platform: .iOS), ]) @@ -34,7 +34,7 @@ struct BundleIDsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockBundleIDRepository() + let mockRepo = MockBundleIDs() given(mockRepo).listBundleIDs(platform: .any, identifier: .any).willReturn([ BundleID(id: "bid-1", name: "My App", identifier: "com.example.app", platform: .iOS), ]) @@ -48,7 +48,7 @@ struct BundleIDsListTests { } @Test func `seed id is omitted from output when not set`() async throws { - let mockRepo = MockBundleIDRepository() + let mockRepo = MockBundleIDs() given(mockRepo).listBundleIDs(platform: .any, identifier: .any).willReturn([ BundleID(id: "bid-1", name: "My App", identifier: "com.example.app", platform: .macOS), ]) diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift index 34749c12..f791f390 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift @@ -13,8 +13,8 @@ struct CertificatesCreateTests { -----END CERTIFICATE REQUEST----- """ - private func makeMock(id: String = "cert-1") -> MockCertificateRepository { - let mock = MockCertificateRepository() + private func makeMock(id: String = "cert-1") -> MockCertificates { + let mock = MockCertificates() given(mock).createCertificate(certificateType: .any, csrContent: .any).willReturn( Certificate(id: id, name: "Mac App Distribution", certificateType: .macAppDistribution) ) @@ -86,7 +86,7 @@ struct CertificatesCreateTests { @Test func `create with neither flag throws validation error`() async throws { let cmd = try CertificatesCreate.parse(["--type", "IOS_DISTRIBUTION"]) await #expect(throws: (any Error).self) { - _ = try await cmd.execute(repo: MockCertificateRepository()) + _ = try await cmd.execute(repo: MockCertificates()) } } @@ -101,7 +101,7 @@ struct CertificatesCreateTests { "--csr-path", tmpFile.path, ]) await #expect(throws: (any Error).self) { - _ = try await cmd.execute(repo: MockCertificateRepository()) + _ = try await cmd.execute(repo: MockCertificates()) } } } diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift index be75c3b2..cdccb3e0 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift @@ -8,7 +8,7 @@ import Testing struct CertificatesListTests { @Test func `listed certificates include type and affordances`() async throws { - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-1", name: "iOS Distribution", certificateType: .iosDistribution), ]) @@ -33,7 +33,7 @@ struct CertificatesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-1", name: "iOS Dist", certificateType: .iosDistribution), ]) @@ -49,7 +49,7 @@ struct CertificatesListTests { @Test func `expired-only flag filters out unexpired certificates`() async throws { let past = Date(timeIntervalSince1970: 1_000_000_000) // year 2001 — expired let future = Date(timeIntervalSinceNow: 31_536_000) // one year from now - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-expired", name: "Old", certificateType: .iosDistribution, expirationDate: past), Certificate(id: "cert-fresh", name: "Fresh", certificateType: .iosDistribution, expirationDate: future), @@ -66,7 +66,7 @@ struct CertificatesListTests { let cutoff = Date(timeIntervalSince1970: 1_700_000_000) let earlier = Date(timeIntervalSince1970: 1_600_000_000) let later = Date(timeIntervalSince1970: 1_800_000_000) - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-early", name: "Early", certificateType: .iosDistribution, expirationDate: earlier), Certificate(id: "cert-late", name: "Late", certificateType: .iosDistribution, expirationDate: later), @@ -83,7 +83,7 @@ struct CertificatesListTests { @Test func `before flag accepts date-only YYYY-MM-DD`() async throws { let earlier = Date(timeIntervalSince1970: 1_600_000_000) // 2020-09 let later = Date(timeIntervalSince1970: 2_000_000_000) // 2033-05 - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-early", name: "Early", certificateType: .iosDistribution, expirationDate: earlier), Certificate(id: "cert-late", name: "Late", certificateType: .iosDistribution, expirationDate: later), @@ -97,7 +97,7 @@ struct CertificatesListTests { } @Test func `limit flag is forwarded to repository`() async throws { - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).listCertificates(certificateType: .any, limit: .value(200)).willReturn([]) let cmd = try CertificatesList.parse(["--limit", "200", "--pretty"]) @@ -113,7 +113,7 @@ struct CertificatesListTests { } @Test func `optional certificate fields are omitted when nil`() async throws { - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate( id: "cert-1", diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift index f52c49f1..a6c4ab70 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift @@ -7,7 +7,7 @@ import Testing struct CertificatesRevokeTests { @Test func `execute revokes certificate`() async throws { - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).revokeCertificate(id: .any).willReturn() let cmd = try CertificatesRevoke.parse(["--certificate-id", "cert-42"]) diff --git a/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift b/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift index 6dffd7d1..ffed19ee 100644 --- a/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift @@ -7,7 +7,7 @@ import Testing struct DevicesListTests { @Test func `table output includes all row fields`() async throws { - let mockRepo = MockDeviceRepository() + let mockRepo = MockDevices() given(mockRepo).listDevices(platform: .any).willReturn([ Device(id: "dev-1", name: "iPhone 15", udid: "ABC-001", deviceClass: .iPhone, platform: .iOS, status: .enabled), ]) @@ -22,7 +22,7 @@ struct DevicesListTests { } @Test func `listed devices include udid class status and affordances`() async throws { - let mockRepo = MockDeviceRepository() + let mockRepo = MockDevices() given(mockRepo).listDevices(platform: .any).willReturn([ Device( id: "dev-1", diff --git a/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift b/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift index 9645faec..4638c00f 100644 --- a/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift +++ b/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift @@ -7,7 +7,7 @@ import Testing struct DevicesRegisterTests { @Test func `execute registers device and returns it`() async throws { - let mockRepo = MockDeviceRepository() + let mockRepo = MockDevices() given(mockRepo).registerDevice(name: .any, udid: .any, platform: .any) .willReturn(Device(id: "dev-new", name: "My iPhone", udid: "UDID-001", deviceClass: .iPhone, platform: .iOS, status: .enabled)) @@ -20,7 +20,7 @@ struct DevicesRegisterTests { } @Test func `execute throws for invalid platform`() async throws { - let mockRepo = MockDeviceRepository() + let mockRepo = MockDevices() let cmd = try DevicesRegister.parse(["--name", "My Device", "--udid", "UDID-001", "--platform", "tvos"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -28,7 +28,7 @@ struct DevicesRegisterTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockDeviceRepository() + let mockRepo = MockDevices() given(mockRepo).registerDevice(name: .any, udid: .any, platform: .any) .willReturn(Device(id: "dev-1", name: "iPad Pro", udid: "UDID-002", deviceClass: .iPad, platform: .iOS, status: .enabled)) diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift index d556f95b..57908ae5 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift @@ -7,7 +7,7 @@ import Testing struct ExperimentTreatmentLocalizationsTests { @Test func `listed localizations show locale and delete affordance`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listTreatmentLocalizations(treatmentId: .any, limit: .any).willReturn([ ExperimentTreatmentLocalization(id: "loc-1", treatmentId: "trt-1", locale: "en-US"), ]) @@ -34,7 +34,7 @@ struct ExperimentTreatmentLocalizationsTests { } @Test func `create passes locale and shows the new localization`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).createTreatmentLocalization(treatmentId: .any, locale: .any) .willReturn(ExperimentTreatmentLocalization(id: "loc-2", treatmentId: "trt-1", locale: "de-DE")) @@ -47,7 +47,7 @@ struct ExperimentTreatmentLocalizationsTests { } @Test func `delete calls the repository with the localization id`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).deleteTreatmentLocalization(localizationId: .any).willReturn(()) let cmd = try ExperimentTreatmentLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift index f8d83609..26c3d427 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift @@ -11,7 +11,7 @@ private func makeTreatment(id: String = "trt-1", experimentId: String = "exp-1", struct ExperimentTreatmentsListTests { @Test func `listed treatments show icon name and localization affordances`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listTreatments(experimentId: .any, limit: .any) .willReturn(PaginatedResponse(data: [makeTreatment()], nextCursor: nil)) @@ -45,7 +45,7 @@ struct ExperimentTreatmentsListTests { struct ExperimentTreatmentsCreateTests { @Test func `create passes name and icon and shows the new treatment`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).createTreatment(experimentId: .any, name: .any, appIconName: .any).willReturn(makeTreatment()) let cmd = try ExperimentTreatmentsCreate.parse([ @@ -65,7 +65,7 @@ struct ExperimentTreatmentsCreateTests { struct ExperimentTreatmentsUpdateTests { @Test func `update forwards only the provided fields`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).updateTreatment(treatmentId: .any, name: .any, appIconName: .any).willReturn(makeTreatment()) let cmd = try ExperimentTreatmentsUpdate.parse(["--treatment-id", "trt-1", "--name", "Red icon"]) @@ -75,7 +75,7 @@ struct ExperimentTreatmentsUpdateTests { } @Test func `update requires at least one field`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() let cmd = try ExperimentTreatmentsUpdate.parse(["--treatment-id", "trt-1"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -87,7 +87,7 @@ struct ExperimentTreatmentsUpdateTests { struct ExperimentTreatmentsDeleteTests { @Test func `delete calls the repository with the treatment id`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).deleteTreatment(treatmentId: .any).willReturn(()) let cmd = try ExperimentTreatmentsDelete.parse(["--treatment-id", "trt-1"]) diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift index 36b7af0c..0548dcd1 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift @@ -19,7 +19,7 @@ private func makeExperiment( struct ExperimentsListTests { @Test func `listed editable experiment shows fields and treatment, update, delete affordances`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any) .willReturn(PaginatedResponse(data: [makeExperiment()], nextCursor: nil)) @@ -53,7 +53,7 @@ struct ExperimentsListTests { } @Test func `listed running experiment shows stop affordance and startDate`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any) .willReturn(PaginatedResponse(data: [makeExperiment(state: .approved, startDate: "2026-09-01T00:00:00Z")], nextCursor: nil)) @@ -86,7 +86,7 @@ struct ExperimentsListTests { } @Test func `state flag is forwarded to the repository as a typed filter`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any) .willReturn(PaginatedResponse(data: [], nextCursor: nil)) @@ -98,7 +98,7 @@ struct ExperimentsListTests { } @Test func `unknown state flag is rejected`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() let cmd = try ExperimentsList.parse(["--app-id", "app-1", "--state", "BOGUS"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -106,7 +106,7 @@ struct ExperimentsListTests { } @Test func `table output lists name, platform, traffic and state`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any) .willReturn(PaginatedResponse(data: [makeExperiment()], nextCursor: nil)) @@ -123,7 +123,7 @@ struct ExperimentsListTests { struct ExperimentsGetTests { @Test func `get shows a single approved experiment with start affordance`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).getExperiment(experimentId: .any).willReturn(makeExperiment(state: .approved)) let cmd = try ExperimentsGet.parse(["--experiment-id", "exp-1", "--pretty"]) @@ -159,7 +159,7 @@ struct ExperimentsGetTests { struct ExperimentsCreateTests { @Test func `create passes name, platform and traffic proportion and shows the new test`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).createExperiment(appId: .any, name: .any, platform: .any, trafficProportion: .any) .willReturn(makeExperiment()) @@ -176,7 +176,7 @@ struct ExperimentsCreateTests { } @Test func `create rejects traffic proportion outside 1-100`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() let cmd = try ExperimentsCreate.parse(["--app-id", "app-1", "--name", "X", "--traffic-proportion", "0"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -188,7 +188,7 @@ struct ExperimentsCreateTests { } @Test func `create rejects unknown platform`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() let cmd = try ExperimentsCreate.parse(["--app-id", "app-1", "--name", "X", "--platform", "android", "--traffic-proportion", "30"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -200,7 +200,7 @@ struct ExperimentsCreateTests { struct ExperimentsUpdateTests { @Test func `update forwards only the provided fields and never touches started`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).updateExperiment(experimentId: .any, name: .any, trafficProportion: .any, isStarted: .any) .willReturn(makeExperiment()) @@ -214,7 +214,7 @@ struct ExperimentsUpdateTests { } @Test func `update requires at least one field`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() let cmd = try ExperimentsUpdate.parse(["--experiment-id", "exp-1"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -226,7 +226,7 @@ struct ExperimentsUpdateTests { struct ExperimentsStartStopTests { @Test func `start sets started to true and shows the running test`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).updateExperiment(experimentId: .any, name: .any, trafficProportion: .any, isStarted: .any) .willReturn(makeExperiment(state: .approved, startDate: "2026-09-01T00:00:00Z")) @@ -240,7 +240,7 @@ struct ExperimentsStartStopTests { } @Test func `stop sets started to false`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).updateExperiment(experimentId: .any, name: .any, trafficProportion: .any, isStarted: .any) .willReturn(makeExperiment(state: .stopped, startDate: "2026-09-01T00:00:00Z")) @@ -258,7 +258,7 @@ struct ExperimentsStartStopTests { struct ExperimentsDeleteTests { @Test func `delete calls the repository with the experiment id`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).deleteExperiment(experimentId: .any).willReturn(()) let cmd = try ExperimentsDelete.parse(["--experiment-id", "exp-1"]) diff --git a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift index b8f61eec..586c4365 100644 --- a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift @@ -7,7 +7,7 @@ import Testing struct GameCenterDetailGetTests { @Test func `detail get table output includes id appId and arcade enabled status`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).getDetail(appId: .any) .willReturn(GameCenterDetail(id: "gc-1", appId: "app-1", isArcadeEnabled: false)) @@ -20,7 +20,7 @@ struct GameCenterDetailGetTests { } @Test func `detail get returns id, appId, isArcadeEnabled and affordances`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).getDetail(appId: .any) .willReturn(GameCenterDetail(id: "gc-1", appId: "app-1", isArcadeEnabled: true)) @@ -51,7 +51,7 @@ struct GameCenterDetailGetTests { struct GameCenterAchievementsListTests { @Test func `achievements list returns id, detailId, and affordances`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).listAchievements(gameCenterDetailId: .any) .willReturn([ GameCenterAchievement( @@ -92,7 +92,7 @@ struct GameCenterAchievementsListTests { } @Test func `table output includes achievement fields`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).listAchievements(gameCenterDetailId: .any) .willReturn([ GameCenterAchievement( @@ -120,7 +120,7 @@ struct GameCenterAchievementsListTests { struct GameCenterAchievementsCreateTests { @Test func `achievement create returns created achievement with affordances`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).createAchievement( gameCenterDetailId: .any, referenceName: .any, @@ -176,7 +176,7 @@ struct GameCenterAchievementsCreateTests { struct GameCenterAchievementsDeleteTests { @Test func `achievement delete calls repo`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).deleteAchievement(id: .any).willReturn(()) let cmd = try GameCenterAchievementsDelete.parse(["--achievement-id", "ach-1"]) @@ -190,7 +190,7 @@ struct GameCenterAchievementsDeleteTests { struct GameCenterLeaderboardsListTests { @Test func `table output includes leaderboard fields`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).listLeaderboards(gameCenterDetailId: .any) .willReturn([ GameCenterLeaderboard( @@ -214,7 +214,7 @@ struct GameCenterLeaderboardsListTests { } @Test func `leaderboards list returns id, detailId, and affordances`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).listLeaderboards(gameCenterDetailId: .any) .willReturn([ GameCenterLeaderboard( @@ -258,7 +258,7 @@ struct GameCenterLeaderboardsListTests { struct GameCenterLeaderboardsCreateTests { @Test func `leaderboard create returns created leaderboard with affordances`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).createLeaderboard( gameCenterDetailId: .any, referenceName: .any, @@ -312,7 +312,7 @@ struct GameCenterLeaderboardsCreateTests { struct GameCenterLeaderboardsCreateValidationTests { @Test func `invalid score sort type throws validation error`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() let cmd = try GameCenterLeaderboardsCreate.parse([ "--detail-id", "gc-1", @@ -329,7 +329,7 @@ struct GameCenterLeaderboardsCreateValidationTests { } @Test func `invalid submission type throws validation error`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() let cmd = try GameCenterLeaderboardsCreate.parse([ "--detail-id", "gc-1", @@ -351,7 +351,7 @@ struct GameCenterLeaderboardsCreateValidationTests { struct GameCenterLeaderboardsDeleteTests { @Test func `leaderboard delete calls repo`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).deleteLeaderboard(id: .any).willReturn(()) let cmd = try GameCenterLeaderboardsDelete.parse(["--leaderboard-id", "lb-1"]) diff --git a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift index 43547749..fccfd69b 100644 --- a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift @@ -31,7 +31,7 @@ private func makeScore( struct GameCenterScoreModerationsListTests { @Test func `should list the leaderboard's scores with their player and next moderation steps`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).listScoreModerations(leaderboardId: .any, blockedOnly: .any).willReturn([makeScore()]) let cmd = try GameCenterScoreModerationsList.parse(["--leaderboard-id", "lb-1", "--pretty"]) @@ -66,7 +66,7 @@ struct GameCenterScoreModerationsListTests { } @Test func `should show only blocked scores when asked for blocked only`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).listScoreModerations(leaderboardId: .value("lb-1"), blockedOnly: .value(true)) .willReturn([makeScore(id: "mod-2", isBlocked: true)]) given(mockRepo).listScoreModerations(leaderboardId: .value("lb-1"), blockedOnly: .value(false)) @@ -87,7 +87,7 @@ struct GameCenterScoreModerationsListTests { struct GameCenterScoreModerationsBlockTests { @Test func `should show the score as blocked and offer unblock`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).updateScoreModeration(id: .value("mod-1"), isBlocked: .value(true)) .willReturn(makeScore(leaderboardId: nil, isBlocked: true, playerNickname: nil, isPlayerBlocked: nil)) @@ -122,7 +122,7 @@ struct GameCenterScoreModerationsBlockTests { struct GameCenterScoreModerationsUnblockTests { @Test func `should show the score as visible again and offer block`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).updateScoreModeration(id: .value("mod-1"), isBlocked: .value(false)) .willReturn(makeScore(leaderboardId: nil, isBlocked: false, playerNickname: nil, isPlayerBlocked: nil)) @@ -157,7 +157,7 @@ struct GameCenterScoreModerationsUnblockTests { struct GameCenterBlockedPlayersListTests { @Test func `should list the game's blocked players and offer to unblock each`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).listBlockedPlayers(gameCenterDetailId: .any).willReturn([ GameCenterPlayer(id: "player-1", gameCenterDetailId: "gc-1", nickname: "Player One", bundleId: "com.example.game", isBlocked: true), @@ -190,7 +190,7 @@ struct GameCenterBlockedPlayersListTests { struct GameCenterPlayersBlockTests { @Test func `should show the player as blocked and offer unblock`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).updatePlayer(id: .value("player-1"), isBlocked: .value(true)).willReturn( GameCenterPlayer(id: "player-1", gameCenterDetailId: nil, nickname: "Player One", bundleId: nil, isBlocked: true) @@ -220,7 +220,7 @@ struct GameCenterPlayersBlockTests { struct GameCenterPlayersUnblockTests { @Test func `should show the player as unblocked and offer block`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).updatePlayer(id: .value("player-1"), isBlocked: .value(false)).willReturn( GameCenterPlayer(id: "player-1", gameCenterDetailId: nil, nickname: "Player One", bundleId: nil, isBlocked: false) diff --git a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift index 3b2ba4bd..f86d52f4 100644 --- a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPAvailabilityCreateTests { @Test func `create availability shows created record with territories and currency`() async throws { - let mockRepo = MockInAppPurchaseAvailabilityRepository() + let mockRepo = MockInAppPurchaseAvailabilities() given(mockRepo).createAvailability(iapId: .any, isAvailableInNewTerritories: .any, territoryIds: .any) .willReturn(InAppPurchaseAvailability( id: "avail-new", diff --git a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift index 2efff7e9..6b28af67 100644 --- a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPAvailabilityGetTests { @Test func `get availability shows iapId, territories with currency and affordances`() async throws { - let mockRepo = MockInAppPurchaseAvailabilityRepository() + let mockRepo = MockInAppPurchaseAvailabilities() given(mockRepo).getAvailability(iapId: .any) .willReturn(InAppPurchaseAvailability( id: "avail-1", diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift index 269b0f41..3c9c0c13 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPCreateTests { @Test func `creates iap and returns it with affordances`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() given(mockRepo).createInAppPurchase(appId: .any, referenceName: .any, productId: .any, type: .any) .willReturn(InAppPurchase( id: "iap-new", @@ -61,7 +61,7 @@ struct IAPCreateTests { } @Test func `throws for invalid iap type`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() let cmd = try IAPCreate.parse([ "--app-id", "app-1", "--reference-name", "Upgrade", diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift index 8c8ba91e..7db75a6c 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPDeleteTests { @Test func `delete iap calls repo with iap id`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() given(mockRepo).deleteInAppPurchase(iapId: .any).willReturn(()) let cmd = try IAPDelete.parse(["--iap-id", "iap-1"]) diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift index f25c2e9c..5fa63d3e 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPListTests { @Test func `listed iaps include appId, productId, type, state and affordances`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() given(mockRepo).listInAppPurchases(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ InAppPurchase( @@ -57,7 +57,7 @@ struct IAPListTests { } @Test func `listed iap with reviewNote surfaces it in JSON output`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() given(mockRepo).listInAppPurchases(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ InAppPurchase( @@ -78,7 +78,7 @@ struct IAPListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() given(mockRepo).listInAppPurchases(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ InAppPurchase( diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift index 4845da4a..ed331589 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPPricePointsListTests { @Test func `listed price points include iapId, territory, price and affordances`() async throws { - let mockRepo = MockInAppPurchasePriceRepository() + let mockRepo = MockInAppPurchasePrices() given(mockRepo).listPricePoints(iapId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [InAppPurchasePricePoint( id: "pp-1", iapId: "iap-1", territory: "USA", @@ -37,7 +37,7 @@ struct IAPPricePointsListTests { } @Test func `price point without territory omits setPrice affordance and nil fields`() async throws { - let mockRepo = MockInAppPurchasePriceRepository() + let mockRepo = MockInAppPurchasePrices() given(mockRepo).listPricePoints(iapId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [InAppPurchasePricePoint( id: "pp-2", iapId: "iap-1", diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift index 7e157f99..9c62ae16 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPPricesSetTests { @Test func `set price returns schedule id, iapId and affordances`() async throws { - let mockRepo = MockInAppPurchasePriceRepository() + let mockRepo = MockInAppPurchasePrices() given(mockRepo).setPriceSchedule(iapId: .any, baseTerritory: .any, pricePointId: .any) .willReturn(InAppPurchasePriceSchedule(id: "sched-1", iapId: "iap-1")) diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift index 7dfebcfc..64ba4e2a 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPSubmitTests { @Test func `submitted iap includes submission id, iapId and affordances`() async throws { - let mockRepo = MockInAppPurchaseSubmissionRepository() + let mockRepo = MockInAppPurchaseSubmissions() given(mockRepo).submitInAppPurchase(iapId: .any) .willReturn(InAppPurchaseSubmission(id: "sub-1", iapId: "iap-1")) diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift index 576bb817..8a73c0df 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPUnsubmitTests { @Test func `unsubmit deletes submission by id`() async throws { - let mockRepo = MockInAppPurchaseSubmissionRepository() + let mockRepo = MockInAppPurchaseSubmissions() given(mockRepo).deleteSubmission(submissionId: .any).willReturn(()) let cmd = try IAPUnsubmit.parse(["--submission-id", "sub-1"]) diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift index 331bcfee..2c450a99 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPUpdateTests { @Test func `updates iap reference name and review note and returns updated record`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() given(mockRepo).updateInAppPurchase( iapId: .any, referenceName: .any, reviewNote: .any, isFamilySharable: .any ).willReturn(InAppPurchase( @@ -35,7 +35,7 @@ struct IAPUpdateTests { } @Test func `family-sharable flag passes true to repo`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() given(mockRepo).updateInAppPurchase( iapId: .any, referenceName: .any, reviewNote: .any, isFamilySharable: .any ).willReturn(InAppPurchase( @@ -53,7 +53,7 @@ struct IAPUpdateTests { } @Test func `not-family-sharable flag passes false to repo`() async throws { - let mockRepo = MockInAppPurchaseRepository() + let mockRepo = MockInAppPurchases() given(mockRepo).updateInAppPurchase( iapId: .any, referenceName: .any, reviewNote: .any, isFamilySharable: .any ).willReturn(InAppPurchase( diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift index 404eed9c..bfcca5e5 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPVersionsListTests { @Test func `listed IAP versions show state and the command to add them to a submission`() async throws { - let mockRepo = MockProductVersionRepository() + let mockRepo = MockProductVersions() given(mockRepo).listInAppPurchaseVersions(iapId: .value("iap-1")).willReturn([ ProductVersion(id: "iv-1", productId: "iap-1", kind: .inAppPurchase, version: 1, state: .prepareForSubmission), ]) diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift index 78cf2184..780185da 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPLocalizationsCreateTests { @Test func `creates iap localization with name and description and returns it with affordances`() async throws { - let mockRepo = MockInAppPurchaseLocalizationRepository() + let mockRepo = MockInAppPurchaseLocalizations() given(mockRepo).createLocalization(iapId: .any, locale: .any, name: .any, description: .any) .willReturn(InAppPurchaseLocalization( id: "loc-new", @@ -47,7 +47,7 @@ struct IAPLocalizationsCreateTests { } @Test func `creates iap localization without description omits description from json`() async throws { - let mockRepo = MockInAppPurchaseLocalizationRepository() + let mockRepo = MockInAppPurchaseLocalizations() given(mockRepo).createLocalization(iapId: .any, locale: .any, name: .any, description: .any) .willReturn(InAppPurchaseLocalization( id: "loc-new", diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift index 2ddac85d..1aec3b4a 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPLocalizationsDeleteTests { @Test func `delete localization calls repo with localization id`() async throws { - let mockRepo = MockInAppPurchaseLocalizationRepository() + let mockRepo = MockInAppPurchaseLocalizations() given(mockRepo).deleteLocalization(localizationId: .any).willReturn(()) let cmd = try IAPLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift index 11996b31..15bd8d96 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPLocalizationsListTests { @Test func `listed iap localizations include iapId, locale, name and affordances`() async throws { - let mockRepo = MockInAppPurchaseLocalizationRepository() + let mockRepo = MockInAppPurchaseLocalizations() given(mockRepo).listLocalizations(iapId: .any) .willReturn([ InAppPurchaseLocalization( @@ -42,7 +42,7 @@ struct IAPLocalizationsListTests { } @Test func `description is included when present`() async throws { - let mockRepo = MockInAppPurchaseLocalizationRepository() + let mockRepo = MockInAppPurchaseLocalizations() given(mockRepo).listLocalizations(iapId: .any) .willReturn([ InAppPurchaseLocalization( diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift index b274b043..8d1dea08 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPLocalizationsUpdateTests { @Test func `updates iap localization name and description and returns updated record with affordances`() async throws { - let mockRepo = MockInAppPurchaseLocalizationRepository() + let mockRepo = MockInAppPurchaseLocalizations() given(mockRepo).updateLocalization(localizationId: .any, name: .any, description: .any) .willReturn(InAppPurchaseLocalization( id: "loc-1", @@ -51,7 +51,7 @@ struct IAPLocalizationsUpdateTests { } @Test func `updates with only name passes nil description to repo`() async throws { - let mockRepo = MockInAppPurchaseLocalizationRepository() + let mockRepo = MockInAppPurchaseLocalizations() given(mockRepo).updateLocalization(localizationId: .any, name: .any, description: .any) .willReturn(InAppPurchaseLocalization(id: "loc-1", iapId: "", locale: "en-US", name: "Just Name")) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift index 5c640a2c..c5156507 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeCustomCodesCreateTests { @Test func `creates IAP custom code and returns result with affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).createCustomCode( offerCodeId: .any, customCode: .any, numberOfCodes: .any, expirationDate: .any diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift index 42c3cf96..f2cd9323 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeCustomCodesListTests { @Test func `listed custom codes include customCode numberOfCodes and affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listCustomCodes(offerCodeId: .any) .willReturn([ InAppPurchaseOfferCodeCustomCode( @@ -31,7 +31,7 @@ struct IAPOfferCodeCustomCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listCustomCodes(offerCodeId: .any) .willReturn([ InAppPurchaseOfferCodeCustomCode( diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift index 366bcfb1..48502432 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeCustomCodesUpdateTests { @Test func `deactivates IAP custom code and returns updated result`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).updateCustomCode(customCodeId: .any, isActive: .any) .willReturn(InAppPurchaseOfferCodeCustomCode( id: "icc-1", @@ -25,7 +25,7 @@ struct IAPOfferCodeCustomCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() let cmd = try IAPOfferCodeCustomCodesUpdate.parse(["--custom-code-id", "icc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift index 08b63954..151fa676 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeOneTimeCodesCreateTests { @Test func `creates IAP one-time codes and returns result with affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(InAppPurchaseOfferCodeOneTimeUseCode( @@ -32,7 +32,7 @@ struct IAPOfferCodeOneTimeCodesCreateTests { } @Test func `defaults environment to production when flag omitted`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(InAppPurchaseOfferCodeOneTimeUseCode( @@ -59,7 +59,7 @@ struct IAPOfferCodeOneTimeCodesCreateTests { } @Test func `forwards sandbox environment to repository`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(InAppPurchaseOfferCodeOneTimeUseCode( diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift index 336c6377..2e3ad9a9 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeOneTimeCodesListTests { @Test func `listed one-time codes include numberOfCodes active and affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any) .willReturn([ InAppPurchaseOfferCodeOneTimeUseCode( @@ -29,7 +29,7 @@ struct IAPOfferCodeOneTimeCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any) .willReturn([ InAppPurchaseOfferCodeOneTimeUseCode( diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift index ea3b1aef..1e127f0c 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeOneTimeCodesUpdateTests { @Test func `deactivates IAP one-time code and returns updated result`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).updateOneTimeUseCode(oneTimeCodeId: .any, isActive: .any) .willReturn(InAppPurchaseOfferCodeOneTimeUseCode( id: "iotc-1", @@ -24,7 +24,7 @@ struct IAPOfferCodeOneTimeCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() let cmd = try IAPOfferCodeOneTimeCodesUpdate.parse(["--one-time-code-id", "iotc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift index ab26cae1..6b674249 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeOneTimeCodesValuesTests { @Test func `returns CSV redemption values from repo`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).fetchOneTimeUseCodeValues(oneTimeCodeId: .any).willReturn("CODE1\nCODE2\nCODE3\n") let cmd = try IAPOfferCodeOneTimeCodesValues.parse(["--one-time-code-id", "otc-1"]) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift index 0d6dd60c..2dafbd3f 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodesCreateTests { @Test func `creates IAP offer code and returns it with affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).createOfferCode( iapId: .any, name: .any, customerEligibilities: .any, prices: .any ).willReturn(InAppPurchaseOfferCode( @@ -32,7 +32,7 @@ struct IAPOfferCodesCreateTests { } @Test func `throws for invalid eligibility`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() let cmd = try IAPOfferCodesCreate.parse([ "--iap-id", "iap-1", "--name", "TEST", @@ -44,7 +44,7 @@ struct IAPOfferCodesCreateTests { } @Test func `forwards paid and free per-territory prices to repository`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).createOfferCode( iapId: .any, name: .any, customerEligibilities: .any, prices: .any ).willReturn(InAppPurchaseOfferCode( @@ -73,7 +73,7 @@ struct IAPOfferCodesCreateTests { } @Test func `defaults to empty prices array when no flags provided`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).createOfferCode( iapId: .any, name: .any, customerEligibilities: .any, prices: .any ).willReturn(InAppPurchaseOfferCode( @@ -95,7 +95,7 @@ struct IAPOfferCodesCreateTests { } @Test func `rejects malformed --price flag`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() let cmd = try IAPOfferCodesCreate.parse([ "--iap-id", "iap-1", "--name", "TEST", diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift index 477af90c..2a1c114e 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodesListTests { @Test func `listed offer codes include name eligibilities active and affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listOfferCodes(iapId: .any) .willReturn([ InAppPurchaseOfferCode( @@ -31,7 +31,7 @@ struct IAPOfferCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listOfferCodes(iapId: .any) .willReturn([ InAppPurchaseOfferCode( diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift index 3fbc9502..9e5ba2f2 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodesPricesListTests { @Test func `lists prices and returns them with affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listPrices(offerCodeId: .any).willReturn([ InAppPurchaseOfferCodePrice(id: "p-1", offerCodeId: "oc-1", territory: "USA", pricePointId: "pp-9") ]) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift index 47662ac7..174d63fe 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodesUpdateTests { @Test func `deactivates IAP offer code and returns updated result`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).updateOfferCode(offerCodeId: .any, isActive: .any) .willReturn(InAppPurchaseOfferCode( id: "ioc-1", @@ -25,7 +25,7 @@ struct IAPOfferCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() let cmd = try IAPOfferCodesUpdate.parse(["--offer-code-id", "ioc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift b/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift index 5f29bd32..80ebe4de 100644 --- a/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift @@ -8,7 +8,7 @@ import Testing struct IAPReviewScreenshotGetTests { @Test func `returns the screenshot when present`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).getReviewScreenshot(iapId: .any).willReturn( InAppPurchaseReviewScreenshot(id: "rs-1", iapId: "iap-1", fileName: "review.png", fileSize: 1234) ) @@ -21,7 +21,7 @@ struct IAPReviewScreenshotGetTests { } @Test func `returns empty data array when no screenshot`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).getReviewScreenshot(iapId: .any).willReturn(nil) let cmd = try IAPReviewScreenshotGet.parse(["--iap-id", "iap-1", "--pretty"]) @@ -41,7 +41,7 @@ struct IAPReviewScreenshotGetTests { struct IAPReviewScreenshotDeleteTests { @Test func `delete calls repo with screenshot id`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).deleteReviewScreenshot(screenshotId: .any).willReturn(()) let cmd = try IAPReviewScreenshotDelete.parse(["--screenshot-id", "rs-1"]) @@ -55,7 +55,7 @@ struct IAPReviewScreenshotDeleteTests { struct IAPImagesListTests { @Test func `lists promotional images with affordances`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).listImages(iapId: .any).willReturn([ InAppPurchasePromotionalImage(id: "img-1", iapId: "iap-1", fileName: "promo.png", fileSize: 9999) ]) @@ -73,7 +73,7 @@ struct IAPImagesListTests { struct IAPImagesDeleteTests { @Test func `delete image calls repo with image id`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).deleteImage(imageId: .any).willReturn(()) let cmd = try IAPImagesDelete.parse(["--image-id", "img-1"]) diff --git a/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift b/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift index 849a2751..5db6ce6b 100644 --- a/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift @@ -9,7 +9,7 @@ struct InitCommandTests { // MARK: - --app-id mode @Test func `app-id resolves app by ID and saves config`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let mockStorage = MockProjectConfigStorage() given(mockRepo).getApp(id: .any).willReturn( App(id: "app-123", name: "My App", bundleId: "com.example.app") @@ -42,7 +42,7 @@ struct InitCommandTests { // MARK: - --name mode @Test func `name finds matching app case-insensitively and saves config`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let mockStorage = MockProjectConfigStorage() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ @@ -59,7 +59,7 @@ struct InitCommandTests { } @Test func `name throws when no matching app found`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let mockStorage = MockProjectConfigStorage() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ @@ -76,7 +76,7 @@ struct InitCommandTests { // MARK: - Auto-detect mode @Test func `auto-detect matches app by bundle ID from xcodeproj`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let mockStorage = MockProjectConfigStorage() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ @@ -96,7 +96,7 @@ struct InitCommandTests { } @Test func `auto-detect throws when scanner finds no bundle IDs`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let mockStorage = MockProjectConfigStorage() var cmd = try InitCommand.parse([]) @@ -112,7 +112,7 @@ struct InitCommandTests { // MARK: - Review contact flags @Test func `init with contact flags saves review contact in config`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let mockStorage = MockProjectConfigStorage() given(mockRepo).getApp(id: .any).willReturn( App(id: "app-123", name: "My App", bundleId: "com.example.app") @@ -154,7 +154,7 @@ struct InitCommandTests { } @Test func `init without contact flags omits contact from config`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let mockStorage = MockProjectConfigStorage() given(mockRepo).getApp(id: .any).willReturn( App(id: "app-123", name: "My App", bundleId: "com.example.app") @@ -173,7 +173,7 @@ struct InitCommandTests { // MARK: - Auto-detect error cases @Test func `auto-detect throws when no ASC app matches bundle ID`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let mockStorage = MockProjectConfigStorage() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ diff --git a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift index 62b78be2..fdd54e41 100644 --- a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift @@ -12,7 +12,7 @@ struct IrisIAPSubmissionsCreateTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisInAppPurchaseSubmissionRepository() + let mockRepo = MockIrisInAppPurchaseSubmissions() given(mockRepo).submitInAppPurchase( session: .any, iapId: .any, submitWithNextAppStoreVersion: .any ).willReturn( @@ -46,7 +46,7 @@ struct IrisIAPSubmissionsCreateTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisInAppPurchaseSubmissionRepository() + let mockRepo = MockIrisInAppPurchaseSubmissions() given(mockRepo).submitInAppPurchase( session: .any, iapId: .any, submitWithNextAppStoreVersion: .value(false) ).willReturn( diff --git a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift index cfdb264f..f657f854 100644 --- a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift @@ -12,7 +12,7 @@ struct IrisIAPSubmissionsDeleteTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisInAppPurchaseSubmissionRepository() + let mockRepo = MockIrisInAppPurchaseSubmissions() given(mockRepo).deleteSubmission(session: .any, submissionId: .any).willReturn(()) let cmd = try IrisIAPSubmissionsDelete.parse(["--submission-id", "iap-7"]) diff --git a/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift b/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift index 19fe6279..903fbd3a 100644 --- a/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift @@ -12,7 +12,7 @@ struct IrisAppsCreateTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisAppBundleRepository() + let mockRepo = MockIrisAppBundles() given(mockRepo).createApp( session: .any, name: .any, diff --git a/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift b/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift index ec62f445..3f5bfdb1 100644 --- a/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift @@ -12,7 +12,7 @@ struct IrisAppsListTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisAppBundleRepository() + let mockRepo = MockIrisAppBundles() given(mockRepo).listAppBundles(session: .any).willReturn([ AppBundle( id: "app-1", diff --git a/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift b/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift index 145e81a2..a55713bf 100644 --- a/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift @@ -35,7 +35,7 @@ struct IrisResolutionCenterGetTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisResolutionCenterRepository() + let mockRepo = MockIrisResolutionCenter() given(mockRepo).getResolution(session: .any, submissionId: .value("sub-1")).willReturn( makeDetail(body: "Guideline 2.1 - Performance") ) @@ -84,7 +84,7 @@ struct IrisResolutionCenterGetTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisResolutionCenterRepository() + let mockRepo = MockIrisResolutionCenter() given(mockRepo).getResolution(session: .any, submissionId: .value("sub-1")).willReturn( ResolutionCenterDetail( id: "thread-1", @@ -117,7 +117,7 @@ struct IrisResolutionCenterGetTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisResolutionCenterRepository() + let mockRepo = MockIrisResolutionCenter() given(mockRepo).getResolution(session: .any, submissionId: .value("sub-1")).willReturn( makeDetail(body: "

Guideline 2.1 & 2.3
We were unable to review.

") ) diff --git a/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift index b6daa6cf..58ce627a 100644 --- a/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift @@ -7,7 +7,7 @@ import Mockable struct DiagnosticLogsListTests { @Test func `listed diagnostic logs show metadata and affordances`() async throws { - let mockRepo = MockDiagnosticsRepository() + let mockRepo = MockDiagnostics() given(mockRepo).listLogs(signatureId: .any).willReturn([ DiagnosticLogEntry( id: "sig-1-0-0", diff --git a/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift index 8848daba..dd6cf5ff 100644 --- a/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift @@ -7,7 +7,7 @@ import Mockable struct DiagnosticsListTests { @Test func `diagnostic type filter is parsed from CLI argument`() async throws { - let mockRepo = MockDiagnosticsRepository() + let mockRepo = MockDiagnostics() given(mockRepo).listSignatures(buildId: .any, diagnosticType: .any).willReturn([]) let cmd = try DiagnosticsList.parse(["--build-id", "build-1", "--diagnostic-type", "DISK_WRITES"]) let output = try await cmd.execute(repo: mockRepo) @@ -15,7 +15,7 @@ struct DiagnosticsListTests { } @Test func `listed diagnostic signatures show type, weight, and affordances`() async throws { - let mockRepo = MockDiagnosticsRepository() + let mockRepo = MockDiagnostics() given(mockRepo).listSignatures(buildId: .any, diagnosticType: .any).willReturn([ DiagnosticSignatureInfo( id: "sig-1", diff --git a/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift index 7dbae9c2..612a8d79 100644 --- a/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift @@ -7,7 +7,7 @@ import Mockable struct PerfMetricsListTests { @Test func `listed app metrics show category, value, and affordances`() async throws { - let mockRepo = MockPerfMetricsRepository() + let mockRepo = MockPerfMetrics() given(mockRepo).listAppMetrics(appId: .any, metricType: .any).willReturn([ PerformanceMetric( id: "app-1-LAUNCH-launchTime", @@ -48,7 +48,7 @@ struct PerfMetricsListTests { } @Test func `metric type filter is parsed from CLI argument`() async throws { - let mockRepo = MockPerfMetricsRepository() + let mockRepo = MockPerfMetrics() given(mockRepo).listAppMetrics(appId: .any, metricType: .any).willReturn([]) let cmd = try PerfMetricsList.parse(["--app-id", "app-1", "--metric-type", "DISK"]) let output = try await cmd.execute(repo: mockRepo) @@ -56,7 +56,7 @@ struct PerfMetricsListTests { } @Test func `listed build metrics use build parent type`() async throws { - let mockRepo = MockPerfMetricsRepository() + let mockRepo = MockPerfMetrics() given(mockRepo).listBuildMetrics(buildId: .any, metricType: .any).willReturn([ PerformanceMetric( id: "build-1-HANG-hangRate", diff --git a/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift b/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift index cf37d73b..98c4dc0d 100644 --- a/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift @@ -7,7 +7,7 @@ import Testing struct PerfOverviewGetTests { @Test func `should show what regressed, each metric against its goal and the top hotspots for the device type asked for`() async throws { - let mockRepo = MockPerfOverviewRepository() + let mockRepo = MockPerfOverviews() given(mockRepo).getOverview(appId: .value("1234567890"), deviceType: .value("iPhone")).willReturn( PerformanceOverview( appId: "1234567890", @@ -94,7 +94,7 @@ struct PerfOverviewGetTests { } @Test func `should show nothing regressed when App Store Connect has no performance data for the app`() async throws { - let mockRepo = MockPerfOverviewRepository() + let mockRepo = MockPerfOverviews() given(mockRepo).getOverview(appId: .value("1234567890"), deviceType: .value(nil)).willReturn( PerformanceOverview(appId: "1234567890", platform: "iOS", bundleId: "com.example.app") ) diff --git a/Tests/ASCCommandTests/Commands/Plugins/PluginsListTests.swift b/Tests/ASCCommandTests/Commands/Plugins/PluginsListTests.swift index 26862e0c..b9bb3bc9 100644 --- a/Tests/ASCCommandTests/Commands/Plugins/PluginsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Plugins/PluginsListTests.swift @@ -7,7 +7,7 @@ import Testing struct PluginsListTests { @Test func `list shows installed plugins with affordances`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).listInstalled().willReturn([ Plugin(id: "asc-pro", name: "ASC Pro", version: "1.0", description: "Simulator streaming", author: "tddworks", @@ -23,7 +23,7 @@ struct PluginsListTests { } @Test func `list shows empty data when no plugins installed`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).listInstalled().willReturn([]) let cmd = try PluginsList.parse(["--pretty"]) diff --git a/Tests/ASCCommandTests/Commands/Plugins/PluginsMarketTests.swift b/Tests/ASCCommandTests/Commands/Plugins/PluginsMarketTests.swift index 97a3ff69..787abe9d 100644 --- a/Tests/ASCCommandTests/Commands/Plugins/PluginsMarketTests.swift +++ b/Tests/ASCCommandTests/Commands/Plugins/PluginsMarketTests.swift @@ -7,7 +7,7 @@ import Testing struct PluginsMarketTests { @Test func `market list shows available plugins with install affordance`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).listAvailable().willReturn([ Plugin( id: "asc-pro", name: "ASC Pro", version: "1.0", @@ -28,7 +28,7 @@ struct PluginsMarketTests { } @Test func `market search filters by query`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).searchAvailable(query: .value("sim")).willReturn([ Plugin(id: "asc-pro", name: "ASC Pro", version: "1.0", description: "Simulator streaming", @@ -43,7 +43,7 @@ struct PluginsMarketTests { } @Test func `market list shows uninstall affordance for installed plugins`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).listAvailable().willReturn([ Plugin(id: "asc-pro", name: "ASC Pro", version: "1.0", description: "Pro features", diff --git a/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdateTests.swift index 23ab46c8..b2d56abd 100644 --- a/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct PluginsUpdateTests { @Test func `updated plugin is returned with the new version and installed affordances`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).update(name: .value("Hello")).willReturn( Plugin( id: "Hello.plugin", diff --git a/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdatesTests.swift b/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdatesTests.swift index c7bc169d..178a5bcf 100644 --- a/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdatesTests.swift +++ b/Tests/ASCCommandTests/Commands/Plugins/PluginsUpdatesTests.swift @@ -7,7 +7,7 @@ import Testing struct PluginsUpdatesTests { @Test func `outdated plugins are listed with installed and latest versions plus update affordance`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).listOutdated().willReturn([ PluginUpdate( name: "Hello", @@ -37,7 +37,7 @@ struct PluginsUpdatesTests { } @Test func `no outdated plugins returns empty data array`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).listOutdated().willReturn([]) let cmd = try PluginsUpdates.parse(["--pretty"]) let output = try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift index da4df370..c20ee7dd 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct ProfilesCreateTests { @Test func `execute creates profile and returns it`() async throws { - let mockRepo = MockProfileRepository() + let mockRepo = MockProfiles() given(mockRepo).createProfile(name: .any, profileType: .any, bundleIdId: .any, certificateIds: .any, deviceIds: .any) .willReturn(Profile(id: "prof-new", name: "My Profile", profileType: .iosAppStore, profileState: .active, bundleIdId: "bid-1")) @@ -40,7 +40,7 @@ struct ProfilesCreateTests { } @Test func `execute throws for invalid profile type`() async throws { - let mockRepo = MockProfileRepository() + let mockRepo = MockProfiles() let cmd = try ProfilesCreate.parse([ "--name", "My Profile", "--type", "INVALID_TYPE", @@ -53,7 +53,7 @@ struct ProfilesCreateTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockProfileRepository() + let mockRepo = MockProfiles() given(mockRepo).createProfile(name: .any, profileType: .any, bundleIdId: .any, certificateIds: .any, deviceIds: .any) .willReturn(Profile(id: "prof-1", name: "Mac Store", profileType: .macAppStore, profileState: .active, bundleIdId: "bid-2")) diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift index fe868107..fc59f550 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct ProfilesDeleteTests { @Test func `execute deletes profile`() async throws { - let mockRepo = MockProfileRepository() + let mockRepo = MockProfiles() given(mockRepo).deleteProfile(id: .any).willReturn() let cmd = try ProfilesDelete.parse(["--profile-id", "prof-42"]) diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift index 5869d84b..a31d903e 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift @@ -7,7 +7,7 @@ import Testing struct ProfilesListTests { @Test func `listed profiles include bundleIdId type state and affordances`() async throws { - let mockRepo = MockProfileRepository() + let mockRepo = MockProfiles() given(mockRepo).listProfiles(bundleIdId: .any, profileType: .any).willReturn([ Profile( id: "prof-1", @@ -41,7 +41,7 @@ struct ProfilesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockProfileRepository() + let mockRepo = MockProfiles() given(mockRepo).listProfiles(bundleIdId: .any, profileType: .any).willReturn([ Profile(id: "prof-1", name: "My Profile", profileType: .iosAppStore, profileState: .active, bundleIdId: "bid-1"), ]) @@ -55,7 +55,7 @@ struct ProfilesListTests { } @Test func `invalid profile state renders in output`() async throws { - let mockRepo = MockProfileRepository() + let mockRepo = MockProfiles() given(mockRepo).listProfiles(bundleIdId: .any, profileType: .any).willReturn([ Profile( id: "prof-2", diff --git a/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift b/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift index 31875536..a32d2c8d 100644 --- a/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift +++ b/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift @@ -12,7 +12,7 @@ private func makePromoted(id: String = "pp-1", appId: String = "app-1") -> Promo struct PromotedPurchasesListTests { @Test func `list returns promoted purchases with affordances`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() given(mockRepo).listPromotedPurchases(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [makePromoted()], nextCursor: nil)) @@ -30,7 +30,7 @@ struct PromotedPurchasesListTests { struct PromotedPurchasesCreateTests { @Test func `requires either iap-id or subscription-id`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() let cmd = try PromotedPurchasesCreate.parse(["--app-id", "app-1"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -38,7 +38,7 @@ struct PromotedPurchasesCreateTests { } @Test func `iap-id and subscription-id are mutually exclusive`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() let cmd = try PromotedPurchasesCreate.parse([ "--app-id", "app-1", "--iap-id", "iap-1", @@ -50,7 +50,7 @@ struct PromotedPurchasesCreateTests { } @Test func `passes iap-id to repo`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() given(mockRepo).createPromotedPurchase( appId: .any, isVisibleForAllUsers: .any, isEnabled: .any, inAppPurchaseId: .any, subscriptionId: .any @@ -73,7 +73,7 @@ struct PromotedPurchasesCreateTests { } @Test func `hidden flag passes false visibility`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() given(mockRepo).createPromotedPurchase( appId: .any, isVisibleForAllUsers: .any, isEnabled: .any, inAppPurchaseId: .any, subscriptionId: .any @@ -101,7 +101,7 @@ struct PromotedPurchasesCreateTests { struct PromotedPurchasesUpdateTests { @Test func `update passes visibility and enabled flags`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() given(mockRepo).updatePromotedPurchase( promotedId: .any, isVisibleForAllUsers: .any, isEnabled: .any ).willReturn(makePromoted()) @@ -125,7 +125,7 @@ struct PromotedPurchasesUpdateTests { struct PromotedPurchasesDeleteTests { @Test func `delete calls repo with promoted-id`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() given(mockRepo).deletePromotedPurchase(promotedId: .any).willReturn(()) let cmd = try PromotedPurchasesDelete.parse(["--promoted-id", "pp-1"]) diff --git a/Tests/ASCCommandTests/Commands/Reports/FinanceReportsDownloadTests.swift b/Tests/ASCCommandTests/Commands/Reports/FinanceReportsDownloadTests.swift index f480d284..19554a69 100644 --- a/Tests/ASCCommandTests/Commands/Reports/FinanceReportsDownloadTests.swift +++ b/Tests/ASCCommandTests/Commands/Reports/FinanceReportsDownloadTests.swift @@ -7,7 +7,7 @@ import Testing struct FinanceReportsDownloadTests { @Test func `downloads finance report and outputs JSON with row data`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() given(mockRepo).downloadFinanceReport( vendorNumber: .any, reportType: .any, @@ -40,7 +40,7 @@ struct FinanceReportsDownloadTests { } @Test func `resolves vendor number from storage when not provided`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() let mockStorage = MockAuthStorage() let accounts = [ConnectAccount(name: "work", keyID: "KEY1", issuerID: "ISS1", isActive: true, vendorNumber: "88012345")] given(mockStorage).loadAll().willReturn(accounts) @@ -65,7 +65,7 @@ struct FinanceReportsDownloadTests { } @Test func `throws when vendor number missing from both flag and storage`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() let mockStorage = MockAuthStorage() given(mockStorage).loadAll().willReturn([]) @@ -81,7 +81,7 @@ struct FinanceReportsDownloadTests { } @Test func `table output includes row values`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() given(mockRepo).downloadFinanceReport( vendorNumber: .any, reportType: .any, diff --git a/Tests/ASCCommandTests/Commands/Reports/SalesReportsDownloadTests.swift b/Tests/ASCCommandTests/Commands/Reports/SalesReportsDownloadTests.swift index 049d8ea8..1c565019 100644 --- a/Tests/ASCCommandTests/Commands/Reports/SalesReportsDownloadTests.swift +++ b/Tests/ASCCommandTests/Commands/Reports/SalesReportsDownloadTests.swift @@ -7,7 +7,7 @@ import Testing struct SalesReportsDownloadTests { @Test func `downloads sales report and outputs JSON with row data`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() given(mockRepo).downloadSalesReport( vendorNumber: .any, reportType: .any, @@ -42,7 +42,7 @@ struct SalesReportsDownloadTests { } @Test func `downloads sales report with report date`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() given(mockRepo).downloadSalesReport( vendorNumber: .any, reportType: .any, @@ -78,7 +78,7 @@ struct SalesReportsDownloadTests { } @Test func `table output includes row values`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() given(mockRepo).downloadSalesReport( vendorNumber: .any, reportType: .any, @@ -105,7 +105,7 @@ struct SalesReportsDownloadTests { } @Test func `resolves vendor number from storage when not provided`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() let mockStorage = MockAuthStorage() let accounts = [ConnectAccount(name: "work", keyID: "KEY1", issuerID: "ISS1", isActive: true, vendorNumber: "88012345")] given(mockStorage).loadAll().willReturn(accounts) @@ -132,7 +132,7 @@ struct SalesReportsDownloadTests { } @Test func `explicit vendor number overrides stored value`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() let mockStorage = MockAuthStorage() let accounts = [ConnectAccount(name: "work", keyID: "KEY1", issuerID: "ISS1", isActive: true, vendorNumber: "stored")] given(mockStorage).loadAll().willReturn(accounts) @@ -160,7 +160,7 @@ struct SalesReportsDownloadTests { } @Test func `throws when vendor number missing from both flag and storage`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() let mockStorage = MockAuthStorage() given(mockStorage).loadAll().willReturn([]) @@ -176,7 +176,7 @@ struct SalesReportsDownloadTests { } @Test func `forwards --version flag to repository as filterVersion`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() given(mockRepo).downloadSalesReport( vendorNumber: .any, reportType: .any, @@ -202,7 +202,7 @@ struct SalesReportsDownloadTests { } @Test func `handles empty report`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() given(mockRepo).downloadSalesReport( vendorNumber: .any, reportType: .any, diff --git a/Tests/ASCCommandTests/Commands/Reports/SalesReportsSummaryTests.swift b/Tests/ASCCommandTests/Commands/Reports/SalesReportsSummaryTests.swift index db6beca9..4dfffbbf 100644 --- a/Tests/ASCCommandTests/Commands/Reports/SalesReportsSummaryTests.swift +++ b/Tests/ASCCommandTests/Commands/Reports/SalesReportsSummaryTests.swift @@ -7,7 +7,7 @@ import Testing struct SalesReportsSummaryTests { @Test func `aggregates 6 days into a summary with per-currency proceeds`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() let storage = MockAuthStorage() given(storage).loadAll().willReturn([ ConnectAccount(name: "test", keyID: "K", issuerID: "I", isActive: true, vendorNumber: "123") @@ -86,7 +86,7 @@ struct SalesReportsSummaryTests { } @Test func `single day window emits days=1`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() let storage = MockAuthStorage() given(storage).loadAll().willReturn([ ConnectAccount(name: "test", keyID: "K", issuerID: "I", isActive: true, vendorNumber: "123") @@ -109,7 +109,7 @@ struct SalesReportsSummaryTests { } @Test func `--from after --to rejects with validation error`() async throws { - let mockRepo = MockReportRepository() + let mockRepo = MockReports() let storage = MockAuthStorage() given(storage).loadAll().willReturn([ ConnectAccount(name: "test", keyID: "K", issuerID: "I", isActive: true, vendorNumber: "123") diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift index 724d5be6..57c6f185 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewSubmissionItemsListTests { @Test func `listed items show id, submissionId, state, linked resource, and affordances`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissionItems(submissionId: .value("sub-1")).willReturn([ ReviewSubmissionItem( id: "item-1", @@ -43,7 +43,7 @@ struct ReviewSubmissionItemsListTests { } @Test func `items filtered by state returns only matching items`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissionItems(submissionId: .value("sub-1")).willReturn([ ReviewSubmissionItem(id: "i-1", submissionId: "sub-1", state: .rejected, linkedResourceId: "v-9", linkedResourceType: .appStoreVersion), diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift index 225c48d9..1a5edc4a 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift @@ -10,7 +10,7 @@ struct ReviewSubmissionsBuildTests { // MARK: - create @Test func `creating a submission shows the draft with commands to add items and submit`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).createSubmission(appId: .value("app-1"), platform: .value(.iOS)).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview) ) @@ -40,7 +40,7 @@ struct ReviewSubmissionsBuildTests { } @Test func `creating a submission for macOS asks for a macOS draft`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).createSubmission(appId: .any, platform: .value(.macOS)).willReturn( ReviewSubmission(id: "sub-2", appId: "app-1", platform: .macOS, state: .readyForReview) ) @@ -53,13 +53,13 @@ struct ReviewSubmissionsBuildTests { @Test func `creating a submission rejects an unknown platform`() async throws { let cmd = try ReviewSubmissionsCreate.parse(["--app-id", "app-1", "--platform", "android"]) - await #expect(throws: ValidationError.self) { try await cmd.execute(repo: MockSubmissionRepository()) } + await #expect(throws: ValidationError.self) { try await cmd.execute(repo: MockReviewSubmissions()) } } // MARK: - items add @Test func `adding a subscription version shows the new item and how to remove it`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).addItem(submissionId: .value("sub-1"), target: .value(.subscriptionVersion("sv-1"))).willReturn( ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .readyForReview, linkedResourceId: "sv-1", linkedResourceType: .subscriptionVersion) @@ -96,7 +96,7 @@ struct ReviewSubmissionsBuildTests { ("--subscription-group-version-id", .subscriptionGroupVersion("x-1")), ] for (flag, target) in cases { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).addItem(submissionId: .any, target: .any).willReturn( ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .readyForReview) ) @@ -108,16 +108,16 @@ struct ReviewSubmissionsBuildTests { @Test func `adding an item needs exactly one version flag`() async throws { let none = try ReviewSubmissionItemsAdd.parse(["--submission-id", "sub-1"]) - await #expect(throws: ValidationError.self) { try await none.execute(repo: MockSubmissionRepository()) } + await #expect(throws: ValidationError.self) { try await none.execute(repo: MockReviewSubmissions()) } let two = try ReviewSubmissionItemsAdd.parse(["--submission-id", "sub-1", "--version-id", "v-1", "--iap-version-id", "iv-1"]) - await #expect(throws: ValidationError.self) { try await two.execute(repo: MockSubmissionRepository()) } + await #expect(throws: ValidationError.self) { try await two.execute(repo: MockReviewSubmissions()) } } // MARK: - items remove @Test func `removing an item removes it from its submission`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).removeItem(itemId: .any).willReturn() let cmd = try ReviewSubmissionItemsRemove.parse(["--item-id", "item-1"]) @@ -129,7 +129,7 @@ struct ReviewSubmissionsBuildTests { // MARK: - submit @Test func `submitting shows the submission waiting for review`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).submit(submissionId: .value("sub-1")).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .waitingForReview) ) diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift index bb425283..68f93361 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewSubmissionsGetTests { @Test func `get submission shows id, appId, state, and affordances`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).getSubmission(id: .value("sub-1")).willReturn( ReviewSubmission(id: "sub-1", appId: "app-42", platform: .iOS, state: .unresolvedIssues) ) diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift index c10eeae1..0c7671a3 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewSubmissionsListTests { @Test func `listed submissions show id, appId, state, platform, and affordances`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissions(appId: .value("app-42"), states: .any, limit: .any) .willReturn([ ReviewSubmission(id: "sub-1", appId: "app-42", platform: .iOS, state: .waitingForReview), @@ -36,7 +36,7 @@ struct ReviewSubmissionsListTests { } @Test func `unresolved issues submission exposes listRejectedItems affordance`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissions( appId: .any, states: .any, @@ -53,7 +53,7 @@ struct ReviewSubmissionsListTests { } @Test func `state filter parses comma-separated values and passes them to repo`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissions( appId: .value("app-1"), states: .value([.waitingForReview, .inReview, .readyForReview]), @@ -78,7 +78,7 @@ struct ReviewSubmissionsListTests { } @Test func `unresolved issues state is preserved through listing`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissions( appId: .value("app-1"), states: .value([.unresolvedIssues]), @@ -98,7 +98,7 @@ struct ReviewSubmissionsListTests { } @Test func `no state filter passes nil to repo and lists all states`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissions( appId: .value("app-1"), states: .value(nil), diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift index 5a7741a3..f65a566e 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewResponsesCreateTests { @Test func `create response returns new response with pending state`() async throws { - let mockRepo = MockCustomerReviewRepository() + let mockRepo = MockCustomerReviews() given(mockRepo).createResponse(reviewId: .any, responseBody: .any).willReturn( CustomerReviewResponse( id: "resp-new", diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift index ec282997..3499cbcd 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift @@ -12,7 +12,7 @@ struct ReviewResponsesDeleteTests { } @Test func `delete response calls repository`() async throws { - let mockRepo = MockCustomerReviewRepository() + let mockRepo = MockCustomerReviews() given(mockRepo).deleteResponse(responseId: .any).willReturn(()) let cmd = try ReviewResponsesDelete.parse(["--response-id", "resp-1"]) diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift index c56b27e6..5564f0c9 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewResponsesGetTests { @Test func `get response shows response body state and affordances`() async throws { - let mockRepo = MockCustomerReviewRepository() + let mockRepo = MockCustomerReviews() given(mockRepo).getResponse(reviewId: .any).willReturn( CustomerReviewResponse( id: "resp-1", diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift index 33aa6c0d..22dd2598 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewsGetTests { @Test func `get review shows full review details with affordances`() async throws { - let mockRepo = MockCustomerReviewRepository() + let mockRepo = MockCustomerReviews() given(mockRepo).getReview(reviewId: .any).willReturn( CustomerReview( id: "rev-1", diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift index 9d51393e..a0b6b11f 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewsListTests { @Test func `listed reviews include rating territory and affordances`() async throws { - let mockRepo = MockCustomerReviewRepository() + let mockRepo = MockCustomerReviews() given(mockRepo).listReviews(appId: .any).willReturn([ CustomerReview( id: "rev-1", diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift index 8a47b3cd..e6e71b47 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotSetsCreateTests { @Test func `created screenshot set is returned with affordances`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).createScreenshotSet(localizationId: .any, displayType: .any).willReturn( AppScreenshotSet(id: "set-new", localizationId: "loc-1", screenshotDisplayType: .iphone67, screenshotsCount: 0) ) @@ -35,7 +35,7 @@ struct ScreenshotSetsCreateTests { } @Test func `unknown display type throws validation error`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() let cmd = try ScreenshotSetsCreate.parse(["--localization-id", "loc-1", "--display-type", "INVALID_TYPE"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -43,7 +43,7 @@ struct ScreenshotSetsCreateTests { } @Test func `created iPad Pro 3gen11 set returns correct display type`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).createScreenshotSet(localizationId: .any, displayType: .any).willReturn( AppScreenshotSet(id: "set-1", localizationId: "loc-42", screenshotDisplayType: .ipadPro3gen11) ) diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift index d4cd73da..b621cf3f 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotSetsDeleteTests { @Test func `should delete the screenshot set it was given`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).deleteScreenshotSet(setId: .value("set-1")).willReturn() let cmd = try ScreenshotSetsDelete.parse(["--set-id", "set-1"]) @@ -18,7 +18,7 @@ struct ScreenshotSetsDeleteTests { } @Test func `should report the App Store Connect error when the set cannot be deleted`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).deleteScreenshotSet(setId: .any).willThrow(APIError.notFound("set-404")) let cmd = try ScreenshotSetsDelete.parse(["--set-id", "set-404"]) diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift index 43011dd4..ce01398a 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotSetsListTests { @Test func `listed screenshot sets include affordances for navigation`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).listScreenshotSets(localizationId: .any).willReturn([ AppScreenshotSet(id: "set-1", localizationId: "loc-1", screenshotDisplayType: .iphone67, screenshotsCount: 3), ]) diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift index 740287fe..03205bfd 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotsDeleteTests { @Test func `should delete the screenshot it was given`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).deleteScreenshot(screenshotId: .value("shot-1")).willReturn() let cmd = try ScreenshotsDelete.parse(["--screenshot-id", "shot-1"]) @@ -18,7 +18,7 @@ struct ScreenshotsDeleteTests { } @Test func `should report the App Store Connect error when the screenshot cannot be deleted`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).deleteScreenshot(screenshotId: .any).willThrow(APIError.notFound("shot-404")) let cmd = try ScreenshotsDelete.parse(["--screenshot-id", "shot-404"]) diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift index a4b1b384..861a4e8c 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift @@ -35,8 +35,8 @@ struct ScreenshotsImportTests { // MARK: - Output format @Test func `import uploads screenshots and returns results`() async throws { - let mockLocRepo = MockVersionLocalizationRepository() - let mockSsRepo = MockScreenshotRepository() + let mockLocRepo = MockVersionLocalizations() + let mockSsRepo = MockAppScreenshots() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v1", locale: "en-US"), ]) @@ -76,8 +76,8 @@ struct ScreenshotsImportTests { // MARK: - Find-or-create localization @Test func `import reuses existing localization when locale matches`() async throws { - let mockLocRepo = MockVersionLocalizationRepository() - let mockSsRepo = MockScreenshotRepository() + let mockLocRepo = MockVersionLocalizations() + let mockSsRepo = MockAppScreenshots() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-existing", versionId: "v1", locale: "en-US"), ]) @@ -101,8 +101,8 @@ struct ScreenshotsImportTests { } @Test func `import creates localization when locale is not found`() async throws { - let mockLocRepo = MockVersionLocalizationRepository() - let mockSsRepo = MockScreenshotRepository() + let mockLocRepo = MockVersionLocalizations() + let mockSsRepo = MockAppScreenshots() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([]) given(mockLocRepo).createLocalization(versionId: .any, locale: .any) .willReturn(AppStoreVersionLocalization(id: "loc-new", versionId: "v1", locale: "ja")) @@ -128,8 +128,8 @@ struct ScreenshotsImportTests { // MARK: - Find-or-create screenshot set @Test func `import reuses existing screenshot set when display type matches`() async throws { - let mockLocRepo = MockVersionLocalizationRepository() - let mockSsRepo = MockScreenshotRepository() + let mockLocRepo = MockVersionLocalizations() + let mockSsRepo = MockAppScreenshots() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v1", locale: "en-US"), ]) @@ -153,8 +153,8 @@ struct ScreenshotsImportTests { } @Test func `table output includes all row fields`() async throws { - let mockLocRepo = MockVersionLocalizationRepository() - let mockSsRepo = MockScreenshotRepository() + let mockLocRepo = MockVersionLocalizations() + let mockSsRepo = MockAppScreenshots() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v1", locale: "en-US"), ]) @@ -179,8 +179,8 @@ struct ScreenshotsImportTests { } @Test func `import creates screenshot set when display type is not found`() async throws { - let mockLocRepo = MockVersionLocalizationRepository() - let mockSsRepo = MockScreenshotRepository() + let mockLocRepo = MockVersionLocalizations() + let mockSsRepo = MockAppScreenshots() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v1", locale: "en-US"), ]) diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift index 7091ff23..af995e64 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift @@ -11,11 +11,11 @@ struct ScreenshotsImportToLibraryTests { // MARK: - App Store Connect, stubbed to apply what it's sent private struct AppStoreConnect { - let versionRepo = MockVersionRepository() - let localizationRepo = MockVersionLocalizationRepository() - let libraryRepo = MockAssetLibraryRepository() - let imageRepo = MockLibraryImageRepository() - let placementRepo = MockAssetPlacementRepository() + let versionRepo = MockAppStoreVersions() + let localizationRepo = MockVersionLocalizations() + let libraryRepo = MockAssetLibraries() + let imageRepo = MockLibraryImages() + let placementRepo = MockAssetPlacements() init( versionState: AppStoreVersionState = .prepareForSubmission, diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift index 2541a799..1733fbbb 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotsListTests { @Test func `listed screenshots include file metadata`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).listScreenshots(setId: .any).willReturn([ AppScreenshot(id: "img-1", setId: "set-1", fileName: "hero.png", fileSize: 2_048_000, assetState: .complete, imageWidth: 1290, imageHeight: 2796), ]) @@ -37,7 +37,7 @@ struct ScreenshotsListTests { } @Test func `screenshots without dimensions omit size fields`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).listScreenshots(setId: .any).willReturn([ AppScreenshot(id: "img-1", setId: "set-1", fileName: "screen.png", fileSize: 100, assetState: nil, imageWidth: nil, imageHeight: nil), ]) @@ -64,7 +64,7 @@ struct ScreenshotsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).listScreenshots(setId: .any).willReturn([ AppScreenshot(id: "img-1", setId: "set-1", fileName: "hero.png", fileSize: 2_048_000, assetState: .complete, imageWidth: 1290, imageHeight: 2796), ]) diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift index 24242c7c..9985ee38 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotsUploadTests { @Test func `uploaded screenshot is returned with file metadata`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).uploadScreenshot(setId: .any, fileURL: .any).willReturn( AppScreenshot(id: "img-new", setId: "set-1", fileName: "hero.png", fileSize: 2_048_000, assetState: .complete, imageWidth: 1290, imageHeight: 2796) ) @@ -37,7 +37,7 @@ struct ScreenshotsUploadTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).uploadScreenshot(setId: .any, fileURL: .any).willReturn( AppScreenshot(id: "img-1", setId: "set-1", fileName: "screen.png", fileSize: 1_048_576, assetState: .complete, imageWidth: 390, imageHeight: 844) ) diff --git a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsBootTests.swift b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsBootTests.swift index 8014c6a5..37bd5625 100644 --- a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsBootTests.swift +++ b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsBootTests.swift @@ -7,7 +7,7 @@ import Testing struct SimulatorsBootTests { @Test func `boot simulator returns success message with udid`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).bootSimulator(udid: .value("ABCD-1234")).willReturn(()) let cmd = try SimulatorsBoot.parse(["--udid", "ABCD-1234"]) diff --git a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsListTests.swift b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsListTests.swift index 0c2eefc2..f653038a 100644 --- a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsListTests.swift @@ -11,7 +11,7 @@ struct SimulatorsListTests { } @Test func `listed simulators show id name state runtime and affordances`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).listSimulators(filter: .any).willReturn([ Simulator( id: "ABCD-1234", @@ -45,7 +45,7 @@ struct SimulatorsListTests { } @Test func `booted simulator shows shutdown affordances`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).listSimulators(filter: .any).willReturn([ Simulator( id: "EFGH-5678", @@ -79,7 +79,7 @@ struct SimulatorsListTests { } @Test func `booted filter passes correct filter to repository`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).listSimulators(filter: .value(.booted)).willReturn([]) let cmd = try SimulatorsList.parse(["--booted", "--pretty"]) @@ -95,7 +95,7 @@ struct SimulatorsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).listSimulators(filter: .any).willReturn([ Simulator( id: "sim-1", @@ -115,7 +115,7 @@ struct SimulatorsListTests { } @Test func `default filter is available not booted`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).listSimulators(filter: .value(.available)).willReturn([]) let cmd = try SimulatorsList.parse(["--pretty"]) @@ -125,7 +125,7 @@ struct SimulatorsListTests { } @Test func `markdown output works`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).listSimulators(filter: .any).willReturn([ Simulator(id: "s-1", name: "iPhone 16", state: SimulatorState.booted, runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-2"), ]) diff --git a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsShutdownTests.swift b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsShutdownTests.swift index 0a278bb7..729dbbdb 100644 --- a/Tests/ASCCommandTests/Commands/Simulators/SimulatorsShutdownTests.swift +++ b/Tests/ASCCommandTests/Commands/Simulators/SimulatorsShutdownTests.swift @@ -7,7 +7,7 @@ import Testing struct SimulatorsShutdownTests { @Test func `shutdown simulator returns success message with udid`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).shutdownSimulator(udid: .value("ABCD-1234")).willReturn(()) let cmd = try SimulatorsShutdown.parse(["--udid", "ABCD-1234"]) diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillUpdateCheckerTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillUpdateCheckerTests.swift index fef9a8e4..b7038d35 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillUpdateCheckerTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillUpdateCheckerTests.swift @@ -8,7 +8,7 @@ import Testing struct SkillUpdateCheckerTests { @Test func `skips check when ASC_SKIP_SKILL_CHECK is true`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() await SkillUpdateChecker.checkIfNeeded( @@ -22,7 +22,7 @@ struct SkillUpdateCheckerTests { } @Test func `skips check in CI environment`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() await SkillUpdateChecker.checkIfNeeded( @@ -35,7 +35,7 @@ struct SkillUpdateCheckerTests { } @Test func `skips check when last check was less than 24h ago`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() let recentCheck = Date().addingTimeInterval(-3600) // 1 hour ago given(mockStorage).load().willReturn(SkillConfig(skillsCheckedAt: recentCheck)) @@ -50,7 +50,7 @@ struct SkillUpdateCheckerTests { } @Test func `runs check when last check was more than 24h ago`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() let oldCheck = Date().addingTimeInterval(-25 * 3600) // 25 hours ago given(mockStorage).load().willReturn(SkillConfig(skillsCheckedAt: oldCheck)) @@ -67,7 +67,7 @@ struct SkillUpdateCheckerTests { } @Test func `runs check when no previous check exists`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() given(mockStorage).load().willReturn(nil) given(mockRepo).check().willReturn(.upToDate) @@ -83,7 +83,7 @@ struct SkillUpdateCheckerTests { } @Test func `does not persist timestamp when result is unavailable`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() given(mockStorage).load().willReturn(nil) given(mockRepo).check().willReturn(.unavailable) @@ -98,7 +98,7 @@ struct SkillUpdateCheckerTests { } @Test func `persists timestamp when result is up to date`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() given(mockStorage).load().willReturn(nil) given(mockRepo).check().willReturn(.upToDate) diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsCheckTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsCheckTests.swift index 5c85e465..44cb9bca 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsCheckTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsCheckTests.swift @@ -7,7 +7,7 @@ import Testing struct SkillsCheckTests { @Test func `check shows up to date message`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() given(mockRepo).check().willReturn(.upToDate) given(mockStorage).load().willReturn(nil) @@ -20,7 +20,7 @@ struct SkillsCheckTests { } @Test func `check shows updates available message`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() given(mockRepo).check().willReturn(.updatesAvailable) given(mockStorage).load().willReturn(nil) @@ -33,7 +33,7 @@ struct SkillsCheckTests { } @Test func `check shows unavailable message`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() let mockStorage = MockSkillConfigStorage() given(mockRepo).check().willReturn(.unavailable) given(mockStorage).load().willReturn(nil) diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsInstallTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsInstallTests.swift index 0c0df305..77044d81 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsInstallTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsInstallTests.swift @@ -7,7 +7,7 @@ import Testing struct SkillsInstallTests { @Test func `install specific skill by name`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() given(mockRepo).install(name: .value("asc-cli")).willReturn("Installed asc-cli") let cmd = try SkillsInstall.parse(["--name", "asc-cli"]) @@ -17,7 +17,7 @@ struct SkillsInstallTests { } @Test func `install all skills when --all flag is used`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() given(mockRepo).installAll().willReturn("Installed 5 skills") let cmd = try SkillsInstall.parse(["--all"]) @@ -27,7 +27,7 @@ struct SkillsInstallTests { } @Test func `install all skills when no flags provided`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() given(mockRepo).installAll().willReturn("Installed all skills") let cmd = try SkillsInstall.parse([]) diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsListTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsListTests.swift index 081b2135..46945489 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SkillsListTests { @Test func `list shows available skills from repo`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() given(mockRepo).listAvailable().willReturn("asc-cli\nasc-auth\nasc-testflight") let cmd = try SkillsList.parse([]) diff --git a/Tests/ASCCommandTests/Commands/Skills/SkillsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Skills/SkillsUpdateTests.swift index 5b559403..3fb31601 100644 --- a/Tests/ASCCommandTests/Commands/Skills/SkillsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Skills/SkillsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SkillsUpdateTests { @Test func `update returns output from skills CLI`() async throws { - let mockRepo = MockSkillRepository() + let mockRepo = MockSkills() given(mockRepo).update().willReturn("Updated 3 skills") let cmd = try SkillsUpdate.parse([]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift index 4e1f6ab1..d84a41a4 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupLocalizationsListTests { @Test func `lists localizations and returns them with affordances`() async throws { - let mockRepo = MockSubscriptionGroupLocalizationRepository() + let mockRepo = MockSubscriptionGroupLocalizations() given(mockRepo).listLocalizations(groupId: .any).willReturn([ SubscriptionGroupLocalization(id: "loc-1", groupId: "grp-1", locale: "en-US", name: "Premium") ]) @@ -39,7 +39,7 @@ struct SubscriptionGroupLocalizationsListTests { struct SubscriptionGroupLocalizationsCreateTests { @Test func `create posts groupId, locale, name and customAppName`() async throws { - let mockRepo = MockSubscriptionGroupLocalizationRepository() + let mockRepo = MockSubscriptionGroupLocalizations() given(mockRepo).createLocalization(groupId: .any, locale: .any, name: .any, customAppName: .any) .willReturn(SubscriptionGroupLocalization( id: "loc-new", groupId: "grp-1", locale: "en-US", @@ -67,7 +67,7 @@ struct SubscriptionGroupLocalizationsCreateTests { struct SubscriptionGroupLocalizationsUpdateTests { @Test func `update passes localizationId, name and customAppName`() async throws { - let mockRepo = MockSubscriptionGroupLocalizationRepository() + let mockRepo = MockSubscriptionGroupLocalizations() given(mockRepo).updateLocalization(localizationId: .any, name: .any, customAppName: .any) .willReturn(SubscriptionGroupLocalization(id: "loc-1", groupId: "", locale: "en-US", name: "Renamed")) @@ -89,7 +89,7 @@ struct SubscriptionGroupLocalizationsUpdateTests { struct SubscriptionGroupLocalizationsDeleteTests { @Test func `delete calls repo with localization id`() async throws { - let mockRepo = MockSubscriptionGroupLocalizationRepository() + let mockRepo = MockSubscriptionGroupLocalizations() given(mockRepo).deleteLocalization(localizationId: .any).willReturn(()) let cmd = try SubscriptionGroupLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift index f4d7e419..f2c64e28 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupVersionsListTests { @Test func `listed subscription group versions show the command to add them to a submission`() async throws { - let mockRepo = MockProductVersionRepository() + let mockRepo = MockProductVersions() given(mockRepo).listSubscriptionGroupVersions(groupId: .value("grp-1")).willReturn([ ProductVersion(id: "gv-1", productId: "grp-1", kind: .subscriptionGroup, version: 1, state: .prepareForSubmission), ]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift index e46cc6aa..dda5f201 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupsCreateTests { @Test func `creates subscription group and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionGroupRepository() + let mockRepo = MockSubscriptionGroups() given(mockRepo).createSubscriptionGroup(appId: .any, referenceName: .any) .willReturn(SubscriptionGroup( id: "grp-new", diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift index 1bc668a7..b25ed191 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupsDeleteTests { @Test func `delete subscription group calls repo with group id`() async throws { - let mockRepo = MockSubscriptionGroupRepository() + let mockRepo = MockSubscriptionGroups() given(mockRepo).deleteSubscriptionGroup(groupId: .any).willReturn(()) let cmd = try SubscriptionGroupsDelete.parse(["--group-id", "grp-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift index d40fbae2..88b44919 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupsListTests { @Test func `listed subscription groups include appId, referenceName and affordances`() async throws { - let mockRepo = MockSubscriptionGroupRepository() + let mockRepo = MockSubscriptionGroups() given(mockRepo).listSubscriptionGroups(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ SubscriptionGroup(id: "grp-1", appId: "app-1", referenceName: "Premium Plans") diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift index 91dc3de4..6cb328bb 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupsUpdateTests { @Test func `updates subscription group reference name and returns updated record`() async throws { - let mockRepo = MockSubscriptionGroupRepository() + let mockRepo = MockSubscriptionGroups() given(mockRepo).updateSubscriptionGroup(groupId: .any, referenceName: .any) .willReturn(SubscriptionGroup(id: "grp-1", appId: "", referenceName: "Renamed Plans")) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift index 8254467a..109f7a51 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionLocalizationsCreateTests { @Test func `creates subscription localization with name and description and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionLocalizationRepository() + let mockRepo = MockSubscriptionLocalizations() given(mockRepo).createLocalization(subscriptionId: .any, locale: .any, name: .any, description: .any) .willReturn(SubscriptionLocalization( id: "loc-new", @@ -47,7 +47,7 @@ struct SubscriptionLocalizationsCreateTests { } @Test func `creates subscription localization without description omits description from json`() async throws { - let mockRepo = MockSubscriptionLocalizationRepository() + let mockRepo = MockSubscriptionLocalizations() given(mockRepo).createLocalization(subscriptionId: .any, locale: .any, name: .any, description: .any) .willReturn(SubscriptionLocalization( id: "loc-new", diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift index 34bd2216..88fe9290 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionLocalizationsDeleteTests { @Test func `delete localization calls repo with localization id`() async throws { - let mockRepo = MockSubscriptionLocalizationRepository() + let mockRepo = MockSubscriptionLocalizations() given(mockRepo).deleteLocalization(localizationId: .any).willReturn(()) let cmd = try SubscriptionLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift index dc583b09..20700a69 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionLocalizationsListTests { @Test func `listed subscription localizations include subscriptionId, locale, name and affordances`() async throws { - let mockRepo = MockSubscriptionLocalizationRepository() + let mockRepo = MockSubscriptionLocalizations() given(mockRepo).listLocalizations(subscriptionId: .any) .willReturn([ SubscriptionLocalization( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift index 764694fc..445fbacf 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionLocalizationsUpdateTests { @Test func `updates subscription localization name and description and returns updated record with affordances`() async throws { - let mockRepo = MockSubscriptionLocalizationRepository() + let mockRepo = MockSubscriptionLocalizations() given(mockRepo).updateLocalization(localizationId: .any, name: .any, description: .any) .willReturn(SubscriptionLocalization( id: "loc-1", diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift index cd10dc09..97197c40 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeCustomCodesCreateTests { @Test func `creates custom code and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createCustomCode( offerCodeId: .any, customCode: .any, numberOfCodes: .any, expirationDate: .any diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift index f5c08f5a..1835b8d0 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeCustomCodesListTests { @Test func `listed custom codes include customCode numberOfCodes and affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listCustomCodes(offerCodeId: .any) .willReturn([ SubscriptionOfferCodeCustomCode( @@ -31,7 +31,7 @@ struct SubscriptionOfferCodeCustomCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listCustomCodes(offerCodeId: .any) .willReturn([ SubscriptionOfferCodeCustomCode( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift index 07bd864e..3d4ca48c 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeCustomCodesUpdateTests { @Test func `deactivates custom code and returns updated result`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).updateCustomCode(customCodeId: .any, isActive: .any) .willReturn(SubscriptionOfferCodeCustomCode( id: "cc-1", @@ -25,7 +25,7 @@ struct SubscriptionOfferCodeCustomCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() let cmd = try SubscriptionOfferCodeCustomCodesUpdate.parse(["--custom-code-id", "cc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift index 81be6fe6..d8570cb9 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeOneTimeCodesCreateTests { @Test func `creates one-time codes and returns result with affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(SubscriptionOfferCodeOneTimeUseCode( @@ -32,7 +32,7 @@ struct SubscriptionOfferCodeOneTimeCodesCreateTests { } @Test func `defaults environment to production when flag omitted`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(SubscriptionOfferCodeOneTimeUseCode( @@ -59,7 +59,7 @@ struct SubscriptionOfferCodeOneTimeCodesCreateTests { } @Test func `forwards sandbox environment to repository`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(SubscriptionOfferCodeOneTimeUseCode( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift index d1fdcf3b..b65687f8 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeOneTimeCodesListTests { @Test func `listed one-time codes include numberOfCodes active and affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any) .willReturn([ SubscriptionOfferCodeOneTimeUseCode( @@ -29,7 +29,7 @@ struct SubscriptionOfferCodeOneTimeCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any) .willReturn([ SubscriptionOfferCodeOneTimeUseCode( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift index 16c636f4..8388366b 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeOneTimeCodesUpdateTests { @Test func `deactivates one-time code and returns updated result`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).updateOneTimeUseCode(oneTimeCodeId: .any, isActive: .any) .willReturn(SubscriptionOfferCodeOneTimeUseCode( id: "otc-1", @@ -24,7 +24,7 @@ struct SubscriptionOfferCodeOneTimeCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() let cmd = try SubscriptionOfferCodeOneTimeCodesUpdate.parse(["--one-time-code-id", "otc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift index 7875201b..57d91d57 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeOneTimeCodesValuesTests { @Test func `returns CSV redemption values from repo`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).fetchOneTimeUseCodeValues(oneTimeCodeId: .any).willReturn("CODE1\nCODE2\n") let cmd = try SubscriptionOfferCodeOneTimeCodesValues.parse(["--one-time-code-id", "otc-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift index 910f1691..3fc74547 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodesCreateTests { @Test func `creates offer code and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createOfferCode( subscriptionId: .any, name: .any, customerEligibilities: .any, offerEligibility: .any, duration: .any, offerMode: .any, @@ -44,7 +44,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `forwards paid prices and isAutoRenewEnabled true by default`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createOfferCode( subscriptionId: .any, name: .any, customerEligibilities: .any, offerEligibility: .any, duration: .any, offerMode: .any, @@ -81,7 +81,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `forwards isAutoRenewEnabled false when flag set`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createOfferCode( subscriptionId: .any, name: .any, customerEligibilities: .any, offerEligibility: .any, duration: .any, offerMode: .any, @@ -114,7 +114,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `throws for invalid duration`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() let cmd = try SubscriptionOfferCodesCreate.parse([ "--subscription-id", "sub-1", "--name", "TEST", @@ -130,7 +130,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `throws for invalid mode`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() let cmd = try SubscriptionOfferCodesCreate.parse([ "--subscription-id", "sub-1", "--name", "TEST", @@ -146,7 +146,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `throws for invalid eligibility`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() let cmd = try SubscriptionOfferCodesCreate.parse([ "--subscription-id", "sub-1", "--name", "TEST", @@ -162,7 +162,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `throws for invalid offer eligibility`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() let cmd = try SubscriptionOfferCodesCreate.parse([ "--subscription-id", "sub-1", "--name", "TEST", diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift index ff6b2661..787cf0e7 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodesListTests { @Test func `listed offer codes include name duration mode active and affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listOfferCodes(subscriptionId: .any) .willReturn([ SubscriptionOfferCode( @@ -55,7 +55,7 @@ struct SubscriptionOfferCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listOfferCodes(subscriptionId: .any) .willReturn([ SubscriptionOfferCode( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift index 7a37bbb1..7c89b659 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodesPricesListTests { @Test func `lists subscription offer code prices with affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listPrices(offerCodeId: .any).willReturn([ SubscriptionOfferCodePrice(id: "p-1", offerCodeId: "oc-1", territory: "USA", subscriptionPricePointId: "spp-7") ]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift index afb739ac..f5a08305 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodesUpdateTests { @Test func `deactivates offer code and returns updated result`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).updateOfferCode(offerCodeId: .any, isActive: .any) .willReturn(SubscriptionOfferCode( id: "oc-1", @@ -29,7 +29,7 @@ struct SubscriptionOfferCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() let cmd = try SubscriptionOfferCodesUpdate.parse(["--offer-code-id", "oc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift index 93779d7c..964fbd7c 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOffersCreateTests { @Test func `creates free trial offer and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() given(mockRepo).createIntroductoryOffer( subscriptionId: .any, duration: .any, offerMode: .any, numberOfPeriods: .any, startDate: .any, endDate: .any, @@ -49,7 +49,7 @@ struct SubscriptionOffersCreateTests { } @Test func `throws for invalid duration`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() let cmd = try SubscriptionOffersCreate.parse([ "--subscription-id", "sub-1", "--duration", "DAILY", @@ -62,7 +62,7 @@ struct SubscriptionOffersCreateTests { } @Test func `throws for invalid mode`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() let cmd = try SubscriptionOffersCreate.parse([ "--subscription-id", "sub-1", "--duration", "ONE_MONTH", @@ -75,7 +75,7 @@ struct SubscriptionOffersCreateTests { } @Test func `throws when PAY_AS_YOU_GO missing price point id`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() let cmd = try SubscriptionOffersCreate.parse([ "--subscription-id", "sub-1", "--duration", "ONE_MONTH", @@ -88,7 +88,7 @@ struct SubscriptionOffersCreateTests { } @Test func `throws when PAY_UP_FRONT missing price point id`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() let cmd = try SubscriptionOffersCreate.parse([ "--subscription-id", "sub-1", "--duration", "ONE_MONTH", @@ -101,7 +101,7 @@ struct SubscriptionOffersCreateTests { } @Test func `succeeds when PAY_AS_YOU_GO with price point id`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() given(mockRepo).createIntroductoryOffer( subscriptionId: .any, duration: .any, offerMode: .any, numberOfPeriods: .any, startDate: .any, endDate: .any, diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift index 5477e489..85a28632 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOffersDeleteTests { @Test func `delete introductory offer calls repo with offer id`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() given(mockRepo).deleteIntroductoryOffer(offerId: .any).willReturn(()) let cmd = try SubscriptionOffersDelete.parse(["--offer-id", "offer-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift index 4a4b6bbc..21828c8d 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOffersListTests { @Test func `listed offers include subscriptionId duration mode and affordances`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() given(mockRepo).listIntroductoryOffers(subscriptionId: .any) .willReturn([ SubscriptionIntroductoryOffer( @@ -42,7 +42,7 @@ struct SubscriptionOffersListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() given(mockRepo).listIntroductoryOffers(subscriptionId: .any) .willReturn([ SubscriptionIntroductoryOffer( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift index adeeb93a..0139f92c 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionPromotionalOffersListTests { @Test func `lists promotional offers with affordances`() async throws { - let mockRepo = MockSubscriptionPromotionalOfferRepository() + let mockRepo = MockSubscriptionPromotionalOffers() given(mockRepo).listPromotionalOffers(subscriptionId: .any).willReturn([ SubscriptionPromotionalOffer( id: "po-1", subscriptionId: "sub-1", name: "Winback", @@ -45,7 +45,7 @@ struct SubscriptionPromotionalOffersListTests { struct SubscriptionPromotionalOffersCreateTests { @Test func `parses --price specs into territory and pricePointId`() async throws { - let mockRepo = MockSubscriptionPromotionalOfferRepository() + let mockRepo = MockSubscriptionPromotionalOffers() given(mockRepo).createPromotionalOffer( subscriptionId: .any, name: .any, offerCode: .any, duration: .any, offerMode: .any, numberOfPeriods: .any, prices: .any @@ -83,7 +83,7 @@ struct SubscriptionPromotionalOffersCreateTests { } @Test func `throws when --price spec is malformed`() async throws { - let mockRepo = MockSubscriptionPromotionalOfferRepository() + let mockRepo = MockSubscriptionPromotionalOffers() let cmd = try SubscriptionPromotionalOffersCreate.parse([ "--subscription-id", "sub-1", "--name", "Winback", @@ -103,7 +103,7 @@ struct SubscriptionPromotionalOffersCreateTests { struct SubscriptionPromotionalOffersDeleteTests { @Test func `delete calls repo with offer id`() async throws { - let mockRepo = MockSubscriptionPromotionalOfferRepository() + let mockRepo = MockSubscriptionPromotionalOffers() given(mockRepo).deletePromotionalOffer(offerId: .any).willReturn(()) let cmd = try SubscriptionPromotionalOffersDelete.parse(["--offer-id", "po-1"]) @@ -117,7 +117,7 @@ struct SubscriptionPromotionalOffersDeleteTests { struct SubscriptionPromotionalOffersPricesListTests { @Test func `lists prices with affordances`() async throws { - let mockRepo = MockSubscriptionPromotionalOfferRepository() + let mockRepo = MockSubscriptionPromotionalOffers() given(mockRepo).listPrices(offerId: .any).willReturn([ SubscriptionPromotionalOfferPrice(id: "p-1", offerId: "po-1", territory: "USA", subscriptionPricePointId: "spp-1") ]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift index 016472cb..bb6832a1 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionReviewScreenshotGetTests { @Test func `returns the screenshot when present`() async throws { - let mockRepo = MockSubscriptionReviewRepository() + let mockRepo = MockSubscriptionReviewAssets() given(mockRepo).getReviewScreenshot(subscriptionId: .any).willReturn( SubscriptionReviewScreenshot(id: "rs-1", subscriptionId: "sub-1", fileName: "review.png", fileSize: 1234) ) @@ -24,7 +24,7 @@ struct SubscriptionReviewScreenshotGetTests { struct SubscriptionReviewScreenshotDeleteTests { @Test func `delete calls repo with screenshot id`() async throws { - let mockRepo = MockSubscriptionReviewRepository() + let mockRepo = MockSubscriptionReviewAssets() given(mockRepo).deleteReviewScreenshot(screenshotId: .any).willReturn(()) let cmd = try SubscriptionReviewScreenshotDelete.parse(["--screenshot-id", "rs-1"]) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift index 3a460f40..14a8fa81 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionAvailabilityCreateTests { @Test func `create availability shows created record with territories and currency`() async throws { - let mockRepo = MockSubscriptionAvailabilityRepository() + let mockRepo = MockSubscriptionAvailabilities() given(mockRepo).createAvailability(subscriptionId: .any, isAvailableInNewTerritories: .any, territoryIds: .any) .willReturn(SubscriptionAvailability( id: "avail-new", diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift index c27f2eaa..91c2ddc9 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionAvailabilityGetTests { @Test func `get availability shows subscriptionId, territories with currency and affordances`() async throws { - let mockRepo = MockSubscriptionAvailabilityRepository() + let mockRepo = MockSubscriptionAvailabilities() given(mockRepo).getAvailability(subscriptionId: .any) .willReturn(SubscriptionAvailability( id: "avail-1", diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift index 8a2370fe..fbd50d8c 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionPricePointsListTests { @Test func `listed price points include subscriptionId, territory, prices and affordances`() async throws { - let mockRepo = MockSubscriptionPriceRepository() + let mockRepo = MockSubscriptionPrices() given(mockRepo).listPricePoints(subscriptionId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [ SubscriptionPricePoint( @@ -54,7 +54,7 @@ struct SubscriptionPricePointsListTests { } @Test func `passes nil territory when flag omitted`() async throws { - let mockRepo = MockSubscriptionPriceRepository() + let mockRepo = MockSubscriptionPrices() given(mockRepo).listPricePoints(subscriptionId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [], nextCursor: nil)) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift index e368b8e3..63034481 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionPricesSetTests { @Test func `set price posts subscriptionId, territory and pricePointId`() async throws { - let mockRepo = MockSubscriptionPriceRepository() + let mockRepo = MockSubscriptionPrices() given(mockRepo).setPrice( subscriptionId: .any, territory: .any, pricePointId: .any, startDate: .any, preserveCurrentPrice: .any @@ -30,7 +30,7 @@ struct SubscriptionPricesSetTests { } @Test func `start-date and preserve-current-price flag pass through`() async throws { - let mockRepo = MockSubscriptionPriceRepository() + let mockRepo = MockSubscriptionPrices() given(mockRepo).setPrice( subscriptionId: .any, territory: .any, pricePointId: .any, startDate: .any, preserveCurrentPrice: .any diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift index d0e8102d..4540abd0 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionVersionsListTests { @Test func `listed subscription versions in review do not offer adding them to a submission`() async throws { - let mockRepo = MockProductVersionRepository() + let mockRepo = MockProductVersions() given(mockRepo).listSubscriptionVersions(subscriptionId: .value("sub-1")).willReturn([ ProductVersion(id: "sv-1", productId: "sub-1", kind: .subscription, version: 2, state: .waitingForReview), ]) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift index d0fb0578..7fd136b2 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsCreateTests { @Test func `creates subscription and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).createSubscription(groupId: .any, name: .any, productId: .any, period: .any, isFamilySharable: .any, groupLevel: .any) .willReturn(Subscription( id: "sub-new", @@ -68,7 +68,7 @@ struct SubscriptionsCreateTests { } @Test func `throws for invalid subscription period`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() let cmd = try SubscriptionsCreate.parse([ "--group-id", "grp-1", "--name", "Monthly", diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift index 1616c709..a2bab913 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsDeleteTests { @Test func `delete subscription calls repo with subscription id`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).deleteSubscription(subscriptionId: .any).willReturn(()) let cmd = try SubscriptionsDelete.parse(["--subscription-id", "sub-1"]) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift index 3127ea7d..a505812f 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsListTests { @Test func `listed subscriptions include groupId, period, state and affordances`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).listSubscriptions(groupId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ Subscription( @@ -64,7 +64,7 @@ struct SubscriptionsListTests { } @Test func `listed subscription with reviewNote surfaces it in JSON output`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).listSubscriptions(groupId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ Subscription( @@ -86,7 +86,7 @@ struct SubscriptionsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).listSubscriptions(groupId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ Subscription( @@ -108,7 +108,7 @@ struct SubscriptionsListTests { } @Test func `should show multi-seat status and markets when App Store Connect sends them`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).listSubscriptions(groupId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ Subscription( diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift index 2759e6d3..d0d8930f 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsSubmitTests { @Test func `submitted subscription includes id, subscriptionId and affordances`() async throws { - let mockRepo = MockSubscriptionSubmissionRepository() + let mockRepo = MockSubscriptionSubmissions() given(mockRepo).submitSubscription(subscriptionId: .any) .willReturn(SubscriptionSubmission(id: "submit-1", subscriptionId: "sub-1")) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift index 3788a161..1f06edfd 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsUnsubmitTests { @Test func `unsubmit deletes submission by id`() async throws { - let mockRepo = MockSubscriptionSubmissionRepository() + let mockRepo = MockSubscriptionSubmissions() given(mockRepo).deleteSubmission(submissionId: .any).willReturn(()) let cmd = try SubscriptionsUnsubmit.parse(["--submission-id", "sub-submit-1"]) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift index c3de583d..2279fda3 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsUpdateTests { @Test func `updates subscription name and review note and returns updated record`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any @@ -37,7 +37,7 @@ struct SubscriptionsUpdateTests { } @Test func `family-sharable flag passes true to repo`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any @@ -58,7 +58,7 @@ struct SubscriptionsUpdateTests { } @Test func `group-level passes through to repo`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any @@ -79,7 +79,7 @@ struct SubscriptionsUpdateTests { } @Test func `period passes through to repo`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any @@ -100,7 +100,7 @@ struct SubscriptionsUpdateTests { } @Test func `should show the multi-seat status and markets App Store Connect saved when updating`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any diff --git a/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift b/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift index 34a15bc4..dc6a0e28 100644 --- a/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift @@ -7,7 +7,7 @@ import Testing struct TerritoriesListTests { @Test func `listed territories show id, currency and affordances`() async throws { - let mockRepo = MockTerritoryRepository() + let mockRepo = MockTerritories() given(mockRepo).listTerritories() .willReturn([ Territory(id: "USA", currency: "USD"), diff --git a/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift b/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift index 466030f9..19b32834 100644 --- a/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaGroupsListTests { @Test func `groups list includes affordances and appId in json output`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).listBetaGroups(appId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaGroup(id: "g-1", appId: "app-1", name: "External Testers", isInternalGroup: false), @@ -55,7 +55,7 @@ struct BetaGroupsListTests { struct BetaGroupsCreateTests { @Test func `groups create external returns group with affordances`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo) .createBetaGroup(appId: .any, name: .any, isInternalGroup: .any, publicLinkEnabled: .any, feedbackEnabled: .any) .willReturn(BetaGroup(id: "g-new", appId: "app-1", name: "External Beta", isInternalGroup: false, publicLinkEnabled: true)) @@ -89,7 +89,7 @@ struct BetaGroupsCreateTests { } @Test func `groups create internal flag marks group as internal`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo) .createBetaGroup(appId: .any, name: .any, isInternalGroup: .any, publicLinkEnabled: .any, feedbackEnabled: .any) .willReturn(BetaGroup(id: "g-int", appId: "app-1", name: "Company Team", isInternalGroup: true)) @@ -127,7 +127,7 @@ struct BetaGroupsCreateTests { struct BetaTestersListTests { @Test func `testers list includes affordances and groupId in json output`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).listBetaTesters(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaTester(id: "t-1", groupId: "g-1", firstName: "Jane", lastName: "Doe", email: "jane@example.com", inviteType: .email), @@ -158,7 +158,7 @@ struct BetaTestersListTests { } @Test func `testers list omits nil optional fields from json output`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).listBetaTesters(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaTester(id: "t-1", groupId: "g-1", firstName: "Unknown", lastName: nil, email: nil, inviteType: nil), @@ -190,7 +190,7 @@ struct BetaTestersListTests { struct BetaTestersAddTests { @Test func `testers add returns created tester with affordances`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).addBetaTester(groupId: .any, email: .any, firstName: .any, lastName: .any).willReturn( BetaTester(id: "t-new", groupId: "g-1", firstName: "New", lastName: nil, email: "new@example.com", inviteType: .email) ) @@ -222,7 +222,7 @@ struct BetaTestersAddTests { struct BetaTestersRemoveTests { @Test func `testers remove returns confirmation message`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).removeBetaTester(groupId: .any, testerId: .any).willReturn() let cmd = try BetaTestersRemove.parse(["--beta-group-id", "g-1", "--tester-id", "t-1"]) @@ -236,7 +236,7 @@ struct BetaTestersRemoveTests { struct BetaTestersImportTests { @Test func `testers import parses csv and adds each tester`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).addBetaTester(groupId: .any, email: .any, firstName: .any, lastName: .any) .willReturn(BetaTester(id: "t-1", groupId: "g-1", firstName: "Jane", lastName: "Doe", email: "jane@example.com")) given(mockRepo).addBetaTester(groupId: .any, email: .any, firstName: .any, lastName: .any) @@ -281,7 +281,7 @@ struct BetaTestersImportTests { } @Test func `testers import skips header row and empty lines`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).addBetaTester(groupId: .any, email: .any, firstName: .any, lastName: .any) .willReturn(BetaTester(id: "t-1", groupId: "g-1", email: "single@example.com")) @@ -316,7 +316,7 @@ struct BetaTestersImportTests { struct BetaTestersExportTests { @Test func `testers export formats testers as csv`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).listBetaTesters(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaTester(id: "t-1", groupId: "g-1", firstName: "Jane", lastName: "Doe", email: "jane@example.com"), @@ -335,7 +335,7 @@ struct BetaTestersExportTests { } @Test func `testers export handles nil name fields as empty strings in csv`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).listBetaTesters(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaTester(id: "t-1", groupId: "g-1", firstName: nil, lastName: nil, email: "anon@example.com"), diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift index 11bc2d2c..1ef2ce8a 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift @@ -7,7 +7,7 @@ import Testing struct UserInvitationsCancelTests { @Test func `cancel calls repository with invitation id`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).cancelUserInvitation(id: .value("inv-1")).willReturn() let cmd = try UserInvitationsCancel.parse(["--invitation-id", "inv-1"]) diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift index bf1ae4ce..0da0cbe8 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift @@ -7,7 +7,7 @@ import Testing struct UserInvitationsInviteTests { @Test func `invite returns invitation record with affordances`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).inviteUser( email: .any, firstName: .any, @@ -41,7 +41,7 @@ struct UserInvitationsInviteTests { } @Test func `invite rejects invalid role`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() let cmd = try UserInvitationsInvite.parse([ "--email", "x@example.com", @@ -55,7 +55,7 @@ struct UserInvitationsInviteTests { } @Test func `invite with all-apps-visible passes flag to repository`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).inviteUser( email: .any, firstName: .any, @@ -89,7 +89,7 @@ struct UserInvitationsInviteTests { } @Test func `invite role filter applied to invitations list`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).listUserInvitations(role: .value(.developer)).willReturn([ UserInvitationRecord( id: "inv-3", diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift index c7760b94..daa8c8bc 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct UserInvitationsListTests { @Test func `listed invitations include email roles and cancel affordance`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).listUserInvitations(role: .any).willReturn([ UserInvitationRecord( id: "inv-1", diff --git a/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift index e7e0cab5..73f1e7b7 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift @@ -7,7 +7,7 @@ import Testing struct UsersListTests { @Test func `listed users include roles and affordances`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).listUsers(role: .any).willReturn([ TeamMember( id: "u-1", @@ -32,7 +32,7 @@ struct UsersListTests { } @Test func `table output includes username and roles`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).listUsers(role: .any).willReturn([ TeamMember( id: "u-1", @@ -54,7 +54,7 @@ struct UsersListTests { } @Test func `role filter is passed to repository`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).listUsers(role: .value(.developer)).willReturn([ TeamMember( id: "u-2", diff --git a/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift index 75205cda..3cd9f630 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift @@ -7,7 +7,7 @@ import Testing struct UsersRemoveTests { @Test func `remove calls repository with user id`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).removeUser(id: .value("u-1")).willReturn() let cmd = try UsersRemove.parse(["--user-id", "u-1"]) diff --git a/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift index 8cb5b3b6..7c553e13 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct UsersUpdateTests { @Test func `update returns team member with new roles`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).updateUser(id: .any, roles: .any).willReturn( TeamMember( id: "u-1", @@ -28,7 +28,7 @@ struct UsersUpdateTests { } @Test func `update rejects invalid role`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() let cmd = try UsersUpdate.parse(["--user-id", "u-1", "--role", "INVALID"]) await #expect(throws: (any Error).self) { @@ -37,7 +37,7 @@ struct UsersUpdateTests { } @Test func `update passes multiple roles to repository`() async throws { - let mockRepo = MockUserRepository() + let mockRepo = MockUsers() given(mockRepo).updateUser(id: .any, roles: .any).willReturn( TeamMember( id: "u-1", diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift index 03fa82ba..b1a6697c 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionLocalizationsCreateTests { @Test func `created localization is returned with affordances`() async throws { - let mockRepo = MockVersionLocalizationRepository() + let mockRepo = MockVersionLocalizations() given(mockRepo).createLocalization(versionId: .any, locale: .any).willReturn( AppStoreVersionLocalization(id: "loc-new", versionId: "v-1", locale: "en-US") ) @@ -35,7 +35,7 @@ struct VersionLocalizationsCreateTests { } @Test func `created zh-Hans localization returns correct locale`() async throws { - let mockRepo = MockVersionLocalizationRepository() + let mockRepo = MockVersionLocalizations() given(mockRepo).createLocalization(versionId: .any, locale: .any).willReturn( AppStoreVersionLocalization(id: "loc-new", versionId: "v-99", locale: "zh-Hans") ) diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift index 7aa63d3b..b2843570 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionLocalizationsListTests { @Test func `listed localizations include affordances for navigation`() async throws { - let mockRepo = MockVersionLocalizationRepository() + let mockRepo = MockVersionLocalizations() given(mockRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v-1", locale: "en-US"), AppStoreVersionLocalization(id: "loc-2", versionId: "v-1", locale: "zh-Hans"), diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift index 568f6ffa..2f94f5e3 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionLocalizationsUpdateTests { @Test func `updated localization is returned with whatsNew text`() async throws { - let mockRepo = MockVersionLocalizationRepository() + let mockRepo = MockVersionLocalizations() given(mockRepo).updateLocalization( localizationId: .any, whatsNew: .any, @@ -53,7 +53,7 @@ struct VersionLocalizationsUpdateTests { } @Test func `update with all optional fields returns full content`() async throws { - let mockRepo = MockVersionLocalizationRepository() + let mockRepo = MockVersionLocalizations() given(mockRepo).updateLocalization( localizationId: .any, whatsNew: .any, diff --git a/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift b/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift index 539cfc2c..c924cc61 100644 --- a/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionReviewDetailGetTests { @Test func `get review detail returns affordances and all fields`() async throws { - let mockRepo = MockReviewDetailRepository() + let mockRepo = MockReviewDetails() given(mockRepo).getReviewDetail(versionId: .any).willReturn( AppStoreReviewDetail( id: "rd-1", @@ -45,7 +45,7 @@ struct VersionReviewDetailGetTests { } @Test func `get review detail omits nil optional fields from JSON`() async throws { - let mockRepo = MockReviewDetailRepository() + let mockRepo = MockReviewDetails() given(mockRepo).getReviewDetail(versionId: .any).willReturn( AppStoreReviewDetail(id: "rd-empty", versionId: "v-2", demoAccountRequired: false) ) @@ -75,7 +75,7 @@ struct VersionReviewDetailGetTests { struct VersionReviewDetailUpdateTests { @Test func `update review detail returns updated record with affordances`() async throws { - let mockRepo = MockReviewDetailRepository() + let mockRepo = MockReviewDetails() given(mockRepo).upsertReviewDetail(versionId: .any, update: .any).willReturn( AppStoreReviewDetail( id: "rd-2", diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift index 4a233b77..c2f153d7 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift @@ -76,9 +76,9 @@ struct VersionsCheckReadinessTests { ) } - private func makeAnsweredAgeRating() -> (MockAppInfoRepository, MockAgeRatingDeclarationRepository) { - let appInfoRepo = MockAppInfoRepository() - let ageRatingRepo = MockAgeRatingDeclarationRepository() + private func makeAnsweredAgeRating() -> (MockAppInfos, MockAgeRatingDeclarations) { + let appInfoRepo = MockAppInfos() + let ageRatingRepo = MockAgeRatingDeclarations() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([makeAppInfo()]) given(ageRatingRepo).getDeclaration(appInfoId: .value("info-1")).willReturn(makeDeclaration()) return (appInfoRepo, ageRatingRepo) @@ -86,16 +86,16 @@ struct VersionsCheckReadinessTests { /// Runs the check on an otherwise ready version, with the given age rating setup. private func checkReadyVersion( - appInfoRepo: MockAppInfoRepository, - ageRatingRepo: MockAgeRatingDeclarationRepository + appInfoRepo: MockAppInfos, + ageRatingRepo: MockAgeRatingDeclarations ) async throws -> String { - let mockVersionRepo = MockVersionRepository() - let mockAppRepo = MockAppRepository() - let mockBuildRepo = MockBuildRepository() - let mockReviewDetailRepo = MockReviewDetailRepository() - let mockLocalizationRepo = MockVersionLocalizationRepository() - let mockScreenshotRepo = MockScreenshotRepository() - let mockPricingRepo = MockPricingRepository() + let mockVersionRepo = MockAppStoreVersions() + let mockAppRepo = MockApps() + let mockBuildRepo = MockBuilds() + let mockReviewDetailRepo = MockReviewDetails() + let mockLocalizationRepo = MockVersionLocalizations() + let mockScreenshotRepo = MockAppScreenshots() + let mockPricingRepo = MockAppPrices() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) given(mockVersionRepo).getVersion(id: .value("v-123")).willReturn(makeEditable()) given(mockBuildRepo).getBuild(id: .value("build-55")).willReturn(makeBuild()) @@ -120,8 +120,8 @@ struct VersionsCheckReadinessTests { // MARK: - Tests @Test func `should not be ready and should name social media when it is unanswered`() async throws { - let appInfoRepo = MockAppInfoRepository() - let ageRatingRepo = MockAgeRatingDeclarationRepository() + let appInfoRepo = MockAppInfos() + let ageRatingRepo = MockAgeRatingDeclarations() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([makeAppInfo()]) given(ageRatingRepo).getDeclaration(appInfoId: .value("info-1")).willReturn(makeDeclaration(isSocialMedia: nil)) @@ -138,8 +138,8 @@ struct VersionsCheckReadinessTests { } @Test func `should read the age rating of the app info being prepared, not the live one`() async throws { - let appInfoRepo = MockAppInfoRepository() - let ageRatingRepo = MockAgeRatingDeclarationRepository() + let appInfoRepo = MockAppInfos() + let ageRatingRepo = MockAgeRatingDeclarations() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([ makeAppInfo(id: "info-live", state: "READY_FOR_DISTRIBUTION"), makeAppInfo(id: "info-1", state: "PREPARE_FOR_SUBMISSION"), @@ -153,8 +153,8 @@ struct VersionsCheckReadinessTests { } @Test func `should read the age rating of a rejected app info rather than the live one`() async throws { - let appInfoRepo = MockAppInfoRepository() - let ageRatingRepo = MockAgeRatingDeclarationRepository() + let appInfoRepo = MockAppInfos() + let ageRatingRepo = MockAgeRatingDeclarations() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([ makeAppInfo(id: "info-live", state: "READY_FOR_DISTRIBUTION"), makeAppInfo(id: "info-1", state: "REJECTED"), @@ -168,23 +168,23 @@ struct VersionsCheckReadinessTests { } @Test func `should not be ready when the app has no app info to read an age rating from`() async throws { - let appInfoRepo = MockAppInfoRepository() + let appInfoRepo = MockAppInfos() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([]) - let output = try await checkReadyVersion(appInfoRepo: appInfoRepo, ageRatingRepo: MockAgeRatingDeclarationRepository()) + let output = try await checkReadyVersion(appInfoRepo: appInfoRepo, ageRatingRepo: MockAgeRatingDeclarations()) #expect(output.contains(#""isReadyToSubmit" : false"#)) #expect(output.contains(#""message" : "No app info found to read the age rating from""#)) } @Test func `version with valid build and pricing is ready to submit`() async throws { - let mockVersionRepo = MockVersionRepository() - let mockAppRepo = MockAppRepository() - let mockBuildRepo = MockBuildRepository() - let mockReviewDetailRepo = MockReviewDetailRepository() - let mockLocalizationRepo = MockVersionLocalizationRepository() - let mockScreenshotRepo = MockScreenshotRepository() - let mockPricingRepo = MockPricingRepository() + let mockVersionRepo = MockAppStoreVersions() + let mockAppRepo = MockApps() + let mockBuildRepo = MockBuilds() + let mockReviewDetailRepo = MockReviewDetails() + let mockLocalizationRepo = MockVersionLocalizations() + let mockScreenshotRepo = MockAppScreenshots() + let mockPricingRepo = MockAppPrices() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) @@ -263,13 +263,13 @@ struct VersionsCheckReadinessTests { } @Test func `version without linked build is not ready to submit`() async throws { - let mockVersionRepo = MockVersionRepository() - let mockAppRepo = MockAppRepository() - let mockBuildRepo = MockBuildRepository() - let mockReviewDetailRepo = MockReviewDetailRepository() - let mockLocalizationRepo = MockVersionLocalizationRepository() - let mockScreenshotRepo = MockScreenshotRepository() - let mockPricingRepo = MockPricingRepository() + let mockVersionRepo = MockAppStoreVersions() + let mockAppRepo = MockApps() + let mockBuildRepo = MockBuilds() + let mockReviewDetailRepo = MockReviewDetails() + let mockLocalizationRepo = MockVersionLocalizations() + let mockScreenshotRepo = MockAppScreenshots() + let mockPricingRepo = MockAppPrices() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) @@ -335,13 +335,13 @@ struct VersionsCheckReadinessTests { } @Test func `live version is not editable so cannot submit`() async throws { - let mockVersionRepo = MockVersionRepository() - let mockAppRepo = MockAppRepository() - let mockBuildRepo = MockBuildRepository() - let mockReviewDetailRepo = MockReviewDetailRepository() - let mockLocalizationRepo = MockVersionLocalizationRepository() - let mockScreenshotRepo = MockScreenshotRepository() - let mockPricingRepo = MockPricingRepository() + let mockVersionRepo = MockAppStoreVersions() + let mockAppRepo = MockApps() + let mockBuildRepo = MockBuilds() + let mockReviewDetailRepo = MockReviewDetails() + let mockLocalizationRepo = MockVersionLocalizations() + let mockScreenshotRepo = MockAppScreenshots() + let mockPricingRepo = MockAppPrices() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) @@ -418,13 +418,13 @@ struct VersionsCheckReadinessTests { } @Test func `secondary locale without screenshots does not block submission`() async throws { - let mockVersionRepo = MockVersionRepository() - let mockAppRepo = MockAppRepository() - let mockBuildRepo = MockBuildRepository() - let mockReviewDetailRepo = MockReviewDetailRepository() - let mockLocalizationRepo = MockVersionLocalizationRepository() - let mockScreenshotRepo = MockScreenshotRepository() - let mockPricingRepo = MockPricingRepository() + let mockVersionRepo = MockAppStoreVersions() + let mockAppRepo = MockApps() + let mockBuildRepo = MockBuilds() + let mockReviewDetailRepo = MockReviewDetails() + let mockLocalizationRepo = MockVersionLocalizations() + let mockScreenshotRepo = MockAppScreenshots() + let mockPricingRepo = MockAppPrices() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) @@ -518,13 +518,13 @@ struct VersionsCheckReadinessTests { } @Test func `missing review contact does not block submission`() async throws { - let mockVersionRepo = MockVersionRepository() - let mockAppRepo = MockAppRepository() - let mockBuildRepo = MockBuildRepository() - let mockReviewDetailRepo = MockReviewDetailRepository() - let mockLocalizationRepo = MockVersionLocalizationRepository() - let mockScreenshotRepo = MockScreenshotRepository() - let mockPricingRepo = MockPricingRepository() + let mockVersionRepo = MockAppStoreVersions() + let mockAppRepo = MockApps() + let mockBuildRepo = MockBuilds() + let mockReviewDetailRepo = MockReviewDetails() + let mockLocalizationRepo = MockVersionLocalizations() + let mockScreenshotRepo = MockAppScreenshots() + let mockPricingRepo = MockAppPrices() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift index 8157c33b..c92d0328 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionsCreateTests { @Test func `created iOS version is returned in prepare for submission state`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).createVersion(appId: .any, versionString: .any, platform: .any).willReturn( AppStoreVersion(id: "v-new", appId: "app-1", versionString: "2.0.0", platform: .iOS, state: .prepareForSubmission) ) @@ -39,7 +39,7 @@ struct VersionsCreateTests { } @Test func `created macOS version returns version with macOS platform`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).createVersion(appId: .any, versionString: .any, platform: .any).willReturn( AppStoreVersion(id: "v-1", appId: "app-42", versionString: "3.1.0", platform: .macOS, state: .prepareForSubmission) ) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift index 9cad6ee8..7f52f202 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionsListTests { @Test func `live version includes navigation affordances`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).listVersions(appId: .any).willReturn([ AppStoreVersion(id: "v-1", appId: "app-1", versionString: "2.3.0", platform: .iOS, state: .readyForSale), ]) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift index 3cdef952..c359d648 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift @@ -12,7 +12,7 @@ struct VersionsSetBuildTests { } @Test func `execute links build to version`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).setBuild(versionId: .any, buildId: .any).willReturn() let cmd = try VersionsSetBuild.parse(["--version-id", "v-1", "--build-id", "build-42"]) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift index 77ad9654..f369fc1d 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionsSubmitTests { @Test func `submitted version returns submission in waitingForReview state`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).submitVersion(versionId: .any).willReturn( ReviewSubmission( id: "sub-1", @@ -41,28 +41,28 @@ struct VersionsSubmitTests { // MARK: - --with-products - private func planner(iapRepo: MockInAppPurchaseRepository, versionRepo: MockProductVersionRepository) -> SubmissionPlanner { - let groups = MockSubscriptionGroupRepository() + private func planner(iapRepo: MockInAppPurchases, versionRepo: MockProductVersions) -> SubmissionPlanner { + let groups = MockSubscriptionGroups() given(groups).listSubscriptionGroups(appId: .any, limit: .any).willReturn(PaginatedResponse(data: [])) return SubmissionPlanner(iapRepo: iapRepo, groupRepo: groups, - subscriptionRepo: MockSubscriptionRepository(), productVersionRepo: versionRepo) + subscriptionRepo: MockSubscriptions(), productVersionRepo: versionRepo) } - private func readyLifetimeIAP() -> (MockInAppPurchaseRepository, MockProductVersionRepository) { - let iaps = MockInAppPurchaseRepository() + private func readyLifetimeIAP() -> (MockInAppPurchases, MockProductVersions) { + let iaps = MockInAppPurchases() given(iaps).listInAppPurchases(appId: .any, limit: .any).willReturn(PaginatedResponse(data: [ InAppPurchase(id: "iap-1", appId: "app-1", referenceName: "Lifetime", productId: "com.app.lifetime", type: .nonConsumable, state: .readyToSubmit), ])) - let versions = MockProductVersionRepository() + let versions = MockProductVersions() given(versions).listInAppPurchaseVersions(iapId: .any).willReturn([ ProductVersion(id: "iv-1", productId: "iap-1", kind: .inAppPurchase, version: 1, state: .prepareForSubmission), ]) return (iaps, versions) } - private func appVersionRepo() -> MockVersionRepository { - let repo = MockVersionRepository() + private func appVersionRepo() -> MockAppStoreVersions { + let repo = MockAppStoreVersions() given(repo).getVersion(id: .value("v-1")).willReturn( AppStoreVersion(id: "v-1", appId: "app-1", versionString: "1.0", platform: .iOS, state: .prepareForSubmission) ) @@ -71,7 +71,7 @@ struct VersionsSubmitTests { @Test func `a dry run lists what would go to review with the app version and submits nothing`() async throws { let (iaps, versions) = readyLifetimeIAP() - let submissions = MockSubmissionRepository() + let submissions = MockReviewSubmissions() let cmd = try VersionsSubmit.parse(["--version-id", "v-1", "--with-products", "--dry-run", "--pretty"]) let output = try await cmd.executeWithProducts( @@ -108,7 +108,7 @@ struct VersionsSubmitTests { @Test func `with products the app version and ready products are submitted together`() async throws { let (iaps, versions) = readyLifetimeIAP() - let submissions = MockSubmissionRepository() + let submissions = MockReviewSubmissions() given(submissions).createSubmission(appId: .any, platform: .any).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview) ) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift index 7c68e20d..4bee6d12 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionsUpdateTests { @Test func `updated version returns new version string with editable affordances`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).updateVersion( id: .any, versionString: .any, @@ -45,7 +45,7 @@ struct VersionsUpdateTests { } @Test func `copyright flag is forwarded to repo update`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).updateVersion( id: .any, versionString: .any, copyright: .any, releaseType: .any, earliestReleaseDate: .any ).willReturn( @@ -72,7 +72,7 @@ struct VersionsUpdateTests { } @Test func `release type and earliest release date flags are forwarded to repo update`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).updateVersion( id: .any, versionString: .any, copyright: .any, releaseType: .any, earliestReleaseDate: .any ).willReturn( @@ -101,7 +101,7 @@ struct VersionsUpdateTests { } @Test func `version flag stays optional when omitted`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).updateVersion( id: .any, versionString: .any, copyright: .any, releaseType: .any, earliestReleaseDate: .any ).willReturn( diff --git a/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift index 87903f85..9dedd30a 100644 --- a/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift @@ -10,7 +10,7 @@ struct AppShotsControllerTests { // MARK: - Templates list @Test func `templates list returns data with _links`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).listTemplates(size: .any).willReturn([ makeTemplate(id: "hero", name: "Hero"), ]) @@ -25,7 +25,7 @@ struct AppShotsControllerTests { // MARK: - Themes list @Test func `themes list returns data with _links`() async throws { - let mockRepo = MockThemeRepository() + let mockRepo = MockThemes() given(mockRepo).listThemes().willReturn([ makeTheme(id: "neon", name: "Neon"), ]) diff --git a/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift index c05dfca8..cd5210f3 100644 --- a/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift @@ -8,7 +8,7 @@ import Mockable struct AppsControllerTests { @Test func `apps list with include icon attaches iconAsset per app`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() let asset = ImageAsset( templateUrl: "https://cdn.example.com/a/{w}x{h}bb.{f}", width: 512, @@ -33,7 +33,7 @@ struct AppsControllerTests { } @Test func `app infos list returns JSON with _links and data wrapper`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo).listAppInfos(appId: .any).willReturn([ AppInfo(id: "ai-1", appId: "42", primaryCategoryId: "6014"), ]) @@ -49,7 +49,7 @@ struct AppsControllerTests { } @Test func `app info localizations list returns JSON with _links and fields`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo).listLocalizations(appInfoId: .any).willReturn([ AppInfoLocalization( id: "loc-1", @@ -75,7 +75,7 @@ struct AppsControllerTests { } @Test func `age rating get returns JSON with _links and data wrapper`() async throws { - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() given(mockRepo).getDeclaration(appInfoId: .any).willReturn( AgeRatingDeclaration(id: "rating-1", appInfoId: "ai-1", isGambling: false) ) @@ -93,7 +93,7 @@ struct AppsControllerTests { } @Test func `app info update returns updated record with category ids`() async throws { - let mockRepo = MockAppInfoRepository() + let mockRepo = MockAppInfos() given(mockRepo) .updateCategories( id: .any, @@ -131,7 +131,7 @@ struct AppsControllerTests { } @Test func `apps list without include icon omits iconAsset`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ App(id: "42", name: "MyApp", bundleId: "com.test"), diff --git a/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift index 50fcab03..fb558388 100644 --- a/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift @@ -7,7 +7,7 @@ import Testing struct AssetLibraryControllerTests { @Test func `should place the image sent over REST on the localization`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).createPlacement( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), mediaType: .value(.image), assetId: .value("img-1"), placementType: .value(.appScreenshot), placementGroup: .value("IPHONE_67") @@ -23,7 +23,7 @@ struct AssetLibraryControllerTests { } @Test func `should place a video sent over REST on a treatment localization`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).createPlacement( surface: .value(.experimentTreatmentLocalization), localizationId: .value("tl-1"), mediaType: .value(.video), assetId: .value("vid-1"), placementType: .value(.appPreview), placementGroup: .value("IPHONE_67") @@ -39,7 +39,7 @@ struct AssetLibraryControllerTests { } @Test func `should rename and archive an image over REST with the same fields as the CLI`() async throws { - let mockRepo = MockLibraryImageRepository() + let mockRepo = MockLibraryImages() given(mockRepo).updateImage(libraryId: .value("lib-1"), imageId: .value("img-1"), referenceName: .value("Home"), isArchived: .value(true)) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 1, category: .appScreenshotsAndPreviews, state: .archived, referenceName: "Home")) @@ -53,12 +53,12 @@ struct AssetLibraryControllerTests { @Test func `should refuse a REST image update that changes nothing`() async throws { await #expect(throws: AssetLibraryController.BadRequest("Provide referenceName or archived")) { - _ = try await AssetLibraryController.updateImage(imageId: "img-1", json: ["libraryId": "lib-1"], repo: MockLibraryImageRepository()) + _ = try await AssetLibraryController.updateImage(imageId: "img-1", json: ["libraryId": "lib-1"], repo: MockLibraryImages()) } } @Test func `should refuse a REST placement that names no asset or an unknown placement type`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() await #expect(throws: AssetLibraryController.BadRequest("Provide imageId or videoId, placementType and placementGroup")) { _ = try await AssetLibraryController.createPlacement( @@ -69,7 +69,7 @@ struct AssetLibraryControllerTests { } @Test func `should reorder the group in the order sent over REST`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() given(mockRepo).reorderPlacements( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), placementGroup: .value("IPHONE_67"), placementIds: .value(["pl-2", "pl-1"]) @@ -84,7 +84,7 @@ struct AssetLibraryControllerTests { } @Test func `should refuse a REST reorder without a group or placements`() async throws { - let mockRepo = MockAssetPlacementRepository() + let mockRepo = MockAssetPlacements() await #expect(throws: AssetLibraryController.BadRequest("Provide placementGroup and placementIds")) { _ = try await AssetLibraryController.reorderPlacements( diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift index 2df17a33..615572a2 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift @@ -12,7 +12,7 @@ import Testing struct AgeRatingRoutesTests { @Test func `should save the social media answers over REST`() async throws { - let repo = MockAgeRatingDeclarationRepository() + let repo = MockAgeRatingDeclarations() given(repo).updateDeclaration(id: .value("decl-1"), update: .any).willProduce { id, update in AgeRatingDeclaration( id: id, diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift index 94b296d8..6234793b 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift @@ -11,7 +11,7 @@ import Testing struct CustomProductPagePlacementRoutesTests { @Test func `should place a header image on a custom product page localization over REST`() async throws { - let placementRepo = MockAssetPlacementRepository() + let placementRepo = MockAssetPlacements() given(placementRepo).createPlacement( surface: .value(.customProductPageLocalization), localizationId: .value("cpl-1"), mediaType: .value(.image), assetId: .value("img-1"), placementType: .value(.productPageHeaderAsset), placementGroup: .value("DEFAULT_PROFILE") @@ -33,7 +33,7 @@ struct CustomProductPagePlacementRoutesTests { } @Test func `should list a custom product page localization's placements over REST`() async throws { - let placementRepo = MockAssetPlacementRepository() + let placementRepo = MockAssetPlacements() given(placementRepo).listPlacements( surface: .value(.customProductPageLocalization), localizationId: .value("cpl-1"), placementType: .value(.appStoreSearchResultsAsset), placementGroup: .value(nil) @@ -58,12 +58,12 @@ struct CustomProductPagePlacementRoutesTests { _ method: HTTPRequest.Method, _ uri: String, body: String? = nil, - placementRepo: MockAssetPlacementRepository + placementRepo: MockAssetPlacements ) async throws -> (HTTPResponse.Status, String) { let router = Router(context: BasicWebSocketRequestContext.self) AssetLibraryController( - libraryRepo: MockAssetLibraryRepository(), imageRepo: MockLibraryImageRepository(), - videoRepo: MockLibraryVideoRepository(), placementRepo: placementRepo + libraryRepo: MockAssetLibraries(), imageRepo: MockLibraryImages(), + videoRepo: MockLibraryVideos(), placementRepo: placementRepo ).addRoutes(to: router.group("/api/v1")) return try await Application(router: router).test(.router) { client in try await client.execute( diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift index 8077d8da..1fdae25d 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift @@ -10,7 +10,7 @@ import Testing struct ScreenshotDeleteRoutesTests { @Test func `should confirm the screenshot was deleted over REST`() async throws { - let repo = MockScreenshotRepository() + let repo = MockAppScreenshots() given(repo).deleteScreenshot(screenshotId: .value("shot-1")).willReturn() let (status, body) = try await Self.delete("/api/v1/screenshots/shot-1") { @@ -22,7 +22,7 @@ struct ScreenshotDeleteRoutesTests { } @Test func `should confirm the screenshot set was deleted over REST`() async throws { - let repo = MockScreenshotRepository() + let repo = MockAppScreenshots() given(repo).deleteScreenshotSet(setId: .value("set-1")).willReturn() let (status, body) = try await Self.delete("/api/v1/screenshot-sets/set-1") { diff --git a/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift index bd8d5f42..727cfde4 100644 --- a/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift @@ -7,8 +7,8 @@ import Testing struct GameCenterControllerTests { /// Stubs App Store Connect so the created achievement echoes what it was sent. - private func achievementEchoingRepo() -> MockGameCenterRepository { - let mockRepo = MockGameCenterRepository() + private func achievementEchoingRepo() -> MockGameCenter { + let mockRepo = MockGameCenter() given(mockRepo).createAchievement( gameCenterDetailId: .any, referenceName: .any, vendorIdentifier: .any, points: .any, isShowBeforeEarned: .any, isRepeatable: .any @@ -23,8 +23,8 @@ struct GameCenterControllerTests { } /// Stubs App Store Connect so the created leaderboard echoes what it was sent. - private func leaderboardEchoingRepo() -> MockGameCenterRepository { - let mockRepo = MockGameCenterRepository() + private func leaderboardEchoingRepo() -> MockGameCenter { + let mockRepo = MockGameCenter() given(mockRepo).createLeaderboard( gameCenterDetailId: .any, referenceName: .any, vendorIdentifier: .any, scoreSortType: .any, submissionType: .any @@ -76,7 +76,7 @@ struct GameCenterControllerTests { _ = try await GameCenterController.createAchievement( detailId: "gc-1", json: ["referenceName": "First Win", "vendorIdentifier": "com.example.first-win"], - repo: MockGameCenterRepository() + repo: MockGameCenter() ) } } @@ -119,7 +119,7 @@ struct GameCenterControllerTests { _ = try await GameCenterController.createLeaderboard( detailId: "gc-1", json: ["referenceName": "All Time High", "vendorIdentifier": "com.example.high-score", "scoreSortType": "SIDEWAYS"], - repo: MockGameCenterRepository() + repo: MockGameCenter() ) } } @@ -132,7 +132,7 @@ struct GameCenterControllerTests { "referenceName": "All Time High", "vendorIdentifier": "com.example.high-score", "scoreSortType": "DESC", "submissionType": "AVERAGE_SCORE", ], - repo: MockGameCenterRepository() + repo: MockGameCenter() ) } } diff --git a/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift index bf7a4fc3..d0ff9a1e 100644 --- a/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift @@ -12,7 +12,7 @@ struct RESTRoutesTests { // MARK: - Apps @Test func `apps list returns JSON with _links`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [App(id: "42", name: "MyApp", bundleId: "com.test")]) ) @@ -24,7 +24,7 @@ struct RESTRoutesTests { } @Test func `apps list returns data wrapper`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [App(id: "1", name: "Test", bundleId: "com.test")]) ) @@ -35,7 +35,7 @@ struct RESTRoutesTests { // MARK: - Versions @Test func `versions list returns JSON with _links`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).listVersions(appId: .any).willReturn([ AppStoreVersion(id: "v-1", appId: "42", versionString: "1.0", platform: .iOS, state: .prepareForSubmission), ]) @@ -46,7 +46,7 @@ struct RESTRoutesTests { } @Test func `plugins updates list returns outdated entries with apply links`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).listOutdated().willReturn([ PluginUpdate(name: "Hello", installedVersion: "1.0.0", latestVersion: "1.2.0"), ]) @@ -58,7 +58,7 @@ struct RESTRoutesTests { } @Test func `plugins update returns the freshly installed plugin`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).update(name: .value("Hello")).willReturn( Plugin(id: "Hello.plugin", name: "Hello", version: "1.2.0", isInstalled: true, slug: "Hello.plugin") ) @@ -69,7 +69,7 @@ struct RESTRoutesTests { } @Test func `plugins install returns the installed plugin in data wrapper`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).install(name: .any).willReturn( Plugin(id: "Hello.plugin", name: "Hello", version: "1.0", author: "me", isInstalled: true, slug: "Hello.plugin") ) @@ -81,7 +81,7 @@ struct RESTRoutesTests { } @Test func `plugins market search returns filtered list under data wrapper`() async throws { - let mockRepo = MockPluginRepository() + let mockRepo = MockPlugins() given(mockRepo).searchAvailable(query: .value("hello")).willReturn([ Plugin(id: "Hello.plugin", name: "Hello", version: "1.0", author: "me"), ]) @@ -121,7 +121,7 @@ struct RESTRoutesTests { } @Test func `age-rating update returns JSON with _links`() async throws { - let mockRepo = MockAgeRatingDeclarationRepository() + let mockRepo = MockAgeRatingDeclarations() given(mockRepo).updateDeclaration(id: .any, update: .any).willReturn( AgeRatingDeclaration(id: "decl-1", appInfoId: "info-42", isAdvertising: false) ) @@ -135,7 +135,7 @@ struct RESTRoutesTests { } @Test func `apps update returns JSON with _links and contentRightsDeclaration`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).updateContentRights(appId: .any, declaration: .any).willReturn( App(id: "42", name: "Bakery", bundleId: "com.example", contentRightsDeclaration: .doesNotUseThirdPartyContent) ) @@ -150,7 +150,7 @@ struct RESTRoutesTests { } @Test func `versions update returns JSON with _links`() async throws { - let mockRepo = MockVersionRepository() + let mockRepo = MockAppStoreVersions() given(mockRepo).updateVersion( id: .any, versionString: .any, @@ -172,7 +172,7 @@ struct RESTRoutesTests { // MARK: - Version Localizations @Test func `version localizations list returns JSON with _links`() async throws { - let mockRepo = MockVersionLocalizationRepository() + let mockRepo = MockVersionLocalizations() given(mockRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v-1", locale: "en-US", description: "A great app"), ]) @@ -200,7 +200,7 @@ struct RESTRoutesTests { // MARK: - Simulators @Test func `simulators list returns JSON with _links`() async throws { - let mockRepo = MockSimulatorRepository() + let mockRepo = MockSimulators() given(mockRepo).listSimulators(filter: .any).willReturn([ Simulator(id: "ABC-123", name: "iPhone 15", state: .booted, runtime: "iOS 17.0"), ]) @@ -213,7 +213,7 @@ struct RESTRoutesTests { // MARK: - Builds @Test func `builds list returns JSON with _links`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [Build(id: "b-1", version: "1.0", expired: false, processingState: .valid)]) ) @@ -224,7 +224,7 @@ struct RESTRoutesTests { } @Test func `builds set-encryption-compliance REST output contains updated build`() async throws { - let mockRepo = MockBuildRepository() + let mockRepo = MockBuilds() given(mockRepo).updateBuildEncryptionCompliance(buildId: .any, usesNonExemptEncryption: .any) .willReturn(Build(id: "b-1", version: "1.0", expired: false, processingState: .valid, usesNonExemptEncryption: false)) let output = try await BuildsSetEncryptionCompliance.parse([ @@ -240,7 +240,7 @@ struct RESTRoutesTests { // MARK: - TestFlight @Test func `testflight groups list returns JSON with _links`() async throws { - let mockRepo = MockTestFlightRepository() + let mockRepo = MockTestFlight() given(mockRepo).listBetaGroups(appId: .any, limit: .any).willReturn( PaginatedResponse(data: [BetaGroup(id: "g-1", appId: "42", name: "External Testers", isInternalGroup: false)]) ) @@ -253,7 +253,7 @@ struct RESTRoutesTests { // MARK: - Beta App Localizations @Test func `beta app localizations list returns JSON with _links to parent app`() async throws { - let mockRepo = MockBetaAppLocalizationRepository() + let mockRepo = MockBetaAppLocalizations() given(mockRepo).listBetaAppLocalizations(appId: .any).willReturn([ BetaAppLocalization(id: "bal-1", appId: "42", locale: "en-US", description: "Welcome", feedbackEmail: "beta@example.com"), ]) @@ -266,7 +266,7 @@ struct RESTRoutesTests { } @Test func `beta app localizations get returns _links for actions on this localization`() async throws { - let mockRepo = MockBetaAppLocalizationRepository() + let mockRepo = MockBetaAppLocalizations() given(mockRepo).getBetaAppLocalization(localizationId: .any).willReturn( BetaAppLocalization(id: "bal-7", appId: "99", locale: "ja", description: "ベータ") ) @@ -280,14 +280,14 @@ struct RESTRoutesTests { // MARK: - App Shots @Test func `templates list returns data wrapper`() async throws { - let mockRepo = MockTemplateRepository() + let mockRepo = MockTemplates() given(mockRepo).listTemplates(size: .any).willReturn([]) let output = try await AppShotsTemplatesList.parse(["--pretty"]).execute(repo: mockRepo, affordanceMode: .rest) #expect(output.contains("\"data\"")) } @Test func `themes list returns data wrapper`() async throws { - let mockRepo = MockThemeRepository() + let mockRepo = MockThemes() given(mockRepo).listThemes().willReturn([]) let output = try await AppShotsThemesList.parse(["--pretty"]).execute(repo: mockRepo, affordanceMode: .rest) #expect(output.contains("\"data\"")) @@ -296,7 +296,7 @@ struct RESTRoutesTests { // MARK: - Review Submissions @Test func `review submissions list returns JSON with _links`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissions(appId: .any, states: .any, limit: .any).willReturn([ ReviewSubmission(id: "sub-1", appId: "42", platform: .iOS, state: .waitingForReview), ]) @@ -312,7 +312,7 @@ struct RESTRoutesTests { } @Test func `review submissions get returns JSON with _links`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).getSubmission(id: .value("sub-1")).willReturn( ReviewSubmission(id: "sub-1", appId: "42", platform: .iOS, state: .unresolvedIssues) ) @@ -326,7 +326,7 @@ struct RESTRoutesTests { } @Test func `review submission items list returns JSON with _links for parent and version`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).listSubmissionItems(submissionId: .value("sub-1")).willReturn([ ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .rejected, linkedResourceId: "v-9", linkedResourceType: .appStoreVersion), @@ -344,7 +344,7 @@ struct RESTRoutesTests { // MARK: - Certificates REST filters @Test func `certificates list accepts limit via rest mode`() async throws { - let mockRepo = MockCertificateRepository() + let mockRepo = MockCertificates() given(mockRepo).listCertificates(certificateType: .any, limit: .value(200)).willReturn([ Certificate(id: "cert-1", name: "Dist", certificateType: .iosDistribution), ]) @@ -365,7 +365,7 @@ struct RESTRoutesTests { // MARK: - Promoted Purchases @Test func `promoted purchases list returns JSON with _links pointing at REST paths`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() given(mockRepo).listPromotedPurchases(appId: .any, limit: .any).willReturn( PaginatedResponse(data: [ PromotedPurchase( @@ -389,7 +389,7 @@ struct RESTRoutesTests { // MARK: - Subscription Group Localizations @Test func `subscription group localizations REST exposes nested path under group`() async throws { - let mockRepo = MockSubscriptionGroupLocalizationRepository() + let mockRepo = MockSubscriptionGroupLocalizations() given(mockRepo).listLocalizations(groupId: .any).willReturn([ SubscriptionGroupLocalization(id: "loc-1", groupId: "grp-7", locale: "en-US", name: "Premium") ]) @@ -404,7 +404,7 @@ struct RESTRoutesTests { } @Test func `subscription group localization create returns JSON with _links`() async throws { - let mockRepo = MockSubscriptionGroupLocalizationRepository() + let mockRepo = MockSubscriptionGroupLocalizations() given(mockRepo).createLocalization(groupId: .any, locale: .any, name: .any, customAppName: .any) .willReturn(SubscriptionGroupLocalization( id: "loc-1", groupId: "grp-7", locale: "en-US", name: "Premium" @@ -423,7 +423,7 @@ struct RESTRoutesTests { // MARK: - Review uploads (IAP + Subscription) @Test func `iap review screenshot upload returns JSON with _links pointing at iap-review-screenshot`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).uploadReviewScreenshot(iapId: .any, fileURL: .any).willReturn( InAppPurchaseReviewScreenshot(id: "rs-1", iapId: "iap-7", fileName: "shot.png", fileSize: 1024, assetState: .complete) ) @@ -438,7 +438,7 @@ struct RESTRoutesTests { } @Test func `iap image upload returns JSON with _links pointing at iap-images`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).uploadImage(iapId: .any, fileURL: .any).willReturn( InAppPurchasePromotionalImage(id: "img-1", iapId: "iap-7", fileName: "promo.jpg", fileSize: 2048, state: .uploadComplete) ) @@ -453,7 +453,7 @@ struct RESTRoutesTests { } @Test func `subscription review screenshot upload returns JSON with _links pointing at subscription-review-screenshot`() async throws { - let mockRepo = MockSubscriptionReviewRepository() + let mockRepo = MockSubscriptionReviewAssets() given(mockRepo).uploadReviewScreenshot(subscriptionId: .any, fileURL: .any).willReturn( SubscriptionReviewScreenshot(id: "srs-1", subscriptionId: "sub-7", fileName: "shot.png", fileSize: 1024, assetState: .complete) ) @@ -468,7 +468,7 @@ struct RESTRoutesTests { } @Test func `subscription image upload returns JSON with _links pointing at subscription-images`() async throws { - let mockRepo = MockSubscriptionReviewRepository() + let mockRepo = MockSubscriptionReviewAssets() given(mockRepo).uploadImage(subscriptionId: .any, fileURL: .any).willReturn( SubscriptionPromotionalImage(id: "simg-1", subscriptionId: "sub-7", fileName: "promo.jpg", fileSize: 2048, state: .uploadComplete) ) @@ -483,7 +483,7 @@ struct RESTRoutesTests { } @Test func `subscription group localization update returns JSON with _links`() async throws { - let mockRepo = MockSubscriptionGroupLocalizationRepository() + let mockRepo = MockSubscriptionGroupLocalizations() given(mockRepo).updateLocalization(localizationId: .any, name: .any, customAppName: .any) .willReturn(SubscriptionGroupLocalization( id: "loc-1", groupId: "grp-7", locale: "en-US", name: "Renamed" @@ -502,7 +502,7 @@ struct RESTRoutesTests { // MARK: - Subscription Pricing @Test func `subscription price-points REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionPriceRepository() + let mockRepo = MockSubscriptionPrices() given(mockRepo).listPricePoints(subscriptionId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [ SubscriptionPricePoint(id: "spp-1", subscriptionId: "sub-7", territory: "USA", @@ -520,7 +520,7 @@ struct RESTRoutesTests { // MARK: - Subscription Promotional Offers @Test func `subscription promotional offers REST exposes nested paths`() async throws { - let mockRepo = MockSubscriptionPromotionalOfferRepository() + let mockRepo = MockSubscriptionPromotionalOffers() given(mockRepo).listPromotionalOffers(subscriptionId: .any).willReturn([ SubscriptionPromotionalOffer( id: "po-1", subscriptionId: "sub-7", name: "Winback", @@ -541,7 +541,7 @@ struct RESTRoutesTests { // MARK: - Win-Back Offers @Test func `win-back offers REST exposes nested paths under subscription`() async throws { - let mockRepo = MockWinBackOfferRepository() + let mockRepo = MockWinBackOffers() given(mockRepo).listWinBackOffers(subscriptionId: .any).willReturn([ WinBackOffer( id: "wb-1", subscriptionId: "sub-7", @@ -567,7 +567,7 @@ struct RESTRoutesTests { // MARK: - Offer Code Prices @Test func `iap offer code prices REST exposes nested path under offer code`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listPrices(offerCodeId: .any).willReturn([ InAppPurchaseOfferCodePrice(id: "p-1", offerCodeId: "oc-7", territory: "USA", pricePointId: "pp-1") ]) @@ -581,7 +581,7 @@ struct RESTRoutesTests { } @Test func `subscription offer code prices REST exposes nested path under offer code`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listPrices(offerCodeId: .any).willReturn([ SubscriptionOfferCodePrice(id: "p-1", offerCodeId: "oc-7", territory: "USA", subscriptionPricePointId: "spp-1") ]) @@ -597,7 +597,7 @@ struct RESTRoutesTests { // MARK: - One-Time Use Codes (IAP + Subscription) @Test func `IAP one-time codes list REST resolves to nested path under offer code`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any).willReturn([ InAppPurchaseOfferCodeOneTimeUseCode( id: "otc-1", offerCodeId: "oc-7", numberOfCodes: 100, @@ -615,7 +615,7 @@ struct RESTRoutesTests { } @Test func `IAP one-time codes update REST resolves to PATCH on the code id`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).updateOneTimeUseCode(oneTimeCodeId: .any, isActive: .any).willReturn( InAppPurchaseOfferCodeOneTimeUseCode( id: "otc-1", offerCodeId: "oc-7", numberOfCodes: 100, @@ -634,7 +634,7 @@ struct RESTRoutesTests { } @Test func `subscription one-time codes list REST resolves to nested path under offer code`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any).willReturn([ SubscriptionOfferCodeOneTimeUseCode( id: "otc-1", offerCodeId: "oc-7", numberOfCodes: 100, @@ -652,7 +652,7 @@ struct RESTRoutesTests { } @Test func `IAP offer codes create REST emits _links pointing back at parent IAP path`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).createOfferCode( iapId: .any, name: .any, customerEligibilities: .any, prices: .any ).willReturn(InAppPurchaseOfferCode( @@ -673,7 +673,7 @@ struct RESTRoutesTests { } @Test func `subscription offer codes create REST emits _links`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createOfferCode( subscriptionId: .any, name: .any, customerEligibilities: .any, offerEligibility: .any, duration: .any, offerMode: .any, numberOfPeriods: .any, @@ -701,7 +701,7 @@ struct RESTRoutesTests { } @Test func `subscription one-time codes create REST forwards environment to repo and emits _links`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn( @@ -731,7 +731,7 @@ struct RESTRoutesTests { // MARK: - IAP Review Assets @Test func `IAP review screenshot REST returns nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).getReviewScreenshot(iapId: .any).willReturn( InAppPurchaseReviewScreenshot(id: "rs-1", iapId: "iap-7", fileName: "review.png", fileSize: 1234, assetState: .complete) @@ -749,7 +749,7 @@ struct RESTRoutesTests { } @Test func `IAP images REST returns nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseReviewRepository() + let mockRepo = MockInAppPurchaseReviewAssets() given(mockRepo).listImages(iapId: .any).willReturn([ InAppPurchasePromotionalImage(id: "img-1", iapId: "iap-7", fileName: "promo.png", fileSize: 9999, state: .approved) @@ -766,7 +766,7 @@ struct RESTRoutesTests { // MARK: - Subscription Review Asset @Test func `subscription review screenshot REST returns nested path under subscription`() async throws { - let mockRepo = MockSubscriptionReviewRepository() + let mockRepo = MockSubscriptionReviewAssets() given(mockRepo).getReviewScreenshot(subscriptionId: .any).willReturn( SubscriptionReviewScreenshot(id: "rs-1", subscriptionId: "sub-7", fileName: "review.png", fileSize: 1234, assetState: .complete) @@ -784,7 +784,7 @@ struct RESTRoutesTests { } @Test func `promoted purchases REST suppresses update and delete links while in review`() async throws { - let mockRepo = MockPromotedPurchaseRepository() + let mockRepo = MockPromotedPurchases() given(mockRepo).listPromotedPurchases(appId: .any, limit: .any).willReturn( PaginatedResponse(data: [ PromotedPurchase( @@ -809,7 +809,7 @@ struct RESTRoutesTests { // MARK: - IAP detail listings (Localizations, Availability, OfferCodes, PricePoints) @Test func `IAP localizations list REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseLocalizationRepository() + let mockRepo = MockInAppPurchaseLocalizations() given(mockRepo).listLocalizations(iapId: .any).willReturn([ InAppPurchaseLocalization(id: "loc-1", iapId: "iap-7", locale: "en-US", name: "Lifetime", description: "Lifetime pass", state: .approved) ]) @@ -823,7 +823,7 @@ struct RESTRoutesTests { } @Test func `IAP availability get REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseAvailabilityRepository() + let mockRepo = MockInAppPurchaseAvailabilities() given(mockRepo).getAvailability(iapId: .any).willReturn( InAppPurchaseAvailability(id: "avail-1", iapId: "iap-7", isAvailableInNewTerritories: true, @@ -839,7 +839,7 @@ struct RESTRoutesTests { } @Test func `IAP availability create REST emits _links pointing back at parent IAP path`() async throws { - let mockRepo = MockInAppPurchaseAvailabilityRepository() + let mockRepo = MockInAppPurchaseAvailabilities() given(mockRepo).createAvailability(iapId: .any, isAvailableInNewTerritories: .any, territoryIds: .any) .willReturn(InAppPurchaseAvailability( id: "iap-7", iapId: "iap-7", @@ -862,7 +862,7 @@ struct RESTRoutesTests { } @Test func `IAP offer codes list REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseOfferCodeRepository() + let mockRepo = MockInAppPurchaseOfferCodes() given(mockRepo).listOfferCodes(iapId: .any).willReturn([ InAppPurchaseOfferCode(id: "oc-1", iapId: "iap-7", name: "Promo", customerEligibilities: [.nonSpender], isActive: true) ]) @@ -876,7 +876,7 @@ struct RESTRoutesTests { } @Test func `IAP equalizations list REST exposes nested path under price point`() async throws { - let mockRepo = MockInAppPurchasePriceRepository() + let mockRepo = MockInAppPurchasePrices() given(mockRepo).listEqualizations(pricePointId: .any, limit: .any).willReturn([ InAppPurchasePricePoint(id: "pp-USA", iapId: "", territory: "USA", customerPrice: "9.99", proceeds: "6.99"), InAppPurchasePricePoint(id: "pp-JPN", iapId: "", territory: "JPN", customerPrice: "1500", proceeds: "1050"), @@ -892,7 +892,7 @@ struct RESTRoutesTests { } @Test func `IAP price-schedule get REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchasePriceRepository() + let mockRepo = MockInAppPurchasePrices() given(mockRepo).getPriceSchedule(iapId: .any).willReturn( InAppPurchasePriceSchedule(id: "iap-7", iapId: "iap-7") ) @@ -906,7 +906,7 @@ struct RESTRoutesTests { } @Test func `IAP price-schedule get REST returns empty data when no schedule`() async throws { - let mockRepo = MockInAppPurchasePriceRepository() + let mockRepo = MockInAppPurchasePrices() given(mockRepo).getPriceSchedule(iapId: .any).willReturn(nil) let output = try await IAPPriceScheduleGet.parse(["--iap-id", "iap-7", "--pretty"]) @@ -917,7 +917,7 @@ struct RESTRoutesTests { } @Test func `IAP price-points list REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchasePriceRepository() + let mockRepo = MockInAppPurchasePrices() given(mockRepo).listPricePoints(iapId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [ InAppPurchasePricePoint(id: "pp-1", iapId: "iap-7", territory: "USA", customerPrice: "9.99", proceeds: "6.99") @@ -934,7 +934,7 @@ struct RESTRoutesTests { // MARK: - Subscription detail listings (Localizations, Availability, OfferCodes, IntroOffers) @Test func `subscriptions list REST exposes nested path under subscription group`() async throws { - let mockRepo = MockSubscriptionRepository() + let mockRepo = MockSubscriptions() given(mockRepo).listSubscriptions(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ Subscription( @@ -957,7 +957,7 @@ struct RESTRoutesTests { } @Test func `subscription localizations list REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionLocalizationRepository() + let mockRepo = MockSubscriptionLocalizations() given(mockRepo).listLocalizations(subscriptionId: .any).willReturn([ SubscriptionLocalization(id: "loc-1", subscriptionId: "sub-7", locale: "en-US", name: "Premium", description: "Premium plan", state: .approved) ]) @@ -971,7 +971,7 @@ struct RESTRoutesTests { } @Test func `subscription availability get REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionAvailabilityRepository() + let mockRepo = MockSubscriptionAvailabilities() given(mockRepo).getAvailability(subscriptionId: .any).willReturn( SubscriptionAvailability(id: "avail-1", subscriptionId: "sub-7", isAvailableInNewTerritories: true, @@ -987,7 +987,7 @@ struct RESTRoutesTests { } @Test func `subscription offer codes list REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionOfferCodeRepository() + let mockRepo = MockSubscriptionOfferCodes() given(mockRepo).listOfferCodes(subscriptionId: .any).willReturn([ SubscriptionOfferCode(id: "oc-1", subscriptionId: "sub-7", name: "Promo", customerEligibilities: [.new], offerEligibility: .introductory, @@ -1006,7 +1006,7 @@ struct RESTRoutesTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisInAppPurchaseSubmissionRepository() + let mockRepo = MockIrisInAppPurchaseSubmissions() given(mockRepo).submitInAppPurchase( session: .any, iapId: .any, submitWithNextAppStoreVersion: .any ).willReturn( @@ -1027,7 +1027,7 @@ struct RESTRoutesTests { } @Test func `subscription introductory offers list REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionIntroductoryOfferRepository() + let mockRepo = MockSubscriptionIntroductoryOffers() given(mockRepo).listIntroductoryOffers(subscriptionId: .any).willReturn([ SubscriptionIntroductoryOffer(id: "io-1", subscriptionId: "sub-7", duration: .oneMonth, offerMode: .freeTrial, numberOfPeriods: 1) ]) @@ -1046,7 +1046,7 @@ struct RESTRoutesTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisResolutionCenterRepository() + let mockRepo = MockIrisResolutionCenter() given(mockRepo).getResolution(session: .any, submissionId: .value("sub-1")).willReturn( ResolutionCenterDetail(id: "thread-1", submissionId: "sub-1", threadState: "OPEN") ) @@ -1061,7 +1061,7 @@ struct RESTRoutesTests { } @Test func `unresolved submission REST links to the iris resolution-center endpoint`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).getSubmission(id: .value("sub-1")).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .macOS, state: .unresolvedIssues) ) @@ -1076,7 +1076,7 @@ struct RESTRoutesTests { // MARK: - Experiments (Product Page Optimization) @Test func `experiments list returns JSON with _links pointing at REST paths`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any).willReturn( PaginatedResponse(data: [ AppStoreVersionExperiment(id: "exp-1", appId: "app-42", name: "Icon test", platform: .iOS, @@ -1096,7 +1096,7 @@ struct RESTRoutesTests { } @Test func `experiments REST exposes start link for approved unstarted test`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).getExperiment(experimentId: .any).willReturn( AppStoreVersionExperiment(id: "exp-1", appId: "app-42", name: "Icon test", platform: .iOS, trafficProportion: 30, state: .approved) @@ -1111,7 +1111,7 @@ struct RESTRoutesTests { } @Test func `experiment treatments REST exposes nested path under experiment`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listTreatments(experimentId: .any, limit: .any).willReturn( PaginatedResponse(data: [ExperimentTreatment(id: "trt-1", experimentId: "exp-7", name: "Blue icon")], nextCursor: nil) ) @@ -1127,7 +1127,7 @@ struct RESTRoutesTests { } @Test func `experiment treatment localizations REST exposes nested path under treatment`() async throws { - let mockRepo = MockExperimentRepository() + let mockRepo = MockExperiments() given(mockRepo).listTreatmentLocalizations(treatmentId: .any, limit: .any).willReturn([ ExperimentTreatmentLocalization(id: "loc-1", treatmentId: "trt-7", locale: "en-US") ]) @@ -1142,7 +1142,7 @@ struct RESTRoutesTests { } @Test func `app REST links include experiments`() async throws { - let mockRepo = MockAppRepository() + let mockRepo = MockApps() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [App(id: "42", name: "MyApp", bundleId: "com.test")]) ) @@ -1155,7 +1155,7 @@ struct RESTRoutesTests { // MARK: - Product versions @Test func `product version lists return REST links to siblings and to add to a submission`() async throws { - let mockRepo = MockProductVersionRepository() + let mockRepo = MockProductVersions() given(mockRepo).listInAppPurchaseVersions(iapId: .any).willReturn([ ProductVersion(id: "iv-1", productId: "iap-1", kind: .inAppPurchase, version: 1, state: .prepareForSubmission), ]) @@ -1181,7 +1181,7 @@ struct RESTRoutesTests { // MARK: - Building a review submission @Test func `a draft submission links to adding items and submitting, and a new item links to removing it`() async throws { - let mockRepo = MockSubmissionRepository() + let mockRepo = MockReviewSubmissions() given(mockRepo).createSubmission(appId: .any, platform: .any).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview) ) @@ -1203,26 +1203,26 @@ struct RESTRoutesTests { } @Test func `a dry run over REST links each planned product to its versions`() async throws { - let versionRepo = MockVersionRepository() + let versionRepo = MockAppStoreVersions() given(versionRepo).getVersion(id: .any).willReturn( AppStoreVersion(id: "v-1", appId: "app-1", versionString: "1.0", platform: .iOS, state: .prepareForSubmission) ) - let iaps = MockInAppPurchaseRepository() + let iaps = MockInAppPurchases() given(iaps).listInAppPurchases(appId: .any, limit: .any).willReturn(PaginatedResponse(data: [ InAppPurchase(id: "iap-1", appId: "app-1", referenceName: "Lifetime", productId: "com.app.lifetime", type: .nonConsumable, state: .readyToSubmit), ])) - let groups = MockSubscriptionGroupRepository() + let groups = MockSubscriptionGroups() given(groups).listSubscriptionGroups(appId: .any, limit: .any).willReturn(PaginatedResponse(data: [])) - let productVersions = MockProductVersionRepository() + let productVersions = MockProductVersions() given(productVersions).listInAppPurchaseVersions(iapId: .any).willReturn([ ProductVersion(id: "iv-1", productId: "iap-1", kind: .inAppPurchase, version: 1, state: .prepareForSubmission), ]) let planner = SubmissionPlanner(iapRepo: iaps, groupRepo: groups, - subscriptionRepo: MockSubscriptionRepository(), productVersionRepo: productVersions) + subscriptionRepo: MockSubscriptions(), productVersionRepo: productVersions) let output = try await VersionsSubmit.parse(["--version-id", "v-1", "--dry-run"]).executeWithProducts( - submissionRepo: MockSubmissionRepository(), versionRepo: versionRepo, planner: planner, affordanceMode: .rest + submissionRepo: MockReviewSubmissions(), versionRepo: versionRepo, planner: planner, affordanceMode: .rest ).replacingOccurrences(of: "\\/", with: "/") #expect(output.contains("\"_links\"")) @@ -1233,7 +1233,7 @@ struct RESTRoutesTests { // MARK: - App pricing @Test func `app price points link to setting the app's price over REST`() async throws { - let mockRepo = MockPricingRepository() + let mockRepo = MockAppPrices() given(mockRepo).listPricePoints(appId: .any, territory: .any).willReturn([ AppPricePoint(id: "pp-1", appId: "app-1", territory: "USA", customerPrice: "0.0", proceeds: "0.0"), ]) @@ -1249,7 +1249,7 @@ struct RESTRoutesTests { // MARK: - App availability @Test func `app availability links to itself over REST`() async throws { - let repo = MockAppAvailabilityRepository() + let repo = MockAppAvailabilities() given(repo).getAppAvailability(appId: .any).willReturn( AppAvailability(id: "avail-1", appId: "app-42", isAvailableInNewTerritories: true, territories: []) ) @@ -1264,7 +1264,7 @@ struct RESTRoutesTests { // MARK: - Performance overview @Test func `should link the performance overview to itself, app metrics and builds over REST`() async throws { - let repo = MockPerfOverviewRepository() + let repo = MockPerfOverviews() given(repo).getOverview(appId: .any, deviceType: .any).willReturn( PerformanceOverview(appId: "1234567890") ) @@ -1281,7 +1281,7 @@ struct RESTRoutesTests { // MARK: - Performance metrics & diagnostics @Test func `should link an app's metrics to the app's perf-metrics over REST`() async throws { - let repo = MockPerfMetricsRepository() + let repo = MockPerfMetrics() given(repo).listAppMetrics(appId: .any, metricType: .any).willReturn([ PerformanceMetric( id: "app-1-LAUNCH-launchTime", parentId: "app-1", parentType: .app, @@ -1314,7 +1314,7 @@ struct RESTRoutesTests { } @Test func `should link a build's metrics to the build's perf-metrics over REST`() async throws { - let repo = MockPerfMetricsRepository() + let repo = MockPerfMetrics() given(repo).listBuildMetrics(buildId: .any, metricType: .any).willReturn([ PerformanceMetric( id: "build-1-HANG-hangRate", parentId: "build-1", parentType: .build, @@ -1347,7 +1347,7 @@ struct RESTRoutesTests { } @Test func `should link a diagnostic signature to its logs and its build's diagnostics over REST`() async throws { - let repo = MockDiagnosticsRepository() + let repo = MockDiagnostics() given(repo).listSignatures(buildId: .any, diagnosticType: .any).willReturn([ DiagnosticSignatureInfo( id: "sig-1", buildId: "build-1", diagnosticType: .hangs, @@ -1384,7 +1384,7 @@ struct RESTRoutesTests { } @Test func `should link a diagnostic log back to its signature's logs over REST`() async throws { - let repo = MockDiagnosticsRepository() + let repo = MockDiagnostics() given(repo).listLogs(signatureId: .any).willReturn([ DiagnosticLogEntry(id: "sig-1-0-0", signatureId: "sig-1", event: "hang"), ]) @@ -1414,7 +1414,7 @@ struct RESTRoutesTests { // MARK: - Game Center @Test func `should link a game's detail, achievements, leaderboards and blocked players over REST`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).getDetail(appId: .any) .willReturn(GameCenterDetail(id: "gc-1", appId: "app-1", isArcadeEnabled: false)) @@ -1453,7 +1453,7 @@ struct RESTRoutesTests { } @Test func `should link a leaderboard's siblings, delete and score moderation over REST`() async throws { - let mockRepo = MockGameCenterRepository() + let mockRepo = MockGameCenter() given(mockRepo).listLeaderboards(gameCenterDetailId: .any).willReturn([ GameCenterLeaderboard(id: "lb-1", gameCenterDetailId: "gc-1", referenceName: "All Time High", vendorIdentifier: "all_time_high", scoreSortType: .desc, @@ -1495,7 +1495,7 @@ struct RESTRoutesTests { } @Test func `should link block, block player and the score list for a visible score over REST`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).listScoreModerations(leaderboardId: .any, blockedOnly: .any).willReturn([ GameCenterScoreModeration(id: "mod-1", leaderboardId: "lb-1", rank: "1", score: "9999", submittedDate: nil, isBlocked: false, isPreReleased: false, context: nil, @@ -1542,7 +1542,7 @@ struct RESTRoutesTests { } @Test func `should link unblock for a blocked score over REST`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).updateScoreModeration(id: .any, isBlocked: .any).willReturn( GameCenterScoreModeration(id: "mod-1", leaderboardId: nil, rank: nil, score: nil, submittedDate: nil, isBlocked: true, isPreReleased: false, context: nil, @@ -1576,7 +1576,7 @@ struct RESTRoutesTests { } @Test func `should link unblock and the blocked list for a blocked player over REST`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).listBlockedPlayers(gameCenterDetailId: .any).willReturn([ GameCenterPlayer(id: "player-1", gameCenterDetailId: "gc-1", nickname: nil, bundleId: nil, isBlocked: true), ]) @@ -1608,7 +1608,7 @@ struct RESTRoutesTests { } @Test func `should link block for an unblocked player over REST`() async throws { - let mockRepo = MockGameCenterModerationRepository() + let mockRepo = MockGameCenterModeration() given(mockRepo).updatePlayer(id: .any, isBlocked: .any).willReturn( GameCenterPlayer(id: "player-1", gameCenterDetailId: nil, nickname: nil, bundleId: nil, isBlocked: false) ) @@ -1637,7 +1637,7 @@ struct RESTRoutesTests { // MARK: - App Asset Library @Test func `should link the asset library to its images, videos, upload and placement groups over REST`() async throws { - let repo = MockAssetLibraryRepository() + let repo = MockAssetLibraries() given(repo).getAssetLibrary(appId: .any).willReturn(AppAssetLibrary(id: "lib-1", appId: "app-1")) let output = try await AssetLibraryGet.parse(["--app-id", "app-1"]) @@ -1647,7 +1647,7 @@ struct RESTRoutesTests { } @Test func `should link a library image to its placements and deletion over REST`() async throws { - let repo = MockLibraryImageRepository() + let repo = MockLibraryImages() given(repo).listImages(libraryId: .any, imageId: .any, state: .any, category: .any).willReturn([ LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 1, category: .appScreenshotsAndPreviews, state: .inReview), ]) @@ -1659,7 +1659,7 @@ struct RESTRoutesTests { } @Test func `should link a placement to deletion and reordering its group over REST`() async throws { - let repo = MockAssetPlacementRepository() + let repo = MockAssetPlacements() given(repo).listPlacements(surface: .any, localizationId: .any, placementType: .any, placementGroup: .any).willReturn([ AssetPlacement(id: "pl-1", surface: .appStoreVersionLocalization, localizationId: "loc-1", mediaType: .image, assetId: "img-1", placementType: .appScreenshot, placementGroup: "IPHONE_67", position: 1, state: .parentPrepareForSubmission), @@ -1672,7 +1672,7 @@ struct RESTRoutesTests { } @Test func `should link a version localization to its asset placements over REST`() async throws { - let repo = MockVersionLocalizationRepository() + let repo = MockVersionLocalizations() given(repo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v-1", locale: "en-US"), ]) @@ -1684,7 +1684,7 @@ struct RESTRoutesTests { } @Test func `should link a library video to its placements, archiving and deletion over REST`() async throws { - let repo = MockLibraryVideoRepository() + let repo = MockLibraryVideos() given(repo).listVideos(libraryId: .any, videoId: .any, state: .any, category: .any).willReturn([ LibraryVideo(id: "vid-1", libraryId: "lib-1", fileName: "p.mp4", fileSize: 1, category: .appScreenshotsAndPreviews, state: .approved), ]) @@ -1696,7 +1696,7 @@ struct RESTRoutesTests { } @Test func `should link a treatment localization's placements to reordering under the treatment localization over REST`() async throws { - let repo = MockAssetPlacementRepository() + let repo = MockAssetPlacements() given(repo).listPlacements(surface: .any, localizationId: .any, placementType: .any, placementGroup: .any).willReturn([ AssetPlacement(id: "pl-1", surface: .experimentTreatmentLocalization, localizationId: "tl-1", mediaType: .image, assetId: "img-1", placementType: .appScreenshot, placementGroup: "IPHONE_67", position: 1, state: .parentPrepareForSubmission), diff --git a/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift index 1481b692..087831b0 100644 --- a/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift @@ -7,8 +7,8 @@ import Testing struct SubscriptionsControllerTests { /// Stubs App Store Connect so the saved subscription echoes the attributes it was sent. - private func echoingRepo() -> MockSubscriptionRepository { - let mockRepo = MockSubscriptionRepository() + private func echoingRepo() -> MockSubscriptions { + let mockRepo = MockSubscriptions() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any diff --git a/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift b/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift index 0058c866..9fe71a4f 100644 --- a/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift +++ b/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift @@ -18,7 +18,7 @@ private func makeOffer(id: String = "wb-1", subscriptionId: String = "sub-1") -> struct WinBackOffersListTests { @Test func `lists win-back offers with affordances`() async throws { - let mockRepo = MockWinBackOfferRepository() + let mockRepo = MockWinBackOffers() given(mockRepo).listWinBackOffers(subscriptionId: .any).willReturn([makeOffer()]) let cmd = try WinBackOffersList.parse(["--subscription-id", "sub-1", "--pretty"]) @@ -33,7 +33,7 @@ struct WinBackOffersListTests { struct WinBackOffersCreateTests { @Test func `create passes through eligibility, dates and prices`() async throws { - let mockRepo = MockWinBackOfferRepository() + let mockRepo = MockWinBackOffers() given(mockRepo).createWinBackOffer( subscriptionId: .any, referenceName: .any, offerId: .any, duration: .any, offerMode: .any, periodCount: .any, @@ -84,7 +84,7 @@ struct WinBackOffersCreateTests { } @Test func `throws when priority invalid`() async throws { - let mockRepo = MockWinBackOfferRepository() + let mockRepo = MockWinBackOffers() let cmd = try WinBackOffersCreate.parse([ "--subscription-id", "sub-1", "--reference-name", "X", @@ -108,7 +108,7 @@ struct WinBackOffersCreateTests { struct WinBackOffersUpdateTests { @Test func `update passes through optional fields`() async throws { - let mockRepo = MockWinBackOfferRepository() + let mockRepo = MockWinBackOffers() given(mockRepo).updateWinBackOffer( offerId: .any, startDate: .any, endDate: .any, priority: .any, promotionIntent: .any, @@ -143,7 +143,7 @@ struct WinBackOffersUpdateTests { struct WinBackOffersDeleteTests { @Test func `delete calls repo with offer id`() async throws { - let mockRepo = MockWinBackOfferRepository() + let mockRepo = MockWinBackOffers() given(mockRepo).deleteWinBackOffer(offerId: .any).willReturn(()) let cmd = try WinBackOffersDelete.parse(["--offer-id", "wb-1"]) @@ -157,7 +157,7 @@ struct WinBackOffersDeleteTests { struct WinBackOffersPricesListTests { @Test func `lists prices with affordances`() async throws { - let mockRepo = MockWinBackOfferRepository() + let mockRepo = MockWinBackOffers() given(mockRepo).listPrices(offerId: .any).willReturn([ WinBackOfferPrice(id: "p-1", offerId: "wb-1", territory: "USA", subscriptionPricePointId: "spp-1") ]) diff --git a/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift b/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift index b3721ac9..9b1ecd8c 100644 --- a/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift @@ -7,7 +7,7 @@ import Testing struct XcodeCloudProductsListTests { @Test func `listed products include app id and affordances`() async throws { - let mockRepo = MockXcodeCloudProductRepository() + let mockRepo = MockXcodeCloudProducts() given(mockRepo).listProducts(appId: .any).willReturn([ XcodeCloudProduct(id: "prod-1", appId: "app-42", name: "My App CI", productType: .app), ]) @@ -38,7 +38,7 @@ struct XcodeCloudProductsListTests { struct XcodeCloudWorkflowsListTests { @Test func `listed workflows include product id and affordances`() async throws { - let mockRepo = MockXcodeCloudWorkflowRepository() + let mockRepo = MockXcodeCloudWorkflows() given(mockRepo).listWorkflows(productId: .value("prod-1")).willReturn([ XcodeCloudWorkflow(id: "wf-1", productId: "prod-1", name: "CI Build", isEnabled: true, isLockedForEditing: false), ]) @@ -67,7 +67,7 @@ struct XcodeCloudWorkflowsListTests { } @Test func `disabled workflow omits startBuild affordance`() async throws { - let mockRepo = MockXcodeCloudWorkflowRepository() + let mockRepo = MockXcodeCloudWorkflows() given(mockRepo).listWorkflows(productId: .value("prod-1")).willReturn([ XcodeCloudWorkflow(id: "wf-2", productId: "prod-1", name: "Disabled CI", isEnabled: false, isLockedForEditing: false), ]) @@ -99,7 +99,7 @@ struct XcodeCloudWorkflowsListTests { struct XcodeCloudBuildsListTests { @Test func `listed build runs include workflow id and affordances`() async throws { - let mockRepo = MockXcodeCloudBuildRunRepository() + let mockRepo = MockXcodeCloudBuildRuns() given(mockRepo).listBuildRuns(workflowId: .value("wf-1")).willReturn([ XcodeCloudBuildRun( id: "run-1", workflowId: "wf-1", number: 5, @@ -137,7 +137,7 @@ struct XcodeCloudBuildsListTests { struct XcodeCloudBuildsGetTests { @Test func `get build run returns single build run with affordances`() async throws { - let mockRepo = MockXcodeCloudBuildRunRepository() + let mockRepo = MockXcodeCloudBuildRuns() given(mockRepo).getBuildRun(id: .value("run-99")).willReturn( XcodeCloudBuildRun( id: "run-99", workflowId: "wf-1", number: 12, @@ -174,7 +174,7 @@ struct XcodeCloudBuildsGetTests { struct XcodeCloudBuildsStartTests { @Test func `start build returns new build run with affordances`() async throws { - let mockRepo = MockXcodeCloudBuildRunRepository() + let mockRepo = MockXcodeCloudBuildRuns() given(mockRepo).startBuildRun(workflowId: .value("wf-1"), clean: .value(false)).willReturn( XcodeCloudBuildRun( id: "run-100", workflowId: "wf-1", number: nil, @@ -206,7 +206,7 @@ struct XcodeCloudBuildsStartTests { } @Test func `start build with clean flag calls repo with clean true`() async throws { - let mockRepo = MockXcodeCloudBuildRunRepository() + let mockRepo = MockXcodeCloudBuildRuns() given(mockRepo).startBuildRun(workflowId: .value("wf-1"), clean: .value(true)).willReturn( XcodeCloudBuildRun(id: "run-101", workflowId: "wf-1", executionProgress: .pending) ) diff --git a/Tests/ASCKitTests/AppWall/Internal/GitHubAppWallRepositoryTests.swift b/Tests/ASCKitTests/AppWall/Internal/GitHubAppWallTests.swift similarity index 97% rename from Tests/ASCKitTests/AppWall/Internal/GitHubAppWallRepositoryTests.swift rename to Tests/ASCKitTests/AppWall/Internal/GitHubAppWallTests.swift index 54c195d1..a6c7cf6e 100644 --- a/Tests/ASCKitTests/AppWall/Internal/GitHubAppWallRepositoryTests.swift +++ b/Tests/ASCKitTests/AppWall/Internal/GitHubAppWallTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct GitHubAppWallRepositoryTests { +struct GitHubAppWallTests { // MARK: - Happy Path @@ -122,7 +122,7 @@ struct GitHubAppWallRepositoryTests { ) let noopSleep: @Sendable (Duration) async throws -> Void = { _ in } - let repo = GitHubAppWallRepository( + let repo = GitHubAppWall( token: "test-token", httpClient: stub, upstreamOwner: "tddworks", @@ -143,9 +143,9 @@ struct GitHubAppWallRepositoryTests { // MARK: - Helpers - private func makeRepo(stub: SequencedStubHTTPClient) -> GitHubAppWallRepository { + private func makeRepo(stub: SequencedStubHTTPClient) -> GitHubAppWall { let noopSleep: @Sendable (Duration) async throws -> Void = { _ in } - return GitHubAppWallRepository( + return GitHubAppWall( token: "test-token", httpClient: stub, upstreamOwner: "tddworks", diff --git a/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipsTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipsTests.swift index 65905689..830849e2 100644 --- a/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipsTests.swift @@ -15,7 +15,7 @@ struct SDKAppClipRepositoryListAppClipsTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.listAppClips(appId: "app-99") #expect(result.count == 2) @@ -31,7 +31,7 @@ struct SDKAppClipRepositoryListAppClipsTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.listAppClips(appId: "app-1") #expect(result[0].bundleId == "com.example.clip") @@ -44,7 +44,7 @@ struct SDKAppClipRepositoryListAppClipsTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.listAppClips(appId: "app-1") #expect(result[0].bundleId == nil) @@ -64,7 +64,7 @@ struct SDKAppClipRepositoryListExperiencesTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.listExperiences(appClipId: "clip-42") #expect(result.count == 2) @@ -80,7 +80,7 @@ struct SDKAppClipRepositoryListExperiencesTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.listExperiences(appClipId: "clip-1") #expect(result[0].action == .open) @@ -97,7 +97,7 @@ struct SDKAppClipRepositoryCreateExperienceTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.createExperience(appClipId: "clip-42", action: .view) #expect(result.id == "exp-new") @@ -119,7 +119,7 @@ struct SDKAppClipRepositoryListLocalizationsTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.listLocalizations(experienceId: "exp-42") #expect(result.count == 2) @@ -139,7 +139,7 @@ struct SDKAppClipRepositoryListLocalizationsTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.listLocalizations(experienceId: "exp-1") #expect(result[0].locale == "fr-FR") @@ -161,7 +161,7 @@ struct SDKAppClipRepositoryCreateLocalizationTests { links: .init(this: "") )) - let repo = SDKAppClipRepository(client: stub) + let repo = SDKAppClips(client: stub) let result = try await repo.createLocalization(experienceId: "exp-42", locale: "en-US", subtitle: "Quick access") #expect(result.id == "loc-new") diff --git a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationsTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationsTests.swift index 2d230ccc..569debe0 100644 --- a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationsTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAgeRatingDeclarationRepositoryTests { +struct SDKAgeRatingDeclarationsTests { // MARK: - getDeclaration @@ -15,7 +15,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-42") #expect(result.id == "decl-1") @@ -33,7 +33,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.isAdvertising == true) @@ -55,7 +55,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.violenceRealistic == .frequentOrIntense) @@ -73,7 +73,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.kidsAgeBand == .nineToEleven) @@ -90,7 +90,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.ageRatingOverride == .thirteenPlus) @@ -107,7 +107,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.koreaAgeRatingOverride == .twelvePlus) @@ -124,7 +124,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.koreaAgeRatingOverride == .all) @@ -141,7 +141,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.gracRatingClassificationNumber == "CC-OL-000000-000") @@ -164,7 +164,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { update.isAdvertising = false update.violenceRealistic = .frequentOrIntense - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) let result = try await repo.updateDeclaration(id: "decl-1", update: update) #expect(result.id == "decl-1") @@ -189,7 +189,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let result = try await SDKAgeRatingDeclarationRepository(client: stub).getDeclaration(appInfoId: "info-1") + let result = try await SDKAgeRatingDeclarations(client: stub).getDeclaration(appInfoId: "info-1") #expect(result.isSocialMedia == false) #expect(result.isSocialMediaAgeRestricted == true) @@ -203,7 +203,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { links: .init(this: "") )) - let result = try await SDKAgeRatingDeclarationRepository(client: stub).getDeclaration(appInfoId: "info-1") + let result = try await SDKAgeRatingDeclarations(client: stub).getDeclaration(appInfoId: "info-1") #expect(result.isSocialMedia == nil) #expect(result.isSocialMediaAgeRestricted == nil) @@ -221,7 +221,7 @@ struct SDKAgeRatingDeclarationRepositoryTests { update.isSocialMediaAgeRestricted = true update.developerAgeRatingInfoUrl = "https://example.com/age" - _ = try await SDKAgeRatingDeclarationRepository(client: stub).updateDeclaration(id: "decl-1", update: update) + _ = try await SDKAgeRatingDeclarations(client: stub).updateDeclaration(id: "decl-1", update: update) let body = try #require(stub.requests.first?.body) let json = try #require(try JSONSerialization.jsonObject(with: Data(body.utf8)) as? [String: Any]) diff --git a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoriesTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoriesTests.swift index 2cab012b..1ad8f7d9 100644 --- a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoriesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppCategoryRepositoryTests { +struct SDKAppCategoriesTests { @Test func `listCategories returns top level and subcategories as flat list`() async throws { let stub = StubAPIClient() @@ -15,7 +15,7 @@ struct SDKAppCategoryRepositoryTests { links: .init(this: "") )) - let repo = SDKAppCategoryRepository(client: stub) + let repo = SDKAppCategories(client: stub) let result = try await repo.listCategories(platform: nil) #expect(result.count == 2) @@ -32,7 +32,7 @@ struct SDKAppCategoryRepositoryTests { links: .init(this: "") )) - let repo = SDKAppCategoryRepository(client: stub) + let repo = SDKAppCategories(client: stub) let result = try await repo.listCategories(platform: nil) #expect(result[0].platforms.contains("IOS")) @@ -53,7 +53,7 @@ struct SDKAppCategoryRepositoryTests { links: .init(this: "") )) - let repo = SDKAppCategoryRepository(client: stub) + let repo = SDKAppCategories(client: stub) let result = try await repo.listCategories(platform: nil) #expect(result[0].parentId == "6014") @@ -71,7 +71,7 @@ struct SDKAppCategoryRepositoryTests { links: .init(this: "") )) - let repo = SDKAppCategoryRepository(client: stub) + let repo = SDKAppCategories(client: stub) let result = try await repo.getCategory(id: "6014-action") #expect(result.id == "6014-action") @@ -89,7 +89,7 @@ struct SDKAppCategoryRepositoryTests { links: .init(this: "") )) - let repo = SDKAppCategoryRepository(client: stub) + let repo = SDKAppCategories(client: stub) let result = try await repo.listCategories(platform: nil) #expect(result[0].parentId == nil) diff --git a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfosTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfosTests.swift index 865b82f5..69fc37d1 100644 --- a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfosTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppInfoRepositoryTests { +struct SDKAppInfosTests { // MARK: - listAppInfos @@ -17,7 +17,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listAppInfos(appId: "app-99") #expect(result.count == 2) @@ -37,7 +37,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].appStoreAgeRating == "FOUR_PLUS") @@ -56,7 +56,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].appStoreState == "READY_FOR_SALE") @@ -83,7 +83,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].primaryCategoryId == "6014") @@ -101,7 +101,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].id == "info-abc") @@ -119,7 +119,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listLocalizations(appInfoId: "info-42") #expect(result.count == 2) @@ -139,7 +139,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listLocalizations(appInfoId: "info-1") #expect(result[0].locale == "fr-FR") @@ -160,7 +160,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.createLocalization(appInfoId: "info-42", locale: "en-US", name: "My App") #expect(result.id == "loc-new") @@ -183,7 +183,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.updateLocalization( id: "loc-1", name: "Updated App", subtitle: "New subtitle", privacyPolicyUrl: nil, privacyChoicesUrl: nil, privacyPolicyText: nil ) @@ -205,7 +205,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.updateLocalization(id: "loc-2", name: "Meine App", subtitle: nil, privacyPolicyUrl: nil, privacyChoicesUrl: nil, privacyPolicyText: nil) #expect(result.appInfoId == "") @@ -224,7 +224,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].primaryCategoryId == "6014") @@ -247,7 +247,7 @@ struct SDKAppInfoRepositoryTests { links: .init(this: "") )) - let repo = SDKAppInfoRepository(client: stub) + let repo = SDKAppInfos(client: stub) let result = try await repo.listLocalizations(appInfoId: "info-1") #expect(result[0].privacyChoicesUrl == "https://example.com/choices") diff --git a/Tests/ASCKitTests/Apps/AppRepositoryTests.swift b/Tests/ASCKitTests/Apps/AppsTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/AppRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AppsTests.swift index de043659..97d233b7 100644 --- a/Tests/ASCKitTests/Apps/AppRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AppsTests.swift @@ -3,11 +3,11 @@ import Testing @testable import ASCKit @Suite -struct AppRepositoryTests { +struct AppsTests { @Test func `list apps returns paginated response`() async throws { - let mock = MockAppRepository() + let mock = MockApps() let apps = [ MockRepositoryFactory.makeApp(id: "1", name: "App One"), MockRepositoryFactory.makeApp(id: "2", name: "App Two"), @@ -24,7 +24,7 @@ struct AppRepositoryTests { @Test func `get app returns single app`() async throws { - let mock = MockAppRepository() + let mock = MockApps() let app = MockRepositoryFactory.makeApp(id: "42", name: "My App") given(mock).getApp(id: .value("42")).willReturn(app) @@ -36,7 +36,7 @@ struct AppRepositoryTests { @Test func `fetch app icon returns image asset when build has icon`() async throws { - let mock = MockAppRepository() + let mock = MockApps() let asset = MockRepositoryFactory.makeImageAsset(width: 1024, height: 1024) given(mock).fetchAppIcon(appId: .value("42")).willReturn(asset) @@ -48,7 +48,7 @@ struct AppRepositoryTests { @Test func `fetch app icon returns nil when no build has icon`() async throws { - let mock = MockAppRepository() + let mock = MockApps() given(mock).fetchAppIcon(appId: .any).willReturn(nil) let result = try await mock.fetchAppIcon(appId: "no-builds") @@ -57,7 +57,7 @@ struct AppRepositoryTests { @Test func `list apps with pagination cursor`() async throws { - let mock = MockAppRepository() + let mock = MockApps() let response = PaginatedResponse( data: [MockRepositoryFactory.makeApp()], nextCursor: "next-page-token", diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImagesTests.swift similarity index 97% rename from Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImagesTests.swift index d5f0a446..19a4acae 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImagesTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKLibraryImageRepositoryTests { +struct SDKLibraryImagesTests { // MARK: - listImages @@ -142,8 +142,8 @@ struct SDKLibraryImageRepositoryTests { // MARK: - Fixtures - static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKLibraryImageRepository { - SDKLibraryImageRepository(client: stub, uploader: UploadOperationsExecutor(http: http)) + static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKLibraryImages { + SDKLibraryImages(client: stub, uploader: UploadOperationsExecutor(http: http)) } static func images(_ json: String) throws -> LibraryAssetsDocument { diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift index fdb7bfc1..649f4875 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift @@ -177,7 +177,7 @@ private struct Refused: LocalizedError { /// An asset library that keeps what it's sent. Images are processed after `readsUntilProcessed` /// reads; files named in `failing` fail processing with that reason. -private final class FakeLibrary: LibraryImageRepository, @unchecked Sendable { +private final class FakeLibrary: LibraryImages, @unchecked Sendable { private let lock = NSLock() private var stored: [LibraryImage] = [] private var reads: [String: Int] = [:] @@ -224,7 +224,7 @@ private final class FakeLibrary: LibraryImageRepository, @unchecked Sendable { } /// Placements that apply what they're sent: create appends, delete removes, reorder reorders. -private final class FakePlacements: AssetPlacementRepository, @unchecked Sendable { +private final class FakePlacements: AssetPlacements, @unchecked Sendable { private let lock = NSLock() private var stored: [AssetPlacement] private var created = 0 diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibrariesTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibrariesTests.swift index 2d8e4fcc..60268e66 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibrariesTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAssetLibraryRepositoryTests { +struct SDKAssetLibrariesTests { // MARK: - getAssetLibrary @@ -15,7 +15,7 @@ struct SDKAssetLibraryRepositoryTests { links: .init(this: "") )) - let library = try await SDKAssetLibraryRepository(client: stub).getAssetLibrary(appId: "app-42") + let library = try await SDKAssetLibraries(client: stub).getAssetLibrary(appId: "app-42") #expect(library == ASCKit.AppAssetLibrary(id: "lib-1", appId: "app-42")) #expect(stub.lastPath == "/v1/apps/app-42/assetLibrary") @@ -27,7 +27,7 @@ struct SDKAssetLibraryRepositoryTests { let stub = StubAPIClient() stub.willReturn(try Self.refData(Self.catalog)) - let groups = try await SDKAssetLibraryRepository(client: stub).listPlacementGroups(placementType: nil, feature: nil) + let groups = try await SDKAssetLibraries(client: stub).listPlacementGroups(placementType: nil, feature: nil) #expect(groups == [ AssetPlacementGroup(id: "IPHONE_DYNAMIC_ISLAND_LARGE_PROFILE", placementType: .appScreenshot, @@ -49,7 +49,7 @@ struct SDKAssetLibraryRepositoryTests { let stub = StubAPIClient() stub.willReturn(try Self.refData(Self.catalog)) - let groups = try await SDKAssetLibraryRepository(client: stub) + let groups = try await SDKAssetLibraries(client: stub) .listPlacementGroups(placementType: .appScreenshot, feature: "CUSTOM_PRODUCT_PAGES") #expect(groups == [ @@ -63,7 +63,7 @@ struct SDKAssetLibraryRepositoryTests { let stub = StubAPIClient() stub.willReturn(try Self.refData(Self.catalog)) - _ = try await SDKAssetLibraryRepository(client: stub) + _ = try await SDKAssetLibraries(client: stub) .listPlacementGroups(placementType: .appScreenshot, feature: "APP_STORE_VERSIONS") #expect(stub.lastPath == "/v1/appAssetLibraryRefData") @@ -81,7 +81,7 @@ struct SDKAssetLibraryRepositoryTests { }}],"links":{"self":""}} """)) - let groups = try await SDKAssetLibraryRepository(client: stub).listPlacementGroups(placementType: nil, feature: nil) + let groups = try await SDKAssetLibraries(client: stub).listPlacementGroups(placementType: nil, feature: nil) #expect(groups == []) } diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementsTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementsTests.swift index e2211512..e3dbc51c 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementsTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAssetPlacementRepositoryTests { +struct SDKAssetPlacementsTests { // MARK: - listPlacements @@ -21,7 +21,7 @@ struct SDKAssetPlacementRepositoryTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacementRepository(client: stub).listPlacements( + let placements = try await SDKAssetPlacements(client: stub).listPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementType: nil, placementGroup: nil ) @@ -45,7 +45,7 @@ struct SDKAssetPlacementRepositoryTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacementRepository(client: stub).listPlacements( + let placements = try await SDKAssetPlacements(client: stub).listPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementType: nil, placementGroup: nil ) @@ -58,7 +58,7 @@ struct SDKAssetPlacementRepositoryTests { let stub = StubAPIClient() stub.willReturn(try Self.placements(#"{"data":[],"links":{"self":""}}"#)) - _ = try await SDKAssetPlacementRepository(client: stub).listPlacements( + _ = try await SDKAssetPlacements(client: stub).listPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementType: .appScreenshot, placementGroup: "IPHONE_DYNAMIC_ISLAND_LARGE_PROFILE" ) @@ -80,7 +80,7 @@ struct SDKAssetPlacementRepositoryTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacementRepository(client: stub).listPlacements( + let placements = try await SDKAssetPlacements(client: stub).listPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementType: nil, placementGroup: nil ) @@ -91,7 +91,7 @@ struct SDKAssetPlacementRepositoryTests { let stub = StubAPIClient() stub.willReturn(try Self.placements(#"{"data":[\#(Self.screenshot(id: "pl-1", group: "IPHONE_67", image: "img-1"))],"links":{"self":""}}"#)) - let placements = try await SDKAssetPlacementRepository(client: stub).listPlacements( + let placements = try await SDKAssetPlacements(client: stub).listPlacements( surface: .experimentTreatmentLocalization, localizationId: "tl-1", placementType: nil, placementGroup: nil ) @@ -110,7 +110,7 @@ struct SDKAssetPlacementRepositoryTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacementRepository(client: stub).listAssetPlacements(mediaType: .video, assetId: "vid-1") + let placements = try await SDKAssetPlacements(client: stub).listAssetPlacements(mediaType: .video, assetId: "vid-1") #expect(stub.lastPath == "/v1/appAssetLibraryVideos/vid-1/placements") #expect(placements == [ @@ -133,7 +133,7 @@ struct SDKAssetPlacementRepositoryTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacementRepository(client: stub).listAssetPlacements(mediaType: .image, assetId: "img-7") + let placements = try await SDKAssetPlacements(client: stub).listAssetPlacements(mediaType: .image, assetId: "img-7") #expect(placements == [ AssetPlacement(id: "pl-1", surface: .appStoreVersionLocalization, localizationId: "loc-1", mediaType: .image, @@ -161,7 +161,7 @@ struct SDKAssetPlacementRepositoryTests { """)) // When - let placements = try await SDKAssetPlacementRepository(client: stub).listAssetPlacements(mediaType: .image, assetId: "img-7") + let placements = try await SDKAssetPlacements(client: stub).listAssetPlacements(mediaType: .image, assetId: "img-7") // Then #expect(placements == [ @@ -180,7 +180,7 @@ struct SDKAssetPlacementRepositoryTests { "links":{"self":""}} """)) - let placement = try await SDKAssetPlacementRepository(client: stub).createPlacement( + let placement = try await SDKAssetPlacements(client: stub).createPlacement( surface: .appStoreVersionLocalization, localizationId: "loc-9", mediaType: .image, assetId: "img-1", placementType: .appScreenshot, placementGroup: "IPHONE_DYNAMIC_ISLAND_LARGE_PROFILE" ) @@ -202,7 +202,7 @@ struct SDKAssetPlacementRepositoryTests { "links":{"self":""}} """)) - _ = try await SDKAssetPlacementRepository(client: stub).createPlacement( + _ = try await SDKAssetPlacements(client: stub).createPlacement( surface: .experimentTreatmentLocalization, localizationId: "tl-1", mediaType: .video, assetId: "vid-1", placementType: .appPreview, placementGroup: "IPHONE_67" ) @@ -222,7 +222,7 @@ struct SDKAssetPlacementRepositoryTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacementRepository(client: stub).reorderPlacements( + let placements = try await SDKAssetPlacements(client: stub).reorderPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementGroup: "IPHONE_67", placementIds: ["pl-2", "pl-1"] ) @@ -237,7 +237,7 @@ struct SDKAssetPlacementRepositoryTests { @Test func `should delete the placement`() async throws { let stub = StubAPIClient() - try await SDKAssetPlacementRepository(client: stub).deletePlacement(placementId: "pl-1") + try await SDKAssetPlacements(client: stub).deletePlacement(placementId: "pl-1") #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["DELETE /v1/appAssetLibraryPlacements/pl-1"]) } diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideosTests.swift similarity index 96% rename from Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideosTests.swift index 545c2da3..726fbbea 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideosTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKLibraryVideoRepositoryTests { +struct SDKLibraryVideosTests { @Test func `should tie each video to the library it was listed under with its preview frame and processed video`() async throws { let stub = StubAPIClient() @@ -88,8 +88,8 @@ struct SDKLibraryVideoRepositoryTests { // MARK: - Fixtures - static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKLibraryVideoRepository { - SDKLibraryVideoRepository(client: stub, uploader: UploadOperationsExecutor(http: http)) + static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKLibraryVideos { + SDKLibraryVideos(client: stub, uploader: UploadOperationsExecutor(http: http)) } static func videos(_ json: String) throws -> LibraryAssetsDocument { diff --git a/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift b/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilitiesTests.swift similarity index 94% rename from Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilitiesTests.swift index a4ceeab2..a4b7ac5b 100644 --- a/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilitiesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppAvailabilityRepositoryTests { +struct SDKAppAvailabilitiesTests { @Test func `getAppAvailability injects appId and maps territory statuses from dedicated relationship`() async throws { let stub = StubAPIClient() @@ -43,7 +43,7 @@ struct SDKAppAvailabilityRepositoryTests { links: .init(this: "") )) - let repo = SDKAppAvailabilityRepository(client: stub) + let repo = SDKAppAvailabilities(client: stub) let result = try await repo.getAppAvailability(appId: "app-99") #expect(result?.id == "avail-1") @@ -86,7 +86,7 @@ struct SDKAppAvailabilityRepositoryTests { links: .init(this: "") )) - let repo = SDKAppAvailabilityRepository(client: stub) + let repo = SDKAppAvailabilities(client: stub) let result = try await repo.getAppAvailability(appId: "app-1") #expect(result?.territories[0].releaseDate == "2026-04-01") @@ -105,7 +105,7 @@ struct SDKAppAvailabilityRepositoryTests { )) stub.willReturn(TerritoryAvailabilitiesResponse(data: [], links: .init(this: ""))) - let repo = SDKAppAvailabilityRepository(client: stub) + let repo = SDKAppAvailabilities(client: stub) let result = try await repo.getAppAvailability(appId: "app-1") #expect(result?.territories.isEmpty == true) @@ -131,7 +131,7 @@ struct SDKAppAvailabilityRepositoryTests { )) stub.willReturn(TerritoryAvailabilitiesResponse(data: many, links: .init(this: ""))) - let repo = SDKAppAvailabilityRepository(client: stub) + let repo = SDKAppAvailabilities(client: stub) let result = try await repo.getAppAvailability(appId: "app-many") #expect(result?.territories.count == 175) @@ -146,7 +146,7 @@ struct SDKAppAvailabilityRepositoryTests { detail: "There is no resource of type 'appAvailabilities' with id 'app-1'"), ]), nil) - let repo = SDKAppAvailabilityRepository(client: stub) + let repo = SDKAppAvailabilities(client: stub) let result = try await repo.getAppAvailability(appId: "app-1") #expect(result == nil) @@ -166,7 +166,7 @@ struct SDKAppAvailabilityRepositoryTests { links: .init(this: "") )) - let repo = SDKAppAvailabilityRepository(client: stub) + let repo = SDKAppAvailabilities(client: stub) let result = try await repo.createAppAvailability( appId: "app-1", isAvailableInNewTerritories: true, territoryIds: ["USA", "JPN"] ) diff --git a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationsTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationsTests.swift index 7cd1ff9e..9cab0cff 100644 --- a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBetaBuildLocalizationRepositoryTests { +struct SDKBetaBuildLocalizationsTests { @Test func `listBetaBuildLocalizations injects buildId into each localization`() async throws { let stub = StubAPIClient() @@ -12,7 +12,7 @@ struct SDKBetaBuildLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaBuildLocalizationRepository(client: stub) + let repo = SDKBetaBuildLocalizations(client: stub) let locs = try await repo.listBetaBuildLocalizations(buildId: "build-42") #expect(locs.count == 1) @@ -36,7 +36,7 @@ struct SDKBetaBuildLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaBuildLocalizationRepository(client: stub) + let repo = SDKBetaBuildLocalizations(client: stub) let result = try await repo.upsertBetaBuildLocalization(buildId: "build-42", locale: "en-US", whatsNew: "New notes") #expect(result.id == "bbl-1") @@ -58,7 +58,7 @@ struct SDKBetaBuildLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaBuildLocalizationRepository(client: stub) + let repo = SDKBetaBuildLocalizations(client: stub) let result = try await repo.upsertBetaBuildLocalization(buildId: "build-42", locale: "fr-FR", whatsNew: "Nouvelles fonctionnalités") #expect(result.id == "bbl-new") diff --git a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift index 587e9a71..8a221d5b 100644 --- a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift @@ -18,7 +18,7 @@ struct SDKBuildUploadRepositoryUploadTests { try Self.file(#"{"data":{"type":"buildUploadFiles","id":"file-1","attributes":{"fileName":"MyApp.ipa","fileSize":7}},"links":{"self":""}}"#), ]) - let upload = try await SDKBuildUploadRepository(client: stub).uploadBuild( + let upload = try await SDKBuildUploads(client: stub).uploadBuild( appId: "app-1", version: "1.2.0", buildNumber: "42", platform: .iOS, fileURL: file ) @@ -40,7 +40,7 @@ struct SDKBuildUploadRepositoryUploadTests { http.enqueue(json: "", statusCode: 500) await #expect(throws: (any Error).self) { - try await SDKBuildUploadRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadBuild( + try await SDKBuildUploads(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadBuild( appId: "app-1", version: "1.2.0", buildNumber: "42", platform: .iOS, fileURL: file ) } @@ -56,7 +56,7 @@ struct SDKBuildUploadRepositoryUploadTests { http.enqueue(json: "", statusCode: 200) await #expect(throws: (any Error).self) { - _ = try await SDKBuildUploadRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadBuild( + _ = try await SDKBuildUploads(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadBuild( appId: "app-1", version: "1.2.0", buildNumber: "42", platform: .iOS, fileURL: file ) } diff --git a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadsTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadsTests.swift index 610c343a..e4c14778 100644 --- a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBuildUploadRepositoryTests { +struct SDKBuildUploadsTests { @Test func `listBuildUploads injects appId into each upload`() async throws { let stub = StubAPIClient() @@ -14,7 +14,7 @@ struct SDKBuildUploadRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildUploadRepository(client: stub) + let repo = SDKBuildUploads(client: stub) let uploads = try await repo.listBuildUploads(appId: "app-42") #expect(uploads.count == 1) @@ -29,7 +29,7 @@ struct SDKBuildUploadRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildUploadRepository(client: stub) + let repo = SDKBuildUploads(client: stub) let uploads = try await repo.listBuildUploads(appId: "app-1") #expect(uploads[0].state == .complete) @@ -43,7 +43,7 @@ struct SDKBuildUploadRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildUploadRepository(client: stub) + let repo = SDKBuildUploads(client: stub) let upload = try await repo.getBuildUpload(id: "up-99") #expect(upload.id == "up-99") @@ -54,7 +54,7 @@ struct SDKBuildUploadRepositoryTests { @Test func `deleteBuildUpload calls void request`() async throws { let stub = StubAPIClient() - let repo = SDKBuildUploadRepository(client: stub) + let repo = SDKBuildUploads(client: stub) try await repo.deleteBuildUpload(id: "up-1") @@ -73,7 +73,7 @@ struct SDKBuildUploadRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildUploadRepository(client: stub) + let repo = SDKBuildUploads(client: stub) let upload = try await repo.getBuildUpload(id: "up-1") #expect(upload.state == .failed) @@ -92,7 +92,7 @@ struct SDKBuildUploadRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildUploadRepository(client: stub) + let repo = SDKBuildUploads(client: stub) let upload = try await repo.getBuildUpload(id: "up-1") #expect(upload.errors.isEmpty) @@ -137,7 +137,7 @@ struct SDKBuildUploadRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKBuildUploadRepository(client: stub) + let repo = SDKBuildUploads(client: stub) let result = try await repo.listBuildUploads(appId: "app-1") #expect(result.count == 75) diff --git a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildsTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildsTests.swift index 94668e72..70e5dd09 100644 --- a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBuildRepositoryTests { +struct SDKBuildsTests { @Test func `listBuilds maps version and processingState`() async throws { let stub = StubAPIClient() @@ -18,7 +18,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) #expect(result.data[0].id == "build-1") @@ -47,7 +47,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) #expect(result.data[0].version == "1.2.0") @@ -68,7 +68,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) #expect(result.data[0].version == "42") @@ -93,7 +93,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) #expect(result.data[0].processingState == domainState) @@ -112,7 +112,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.listBuilds(appId: "app-42", platform: nil, version: nil, limit: nil) #expect(result.data.count == 1) @@ -131,7 +131,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.getBuild(id: "build-99") #expect(result.id == "build-99") @@ -143,14 +143,14 @@ struct SDKBuildRepositoryTests { @Test func `addBetaGroups succeeds without error`() async throws { let stub = StubAPIClient() - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) try await repo.addBetaGroups(buildId: "build-1", betaGroupIds: ["bg-1", "bg-2"]) #expect(stub.voidRequestCalled) } @Test func `removeBetaGroups succeeds without error`() async throws { let stub = StubAPIClient() - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) try await repo.removeBetaGroups(buildId: "build-1", betaGroupIds: ["bg-1"]) #expect(stub.voidRequestCalled) } @@ -167,7 +167,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.getBuild(id: "build-1") #expect(result.usesNonExemptEncryption == false) @@ -183,7 +183,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.getBuild(id: "build-1") #expect(result.usesNonExemptEncryption == nil) @@ -200,7 +200,7 @@ struct SDKBuildRepositoryTests { links: .init(this: "") )) - let repo = SDKBuildRepository(client: stub) + let repo = SDKBuilds(client: stub) let result = try await repo.updateBuildEncryptionCompliance(buildId: "build-1", usesNonExemptEncryption: false) #expect(result.id == "build-1") diff --git a/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift b/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentsTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentsTests.swift index ec4638fa..873cdf6b 100644 --- a/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentsTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKExperimentRepositoryTests { +struct SDKExperimentsTests { private func sdkExperiment( id: String = "exp-1", @@ -28,7 +28,7 @@ struct SDKExperimentRepositoryTests { links: .init(this: "") )) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let result = try await repo.listExperiments(appId: "app-99", state: nil, limit: nil) #expect(result.data.count == 2) @@ -46,7 +46,7 @@ struct SDKExperimentRepositoryTests { let stub = StubAPIClient() stub.willReturn(AppStoreVersionExperimentsV2Response(data: [], links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) _ = try await repo.listExperiments(appId: "app-1", state: .approved, limit: 5) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) @@ -61,7 +61,7 @@ struct SDKExperimentRepositoryTests { links: .init(this: "") )) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let result = try await repo.listExperiments(appId: "app-1", state: nil, limit: nil) #expect(result.data[0].startDate == "2025-09-01T00:00:00Z") @@ -74,7 +74,7 @@ struct SDKExperimentRepositoryTests { sdk.relationships?.app = .init(data: .init(type: .apps, id: "app-3")) stub.willReturn(AppStoreVersionExperimentV2Response(data: sdk, links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let exp = try await repo.getExperiment(experimentId: "exp-7") #expect(exp.id == "exp-7") @@ -86,7 +86,7 @@ struct SDKExperimentRepositoryTests { let stub = StubAPIClient() stub.willReturn(AppStoreVersionExperimentV2Response(data: sdkExperiment(id: "exp-new"), links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let exp = try await repo.createExperiment(appId: "app-1", name: "Icon test", platform: .iOS, trafficProportion: 30) #expect(exp.id == "exp-new") @@ -100,7 +100,7 @@ struct SDKExperimentRepositoryTests { sdk.relationships?.app = .init(data: .init(type: .apps, id: "app-1")) stub.willReturn(AppStoreVersionExperimentV2Response(data: sdk, links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let exp = try await repo.updateExperiment(experimentId: "exp-1", name: nil, trafficProportion: nil, isStarted: true) #expect(exp.appId == "app-1") @@ -114,7 +114,7 @@ struct SDKExperimentRepositoryTests { sdk.relationships?.app = .init(data: .init(type: .apps, id: "app-3")) stub.willReturn(AppStoreVersionExperimentV2Response(data: sdk, links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) _ = try await repo.getExperiment(experimentId: "exp-7") // Apple omits `relationships.app` from GET unless `include=app` is requested. @@ -128,7 +128,7 @@ struct SDKExperimentRepositoryTests { sdk.relationships?.app = .init(data: .init(type: .apps, id: "app-1")) stub.willReturn(AppStoreVersionExperimentV2Response(data: sdk, links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let exp = try await repo.updateExperiment(experimentId: "exp-1", name: "Renamed", trafficProportion: nil, isStarted: nil) // PATCH responses carry no relationships; the adapter follows up with GET ?include=app. @@ -139,7 +139,7 @@ struct SDKExperimentRepositoryTests { @Test func `deleteExperiment issues a void request`() async throws { let stub = StubAPIClient() - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) try await repo.deleteExperiment(experimentId: "exp-1") #expect(stub.voidRequestCalled == true) } @@ -160,7 +160,7 @@ struct SDKExperimentRepositoryTests { links: .init(this: "") )) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let result = try await repo.listTreatments(experimentId: "exp-5", limit: nil) #expect(result.data.count == 2) @@ -175,7 +175,7 @@ struct SDKExperimentRepositoryTests { let stub = StubAPIClient() stub.willReturn(AppStoreVersionExperimentTreatmentResponse(data: sdkTreatment(id: "trt-new"), links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let t = try await repo.createTreatment(experimentId: "exp-1", name: "Blue icon", appIconName: "AppIcon-Blue") #expect(t.id == "trt-new") @@ -189,7 +189,7 @@ struct SDKExperimentRepositoryTests { sdk.relationships = .init(appStoreVersionExperimentV2: .init(data: .init(type: .appStoreVersionExperiments, id: "exp-4"))) stub.willReturn(AppStoreVersionExperimentTreatmentResponse(data: sdk, links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let t = try await repo.updateTreatment(treatmentId: "trt-1", name: "Red icon", appIconName: nil) #expect(t.experimentId == "exp-4") @@ -202,7 +202,7 @@ struct SDKExperimentRepositoryTests { sdk.relationships = .init(appStoreVersionExperimentV2: .init(data: .init(type: .appStoreVersionExperiments, id: "exp-4"))) stub.willReturn(AppStoreVersionExperimentTreatmentResponse(data: sdk, links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let t = try await repo.updateTreatment(treatmentId: "trt-1", name: "Red icon", appIconName: nil) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) @@ -212,7 +212,7 @@ struct SDKExperimentRepositoryTests { @Test func `deleteTreatment issues a void request`() async throws { let stub = StubAPIClient() - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) try await repo.deleteTreatment(treatmentId: "trt-1") #expect(stub.voidRequestCalled == true) } @@ -233,7 +233,7 @@ struct SDKExperimentRepositoryTests { links: .init(this: "") )) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let locs = try await repo.listTreatmentLocalizations(treatmentId: "trt-3", limit: nil) #expect(locs.count == 2) @@ -246,7 +246,7 @@ struct SDKExperimentRepositoryTests { let stub = StubAPIClient() stub.willReturn(AppStoreVersionExperimentTreatmentLocalizationResponse(data: sdkLocalization(id: "loc-new", locale: "fr-FR"), links: .init(this: ""))) - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) let loc = try await repo.createTreatmentLocalization(treatmentId: "trt-1", locale: "fr-FR") #expect(loc.id == "loc-new") @@ -257,7 +257,7 @@ struct SDKExperimentRepositoryTests { @Test func `deleteTreatmentLocalization issues a void request`() async throws { let stub = StubAPIClient() - let repo = SDKExperimentRepository(client: stub) + let repo = SDKExperiments(client: stub) try await repo.deleteTreatmentLocalization(localizationId: "loc-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilitiesTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilitiesTests.swift index 653ecfd7..c3e40ec1 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilitiesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseAvailabilityRepositoryTests { +struct SDKInAppPurchaseAvailabilitiesTests { @Test func `getAvailability composes attributes call with availableTerritories relationship call`() async throws { let stub = StubAPIClient() @@ -25,7 +25,7 @@ struct SDKInAppPurchaseAvailabilityRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) + let repo = SDKInAppPurchaseAvailabilities(client: stub) let result = try await repo.getAvailability(iapId: "iap-99") #expect(result?.id == "avail-1") @@ -56,7 +56,7 @@ struct SDKInAppPurchaseAvailabilityRepositoryTests { } stub.willReturn(TerritoriesResponse(data: manyTerritories, links: .init(this: ""))) - let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) + let repo = SDKInAppPurchaseAvailabilities(client: stub) let result = try await repo.getAvailability(iapId: "iap-big") #expect(result?.territories.count == 175) @@ -74,7 +74,7 @@ struct SDKInAppPurchaseAvailabilityRepositoryTests { )) stub.willReturn(TerritoriesResponse(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) + let repo = SDKInAppPurchaseAvailabilities(client: stub) let result = try await repo.getAvailability(iapId: "iap-1") #expect(result?.territories.isEmpty == true) @@ -87,7 +87,7 @@ struct SDKInAppPurchaseAvailabilityRepositoryTests { // treat nil as "no availability set yet" and seed sensible defaults. let stub = StubAPIClient() // No `willReturn(_:)` for InAppPurchaseAvailabilityResponse → request throws → nil. - let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) + let repo = SDKInAppPurchaseAvailabilities(client: stub) let result = try? await repo.getAvailability(iapId: "iap-fresh") #expect(result == nil) } @@ -109,7 +109,7 @@ struct SDKInAppPurchaseAvailabilityRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) + let repo = SDKInAppPurchaseAvailabilities(client: stub) let result = try await repo.createAvailability( iapId: "iap-42", isAvailableInNewTerritories: true, diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationsTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationsTests.swift index 355b0a79..caad57e6 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseLocalizationRepositoryTests { +struct SDKInAppPurchaseLocalizationsTests { // MARK: - listLocalizations @@ -17,7 +17,7 @@ struct SDKInAppPurchaseLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizationRepository(client: stub) + let repo = SDKInAppPurchaseLocalizations(client: stub) let result = try await repo.listLocalizations(iapId: "iap-42") #expect(result.count == 2) @@ -37,7 +37,7 @@ struct SDKInAppPurchaseLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizationRepository(client: stub) + let repo = SDKInAppPurchaseLocalizations(client: stub) let result = try await repo.listLocalizations(iapId: "iap-1") #expect(result[0].locale == "fr-FR") @@ -54,7 +54,7 @@ struct SDKInAppPurchaseLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizationRepository(client: stub) + let repo = SDKInAppPurchaseLocalizations(client: stub) let result = try await repo.listLocalizations(iapId: "iap-1") #expect(result[0].id == "loc-xyz") @@ -73,7 +73,7 @@ struct SDKInAppPurchaseLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizationRepository(client: stub) + let repo = SDKInAppPurchaseLocalizations(client: stub) let result = try await repo.createLocalization( iapId: "iap-42", locale: "en-US", @@ -99,7 +99,7 @@ struct SDKInAppPurchaseLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizationRepository(client: stub) + let repo = SDKInAppPurchaseLocalizations(client: stub) let result = try await repo.createLocalization( iapId: "iap-1", locale: "zh-Hans", @@ -123,7 +123,7 @@ struct SDKInAppPurchaseLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizationRepository(client: stub) + let repo = SDKInAppPurchaseLocalizations(client: stub) let result = try await repo.updateLocalization( localizationId: "loc-1", name: "Renamed", description: "New desc" ) @@ -138,7 +138,7 @@ struct SDKInAppPurchaseLocalizationRepositoryTests { @Test func `deleteLocalization performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseLocalizationRepository(client: stub) + let repo = SDKInAppPurchaseLocalizations(client: stub) try await repo.deleteLocalization(localizationId: "loc-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePricesTests.swift similarity index 94% rename from Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePricesTests.swift index 26fe82ab..92bf6ee1 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePricesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchasePriceRepositoryTests { +struct SDKInAppPurchasePricesTests { // MARK: - listPricePoints @@ -17,7 +17,7 @@ struct SDKInAppPurchasePriceRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.listPricePoints(iapId: "iap-99", territory: nil, limit: nil, cursor: nil) #expect(result.data.count == 2) @@ -37,7 +37,7 @@ struct SDKInAppPurchasePriceRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.listPricePoints(iapId: "iap-1", territory: nil, limit: nil, cursor: nil) #expect(result.data[0].territory == "USA") @@ -56,7 +56,7 @@ struct SDKInAppPurchasePriceRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.listPricePoints(iapId: "iap-1", territory: nil, limit: nil, cursor: nil) #expect(result.data[0].customerPrice == "0.99") @@ -71,7 +71,7 @@ struct SDKInAppPurchasePriceRepositoryTests { meta: PagingInformation(paging: .init(total: 100, limit: 50, nextCursor: "next-page-token")) )) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.listPricePoints(iapId: "iap-1", territory: nil, limit: 50, cursor: nil) #expect(result.nextCursor == "next-page-token") @@ -87,7 +87,7 @@ struct SDKInAppPurchasePriceRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.setPriceSchedule(iapId: "iap-abc", baseTerritory: "USA", pricePointId: "pp-1") #expect(result.id == "sched-1") @@ -99,7 +99,7 @@ struct SDKInAppPurchasePriceRepositoryTests { // back-reference so the server knows which IAP the price belongs to. Omitting either // produces a 4xx that surfaces as a 500 to web clients. @Test func `price schedule request mirrors iOS app shape`() throws { - let request = SDKInAppPurchasePriceRepository.makePriceScheduleCreateRequest( + let request = SDKInAppPurchasePrices.makePriceScheduleCreateRequest( iapId: "iap-abc", baseTerritory: "CHN", pricePointId: "pp-1" @@ -150,7 +150,7 @@ struct SDKInAppPurchasePriceRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.listEqualizations(pricePointId: "pp-USA", limit: nil) #expect(result.count == 2) @@ -169,7 +169,7 @@ struct SDKInAppPurchasePriceRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.listEqualizations(pricePointId: "pp-USA", limit: nil) // The equalizations endpoint is keyed by price point, not by IAP, so iapId is empty. @@ -200,7 +200,7 @@ struct SDKInAppPurchasePriceRepositoryTests { // Step 3: equalizations empty. stub.willReturn(InAppPurchasePricePointsResponse(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.getPriceSchedule(iapId: "iap-7") #expect(result?.baseTerritory?.id == "USA") @@ -269,7 +269,7 @@ struct SDKInAppPurchasePriceRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.getPriceSchedule(iapId: "iap-7") // territoryPrices contains USA (manual + equalized) deduped + JPN (equalized). @@ -317,7 +317,7 @@ struct SDKInAppPurchasePriceRepositoryTests { ]) stub.willReturn(InAppPurchasePricePointsResponse(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchasePriceRepository(client: stub) + let repo = SDKInAppPurchasePrices(client: stub) let result = try await repo.getPriceSchedule(iapId: "iap-7") let prices = result?.territoryPrices ?? [] diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionsTests.swift similarity index 80% rename from Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionsTests.swift index 4ba02e66..89e94ef3 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseSubmissionRepositoryTests { +struct SDKInAppPurchaseSubmissionsTests { @Test func `submitInAppPurchase injects iapId into result`() async throws { let stub = StubAPIClient() @@ -12,7 +12,7 @@ struct SDKInAppPurchaseSubmissionRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseSubmissionRepository(client: stub) + let repo = SDKInAppPurchaseSubmissions(client: stub) let result = try await repo.submitInAppPurchase(iapId: "iap-abc") #expect(result.id == "sub-1") @@ -21,7 +21,7 @@ struct SDKInAppPurchaseSubmissionRepositoryTests { @Test func `deleteSubmission performs void request via manual DELETE`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseSubmissionRepository(client: stub) + let repo = SDKInAppPurchaseSubmissions(client: stub) try await repo.deleteSubmission(submissionId: "sub-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasesTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasesTests.swift index bd30a09f..20dca02f 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseRepositoryTests { +struct SDKInAppPurchasesTests { // MARK: - listInAppPurchases @@ -17,7 +17,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-99", limit: nil) #expect(result.data.count == 2) @@ -33,7 +33,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].id == "iap-abc") @@ -48,7 +48,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].type == .consumable) @@ -61,7 +61,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].type == .nonConsumable) @@ -74,7 +74,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].reviewNote == "Use code TEST") @@ -87,7 +87,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].reviewNote == nil) @@ -100,7 +100,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].state == .missingMetadata) @@ -121,7 +121,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data.allSatisfy { $0.isFirstTimeSubmission == true }) @@ -139,7 +139,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data.allSatisfy { $0.isFirstTimeSubmission == false }) @@ -157,7 +157,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) let newIAP = try #require(result.data.first { $0.id == "iap-new" }) @@ -169,7 +169,7 @@ struct SDKInAppPurchaseRepositoryTests { let stub = StubAPIClient() stub.willReturn(InAppPurchasesV2Response(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data.isEmpty) @@ -194,7 +194,7 @@ struct SDKInAppPurchaseRepositoryTests { ["iap-1": true, "iap-2": false] } - let repo = SDKInAppPurchaseRepository(client: stub, irisFlagsProvider: enricher) + let repo = SDKInAppPurchases(client: stub, irisFlagsProvider: enricher) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) let iap1 = try #require(result.data.first { $0.id == "iap-1" }) @@ -212,7 +212,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].submitWithNextAppStoreVersion == false) @@ -231,7 +231,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.createInAppPurchase( appId: "app-42", referenceName: "Gold Coins", @@ -255,7 +255,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.createInAppPurchase( appId: "app-1", referenceName: "Subscription", @@ -268,7 +268,7 @@ struct SDKInAppPurchaseRepositoryTests { @Test func `createInAppPurchase throws for freeSubscription type`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) await #expect(throws: (any Error).self) { try await repo.createInAppPurchase( appId: "app-1", @@ -291,7 +291,7 @@ struct SDKInAppPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) let result = try await repo.updateInAppPurchase( iapId: "iap-1", referenceName: "Renamed", reviewNote: "Note", isFamilySharable: true ) @@ -305,7 +305,7 @@ struct SDKInAppPurchaseRepositoryTests { @Test func `deleteInAppPurchase performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseRepository(client: stub) + let repo = SDKInAppPurchases(client: stub) try await repo.deleteInAppPurchase(iapId: "iap-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodesTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodesTests.swift index c736d59a..a266b5a9 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseOfferCodeRepositoryTests { +struct SDKInAppPurchaseOfferCodesTests { // MARK: - listOfferCodes @@ -33,7 +33,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.listOfferCodes(iapId: "iap-99") #expect(result.count == 2) @@ -57,7 +57,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.listOfferCodes(iapId: "iap-1") #expect(result[0].id == "iap-oc-1") @@ -85,7 +85,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.listOfferCodes(iapId: "iap-1") #expect(result[0].productionCodeCount == 8_500) @@ -109,7 +109,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.createOfferCode( iapId: "iap-42", name: "LAUNCH", @@ -142,7 +142,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.updateOfferCode(offerCodeId: "iap-oc-1", isActive: false) #expect(result.id == "iap-oc-1") @@ -170,7 +170,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.listCustomCodes(offerCodeId: "iap-oc-10") #expect(result.count == 1) @@ -198,7 +198,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.createCustomCode( offerCodeId: "iap-oc-5", customCode: "WELCOME", @@ -228,7 +228,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.updateCustomCode(customCodeId: "iap-cc-1", isActive: false) #expect(result.id == "iap-cc-1") @@ -255,7 +255,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.listOneTimeUseCodes(offerCodeId: "iap-oc-20") #expect(result.count == 1) @@ -281,7 +281,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.createOneTimeUseCode( offerCodeId: "iap-oc-7", numberOfCodes: 750, @@ -310,7 +310,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.createOneTimeUseCode( offerCodeId: "iap-oc-7", numberOfCodes: 10, @@ -337,7 +337,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.updateOneTimeUseCode(oneTimeCodeId: "iap-otc-1", isActive: false) #expect(result.id == "iap-otc-1") @@ -360,7 +360,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.listPrices(offerCodeId: "oc-77") #expect(result[0].offerCodeId == "oc-77") @@ -371,7 +371,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { @Test func `fetchOneTimeUseCodeValues returns CSV string from SDK`() async throws { let stub = StubAPIClient() stub.willReturn("CODE1\nCODE2\nCODE3\n") - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.fetchOneTimeUseCodeValues(oneTimeCodeId: "otc-1") #expect(result == "CODE1\nCODE2\nCODE3\n") } @@ -395,7 +395,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<100, nextCursor: "page-2"), page(100..<175, nextCursor: nil)]) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) let result = try await repo.listPrices(offerCodeId: "oc-1") #expect(result.count == 175) @@ -408,7 +408,7 @@ struct SDKInAppPurchaseOfferCodeRepositoryTests { let stub = StubAPIClient() stub.willReturn(InAppPurchaseOfferPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) + let repo = SDKInAppPurchaseOfferCodes(client: stub) _ = try await repo.listPrices(offerCodeId: "oc-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssetsTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssetsTests.swift index 4ceb6ace..a885de52 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssetsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseReviewRepositoryTests { +struct SDKInAppPurchaseReviewAssetsTests { // MARK: - listImages @@ -23,7 +23,7 @@ struct SDKInAppPurchaseReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewRepository(client: stub) + let repo = SDKInAppPurchaseReviewAssets(client: stub) let result = try await repo.listImages(iapId: "iap-77") #expect(result.count == 2) @@ -42,7 +42,7 @@ struct SDKInAppPurchaseReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewRepository(client: stub) + let repo = SDKInAppPurchaseReviewAssets(client: stub) let result = try await repo.listImages(iapId: "iap-1") #expect(result[0].fileName == "promo.png") @@ -68,7 +68,7 @@ struct SDKInAppPurchaseReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewRepository(client: stub) + let repo = SDKInAppPurchaseReviewAssets(client: stub) let result = try await repo.listImages(iapId: "iap-1") #expect(result[0].imageAsset == nil) @@ -92,7 +92,7 @@ struct SDKInAppPurchaseReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewRepository(client: stub) + let repo = SDKInAppPurchaseReviewAssets(client: stub) let result = try await repo.listImages(iapId: "iap-1") #expect(result[0].imageAsset == nil) @@ -116,7 +116,7 @@ struct SDKInAppPurchaseReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewRepository(client: stub) + let repo = SDKInAppPurchaseReviewAssets(client: stub) let result = try await repo.listImages(iapId: "iap-1") #expect(result[0].imageAsset?.templateUrl == "https://cdn/{w}x{h}bb.{f}") @@ -128,14 +128,14 @@ struct SDKInAppPurchaseReviewRepositoryTests { @Test func `deleteReviewScreenshot performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseReviewRepository(client: stub) + let repo = SDKInAppPurchaseReviewAssets(client: stub) try await repo.deleteReviewScreenshot(screenshotId: "rs-1") #expect(stub.voidRequestCalled == true) } @Test func `deleteImage performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseReviewRepository(client: stub) + let repo = SDKInAppPurchaseReviewAssets(client: stub) try await repo.deleteImage(imageId: "img-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift b/Tests/ASCKitTests/Apps/Internal/SDKAppsTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Internal/SDKAppsTests.swift index 8022e9bc..44fbb307 100644 --- a/Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Internal/SDKAppsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppRepositoryTests { +struct SDKAppsTests { @Test func `getApp maps single app from SDK response`() async throws { let stub = StubAPIClient() @@ -16,7 +16,7 @@ struct SDKAppRepositoryTests { links: .init(this: "") )) - let repo = SDKAppRepository(client: stub) + let repo = SDKApps(client: stub) let result = try await repo.getApp(id: "app-99") #expect(result.id == "app-99") @@ -53,7 +53,7 @@ struct SDKAppRepositoryTests { links: .init(this: "") )) - let repo = SDKAppRepository(client: stub) + let repo = SDKApps(client: stub) let icon = try await repo.fetchAppIcon(appId: "app-1") #expect(icon?.templateUrl == "https://cdn.example.com/a/{w}x{h}bb.{f}") @@ -76,7 +76,7 @@ struct SDKAppRepositoryTests { links: .init(this: "") )) - let repo = SDKAppRepository(client: stub) + let repo = SDKApps(client: stub) let icon = try await repo.fetchAppIcon(appId: "app-1") #expect(icon == nil) @@ -95,7 +95,7 @@ struct SDKAppRepositoryTests { links: .init(this: "") )) - let repo = SDKAppRepository(client: stub) + let repo = SDKApps(client: stub) let result = try await repo.listApps(limit: nil) #expect(result.data[0].id == "app-1") diff --git a/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsTests.swift index e4d3e03b..63c56e74 100644 --- a/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKDiagnosticsRepositoryTests { +struct SDKDiagnosticsTests { private func makeSDKSignature( id: String = "sig-1", @@ -31,7 +31,7 @@ struct SDKDiagnosticsRepositoryTests { links: .init(this: "") )) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result.count == 1) @@ -53,7 +53,7 @@ struct SDKDiagnosticsRepositoryTests { links: .init(this: "") )) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-99", diagnosticType: nil) #expect(result.allSatisfy { $0.buildId == "build-99" }) @@ -66,7 +66,7 @@ struct SDKDiagnosticsRepositoryTests { links: .init(this: "") )) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result[0].insightDirection == nil) @@ -79,7 +79,7 @@ struct SDKDiagnosticsRepositoryTests { links: .init(this: "") )) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: .diskWrites) #expect(result[0].diagnosticType == .diskWrites) @@ -92,7 +92,7 @@ struct SDKDiagnosticsRepositoryTests { links: .init(this: "") )) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: .launches) #expect(result[0].diagnosticType == .launches) @@ -105,7 +105,7 @@ struct SDKDiagnosticsRepositoryTests { links: .init(this: "") )) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result[0].insightDirection == "DOWN") @@ -118,7 +118,7 @@ struct SDKDiagnosticsRepositoryTests { links: .init(this: "") )) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result[0].insightDirection == "UNDEFINED") @@ -133,7 +133,7 @@ struct SDKDiagnosticsRepositoryTests { ) stub.willReturn(DiagnosticSignaturesResponse(data: [sig], links: .init(this: ""))) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result[0].diagnosticType == .hangs) @@ -177,7 +177,7 @@ struct SDKDiagnosticsRepositoryTests { ) stub.willReturn(logs) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listLogs(signatureId: "sig-1") #expect(result[0].callStackSummary == "main > UIApplicationMain > layoutSubviews") @@ -199,7 +199,7 @@ struct SDKDiagnosticsRepositoryTests { ) stub.willReturn(logs) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listLogs(signatureId: "sig-1") #expect(result[0].callStackSummary == nil) @@ -234,7 +234,7 @@ struct SDKDiagnosticsRepositoryTests { ) stub.willReturn(logs) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listLogs(signatureId: "sig-1") #expect(result.count == 1) @@ -251,7 +251,7 @@ struct SDKDiagnosticsRepositoryTests { let stub = StubAPIClient() stub.willReturn(DiagnosticLogs(productData: nil, version: "1.0")) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listLogs(signatureId: "sig-1") #expect(result.isEmpty) @@ -268,7 +268,7 @@ struct SDKDiagnosticsRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKDiagnosticsRepository(client: stub) + let repo = SDKDiagnostics(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result.count == 75) diff --git a/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsTests.swift index a1c544d0..591d5656 100644 --- a/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKPerfMetricsRepositoryTests { +struct SDKPerfMetricsTests { private func makeXcodeMetrics( platform: String = "IOS", @@ -49,7 +49,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics()) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.count == 1) @@ -68,7 +68,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics()) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-42", metricType: nil) #expect(result.allSatisfy { $0.parentId == "app-42" }) @@ -79,7 +79,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics()) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listBuildMetrics(buildId: "build-7", metricType: nil) #expect(result.allSatisfy { $0.parentId == "build-7" }) @@ -93,7 +93,7 @@ struct SDKPerfMetricsRepositoryTests { metricIdentifier: "peakMemory" )) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result[0].id == "app-1-MEMORY-peakMemory") @@ -103,7 +103,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .hang, metricIdentifier: "hangRate")) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: .hang) #expect(result.count == 1) @@ -114,7 +114,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .disk, metricIdentifier: "diskWrites")) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listBuildMetrics(buildId: "build-1", metricType: .disk) #expect(result.count == 1) @@ -131,7 +131,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: sdkCategory, metricIdentifier: "test")) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result[0].category == domainCategory) @@ -160,7 +160,7 @@ struct SDKPerfMetricsRepositoryTests { ) stub.willReturn(metrics) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.count == 1) @@ -183,7 +183,7 @@ struct SDKPerfMetricsRepositoryTests { ) stub.willReturn(metrics) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.isEmpty) @@ -207,7 +207,7 @@ struct SDKPerfMetricsRepositoryTests { ) stub.willReturn(metrics) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.count == 1) @@ -220,7 +220,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(XcodeMetrics(version: "1.0", insights: nil, productData: nil)) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.isEmpty) @@ -230,7 +230,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .storage, metricIdentifier: "storageUsed")) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.map(\.category) == [.storage]) @@ -240,7 +240,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .storage, metricIdentifier: "storageUsed")) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) _ = try await repo.listAppMetrics(appId: "app-1", metricType: .storage) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) @@ -251,7 +251,7 @@ struct SDKPerfMetricsRepositoryTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .storage, metricIdentifier: "storageUsed")) - let repo = SDKPerfMetricsRepository(client: stub) + let repo = SDKPerfMetrics(client: stub) _ = try await repo.listBuildMetrics(buildId: "build-1", metricType: .storage) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewsTests.swift similarity index 97% rename from Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewsTests.swift index 42a96011..0ed8d6cf 100644 --- a/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKPerfOverviewRepositoryTests { +struct SDKPerfOverviewsTests { /// A real `GET /v1/apps/{id}/performanceOverviews` body for an app without data (redacted). private let emptyOverviewJSON = """ @@ -60,10 +60,10 @@ struct SDKPerfOverviewRepositoryTests { } """ - private func makeRepo(json: String) -> SDKPerfOverviewRepository { + private func makeRepo(json: String) -> SDKPerfOverviews { let stub = StubAPIClient() stub.willReturn(Data(json.utf8)) - return SDKPerfOverviewRepository(client: stub) + return SDKPerfOverviews(client: stub) } @Test func `should show an empty overview when App Store Connect has no performance data for the app`() async throws { diff --git a/Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift b/Tests/ASCKitTests/Apps/Pricing/Internal/SDKAppPricesTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Pricing/Internal/SDKAppPricesTests.swift index 3437e746..611c813b 100644 --- a/Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Pricing/Internal/SDKAppPricesTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKPricingRepositoryTests { +struct SDKAppPricesTests { @Test func `hasPricing returns true when price schedule exists`() async throws { let stub = StubAPIClient() @@ -16,7 +16,7 @@ struct SDKPricingRepositoryTests { links: .init(this: "") )) - let repo = SDKPricingRepository(client: stub) + let repo = SDKAppPrices(client: stub) let result = try await repo.hasPricing(appId: "app-1") #expect(result == true) } @@ -24,7 +24,7 @@ struct SDKPricingRepositoryTests { @Test func `hasPricing returns false when request throws`() async throws { let stub = ThrowingStubAPIClient() - let repo = SDKPricingRepository(client: stub) + let repo = SDKAppPrices(client: stub) let result = try await repo.hasPricing(appId: "app-no-pricing") #expect(result == false) } @@ -53,7 +53,7 @@ private final class ThrowingStubAPIClient: APIClient, @unchecked Sendable { let stub = StubAPIClient() stub.willReturnPages([page(0..<200, nextCursor: "page-2"), page(200..<250, nextCursor: nil)]) - let repo = SDKPricingRepository(client: stub) + let repo = SDKAppPrices(client: stub) let points = try await repo.listPricePoints(appId: "app-1", territory: "USA") #expect(points.count == 250) @@ -70,7 +70,7 @@ private final class ThrowingStubAPIClient: APIClient, @unchecked Sendable { data: .init(type: .appPriceSchedules, id: "sched-1"), links: .init(this: "") )) - let repo = SDKPricingRepository(client: stub) + let repo = SDKAppPrices(client: stub) let schedule = try await repo.setPriceSchedule(appId: "app-1", baseTerritory: "USA", pricePointId: "pp-9") #expect(schedule == ASCKit.AppPriceSchedule(id: "sched-1", appId: "app-1", baseTerritory: "USA")) diff --git a/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift b/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionsTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionsTests.swift index 2862958f..6a5f8f27 100644 --- a/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKProductVersionRepositoryTests { +struct SDKProductVersionsTests { @Test func `in-app purchase versions carry their IAP id, version number and state`() async throws { let stub = StubAPIClient() @@ -15,7 +15,7 @@ struct SDKProductVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKProductVersionRepository(client: stub) + let repo = SDKProductVersions(client: stub) let versions = try await repo.listInAppPurchaseVersions(iapId: "iap-7") #expect(versions == [ @@ -34,7 +34,7 @@ struct SDKProductVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKProductVersionRepository(client: stub) + let repo = SDKProductVersions(client: stub) let versions = try await repo.listSubscriptionVersions(subscriptionId: "sub-7") #expect(versions == [ @@ -53,7 +53,7 @@ struct SDKProductVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKProductVersionRepository(client: stub) + let repo = SDKProductVersions(client: stub) let versions = try await repo.listSubscriptionGroupVersions(groupId: "grp-7") #expect(versions == [ @@ -74,7 +74,7 @@ struct SDKProductVersionRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKProductVersionRepository(client: stub) + let repo = SDKProductVersions(client: stub) let versions = try await repo.listSubscriptionVersions(subscriptionId: "sub-7") #expect(versions.count == 75) diff --git a/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift b/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchasesTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift rename to Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchasesTests.swift index ad3204c3..5bbf70ac 100644 --- a/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchasesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKPromotedPurchaseRepositoryTests { +struct SDKPromotedPurchasesTests { @Test func `listPromotedPurchases injects appId into each item`() async throws { let stub = StubAPIClient() @@ -21,7 +21,7 @@ struct SDKPromotedPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKPromotedPurchaseRepository(client: stub) + let repo = SDKPromotedPurchases(client: stub) let result = try await repo.listPromotedPurchases(appId: "app-99", limit: nil) #expect(result.data.count == 2) @@ -40,7 +40,7 @@ struct SDKPromotedPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKPromotedPurchaseRepository(client: stub) + let repo = SDKPromotedPurchases(client: stub) let result = try await repo.listPromotedPurchases(appId: "app-1", limit: nil) #expect(result.data[0].state == .approved) @@ -63,7 +63,7 @@ struct SDKPromotedPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKPromotedPurchaseRepository(client: stub) + let repo = SDKPromotedPurchases(client: stub) let result = try await repo.listPromotedPurchases(appId: "app-1", limit: nil) #expect(result.data[0].inAppPurchaseId == "iap-1") @@ -81,7 +81,7 @@ struct SDKPromotedPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKPromotedPurchaseRepository(client: stub) + let repo = SDKPromotedPurchases(client: stub) let result = try await repo.createPromotedPurchase( appId: "app-42", isVisibleForAllUsers: true, isEnabled: true, inAppPurchaseId: "iap-1", subscriptionId: nil @@ -102,7 +102,7 @@ struct SDKPromotedPurchaseRepositoryTests { links: .init(this: "") )) - let repo = SDKPromotedPurchaseRepository(client: stub) + let repo = SDKPromotedPurchases(client: stub) let result = try await repo.updatePromotedPurchase( promotedId: "pp-1", isVisibleForAllUsers: false, isEnabled: false ) @@ -113,7 +113,7 @@ struct SDKPromotedPurchaseRepositoryTests { @Test func `deletePromotedPurchase performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKPromotedPurchaseRepository(client: stub) + let repo = SDKPromotedPurchases(client: stub) try await repo.deletePromotedPurchase(promotedId: "pp-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewsTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewsTests.swift index a51f5060..c001e6f6 100644 --- a/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewsTests.swift @@ -15,7 +15,7 @@ struct SDKCustomerReviewRepositoryListReviewsTests { links: .init(this: "") )) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.listReviews(appId: "app-99") #expect(result.count == 2) @@ -40,7 +40,7 @@ struct SDKCustomerReviewRepositoryListReviewsTests { links: .init(this: "") )) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.listReviews(appId: "app-1") #expect(result[0].rating == 5) @@ -62,7 +62,7 @@ struct SDKCustomerReviewRepositoryListReviewsTests { links: .init(this: "") )) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.listReviews(appId: "app-1") #expect(result[0].territory == "USA") @@ -77,7 +77,7 @@ struct SDKCustomerReviewRepositoryListReviewsTests { links: .init(this: "") )) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.listReviews(appId: "app-1") #expect(result[0].territory == nil) @@ -98,7 +98,7 @@ struct SDKCustomerReviewRepositoryGetReviewTests { links: .init(this: "") )) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.getReview(reviewId: "rev-42") #expect(result.id == "rev-42") @@ -122,7 +122,7 @@ struct SDKCustomerReviewRepositoryGetResponseTests { links: .init(this: "") )) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.getResponse(reviewId: "rev-42") #expect(result.id == "resp-1") @@ -142,7 +142,7 @@ struct SDKCustomerReviewRepositoryGetResponseTests { links: .init(this: "") )) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.getResponse(reviewId: "rev-1") #expect(result.state == .pendingPublish) @@ -163,7 +163,7 @@ struct SDKCustomerReviewRepositoryCreateResponseTests { links: .init(this: "") )) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.createResponse(reviewId: "rev-42", responseBody: "Thank you!") #expect(result.id == "resp-new") @@ -179,7 +179,7 @@ struct SDKCustomerReviewRepositoryDeleteResponseTests { @Test func `deleteResponse calls void request`() async throws { let stub = StubAPIClient() - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) try await repo.deleteResponse(responseId: "resp-1") #expect(stub.voidRequestCalled) @@ -196,7 +196,7 @@ struct SDKCustomerReviewRepositoryDeleteResponseTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKCustomerReviewRepository(client: stub) + let repo = SDKCustomerReviews(client: stub) let result = try await repo.listReviews(appId: "app-1") #expect(result.count == 75) diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilitiesTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilitiesTests.swift index a5b21311..2529fe56 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilitiesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionAvailabilityRepositoryTests { +struct SDKSubscriptionAvailabilitiesTests { @Test func `getAvailability composes attributes call with availableTerritories relationship call`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKSubscriptionAvailabilityRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionAvailabilityRepository(client: stub) + let repo = SDKSubscriptionAvailabilities(client: stub) let result = try await repo.getAvailability(subscriptionId: "sub-99") #expect(result?.id == "avail-1") @@ -50,7 +50,7 @@ struct SDKSubscriptionAvailabilityRepositoryTests { } stub.willReturn(TerritoriesResponse(data: many, links: .init(this: ""))) - let repo = SDKSubscriptionAvailabilityRepository(client: stub) + let repo = SDKSubscriptionAvailabilities(client: stub) let result = try await repo.getAvailability(subscriptionId: "sub-big") #expect(result?.territories.count == 175) @@ -68,7 +68,7 @@ struct SDKSubscriptionAvailabilityRepositoryTests { )) stub.willReturn(TerritoriesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionAvailabilityRepository(client: stub) + let repo = SDKSubscriptionAvailabilities(client: stub) let result = try await repo.getAvailability(subscriptionId: "sub-1") #expect(result?.territories.isEmpty == true) @@ -76,7 +76,7 @@ struct SDKSubscriptionAvailabilityRepositoryTests { @Test func `getAvailability returns nil when subscription has no availability resource yet`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionAvailabilityRepository(client: stub) + let repo = SDKSubscriptionAvailabilities(client: stub) let result = try? await repo.getAvailability(subscriptionId: "sub-fresh") #expect(result == nil) } @@ -98,7 +98,7 @@ struct SDKSubscriptionAvailabilityRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionAvailabilityRepository(client: stub) + let repo = SDKSubscriptionAvailabilities(client: stub) let result = try await repo.createAvailability( subscriptionId: "sub-42", isAvailableInNewTerritories: false, diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationsTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationsTests.swift index b3bb5fee..b61f3901 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionGroupLocalizationRepositoryTests { +struct SDKSubscriptionGroupLocalizationsTests { @Test func `listLocalizations injects groupId into each item`() async throws { let stub = StubAPIClient() @@ -21,7 +21,7 @@ struct SDKSubscriptionGroupLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) + let repo = SDKSubscriptionGroupLocalizations(client: stub) let result = try await repo.listLocalizations(groupId: "grp-77") #expect(result.count == 2) @@ -40,7 +40,7 @@ struct SDKSubscriptionGroupLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) + let repo = SDKSubscriptionGroupLocalizations(client: stub) let result = try await repo.listLocalizations(groupId: "grp-1") #expect(result[0].locale == "en-US") @@ -58,7 +58,7 @@ struct SDKSubscriptionGroupLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) + let repo = SDKSubscriptionGroupLocalizations(client: stub) let result = try await repo.createLocalization( groupId: "grp-42", locale: "en-US", name: "Premium", customAppName: nil ) @@ -78,7 +78,7 @@ struct SDKSubscriptionGroupLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) + let repo = SDKSubscriptionGroupLocalizations(client: stub) let result = try await repo.updateLocalization(localizationId: "loc-1", name: "Renamed", customAppName: nil) #expect(result.id == "loc-1") @@ -89,7 +89,7 @@ struct SDKSubscriptionGroupLocalizationRepositoryTests { @Test func `deleteLocalization performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) + let repo = SDKSubscriptionGroupLocalizations(client: stub) try await repo.deleteLocalization(localizationId: "loc-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupsTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupsTests.swift index ee273830..a0cb6916 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionGroupRepositoryTests { +struct SDKSubscriptionGroupsTests { // MARK: - listSubscriptionGroups @@ -17,7 +17,7 @@ struct SDKSubscriptionGroupRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupRepository(client: stub) + let repo = SDKSubscriptionGroups(client: stub) let result = try await repo.listSubscriptionGroups(appId: "app-99", limit: nil) #expect(result.data.count == 2) @@ -33,7 +33,7 @@ struct SDKSubscriptionGroupRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupRepository(client: stub) + let repo = SDKSubscriptionGroups(client: stub) let result = try await repo.listSubscriptionGroups(appId: "app-1", limit: nil) #expect(result.data[0].id == "grp-abc") @@ -53,7 +53,7 @@ struct SDKSubscriptionGroupRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupRepository(client: stub) + let repo = SDKSubscriptionGroups(client: stub) let result = try await repo.createSubscriptionGroup(appId: "app-42", referenceName: "Premium Plans") #expect(result.id == "grp-new") @@ -71,7 +71,7 @@ struct SDKSubscriptionGroupRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupRepository(client: stub) + let repo = SDKSubscriptionGroups(client: stub) let result = try await repo.updateSubscriptionGroup(groupId: "grp-1", referenceName: "Renamed Plans") #expect(result.id == "grp-1") @@ -81,7 +81,7 @@ struct SDKSubscriptionGroupRepositoryTests { @Test func `deleteSubscriptionGroup performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionGroupRepository(client: stub) + let repo = SDKSubscriptionGroups(client: stub) try await repo.deleteSubscriptionGroup(groupId: "grp-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationsTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationsTests.swift index d8aed37a..389374a5 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionLocalizationRepositoryTests { +struct SDKSubscriptionLocalizationsTests { // MARK: - listLocalizations @@ -17,7 +17,7 @@ struct SDKSubscriptionLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizationRepository(client: stub) + let repo = SDKSubscriptionLocalizations(client: stub) let result = try await repo.listLocalizations(subscriptionId: "sub-42") #expect(result.count == 2) @@ -37,7 +37,7 @@ struct SDKSubscriptionLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizationRepository(client: stub) + let repo = SDKSubscriptionLocalizations(client: stub) let result = try await repo.listLocalizations(subscriptionId: "sub-1") #expect(result[0].locale == "de-DE") @@ -54,7 +54,7 @@ struct SDKSubscriptionLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizationRepository(client: stub) + let repo = SDKSubscriptionLocalizations(client: stub) let result = try await repo.listLocalizations(subscriptionId: "sub-1") #expect(result[0].id == "loc-xyz") @@ -73,7 +73,7 @@ struct SDKSubscriptionLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizationRepository(client: stub) + let repo = SDKSubscriptionLocalizations(client: stub) let result = try await repo.createLocalization( subscriptionId: "sub-42", locale: "en-US", @@ -99,7 +99,7 @@ struct SDKSubscriptionLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizationRepository(client: stub) + let repo = SDKSubscriptionLocalizations(client: stub) let result = try await repo.createLocalization( subscriptionId: "sub-1", locale: "zh-Hans", @@ -121,7 +121,7 @@ struct SDKSubscriptionLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizationRepository(client: stub) + let repo = SDKSubscriptionLocalizations(client: stub) let result = try await repo.updateLocalization(localizationId: "loc-1", name: "Renamed", description: "New") #expect(result.id == "loc-1") @@ -131,7 +131,7 @@ struct SDKSubscriptionLocalizationRepositoryTests { @Test func `deleteLocalization performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionLocalizationRepository(client: stub) + let repo = SDKSubscriptionLocalizations(client: stub) try await repo.deleteLocalization(localizationId: "loc-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPricesTests.swift similarity index 94% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPricesTests.swift index e4937871..b14e9a03 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPricesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionPriceRepositoryTests { +struct SDKSubscriptionPricesTests { @Test func `listPricePoints injects subscriptionId into each price point`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKSubscriptionPriceRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) let result = try await repo.listPricePoints(subscriptionId: "sub-77", territory: nil, limit: nil, cursor: nil) #expect(result.data.count == 2) @@ -43,7 +43,7 @@ struct SDKSubscriptionPriceRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) let result = try await repo.listPricePoints(subscriptionId: "sub-1", territory: "USA", limit: nil, cursor: nil) #expect(result.data[0].customerPrice == "9.99") @@ -61,7 +61,7 @@ struct SDKSubscriptionPriceRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) let result = try await repo.setPrice( subscriptionId: "sub-42", territory: "USA", pricePointId: "spp-1", startDate: nil, preserveCurrentPrice: nil @@ -81,7 +81,7 @@ struct SDKSubscriptionPriceRepositoryTests { stub.willReturn(SubscriptionPricesResponse(data: [], links: .init(this: ""))) let inputs = (0..<175).map { SubscriptionPriceInput(territory: "T\($0)", pricePointId: "spp-\($0)") } - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) _ = try await repo.setPrices(subscriptionId: "sub-1", prices: inputs) let writes = stub.requests.filter { $0.method != "GET" } @@ -96,7 +96,7 @@ struct SDKSubscriptionPriceRepositoryTests { )) stub.willReturn(SubscriptionPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) _ = try await repo.setPrices(subscriptionId: "sub-1", prices: [ SubscriptionPriceInput(territory: "USA", pricePointId: "spp-USA", startDate: "2026-10-01", preserveCurrentPrice: true), SubscriptionPriceInput(territory: "JPN", pricePointId: "spp-JPN"), @@ -126,7 +126,7 @@ struct SDKSubscriptionPriceRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) let result = try await repo.listEqualizations(pricePointId: "spp-USA", limit: nil) #expect(result.count == 2) @@ -142,7 +142,7 @@ struct SDKSubscriptionPriceRepositoryTests { let stub = StubAPIClient() stub.willReturn(SubscriptionPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) let result = try await repo.getPriceSchedule(subscriptionId: "sub-7") #expect(result == nil) @@ -193,7 +193,7 @@ struct SDKSubscriptionPriceRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) let result = try await repo.getPriceSchedule(subscriptionId: "sub-7") let prices: [ASCKit.TerritoryPrice] = result?.territoryPrices ?? [] @@ -237,7 +237,7 @@ struct SDKSubscriptionPriceRepositoryTests { ]) // No equalizations stubbed — every territory must come from the manual prices. - let repo = SDKSubscriptionPriceRepository(client: stub) + let repo = SDKSubscriptionPrices(client: stub) let result = try await repo.getPriceSchedule(subscriptionId: "sub-7") let prices = result?.territoryPrices ?? [] diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOffersTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOffersTests.swift index bb36a0b4..012df6cc 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOffersTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionPromotionalOfferRepositoryTests { +struct SDKSubscriptionPromotionalOffersTests { @Test func `listPromotionalOffers injects subscriptionId into each offer`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKSubscriptionPromotionalOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) + let repo = SDKSubscriptionPromotionalOffers(client: stub) let result = try await repo.listPromotionalOffers(subscriptionId: "sub-77") #expect(result.count == 2) @@ -43,7 +43,7 @@ struct SDKSubscriptionPromotionalOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) + let repo = SDKSubscriptionPromotionalOffers(client: stub) let result = try await repo.listPromotionalOffers(subscriptionId: "sub-1") #expect(result[0].duration == .threeMonths) @@ -63,7 +63,7 @@ struct SDKSubscriptionPromotionalOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) + let repo = SDKSubscriptionPromotionalOffers(client: stub) let result = try await repo.createPromotionalOffer( subscriptionId: "sub-42", name: "Winback", offerCode: "wb25", @@ -77,7 +77,7 @@ struct SDKSubscriptionPromotionalOfferRepositoryTests { @Test func `deletePromotionalOffer performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) + let repo = SDKSubscriptionPromotionalOffers(client: stub) try await repo.deletePromotionalOffer(offerId: "po-1") #expect(stub.voidRequestCalled == true) } @@ -97,7 +97,7 @@ struct SDKSubscriptionPromotionalOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) + let repo = SDKSubscriptionPromotionalOffers(client: stub) let result = try await repo.listPrices(offerId: "po-77") #expect(result.count == 1) @@ -125,7 +125,7 @@ struct SDKSubscriptionPromotionalOfferRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<100, nextCursor: "page-2"), page(100..<175, nextCursor: nil)]) - let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) + let repo = SDKSubscriptionPromotionalOffers(client: stub) let result = try await repo.listPrices(offerId: "po-1") #expect(result.count == 175) @@ -138,7 +138,7 @@ struct SDKSubscriptionPromotionalOfferRepositoryTests { let stub = StubAPIClient() stub.willReturn(SubscriptionPromotionalOfferPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) + let repo = SDKSubscriptionPromotionalOffers(client: stub) _ = try await repo.listPrices(offerId: "po-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionsTests.swift similarity index 82% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionsTests.swift index d55f34ea..232eb695 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionSubmissionRepositoryTests { +struct SDKSubscriptionSubmissionsTests { @Test func `submitSubscription injects subscriptionId into result`() async throws { let stub = StubAPIClient() @@ -15,7 +15,7 @@ struct SDKSubscriptionSubmissionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionSubmissionRepository(client: stub) + let repo = SDKSubscriptionSubmissions(client: stub) let result = try await repo.submitSubscription(subscriptionId: "sub-abc") #expect(result.id == "submit-1") @@ -24,7 +24,7 @@ struct SDKSubscriptionSubmissionRepositoryTests { @Test func `deleteSubmission performs void request via manual DELETE`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionSubmissionRepository(client: stub) + let repo = SDKSubscriptionSubmissions(client: stub) try await repo.deleteSubmission(submissionId: "sub-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionsTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionsTests.swift index 45691cbe..e08a9eae 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionRepositoryTests { +struct SDKSubscriptionsTests { // MARK: - listSubscriptions @@ -17,7 +17,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-99", limit: nil) #expect(result.data.count == 2) @@ -33,7 +33,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].id == "sub-1") @@ -50,7 +50,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].subscriptionPeriod == .oneMonth) @@ -65,7 +65,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].reviewNote == "Use code TEST") @@ -80,7 +80,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].reviewNote == nil) @@ -95,7 +95,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].isFamilySharable == true) @@ -113,7 +113,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].multiSeatStatus == .enabled) @@ -129,7 +129,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].multiSeatStatus == nil) @@ -149,7 +149,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.createSubscription( groupId: "grp-42", name: "Monthly Premium", @@ -175,7 +175,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.createSubscription( groupId: "grp-1", name: "Annual", @@ -206,7 +206,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.updateSubscription( subscriptionId: "sub-1", name: "Renamed", isFamilySharable: true, groupLevel: 3, @@ -228,7 +228,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) _ = try await repo.updateSubscription( subscriptionId: "sub-1", name: nil, isFamilySharable: nil, groupLevel: nil, @@ -249,7 +249,7 @@ struct SDKSubscriptionRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) let result = try await repo.updateSubscription( subscriptionId: "sub-1", name: nil, isFamilySharable: nil, groupLevel: nil, @@ -265,7 +265,7 @@ struct SDKSubscriptionRepositoryTests { @Test func `deleteSubscription performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionRepository(client: stub) + let repo = SDKSubscriptions(client: stub) try await repo.deleteSubscription(subscriptionId: "sub-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOffersTests.swift similarity index 94% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOffersTests.swift index c90a8e84..6412b505 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOffersTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKWinBackOfferRepositoryTests { +struct SDKWinBackOffersTests { @Test func `listWinBackOffers injects subscriptionId into each offer`() async throws { let stub = StubAPIClient() @@ -24,7 +24,7 @@ struct SDKWinBackOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKWinBackOfferRepository(client: stub) + let repo = SDKWinBackOffers(client: stub) let result = try await repo.listWinBackOffers(subscriptionId: "sub-77") #expect(result.count == 1) @@ -54,7 +54,7 @@ struct SDKWinBackOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKWinBackOfferRepository(client: stub) + let repo = SDKWinBackOffers(client: stub) let result = try await repo.listWinBackOffers(subscriptionId: "sub-1") #expect(result[0].customerEligibilityTimeSinceLastSubscribedMin == 2) @@ -82,7 +82,7 @@ struct SDKWinBackOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKWinBackOfferRepository(client: stub) + let repo = SDKWinBackOffers(client: stub) let result = try await repo.updateWinBackOffer( offerId: "wb-1", startDate: nil, endDate: nil, @@ -114,7 +114,7 @@ struct SDKWinBackOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKWinBackOfferRepository(client: stub) + let repo = SDKWinBackOffers(client: stub) let result = try await repo.createWinBackOffer( subscriptionId: "sub-42", referenceName: "Lapsed", offerId: "lapsed25", @@ -137,7 +137,7 @@ struct SDKWinBackOfferRepositoryTests { @Test func `deleteWinBackOffer performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKWinBackOfferRepository(client: stub) + let repo = SDKWinBackOffers(client: stub) try await repo.deleteWinBackOffer(offerId: "wb-1") #expect(stub.voidRequestCalled == true) } @@ -157,7 +157,7 @@ struct SDKWinBackOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKWinBackOfferRepository(client: stub) + let repo = SDKWinBackOffers(client: stub) let result = try await repo.listPrices(offerId: "wb-77") #expect(result[0].offerId == "wb-77") @@ -184,7 +184,7 @@ struct SDKWinBackOfferRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<100, nextCursor: "page-2"), page(100..<175, nextCursor: nil)]) - let repo = SDKWinBackOfferRepository(client: stub) + let repo = SDKWinBackOffers(client: stub) let result = try await repo.listPrices(offerId: "wb-1") #expect(result.count == 175) @@ -197,7 +197,7 @@ struct SDKWinBackOfferRepositoryTests { let stub = StubAPIClient() stub.willReturn(WinBackOfferPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKWinBackOfferRepository(client: stub) + let repo = SDKWinBackOffers(client: stub) _ = try await repo.listPrices(offerId: "wb-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffersTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffersTests.swift index 902d91fd..2b726c1d 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffersTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionIntroductoryOfferRepositoryTests { +struct SDKSubscriptionIntroductoryOffersTests { // MARK: - listIntroductoryOffers @@ -25,7 +25,7 @@ struct SDKSubscriptionIntroductoryOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) + let repo = SDKSubscriptionIntroductoryOffers(client: stub) let result = try await repo.listIntroductoryOffers(subscriptionId: "sub-99") #expect(result.count == 2) @@ -45,7 +45,7 @@ struct SDKSubscriptionIntroductoryOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) + let repo = SDKSubscriptionIntroductoryOffers(client: stub) let result = try await repo.listIntroductoryOffers(subscriptionId: "sub-1") #expect(result[0].duration == .sixMonths) @@ -67,7 +67,7 @@ struct SDKSubscriptionIntroductoryOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) + let repo = SDKSubscriptionIntroductoryOffers(client: stub) let result = try await repo.listIntroductoryOffers(subscriptionId: "sub-1") #expect(result[0].territory == "USA") @@ -86,7 +86,7 @@ struct SDKSubscriptionIntroductoryOfferRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) + let repo = SDKSubscriptionIntroductoryOffers(client: stub) let result = try await repo.createIntroductoryOffer( subscriptionId: "sub-42", duration: .oneMonth, @@ -106,7 +106,7 @@ struct SDKSubscriptionIntroductoryOfferRepositoryTests { @Test func `deleteIntroductoryOffer performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) + let repo = SDKSubscriptionIntroductoryOffers(client: stub) try await repo.deleteIntroductoryOffer(offerId: "offer-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodesTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodesTests.swift index 8f578b35..541c0303 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionOfferCodeRepositoryTests { +struct SDKSubscriptionOfferCodesTests { // MARK: - listOfferCodes @@ -42,7 +42,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.listOfferCodes(subscriptionId: "sub-99") #expect(result.count == 2) @@ -71,7 +71,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.listOfferCodes(subscriptionId: "sub-1") #expect(result[0].id == "oc-1") @@ -107,7 +107,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.listOfferCodes(subscriptionId: "sub-1") #expect(result[0].productionCodeCount == 480) @@ -135,7 +135,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.createOfferCode( subscriptionId: "sub-42", name: "LAUNCH", @@ -176,7 +176,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.updateOfferCode(offerCodeId: "oc-1", isActive: false) #expect(result.id == "oc-1") @@ -205,7 +205,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.listCustomCodes(offerCodeId: "oc-10") #expect(result.count == 1) @@ -233,7 +233,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.createCustomCode( offerCodeId: "oc-5", customCode: "HOLIDAY", @@ -263,7 +263,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.updateCustomCode(customCodeId: "cc-1", isActive: false) #expect(result.id == "cc-1") @@ -290,7 +290,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.listOneTimeUseCodes(offerCodeId: "oc-20") #expect(result.count == 1) @@ -316,7 +316,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.createOneTimeUseCode( offerCodeId: "oc-7", numberOfCodes: 500, @@ -345,7 +345,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.createOneTimeUseCode( offerCodeId: "oc-7", numberOfCodes: 10, @@ -372,7 +372,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.updateOneTimeUseCode(oneTimeCodeId: "otc-1", isActive: false) #expect(result.id == "otc-1") @@ -395,7 +395,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.listPrices(offerCodeId: "oc-77") #expect(result[0].offerCodeId == "oc-77") @@ -406,7 +406,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { @Test func `fetchOneTimeUseCodeValues returns CSV string from SDK`() async throws { let stub = StubAPIClient() stub.willReturn("ABC\nDEF\n") - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.fetchOneTimeUseCodeValues(oneTimeCodeId: "otc-1") #expect(result == "ABC\nDEF\n") } @@ -430,7 +430,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<100, nextCursor: "page-2"), page(100..<175, nextCursor: nil)]) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) let result = try await repo.listPrices(offerCodeId: "oc-1") #expect(result.count == 175) @@ -443,7 +443,7 @@ struct SDKSubscriptionOfferCodeRepositoryTests { let stub = StubAPIClient() stub.willReturn(SubscriptionOfferCodePricesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionOfferCodeRepository(client: stub) + let repo = SDKSubscriptionOfferCodes(client: stub) _ = try await repo.listPrices(offerCodeId: "oc-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssetsTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssetsTests.swift index 2073bdf4..82811133 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssetsTests.swift @@ -3,11 +3,11 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionReviewRepositoryTests { +struct SDKSubscriptionReviewAssetsTests { @Test func `deleteReviewScreenshot performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionReviewRepository(client: stub) + let repo = SDKSubscriptionReviewAssets(client: stub) try await repo.deleteReviewScreenshot(screenshotId: "rs-1") #expect(stub.voidRequestCalled == true) } @@ -30,7 +30,7 @@ struct SDKSubscriptionReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionReviewRepository(client: stub) + let repo = SDKSubscriptionReviewAssets(client: stub) let result = try await repo.listImages(subscriptionId: "sub-1") #expect(result[0].imageAsset == nil) @@ -54,7 +54,7 @@ struct SDKSubscriptionReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionReviewRepository(client: stub) + let repo = SDKSubscriptionReviewAssets(client: stub) let result = try await repo.listImages(subscriptionId: "sub-1") #expect(result[0].imageAsset == nil) @@ -78,7 +78,7 @@ struct SDKSubscriptionReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKSubscriptionReviewRepository(client: stub) + let repo = SDKSubscriptionReviewAssets(client: stub) let result = try await repo.listImages(subscriptionId: "sub-1") #expect(result[0].imageAsset?.templateUrl == "https://cdn/{w}x{h}bb.{f}") diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift index 2f4c2ecf..1d0d6757 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift @@ -72,8 +72,8 @@ struct SDKSubscriptionReviewRepositoryUploadTests { #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/subscriptionImages"]) } - static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKSubscriptionReviewRepository { - SDKSubscriptionReviewRepository(client: stub, uploader: UploadOperationsExecutor(http: http), pollDelayNanos: 0, pollMaxAttempts: 1) + static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKSubscriptionReviewAssets { + SDKSubscriptionReviewAssets(client: stub, uploader: UploadOperationsExecutor(http: http), pollDelayNanos: 0, pollMaxAttempts: 1) } static func screenshot(_ json: String) throws -> SubscriptionAppStoreReviewScreenshotResponse { diff --git a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationsTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationsTests.swift index 7c811c32..96f0840a 100644 --- a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBetaAppLocalizationRepositoryTests { +struct SDKBetaAppLocalizationsTests { @Test func `listBetaAppLocalizations injects appId into each localization`() async throws { let stub = StubAPIClient() @@ -15,7 +15,7 @@ struct SDKBetaAppLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppLocalizationRepository(client: stub) + let repo = SDKBetaAppLocalizations(client: stub) let locs = try await repo.listBetaAppLocalizations(appId: "app-42") #expect(locs.count == 2) @@ -41,7 +41,7 @@ struct SDKBetaAppLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppLocalizationRepository(client: stub) + let repo = SDKBetaAppLocalizations(client: stub) let loc = try await repo.getBetaAppLocalization(localizationId: "bal-7") #expect(loc.id == "bal-7") @@ -63,7 +63,7 @@ struct SDKBetaAppLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppLocalizationRepository(client: stub) + let repo = SDKBetaAppLocalizations(client: stub) let loc = try await repo.createBetaAppLocalization( appId: "app-1", locale: "de-DE", @@ -92,7 +92,7 @@ struct SDKBetaAppLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppLocalizationRepository(client: stub) + let repo = SDKBetaAppLocalizations(client: stub) let loc = try await repo.updateBetaAppLocalization( localizationId: "bal-1", update: BetaAppLocalizationUpdate(description: "Updated description") @@ -105,7 +105,7 @@ struct SDKBetaAppLocalizationRepositoryTests { @Test func `deleteBetaAppLocalization completes without throwing`() async throws { let stub = StubAPIClient() - let repo = SDKBetaAppLocalizationRepository(client: stub) + let repo = SDKBetaAppLocalizations(client: stub) try await repo.deleteBetaAppLocalization(localizationId: "bal-1") #expect(stub.voidRequestCalled) } diff --git a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewsTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewsTests.swift index 7a84e8de..07d87b36 100644 --- a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBetaAppReviewRepositoryTests { +struct SDKBetaAppReviewsTests { // MARK: - Submissions @@ -20,7 +20,7 @@ struct SDKBetaAppReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppReviewRepository(client: stub) + let repo = SDKBetaAppReviews(client: stub) let result = try await repo.listSubmissions(buildId: "build-42") #expect(result.count == 1) @@ -40,7 +40,7 @@ struct SDKBetaAppReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppReviewRepository(client: stub) + let repo = SDKBetaAppReviews(client: stub) let result = try await repo.listSubmissions(buildId: "b-1") #expect(result[0].state == .approved) @@ -59,7 +59,7 @@ struct SDKBetaAppReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppReviewRepository(client: stub) + let repo = SDKBetaAppReviews(client: stub) let result = try await repo.createSubmission(buildId: "build-99") #expect(result.id == "sub-new") @@ -79,7 +79,7 @@ struct SDKBetaAppReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppReviewRepository(client: stub) + let repo = SDKBetaAppReviews(client: stub) let result = try await repo.getSubmission(id: "sub-1") #expect(result.id == "sub-1") @@ -109,7 +109,7 @@ struct SDKBetaAppReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppReviewRepository(client: stub) + let repo = SDKBetaAppReviews(client: stub) let result = try await repo.getDetail(appId: "app-42") #expect(result.id == "detail-1") @@ -139,7 +139,7 @@ struct SDKBetaAppReviewRepositoryTests { links: .init(this: "") )) - let repo = SDKBetaAppReviewRepository(client: stub) + let repo = SDKBetaAppReviews(client: stub) let result = try await repo.updateDetail( id: "detail-1", update: BetaAppReviewDetailUpdate(contactFirstName: "Jane", contactEmail: "jane@example.com", notes: "Updated") diff --git a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightTests.swift index 49561f10..b3e5fca4 100644 --- a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKTestFlightRepositoryTests { +struct SDKTestFlightTests { @Test func `listBetaGroups maps name and isInternalGroup`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKTestFlightRepositoryTests { links: .init(this: "") )) - let repo = SDKTestFlightRepository(client: stub) + let repo = SDKTestFlight(client: stub) let result = try await repo.listBetaGroups(appId: nil, limit: nil) #expect(result.data.count == 2) @@ -41,7 +41,7 @@ struct SDKTestFlightRepositoryTests { links: .init(this: "") )) - let repo = SDKTestFlightRepository(client: stub) + let repo = SDKTestFlight(client: stub) let result = try await repo.listBetaGroups(appId: "app-42", limit: nil) #expect(result.data[0].appId == "app-42") @@ -60,7 +60,7 @@ struct SDKTestFlightRepositoryTests { links: .init(this: "") )) - let repo = SDKTestFlightRepository(client: stub) + let repo = SDKTestFlight(client: stub) let result = try await repo.listBetaTesters(groupId: "group-99", limit: nil) #expect(result.data[0].firstName == "Jane") @@ -88,7 +88,7 @@ struct SDKTestFlightRepositoryTests { links: .init(this: "") )) - let repo = SDKTestFlightRepository(client: stub) + let repo = SDKTestFlight(client: stub) let result = try await repo.listBetaTesters(groupId: "g-1", limit: nil) #expect(result.data[0].inviteType == domainType) @@ -106,7 +106,7 @@ struct SDKTestFlightRepositoryTests { links: .init(this: "") )) - let repo = SDKTestFlightRepository(client: stub) + let repo = SDKTestFlight(client: stub) let tester = try await repo.addBetaTester(groupId: "g-1", email: "new@example.com", firstName: "New", lastName: nil) #expect(tester.id == "t-new") @@ -126,7 +126,7 @@ struct SDKTestFlightRepositoryTests { links: .init(this: "") )) - let repo = SDKTestFlightRepository(client: stub) + let repo = SDKTestFlight(client: stub) let group = try await repo.createBetaGroup( appId: "app-1", name: "External Beta", @@ -153,7 +153,7 @@ struct SDKTestFlightRepositoryTests { links: .init(this: "") )) - let repo = SDKTestFlightRepository(client: stub) + let repo = SDKTestFlight(client: stub) let group = try await repo.createBetaGroup( appId: "app-7", name: "Company Team", @@ -170,7 +170,7 @@ struct SDKTestFlightRepositoryTests { @Test func `removeBetaTester calls void delete endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKTestFlightRepository(client: stub) + let repo = SDKTestFlight(client: stub) try await repo.removeBetaTester(groupId: "g-1", testerId: "t-1") #expect(stub.voidRequestCalled == true) diff --git a/Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/AppStoreVersionsTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/AppStoreVersionsTests.swift index fd888344..b1d70d86 100644 --- a/Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/AppStoreVersionsTests.swift @@ -3,11 +3,11 @@ import Testing @testable import ASCKit @Suite -struct VersionRepositoryTests { +struct AppStoreVersionsTests { @Test func `list versions returns versions for app`() async throws { - let mock = MockVersionRepository() + let mock = MockAppStoreVersions() let versions = [ MockRepositoryFactory.makeVersion(id: "v1", versionString: "2.1.0", platform: .iOS), MockRepositoryFactory.makeVersion(id: "v2", versionString: "1.5.0", platform: .macOS), @@ -24,7 +24,7 @@ struct VersionRepositoryTests { @Test func `list versions returns empty when app has no versions`() async throws { - let mock = MockVersionRepository() + let mock = MockAppStoreVersions() given(mock).listVersions(appId: .any).willReturn([]) let result = try await mock.listVersions(appId: "new-app") diff --git a/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKAppStoreVersionsTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Internal/SDKAppStoreVersionsTests.swift index b51fb16d..1551401e 100644 --- a/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKAppStoreVersionsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKVersionRepositoryTests { +struct SDKAppStoreVersionsTests { @Test func `listVersions injects appId into each version`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) let result = try await repo.listVersions(appId: "app-42") #expect(result.count == 2) @@ -43,7 +43,7 @@ struct SDKVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) let result = try await repo.listVersions(appId: "app-1") #expect(result[0].versionString == "2.3.0") @@ -67,7 +67,7 @@ struct SDKVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) let result = try await repo.getVersion(id: "v-1") #expect(result.id == "v-1") @@ -87,7 +87,7 @@ struct SDKVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) let result = try await repo.getVersion(id: "v-2") #expect(result.appId == "") @@ -105,7 +105,7 @@ struct SDKVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) await #expect(throws: (any Error).self) { try await repo.getVersion(id: "v-bad") } @@ -124,7 +124,7 @@ struct SDKVersionRepositoryTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) try await repo.setBuild(versionId: "v-1", buildId: "build-42") // No error thrown = success } @@ -140,7 +140,7 @@ struct SDKVersionRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) let result = try await repo.listVersions(appId: "app-1") #expect(result.count == 75) diff --git a/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailsTests.swift similarity index 95% rename from Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailsTests.swift index c0bdd9c5..780c80e0 100644 --- a/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailsTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKReviewDetailRepositoryTests { +struct SDKReviewDetailsTests { @Test func `getReviewDetail injects versionId and maps contact fields`() async throws { let stub = StubAPIClient() @@ -26,7 +26,7 @@ struct SDKReviewDetailRepositoryTests { links: .init(this: "") )) - let repo = SDKReviewDetailRepository(client: stub) + let repo = SDKReviewDetails(client: stub) let result = try await repo.getReviewDetail(versionId: "v-42") #expect(result.id == "rd-1") @@ -58,7 +58,7 @@ struct SDKReviewDetailRepositoryTests { links: .init(this: "") )) - let repo = SDKReviewDetailRepository(client: stub) + let repo = SDKReviewDetails(client: stub) let result = try await repo.getReviewDetail(versionId: "v-99") #expect(result.demoAccountRequired == true) @@ -68,7 +68,7 @@ struct SDKReviewDetailRepositoryTests { } @Test func `getReviewDetail returns empty detail when API throws`() async throws { - let repo = SDKReviewDetailRepository(client: ReviewDetailThrowingStub()) + let repo = SDKReviewDetails(client: ReviewDetailThrowingStub()) let result = try await repo.getReviewDetail(versionId: "v-empty") #expect(result.id == "") @@ -101,7 +101,7 @@ struct SDKReviewDetailRepositoryTests { ), links: .init(this: "") ) - let repo = SDKReviewDetailRepository(client: stub) + let repo = SDKReviewDetails(client: stub) let update = ASCKit.ReviewDetailUpdate( contactFirstName: "Jane", contactLastName: "Smith", @@ -154,7 +154,7 @@ struct SDKReviewDetailRepositoryTests { ), links: .init(this: "") )) - let repo = SDKReviewDetailRepository(client: stub) + let repo = SDKReviewDetails(client: stub) let update = ASCKit.ReviewDetailUpdate( contactFirstName: "New", contactPhone: "+1-555-9999", diff --git a/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift index c2d11d84..9c9caa87 100644 --- a/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift @@ -16,7 +16,7 @@ struct SDKVersionRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) let result = try await repo.createVersion(appId: "app-42", versionString: "2.0.0", platform: .iOS) #expect(result.id == "v-new") @@ -37,14 +37,14 @@ struct SDKVersionRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) let result = try await repo.createVersion(appId: "app-1", versionString: "1.0.0", platform: .macOS) #expect(result.platform == .macOS) } @Test func `createVersion throws for unsupported platform`() async throws { - let repo = SDKVersionRepository(client: StubAPIClient()) + let repo = SDKAppStoreVersions(client: StubAPIClient()) await #expect(throws: (any Error).self) { try await repo.createVersion(appId: "app-1", versionString: "1.0.0", platform: .watchOS) } @@ -61,7 +61,7 @@ struct SDKVersionRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKVersionRepository(client: stub) + let repo = SDKAppStoreVersions(client: stub) await #expect(throws: (any Error).self) { try await repo.createVersion(appId: "app-1", versionString: "1.0.0", platform: .iOS) } diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKVersionLocalizationsTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKVersionLocalizationsTests.swift index a2902b3a..966a6b14 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKVersionLocalizationsTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKLocalizationRepositoryTests { +struct SDKVersionLocalizationsTests { // MARK: - listLocalizations @@ -26,7 +26,7 @@ struct SDKLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKLocalizationRepository(client: stub) + let repo = SDKVersionLocalizations(client: stub) let result = try await repo.listLocalizations(versionId: "v-42") #expect(result.count == 2) @@ -46,7 +46,7 @@ struct SDKLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKLocalizationRepository(client: stub) + let repo = SDKVersionLocalizations(client: stub) let result = try await repo.listLocalizations(versionId: "v-1") #expect(result[0].id == "loc-1") @@ -66,7 +66,7 @@ struct SDKLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKLocalizationRepository(client: stub) + let repo = SDKVersionLocalizations(client: stub) let result = try await repo.createLocalization(versionId: "v-42", locale: "en-US") #expect(result.id == "loc-new") @@ -87,7 +87,7 @@ struct SDKLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKLocalizationRepository(client: stub) + let repo = SDKVersionLocalizations(client: stub) let result = try await repo.updateLocalization( localizationId: "loc-42", whatsNew: "Bug fixes and performance improvements", @@ -121,7 +121,7 @@ struct SDKLocalizationRepositoryTests { links: .init(this: "") )) - let repo = SDKLocalizationRepository(client: stub) + let repo = SDKVersionLocalizations(client: stub) let result = try await repo.updateLocalization( localizationId: "loc-1", whatsNew: "新功能", diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviewsTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviewsTests.swift index 9e108932..37cdffa8 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviewsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct OpenAPIPreviewRepositoryTests { +struct OpenAPIAppPreviewsTests { // MARK: - listPreviewSets @@ -25,7 +25,7 @@ struct OpenAPIPreviewRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIPreviewRepository(client: stub) + let repo = OpenAPIAppPreviews(client: stub) let result = try await repo.listPreviewSets(localizationId: "loc-99") #expect(result.count == 2) @@ -45,7 +45,7 @@ struct OpenAPIPreviewRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIPreviewRepository(client: stub) + let repo = OpenAPIAppPreviews(client: stub) let result = try await repo.listPreviewSets(localizationId: "loc-1") #expect(result[0].previewType == .iphone67) @@ -72,7 +72,7 @@ struct OpenAPIPreviewRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIPreviewRepository(client: stub) + let repo = OpenAPIAppPreviews(client: stub) let result = try await repo.listPreviewSets(localizationId: "loc-1") #expect(result[0].previewsCount == 2) @@ -98,7 +98,7 @@ struct OpenAPIPreviewRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIPreviewRepository(client: stub) + let repo = OpenAPIAppPreviews(client: stub) let result = try await repo.listPreviews(setId: "set-42") #expect(result.count == 2) @@ -122,7 +122,7 @@ struct OpenAPIPreviewRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIPreviewRepository(client: stub) + let repo = OpenAPIAppPreviews(client: stub) let result = try await repo.listPreviews(setId: "set-1") #expect(result[0].videoDeliveryState == .complete) @@ -145,7 +145,7 @@ struct OpenAPIPreviewRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIPreviewRepository(client: stub) + let repo = OpenAPIAppPreviews(client: stub) let result = try await repo.listPreviews(setId: "set-1") #expect(result[0].videoDeliveryState == .processing) @@ -165,7 +165,7 @@ struct OpenAPIPreviewRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIPreviewRepository(client: stub) + let repo = OpenAPIAppPreviews(client: stub) let result = try await repo.createPreviewSet(localizationId: "loc-77", previewType: .iphone67) #expect(result.id == "new-set") diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift index afc88c2b..99ed81ab 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift @@ -14,7 +14,7 @@ struct OpenAPIPreviewRepositoryUploadTests { try Self.preview(#"{"data":{"type":"appPreviews","id":"prev-1","attributes":{"fileName":"demo.mov","fileSize":7,"mimeType":"video/quicktime","previewFrameTimeCode":"00:00:05:00","videoDeliveryState":{"state":"UPLOAD_COMPLETE"}}},"links":{"self":""}}"#), ]) - let preview = try await OpenAPIPreviewRepository(client: stub).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: "00:00:05:00") + let preview = try await OpenAPIAppPreviews(client: stub).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: "00:00:05:00") #expect(preview == AppPreview(id: "prev-1", setId: "pset-1", fileName: "demo.mov", fileSize: 7, mimeType: "video/quicktime", videoDeliveryState: .uploadComplete, previewFrameTimeCode: "00:00:05:00")) @@ -32,7 +32,7 @@ struct OpenAPIPreviewRepositoryUploadTests { http.enqueue(json: "", statusCode: 500) await #expect(throws: (any Error).self) { - try await OpenAPIPreviewRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: nil) + try await OpenAPIAppPreviews(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: nil) } #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/appPreviews"]) } @@ -45,7 +45,7 @@ struct OpenAPIPreviewRepositoryUploadTests { http.enqueue(json: "", statusCode: 200) await #expect(throws: (any Error).self) { - _ = try await OpenAPIPreviewRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: nil) + _ = try await OpenAPIAppPreviews(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: nil) } #expect(http.capturedRequests.isEmpty) #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/appPreviews"]) diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift index c1311fa4..9f2b8c15 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift @@ -46,14 +46,14 @@ struct AppScreenshotSetTests { @Test func `set is equatable regardless of injected repo`() { - let a = MockRepositoryFactory.makeScreenshotSet(id: "1", repo: MockScreenshotRepository()) - let b = MockRepositoryFactory.makeScreenshotSet(id: "1", repo: MockScreenshotRepository()) + let a = MockRepositoryFactory.makeScreenshotSet(id: "1", repo: MockAppScreenshots()) + let b = MockRepositoryFactory.makeScreenshotSet(id: "1", repo: MockAppScreenshots()) #expect(a == b) } @Test func `importScreenshots uses own id as setId`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).uploadScreenshot(setId: .value("set-42"), fileURL: .any) .willReturn(MockRepositoryFactory.makeScreenshot(setId: "set-42")) @@ -68,7 +68,7 @@ struct AppScreenshotSetTests { @Test func `importScreenshots uploads entries sorted by order`() async throws { - let mockRepo = MockScreenshotRepository() + let mockRepo = MockAppScreenshots() given(mockRepo).uploadScreenshot(setId: .any, fileURL: .any) .willReturn(MockRepositoryFactory.makeScreenshot(id: "img-1")) @@ -88,7 +88,7 @@ struct AppScreenshotSetTests { @Test func `importScreenshots skips entries with no matching imageURL`() async throws { - let set = MockRepositoryFactory.makeScreenshotSet(id: "set-1", repo: MockScreenshotRepository()) + let set = MockRepositoryFactory.makeScreenshotSet(id: "set-1", repo: MockAppScreenshots()) let results = try await set.importScreenshots( entries: [ScreenshotManifest.ScreenshotEntry(order: 1, file: "missing.png")], imageURLs: [:] diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotsTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotsTests.swift index 4dd1d93c..d2e0d312 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotsTests.swift @@ -3,10 +3,10 @@ import Testing @testable import ASCKit @Suite -struct ScreenshotRepositoryTests { +struct AppScreenshotsTests { @Test func `list screenshot sets returns sets for localization`() async throws { - let mock = MockScreenshotRepository() + let mock = MockAppScreenshots() let sets = [ MockRepositoryFactory.makeScreenshotSet(id: "set-1", displayType: .iphone67), MockRepositoryFactory.makeScreenshotSet(id: "set-2", displayType: .ipadPro3gen129), @@ -20,7 +20,7 @@ struct ScreenshotRepositoryTests { } @Test func `list screenshots returns screenshots for set`() async throws { - let mock = MockScreenshotRepository() + let mock = MockAppScreenshots() let screenshots = [ MockRepositoryFactory.makeScreenshot(id: "img-1", fileName: "screen1.png"), MockRepositoryFactory.makeScreenshot(id: "img-2", fileName: "screen2.png"), @@ -34,7 +34,7 @@ struct ScreenshotRepositoryTests { } @Test func `list screenshots returns empty for set with no screenshots`() async throws { - let mock = MockScreenshotRepository() + let mock = MockAppScreenshots() given(mock).listScreenshots(setId: .any).willReturn([]) let result = try await mock.listScreenshots(setId: "empty-set") diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKAppScreenshotsTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKAppScreenshotsTests.swift index aa3a05ed..608807a2 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKAppScreenshotsTests.swift @@ -3,14 +3,14 @@ import Testing @testable import ASCKit @Suite -struct SDKScreenshotRepositoryTests { +struct SDKAppScreenshotsTests { // MARK: - deleteScreenshot @Test func `should delete the screenshot from App Store Connect`() async throws { let stub = StubAPIClient() - try await SDKScreenshotRepository(client: stub).deleteScreenshot(screenshotId: "shot-1") + try await SDKAppScreenshots(client: stub).deleteScreenshot(screenshotId: "shot-1") #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["DELETE /v1/appScreenshots/shot-1"]) } @@ -18,7 +18,7 @@ struct SDKScreenshotRepositoryTests { @Test func `should delete the screenshot set from App Store Connect`() async throws { let stub = StubAPIClient() - try await SDKScreenshotRepository(client: stub).deleteScreenshotSet(setId: "set-1") + try await SDKAppScreenshots(client: stub).deleteScreenshotSet(setId: "set-1") #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["DELETE /v1/appScreenshotSets/set-1"]) } @@ -43,7 +43,7 @@ struct SDKScreenshotRepositoryTests { links: .init(this: "") )) - let repo = SDKScreenshotRepository(client: stub) + let repo = SDKAppScreenshots(client: stub) let result = try await repo.listScreenshotSets(localizationId: "loc-99") #expect(result.count == 2) @@ -63,7 +63,7 @@ struct SDKScreenshotRepositoryTests { links: .init(this: "") )) - let repo = SDKScreenshotRepository(client: stub) + let repo = SDKAppScreenshots(client: stub) let result = try await repo.listScreenshotSets(localizationId: "loc-1") // A set with repo injected does not throw "requires a repository" @@ -84,7 +84,7 @@ struct SDKScreenshotRepositoryTests { links: .init(this: "") )) - let repo = SDKScreenshotRepository(client: stub) + let repo = SDKAppScreenshots(client: stub) let result = try await repo.listScreenshotSets(localizationId: "loc-1") #expect(result[0].screenshotDisplayType == .iphone67) @@ -110,7 +110,7 @@ struct SDKScreenshotRepositoryTests { links: .init(this: "") )) - let repo = SDKScreenshotRepository(client: stub) + let repo = SDKAppScreenshots(client: stub) let result = try await repo.listScreenshots(setId: "set-77") #expect(result.count == 2) @@ -130,7 +130,7 @@ struct SDKScreenshotRepositoryTests { links: .init(this: "") )) - let repo = SDKScreenshotRepository(client: stub) + let repo = SDKAppScreenshots(client: stub) let result = try await repo.listScreenshots(setId: "set-1") #expect(result[0].id == "img-1") diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift index ee38ffab..129827ab 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift @@ -18,7 +18,7 @@ struct SDKScreenshotRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKScreenshotRepository(client: stub) + let repo = SDKAppScreenshots(client: stub) let result = try await repo.createScreenshotSet(localizationId: "loc-42", displayType: .iphone67) #expect(result.id == "set-new") @@ -37,7 +37,7 @@ struct SDKScreenshotRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKScreenshotRepository(client: stub) + let repo = SDKAppScreenshots(client: stub) let result = try await repo.createScreenshotSet(localizationId: "loc-1", displayType: .iphone67) // A set with repo injected does not throw "requires a repository" @@ -56,7 +56,7 @@ struct SDKScreenshotRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKScreenshotRepository(client: stub) + let repo = SDKAppScreenshots(client: stub) let result = try await repo.createScreenshotSet(localizationId: "loc-1", displayType: .ipadPro3gen11) #expect(result.screenshotDisplayType == .ipadPro3gen11) diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift index 319eb08b..fb0c371f 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift @@ -14,7 +14,7 @@ struct SDKScreenshotRepositoryUploadTests { try Self.screenshot(#"{"data":{"type":"appScreenshots","id":"shot-1","attributes":{"fileName":"home.png","fileSize":7,"assetDeliveryState":{"state":"UPLOAD_COMPLETE"}}},"links":{"self":""}}"#), ]) - let screenshot = try await SDKScreenshotRepository(client: stub).uploadScreenshot(setId: "set-1", fileURL: file) + let screenshot = try await SDKAppScreenshots(client: stub).uploadScreenshot(setId: "set-1", fileURL: file) #expect(screenshot == AppScreenshot(id: "shot-1", setId: "set-1", fileName: "home.png", fileSize: 7, assetState: .uploadComplete)) #expect(stub.requests.map { "\($0.method) \($0.path) \($0.body ?? "")" } == [ @@ -31,7 +31,7 @@ struct SDKScreenshotRepositoryUploadTests { http.enqueue(json: "", statusCode: 500) await #expect(throws: (any Error).self) { - try await SDKScreenshotRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadScreenshot(setId: "set-1", fileURL: file) + try await SDKAppScreenshots(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadScreenshot(setId: "set-1", fileURL: file) } #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/appScreenshots"]) } @@ -44,7 +44,7 @@ struct SDKScreenshotRepositoryUploadTests { http.enqueue(json: "", statusCode: 200) await #expect(throws: (any Error).self) { - _ = try await SDKScreenshotRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadScreenshot(setId: "set-1", fileURL: file) + _ = try await SDKAppScreenshots(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadScreenshot(setId: "set-1", fileURL: file) } #expect(http.capturedRequests.isEmpty) #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/appScreenshots"]) diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationsTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationsTests.swift index 546026d6..7a6b8de4 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationsTests.swift @@ -3,12 +3,12 @@ import Testing @testable import ASCKit @Suite -struct VersionLocalizationRepositoryTests { +struct VersionLocalizationsTests { // MARK: - list @Test func `list localizations returns localizations for version`() async throws { - let mock = MockVersionLocalizationRepository() + let mock = MockVersionLocalizations() let localizations = [ MockRepositoryFactory.makeLocalization(id: "loc-1", locale: "en-US"), MockRepositoryFactory.makeLocalization(id: "loc-2", locale: "zh-Hans"), @@ -22,7 +22,7 @@ struct VersionLocalizationRepositoryTests { } @Test func `list localizations returns empty when version has no localizations`() async throws { - let mock = MockVersionLocalizationRepository() + let mock = MockVersionLocalizations() given(mock).listLocalizations(versionId: .any).willReturn([]) let result = try await mock.listLocalizations(versionId: "v1") @@ -32,7 +32,7 @@ struct VersionLocalizationRepositoryTests { // MARK: - create @Test func `create localization returns new localization with locale`() async throws { - let mock = MockVersionLocalizationRepository() + let mock = MockVersionLocalizations() let created = MockRepositoryFactory.makeLocalization(id: "loc-new", versionId: "v1", locale: "fr-FR") given(mock).createLocalization(versionId: .any, locale: .any).willReturn(created) @@ -44,7 +44,7 @@ struct VersionLocalizationRepositoryTests { // MARK: - update (mental model: I have a localization, I want to set What's New text) @Test func `update localization returns localization with new whatsNew text`() async throws { - let mock = MockVersionLocalizationRepository() + let mock = MockVersionLocalizations() let updated = MockRepositoryFactory.makeLocalization(id: "loc-1", whatsNew: "Bug fixes and performance improvements") given(mock).updateLocalization( localizationId: .any, @@ -69,7 +69,7 @@ struct VersionLocalizationRepositoryTests { } @Test func `update localization with nil fields does not overwrite existing data`() async throws { - let mock = MockVersionLocalizationRepository() + let mock = MockVersionLocalizations() let existing = MockRepositoryFactory.makeLocalization( id: "loc-1", whatsNew: "Previous text", diff --git a/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDsTests.swift similarity index 90% rename from Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDsTests.swift index be0cb830..aa3984c0 100644 --- a/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBundleIDRepositoryTests { +struct SDKBundleIDsTests { @Test func `listBundleIDs maps identifier and platform`() async throws { let stub = StubAPIClient() @@ -18,7 +18,7 @@ struct SDKBundleIDRepositoryTests { links: .init(this: "") )) - let repo = SDKBundleIDRepository(client: stub) + let repo = SDKBundleIDs(client: stub) let result = try await repo.listBundleIDs(platform: nil, identifier: nil) #expect(result[0].id == "bid-1") @@ -40,7 +40,7 @@ struct SDKBundleIDRepositoryTests { links: .init(this: "") )) - let repo = SDKBundleIDRepository(client: stub) + let repo = SDKBundleIDs(client: stub) let result = try await repo.listBundleIDs(platform: nil, identifier: nil) #expect(result[0].platform == .macOS) @@ -48,7 +48,7 @@ struct SDKBundleIDRepositoryTests { @Test func `deleteBundleID calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKBundleIDRepository(client: stub) + let repo = SDKBundleIDs(client: stub) try await repo.deleteBundleID(id: "bid-1") @@ -66,7 +66,7 @@ struct SDKBundleIDRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKBundleIDRepository(client: stub) + let repo = SDKBundleIDs(client: stub) let result = try await repo.listBundleIDs(platform: nil, identifier: nil) #expect(result.count == 75) diff --git a/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificatesTests.swift similarity index 90% rename from Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKCertificatesTests.swift index 7a7d0a48..0db1b732 100644 --- a/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificatesTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKCertificateRepositoryTests { +struct SDKCertificatesTests { @Test func `listCertificates maps name and type`() async throws { let stub = StubAPIClient() @@ -24,7 +24,7 @@ struct SDKCertificateRepositoryTests { links: .init(this: "") )) - let repo = SDKCertificateRepository(client: stub) + let repo = SDKCertificates(client: stub) let result = try await repo.listCertificates(certificateType: nil, limit: nil) #expect(result[0].id == "cert-1") @@ -48,7 +48,7 @@ struct SDKCertificateRepositoryTests { links: .init(this: "") )) - let repo = SDKCertificateRepository(client: stub) + let repo = SDKCertificates(client: stub) let result = try await repo.listCertificates(certificateType: nil, limit: nil) #expect(result[0].expirationDate == expiration) @@ -56,7 +56,7 @@ struct SDKCertificateRepositoryTests { @Test func `revokeCertificate calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKCertificateRepository(client: stub) + let repo = SDKCertificates(client: stub) try await repo.revokeCertificate(id: "cert-1") diff --git a/Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKDevicesTests.swift similarity index 93% rename from Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKDevicesTests.swift index 67b1bf93..1ad86c5c 100644 --- a/Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKDevicesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKDeviceRepositoryTests { +struct SDKDevicesTests { @Test func `listDevices maps name udid and deviceClass`() async throws { let stub = StubAPIClient() @@ -25,7 +25,7 @@ struct SDKDeviceRepositoryTests { links: .init(this: "") )) - let repo = SDKDeviceRepository(client: stub) + let repo = SDKDevices(client: stub) let result = try await repo.listDevices(platform: nil) #expect(result[0].id == "dev-1") @@ -50,7 +50,7 @@ struct SDKDeviceRepositoryTests { links: .init(this: "") )) - let repo = SDKDeviceRepository(client: stub) + let repo = SDKDevices(client: stub) let result = try await repo.listDevices(platform: nil) #expect(result[0].isEnabled == false) @@ -67,7 +67,7 @@ struct SDKDeviceRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKDeviceRepository(client: stub) + let repo = SDKDevices(client: stub) let result = try await repo.listDevices(platform: nil) #expect(result.count == 75) diff --git a/Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKProfilesTests.swift similarity index 92% rename from Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKProfilesTests.swift index d7d837b0..752d2cfc 100644 --- a/Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKProfilesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKProfileRepositoryTests { +struct SDKProfilesTests { @Test func `listProfiles injects bundleIdId from request when filtering by bundle id`() async throws { let stub = StubAPIClient() @@ -18,7 +18,7 @@ struct SDKProfileRepositoryTests { links: .init(this: "") )) - let repo = SDKProfileRepository(client: stub) + let repo = SDKProfiles(client: stub) let result = try await repo.listProfiles(bundleIdId: "bid-99", profileType: nil) #expect(result[0].id == "prof-1") @@ -43,7 +43,7 @@ struct SDKProfileRepositoryTests { links: .init(this: "") )) - let repo = SDKProfileRepository(client: stub) + let repo = SDKProfiles(client: stub) let result = try await repo.listProfiles(bundleIdId: nil, profileType: nil) #expect(result[0].bundleIdId == "bid-from-relationship") @@ -52,7 +52,7 @@ struct SDKProfileRepositoryTests { @Test func `deleteProfile calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKProfileRepository(client: stub) + let repo = SDKProfiles(client: stub) try await repo.deleteProfile(id: "prof-1") @@ -70,7 +70,7 @@ struct SDKProfileRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKProfileRepository(client: stub) + let repo = SDKProfiles(client: stub) let result = try await repo.listProfiles(bundleIdId: "bid-1", profileType: nil) #expect(result.count == 75) @@ -88,7 +88,7 @@ struct SDKProfileRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKProfileRepository(client: stub) + let repo = SDKProfiles(client: stub) let result = try await repo.listProfiles(bundleIdId: nil, profileType: nil) #expect(result.count == 75) @@ -100,7 +100,7 @@ struct SDKProfileRepositoryTests { let stub = StubAPIClient() stub.willReturn(ProfilesResponse(data: [], links: .init(this: ""))) - let repo = SDKProfileRepository(client: stub) + let repo = SDKProfiles(client: stub) _ = try await repo.listProfiles(bundleIdId: nil, profileType: nil) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift b/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterTests.swift similarity index 93% rename from Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift rename to Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterTests.swift index 55ca398f..641b39a6 100644 --- a/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift +++ b/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKGameCenterRepositoryTests { +struct SDKGameCenterTests { // MARK: - getDetail @@ -18,7 +18,7 @@ struct SDKGameCenterRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterRepository(client: stub) + let repo = SDKGameCenter(client: stub) let detail = try await repo.getDetail(appId: "app-42") #expect(detail.id == "gc-99") @@ -37,7 +37,7 @@ struct SDKGameCenterRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterRepository(client: stub) + let repo = SDKGameCenter(client: stub) let detail = try await repo.getDetail(appId: "app-1") #expect(detail.isArcadeEnabled == false) @@ -65,7 +65,7 @@ struct SDKGameCenterRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterRepository(client: stub) + let repo = SDKGameCenter(client: stub) let result = try await repo.listAchievements(gameCenterDetailId: "gc-42") #expect(result[0].id == "ach-1") @@ -98,7 +98,7 @@ struct SDKGameCenterRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterRepository(client: stub) + let repo = SDKGameCenter(client: stub) let result = try await repo.createAchievement( gameCenterDetailId: "gc-1", referenceName: "High Score", @@ -119,7 +119,7 @@ struct SDKGameCenterRepositoryTests { @Test func `deleteAchievement calls void request`() async throws { let stub = StubAPIClient() - let repo = SDKGameCenterRepository(client: stub) + let repo = SDKGameCenter(client: stub) try await repo.deleteAchievement(id: "ach-1") #expect(stub.voidRequestCalled == true) @@ -147,7 +147,7 @@ struct SDKGameCenterRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterRepository(client: stub) + let repo = SDKGameCenter(client: stub) let result = try await repo.listLeaderboards(gameCenterDetailId: "gc-42") #expect(result[0].id == "lb-1") @@ -179,7 +179,7 @@ struct SDKGameCenterRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterRepository(client: stub) + let repo = SDKGameCenter(client: stub) let result = try await repo.createLeaderboard( gameCenterDetailId: "gc-1", referenceName: "Speed Run", @@ -199,7 +199,7 @@ struct SDKGameCenterRepositoryTests { @Test func `deleteLeaderboard calls void request`() async throws { let stub = StubAPIClient() - let repo = SDKGameCenterRepository(client: stub) + let repo = SDKGameCenter(client: stub) try await repo.deleteLeaderboard(id: "lb-1") #expect(stub.voidRequestCalled == true) diff --git a/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift b/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationTests.swift similarity index 92% rename from Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift rename to Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationTests.swift index f843468d..6a13eabb 100644 --- a/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift +++ b/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKGameCenterModerationRepositoryTests { +struct SDKGameCenterModerationTests { // MARK: - Score moderations @@ -37,7 +37,7 @@ struct SDKGameCenterModerationRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.listScoreModerations(leaderboardId: "lb-42", blockedOnly: false) #expect(result == [ @@ -72,7 +72,7 @@ struct SDKGameCenterModerationRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.listScoreModerations(leaderboardId: "lb-42", blockedOnly: true) #expect(result == [ @@ -97,7 +97,7 @@ struct SDKGameCenterModerationRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<200, nextCursor: "page-2"), page(200..<250, nextCursor: nil)]) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.listScoreModerations(leaderboardId: "lb-42", blockedOnly: false) #expect(result.count == 250) @@ -116,7 +116,7 @@ struct SDKGameCenterModerationRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.updateScoreModeration(id: "mod-1", isBlocked: true) #expect(result == ASCKit.GameCenterScoreModeration( @@ -133,7 +133,7 @@ struct SDKGameCenterModerationRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.updateScoreModeration(id: "mod-1", isBlocked: false) #expect(result.isBlocked == false) @@ -154,7 +154,7 @@ struct SDKGameCenterModerationRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.listBlockedPlayers(gameCenterDetailId: "gc-42") #expect(result == [ @@ -172,7 +172,7 @@ struct SDKGameCenterModerationRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.listBlockedPlayers(gameCenterDetailId: "gc-42") #expect(result.map(\.isBlocked) == [true]) @@ -191,7 +191,7 @@ struct SDKGameCenterModerationRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<200, nextCursor: "page-2"), page(200..<230, nextCursor: nil)]) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.listBlockedPlayers(gameCenterDetailId: "gc-42") #expect(result.count == 230) @@ -209,7 +209,7 @@ struct SDKGameCenterModerationRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.updatePlayer(id: "player-1", isBlocked: false) #expect(result == ASCKit.GameCenterPlayer( @@ -225,7 +225,7 @@ struct SDKGameCenterModerationRepositoryTests { links: .init(this: "") )) - let repo = SDKGameCenterModerationRepository(client: stub) + let repo = SDKGameCenterModeration(client: stub) let result = try await repo.updatePlayer(id: "player-1", isBlocked: true) #expect(result.isBlocked == true) diff --git a/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift b/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundlesTests.swift similarity index 90% rename from Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift rename to Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundlesTests.swift index 9dbf63cd..59a2cdb2 100644 --- a/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundlesTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct IrisSDKAppBundleRepositoryTests { +struct IrisSDKAppBundlesTests { private let session = IrisSession(cookies: "myacinfo=a") private func reply(_ status: Int, _ body: String) -> (Data, HTTPURLResponse) { @@ -25,7 +25,7 @@ struct IrisSDKAppBundleRepositoryTests { ]} """#)) - let bundles = try await IrisSDKAppBundleRepository(client: iris).listAppBundles(session: session) + let bundles = try await IrisSDKAppBundles(client: iris).listAppBundles(session: session) #expect(bundles == [ AppBundle(id: "b1", name: "Bakery", bundleId: "com.example.bakery", sku: "BAKE", primaryLocale: "en-GB", platforms: ["IOS"]), @@ -39,7 +39,7 @@ struct IrisSDKAppBundleRepositoryTests { {"data":{"id":"new","type":"apps","attributes":{"bundleId":"com.example.new","sku":"NEW","primaryLocale":"en-US","platformNames":["IOS"]}}} """#)) - let bundle = try await IrisSDKAppBundleRepository(client: iris).createApp( + let bundle = try await IrisSDKAppBundles(client: iris).createApp( session: session, name: "New App", bundleId: "com.example.new", sku: "NEW", primaryLocale: "en-US", platforms: ["IOS"], versionString: "1.0" ) @@ -53,7 +53,7 @@ struct IrisSDKAppBundleRepositoryTests { .willThrow(IrisAPIError.httpError(statusCode: 409, body: "bundle id taken")) do { - _ = try await IrisSDKAppBundleRepository(client: iris).createApp( + _ = try await IrisSDKAppBundles(client: iris).createApp( session: session, name: "Dup", bundleId: "com.example.dup", sku: "DUP", primaryLocale: "en-US", platforms: ["IOS"], versionString: "1.0" ) diff --git a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStatesTests.swift similarity index 94% rename from Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift rename to Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStatesTests.swift index 9a926291..8bf7407f 100644 --- a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStatesTests.swift @@ -2,7 +2,7 @@ import Foundation import Testing @testable import ASCKit -/// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionRepositoryTests` +/// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionsTests` /// for why we don't share `URLProtocolStub` between iris suites. final class IrisStateURLProtocolStub: URLProtocol, @unchecked Sendable { nonisolated(unsafe) static var handler: (@Sendable (URLRequest) -> (HTTPURLResponse, Data))? @@ -36,7 +36,7 @@ private final class CapturedURL: @unchecked Sendable { } @Suite(.serialized) -struct IrisSDKInAppPurchaseStateRepositoryTests { +struct IrisSDKInAppPurchaseStatesTests { @Test func `fetchSubmitFlags returns map of iapId to submitWithNextAppStoreVersion`() async throws { IrisStateURLProtocolStub.handler = { _ in @@ -67,7 +67,7 @@ struct IrisSDKInAppPurchaseStateRepositoryTests { } let client = IrisClient(session: IrisStateURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseStateRepository(client: client) + let repo = IrisSDKInAppPurchaseStates(client: client) let flags = try await repo.fetchSubmitFlags( session: IrisSession(cookies: "myacinfo=A"), appId: "app-7" @@ -89,7 +89,7 @@ struct IrisSDKInAppPurchaseStateRepositoryTests { } let client = IrisClient(session: IrisStateURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseStateRepository(client: client) + let repo = IrisSDKInAppPurchaseStates(client: client) _ = try await repo.fetchSubmitFlags( session: IrisSession(cookies: "myacinfo=A"), appId: "app-7" @@ -116,7 +116,7 @@ struct IrisSDKInAppPurchaseStateRepositoryTests { } let client = IrisClient(session: IrisStateURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseStateRepository(client: client) + let repo = IrisSDKInAppPurchaseStates(client: client) let flags = try await repo.fetchSubmitFlags( session: IrisSession(cookies: "myacinfo=A"), appId: "app-7" diff --git a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionsTests.swift similarity index 94% rename from Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift rename to Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionsTests.swift index 5efff7d5..93c6bd4d 100644 --- a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionsTests.swift @@ -49,7 +49,7 @@ final class IrisSubmissionsURLProtocolStub: URLProtocol, @unchecked Sendable { } @Suite(.serialized) -struct IrisSDKInAppPurchaseSubmissionRepositoryTests { +struct IrisSDKInAppPurchaseSubmissionsTests { @Test func `submitInAppPurchase posts JSON-API body with submitWithNextAppStoreVersion attribute`() async throws { let captured = CapturedBody() @@ -63,7 +63,7 @@ struct IrisSDKInAppPurchaseSubmissionRepositoryTests { } let client = IrisClient(session: IrisSubmissionsURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseSubmissionRepository(client: client) + let repo = IrisSDKInAppPurchaseSubmissions(client: client) _ = try await repo.submitInAppPurchase( session: IrisSession(cookies: "myacinfo=ABC"), iapId: "iap-7", @@ -92,7 +92,7 @@ struct IrisSDKInAppPurchaseSubmissionRepositoryTests { } let client = IrisClient(session: IrisSubmissionsURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseSubmissionRepository(client: client) + let repo = IrisSDKInAppPurchaseSubmissions(client: client) let submission = try await repo.submitInAppPurchase( session: IrisSession(cookies: "myacinfo=ABC"), iapId: "iap-7", @@ -117,7 +117,7 @@ struct IrisSDKInAppPurchaseSubmissionRepositoryTests { } let client = IrisClient(session: IrisSubmissionsURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseSubmissionRepository(client: client) + let repo = IrisSDKInAppPurchaseSubmissions(client: client) _ = try await repo.submitInAppPurchase( session: IrisSession(cookies: "myacinfo=ABC"), iapId: "iap-7", @@ -141,7 +141,7 @@ struct IrisSDKInAppPurchaseSubmissionRepositoryTests { } let client = IrisClient(session: IrisSubmissionsURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseSubmissionRepository(client: client) + let repo = IrisSDKInAppPurchaseSubmissions(client: client) try await repo.deleteSubmission( session: IrisSession(cookies: "myacinfo=ABC"), submissionId: "iap-7" diff --git a/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionsTests.swift similarity index 86% rename from Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionsTests.swift index 0e40d370..b241d72f 100644 --- a/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct FileIrisSessionRepositoryTests { +struct FileIrisSessionsTests { private func tempURL() -> URL { FileManager.default.temporaryDirectory @@ -13,7 +13,7 @@ struct FileIrisSessionRepositoryTests { @Test func `save then load roundtrips the session`() throws { let url = tempURL() defer { try? FileManager.default.removeItem(at: url) } - let repo = FileIrisSessionRepository(fileURL: url) + let repo = FileIrisSessions(fileURL: url) let session = IrisAuthSession( cookies: "myacinfo=A1", scnt: "scnt", serviceKey: "key", appleIDSessionID: "sess", providerID: 42, teamId: "T", userEmail: "u@x.com", @@ -25,13 +25,13 @@ struct FileIrisSessionRepositoryTests { @Test func `current returns nil when no session is persisted`() throws { let url = tempURL() - let repo = FileIrisSessionRepository(fileURL: url) + let repo = FileIrisSessions(fileURL: url) #expect(try repo.current() == nil) } @Test func `delete removes the persisted file`() throws { let url = tempURL() - let repo = FileIrisSessionRepository(fileURL: url) + let repo = FileIrisSessions(fileURL: url) try repo.save(IrisAuthSession( cookies: "c", scnt: "s", serviceKey: "k", appleIDSessionID: "id", userEmail: "u@x.com", expiresAt: Date() @@ -44,7 +44,7 @@ struct FileIrisSessionRepositoryTests { @Test func `save writes file with 0600 permissions`() throws { let url = tempURL() defer { try? FileManager.default.removeItem(at: url) } - let repo = FileIrisSessionRepository(fileURL: url) + let repo = FileIrisSessions(fileURL: url) try repo.save(IrisAuthSession( cookies: "c", scnt: "s", serviceKey: "k", appleIDSessionID: "id", userEmail: "u@x.com", expiresAt: Date() diff --git a/Tests/ASCKitTests/Iris/Internal/Auth/IrisAuthSDKRepositoryTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/IrisSDKSignInTests.swift similarity index 86% rename from Tests/ASCKitTests/Iris/Internal/Auth/IrisAuthSDKRepositoryTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/IrisSDKSignInTests.swift index 9976fc7e..b88fdb39 100644 --- a/Tests/ASCKitTests/Iris/Internal/Auth/IrisAuthSDKRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/IrisSDKSignInTests.swift @@ -4,14 +4,14 @@ import Testing @testable import ASCKit @Suite -struct IrisAuthSDKRepositoryTests { +struct IrisSDKSignInTests { private let now = Date(timeIntervalSince1970: 1_800_000_000) private let credentials = IrisAuthCredentials(appleId: "dev@example.com", password: "secret") private let trustedDevice = TwoFactorChallenge(method: .trustedDevice, maskedDestination: "Trusted devices", codeLength: 6) private var pending: PendingTwoFactorState { PendingTwoFactorState( - credentials: credentials, scnt: "scnt-1", serviceKey: IrisAuthSDKRepository.ascServiceKey, + credentials: credentials, scnt: "scnt-1", serviceKey: IrisSDKSignIn.ascServiceKey, appleIDSessionID: "session-1", twoFactorCookieBag: "aasp=1", challenge: trustedDevice ) } @@ -39,14 +39,14 @@ struct IrisAuthSDKRepositoryTests { accountName: .any, c: .any, m1: .any, m2: .any, scnt: .any, appleIDSessionID: .any, hashcashChallenge: .any, hashcashBits: .any, cookies: .any ).willReturn(.twoFactorRequired(scnt: "scnt-2fa", appleIDSessionID: "session-1", cookies: "aasp=1; dslang=GB")) - let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) + let repo = IrisSDKSignIn(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) do { _ = try await repo.login(credentials: credentials) Issue.record("expected two-factor to be required") } catch IrisAuthError.twoFactorRequired(let state) { #expect(state == PendingTwoFactorState( - credentials: credentials, scnt: "scnt-2fa", serviceKey: IrisAuthSDKRepository.ascServiceKey, + credentials: credentials, scnt: "scnt-2fa", serviceKey: IrisSDKSignIn.ascServiceKey, appleIDSessionID: "session-1", twoFactorCookieBag: "aasp=1; dslang=GB", challenge: trustedDevice )) } @@ -58,12 +58,12 @@ struct IrisAuthSDKRepositoryTests { accountName: .any, c: .any, m1: .any, m2: .any, scnt: .any, appleIDSessionID: .any, hashcashChallenge: .any, hashcashBits: .any, cookies: .any ).willReturn(.success(scnt: "scnt-ok", cookies: "myacinfo=a")) - let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "team@example.com", teamId: "TEAM1"), now: { now }) + let repo = IrisSDKSignIn(signIn: signIn, accounts: accounts(email: "team@example.com", teamId: "TEAM1"), now: { now }) let session = try await repo.login(credentials: credentials) #expect(session == IrisAuthSession( - cookies: "myacinfo=a", scnt: "scnt-ok", serviceKey: IrisAuthSDKRepository.ascServiceKey, + cookies: "myacinfo=a", scnt: "scnt-ok", serviceKey: IrisSDKSignIn.ascServiceKey, appleIDSessionID: "session-1", providerID: 42, teamId: "TEAM1", userEmail: "team@example.com", expiresAt: now.addingTimeInterval(30 * 24 * 60 * 60) )) @@ -74,12 +74,12 @@ struct IrisAuthSDKRepositoryTests { given(signIn).fetchAuthOptions(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1") given(signIn).submitTwoFactorCode(.any, method: .any, scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1; verified=1") given(signIn).trust(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("myacinfo=a; trusted=1") - let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "team@example.com", teamId: "TEAM1"), now: { now }) + let repo = IrisSDKSignIn(signIn: signIn, accounts: accounts(email: "team@example.com", teamId: "TEAM1"), now: { now }) let session = try await repo.submitTwoFactorCode("123456", pending: pending) #expect(session == IrisAuthSession( - cookies: "myacinfo=a; trusted=1", scnt: "scnt-1", serviceKey: IrisAuthSDKRepository.ascServiceKey, + cookies: "myacinfo=a; trusted=1", scnt: "scnt-1", serviceKey: IrisSDKSignIn.ascServiceKey, appleIDSessionID: "session-1", providerID: 42, teamId: "TEAM1", userEmail: "team@example.com", expiresAt: now.addingTimeInterval(30 * 24 * 60 * 60) )) @@ -90,7 +90,7 @@ struct IrisAuthSDKRepositoryTests { given(signIn).fetchAuthOptions(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1") given(signIn).submitTwoFactorCode(.any, method: .any, scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1") given(signIn).trust(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("myacinfo=a") - let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) + let repo = IrisSDKSignIn(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) let session = try await repo.submitTwoFactorCode("123456", pending: pending) @@ -103,7 +103,7 @@ struct IrisAuthSDKRepositoryTests { given(signIn).fetchAuthOptions(scnt: .any, appleIDSessionID: .any, cookies: .any).willReturn("aasp=1") given(signIn).submitTwoFactorCode(.any, method: .any, scnt: .any, appleIDSessionID: .any, cookies: .any) .willThrow(IrisAuthError.twoFactorCodeRejected(remainingAttempts: nil)) - let repo = IrisAuthSDKRepository(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) + let repo = IrisSDKSignIn(signIn: signIn, accounts: accounts(email: "", teamId: nil), now: { now }) await #expect(throws: IrisAuthError.twoFactorCodeRejected(remainingAttempts: nil)) { try await repo.submitTwoFactorCode("000000", pending: pending) diff --git a/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift index a9b1c66e..869a795e 100644 --- a/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift @@ -2,7 +2,7 @@ import Foundation import Testing @testable import ASCKit -/// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionRepositoryTests` +/// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionsTests` /// for the rationale (avoids racing the shared `URLProtocolStub.handler` static used /// by `IdmsaAPIClientTests` when suites run in parallel). final class OlympusURLProtocolStub: URLProtocol, @unchecked Sendable { diff --git a/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift index ee434aab..808fcc2c 100644 --- a/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift @@ -23,7 +23,7 @@ struct StoredSRPIrisCookieProviderTests { } @Test func `resolveSession returns cookies from the persisted session when it has not expired`() throws { - let storage = MockIrisSessionRepository() + let storage = MockIrisSessions() given(storage).current().willReturn( session(cookies: "myacinfo=1; itctx=2", expiresAt: Date().addingTimeInterval(3600)) ) @@ -33,7 +33,7 @@ struct StoredSRPIrisCookieProviderTests { } @Test func `resolveSession throws noCookiesFound when storage is empty`() { - let storage = MockIrisSessionRepository() + let storage = MockIrisSessions() given(storage).current().willReturn(nil) let provider = StoredSRPIrisCookieProvider(sessionRepository: storage) #expect(throws: IrisCookieError.noCookiesFound) { @@ -42,7 +42,7 @@ struct StoredSRPIrisCookieProviderTests { } @Test func `resolveSession throws when the persisted session has expired`() { - let storage = MockIrisSessionRepository() + let storage = MockIrisSessions() given(storage).current().willReturn( session(expiresAt: Date(timeIntervalSinceNow: -60)) ) @@ -53,7 +53,7 @@ struct StoredSRPIrisCookieProviderTests { } @Test func `resolveStatus reports srpLogin source and counts cookies`() throws { - let storage = MockIrisSessionRepository() + let storage = MockIrisSessions() given(storage).current().willReturn( session( cookies: "myacinfo=1; itctx=2; dqsid=3", diff --git a/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift b/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift index eea95beb..2973bd93 100644 --- a/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift @@ -87,7 +87,7 @@ struct IrisResponseDecodingTests { // MARK: - mapToAppBundle @Test func `maps resource to AppBundle with all fields`() { - let repo = IrisSDKAppBundleRepository() + let repo = IrisSDKAppBundles() let resource = makeResource( id: "app-1", name: "Test", @@ -106,28 +106,28 @@ struct IrisResponseDecodingTests { } @Test func `maps resource with nil name uses fallback`() { - let repo = IrisSDKAppBundleRepository() + let repo = IrisSDKAppBundles() let resource = makeResource(id: "app-1") let bundle = repo.mapToAppBundle(resource, fallbackName: "Fallback") #expect(bundle.name == "Fallback") } @Test func `maps resource with nil name and no fallback uses empty string`() { - let repo = IrisSDKAppBundleRepository() + let repo = IrisSDKAppBundles() let resource = makeResource(id: "app-1") let bundle = repo.mapToAppBundle(resource) #expect(bundle.name == "") } @Test func `maps resource with nil platforms uses empty array`() { - let repo = IrisSDKAppBundleRepository() + let repo = IrisSDKAppBundles() let resource = makeResource(id: "app-1") let bundle = repo.mapToAppBundle(resource) #expect(bundle.platforms == []) } @Test func `maps resource with nil primaryLocale defaults to en-US`() { - let repo = IrisSDKAppBundleRepository() + let repo = IrisSDKAppBundles() let resource = makeResource(id: "app-1") let bundle = repo.mapToAppBundle(resource) #expect(bundle.primaryLocale == "en-US") diff --git a/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift b/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterTests.swift similarity index 98% rename from Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift rename to Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterTests.swift index a3e7ef33..fb727455 100644 --- a/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterTests.swift @@ -107,10 +107,10 @@ private let rejectionsJSON = Data(""" private let emptyThreadsJSON = Data(#"{"data":[]}"#.utf8) @Suite(.serialized) -struct IrisSDKResolutionCenterRepositoryTests { +struct IrisSDKResolutionCenterTests { - private func makeRepo() -> IrisSDKResolutionCenterRepository { - IrisSDKResolutionCenterRepository( + private func makeRepo() -> IrisSDKResolutionCenter { + IrisSDKResolutionCenter( client: IrisClient(session: IrisResolutionCenterURLProtocolStub.makeSession()) ) } diff --git a/Tests/ASCKitTests/Plugins/Internal/PluginMarketRepositoryTests.swift b/Tests/ASCKitTests/Plugins/Internal/MarketplacePluginsTests.swift similarity index 97% rename from Tests/ASCKitTests/Plugins/Internal/PluginMarketRepositoryTests.swift rename to Tests/ASCKitTests/Plugins/Internal/MarketplacePluginsTests.swift index 9fc2fc97..b6913e7e 100644 --- a/Tests/ASCKitTests/Plugins/Internal/PluginMarketRepositoryTests.swift +++ b/Tests/ASCKitTests/Plugins/Internal/MarketplacePluginsTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct PluginMarketRepositoryTests { +struct MarketplacePluginsTests { private let ascPro = InstalledPlugin( slug: "ASCPro", name: "ASC Pro", uiScripts: ["ui/pro.js"], version: "1.2.0", description: "Pro tools", author: "tddworks", @@ -28,8 +28,8 @@ struct PluginMarketRepositoryTests { private func repository( folder: MockPluginsFolder, market: [Plugin] = [], downloads: MockPluginDownloads = MockPluginDownloads() - ) -> PluginMarketRepository { - PluginMarketRepository(sources: [self.market(market)], folder: folder, downloads: downloads) + ) -> MarketplacePlugins { + MarketplacePlugins(sources: [self.market(market)], folder: folder, downloads: downloads) } // MARK: - installed diff --git a/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift b/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportsTests.swift similarity index 92% rename from Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift rename to Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportsTests.swift index b3068498..541c0f12 100644 --- a/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift +++ b/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportsTests.swift @@ -17,7 +17,7 @@ struct SDKAnalyticsReportRepositoryCreateRequestTests { links: .init(this: "") )) - let repo = SDKAnalyticsReportRepository(client: stub) + let repo = SDKAnalyticsReports(client: stub) let result = try await repo.createRequest(appId: "app-42", accessType: .oneTimeSnapshot) #expect(result.id == "req-new") @@ -39,7 +39,7 @@ struct SDKAnalyticsReportRepositoryListRequestsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReportRepository(client: stub) + let repo = SDKAnalyticsReports(client: stub) let result = try await repo.listRequests(appId: "app-99", accessType: nil) #expect(result.count == 2) @@ -56,7 +56,7 @@ struct SDKAnalyticsReportRepositoryListRequestsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReportRepository(client: stub) + let repo = SDKAnalyticsReports(client: stub) let result = try await repo.listRequests(appId: "app-1", accessType: nil) #expect(result[0].isStoppedDueToInactivity == true) @@ -76,7 +76,7 @@ struct SDKAnalyticsReportRepositoryListReportsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReportRepository(client: stub) + let repo = SDKAnalyticsReports(client: stub) let result = try await repo.listReports(requestId: "req-42", category: nil) #expect(result.count == 2) @@ -98,7 +98,7 @@ struct SDKAnalyticsReportRepositoryListInstancesTests { links: .init(this: "") )) - let repo = SDKAnalyticsReportRepository(client: stub) + let repo = SDKAnalyticsReports(client: stub) let result = try await repo.listInstances(reportId: "rpt-42", granularity: nil) #expect(result.count == 1) @@ -120,7 +120,7 @@ struct SDKAnalyticsReportRepositoryListSegmentsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReportRepository(client: stub) + let repo = SDKAnalyticsReports(client: stub) let result = try await repo.listSegments(instanceId: "inst-42") #expect(result.count == 1) @@ -139,7 +139,7 @@ struct SDKAnalyticsReportRepositoryListSegmentsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReportRepository(client: stub) + let repo = SDKAnalyticsReports(client: stub) let result = try await repo.listSegments(instanceId: "inst-1") #expect(result[0].checksum == nil) diff --git a/Tests/ASCKitTests/Reports/Internal/SDKReportRepositoryTests.swift b/Tests/ASCKitTests/Reports/Internal/SDKReportsTests.swift similarity index 96% rename from Tests/ASCKitTests/Reports/Internal/SDKReportRepositoryTests.swift rename to Tests/ASCKitTests/Reports/Internal/SDKReportsTests.swift index 7f946460..57130dd0 100644 --- a/Tests/ASCKitTests/Reports/Internal/SDKReportRepositoryTests.swift +++ b/Tests/ASCKitTests/Reports/Internal/SDKReportsTests.swift @@ -84,7 +84,7 @@ struct SDKReportRepositoryDownloadSalesReportTests { let stub = StubAPIClient() stub.willReturn(gzipped) - let repo = SDKReportRepository(client: stub) + let repo = SDKReports(client: stub) let rows = try await repo.downloadSalesReport( vendorNumber: "123", reportType: .sales, @@ -107,7 +107,7 @@ struct SDKReportRepositoryDownloadSalesReportTests { let stub = StubAPIClient() stub.willReturn(gzipped) - let repo = SDKReportRepository(client: stub) + let repo = SDKReports(client: stub) _ = try await repo.downloadSalesReport( vendorNumber: "123", reportType: .sales, @@ -128,7 +128,7 @@ struct SDKReportRepositoryDownloadSalesReportTests { let stub = StubAPIClient() stub.willReturn(gzipped) - let repo = SDKReportRepository(client: stub) + let repo = SDKReports(client: stub) _ = try await repo.downloadSalesReport( vendorNumber: "123", reportType: .sales, @@ -153,7 +153,7 @@ struct SDKReportRepositoryDownloadFinanceReportTests { let stub = StubAPIClient() stub.willReturn(gzipped) - let repo = SDKReportRepository(client: stub) + let repo = SDKReports(client: stub) let rows = try await repo.downloadFinanceReport( vendorNumber: "123", reportType: .financial, diff --git a/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplatesTests.swift similarity index 86% rename from Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplatesTests.swift index 763d3d7d..dd6f32c8 100644 --- a/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplatesTests.swift @@ -3,13 +3,13 @@ import Testing import Mockable @testable import ASCKit -@Suite("GalleryTemplateRepository") -struct GalleryTemplateRepositoryTests { +@Suite("GalleryTemplates") +struct GalleryTemplatesTests { // ── User: "I browse gallery templates" ── @Test func `list returns all galleries`() async throws { - let repo = MockGalleryTemplateRepository() + let repo = MockGalleryTemplates() let g1 = Gallery(appName: "App1", screenshots: ["s.png"]) g1.template = MockRepositoryFactory.makeGalleryTemplate(id: "neon-pop") let g2 = Gallery(appName: "App2", screenshots: ["s.png"]) @@ -26,7 +26,7 @@ struct GalleryTemplateRepositoryTests { // ── User: "I pick a specific gallery template" ── @Test func `get returns gallery by template id`() async throws { - let repo = MockGalleryTemplateRepository() + let repo = MockGalleryTemplates() let g = Gallery(appName: "App", screenshots: ["s.png"]) g.template = MockRepositoryFactory.makeGalleryTemplate(id: "neon-pop", name: "Neon Pop") @@ -37,7 +37,7 @@ struct GalleryTemplateRepositoryTests { } @Test func `get returns nil for unknown id`() async throws { - let repo = MockGalleryTemplateRepository() + let repo = MockGalleryTemplates() given(repo).getGallery(templateId: .value("unknown")).willReturn(nil) let gallery = try await repo.getGallery(templateId: "unknown") diff --git a/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift b/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplatesTests.swift similarity index 88% rename from Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplatesTests.swift index 6bfebe3a..84cc8666 100644 --- a/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplatesTests.swift @@ -3,17 +3,17 @@ import Mockable import Testing @testable import ASCKit -@Suite("AggregateGalleryTemplateRepository") -struct AggregateGalleryTemplateRepositoryTests { +@Suite("AggregateGalleryTemplates") +struct AggregateGalleryTemplatesTests { @Test func `empty repository returns no galleries`() async throws { - let repo = AggregateGalleryTemplateRepository() + let repo = AggregateGalleryTemplates() let galleries = try await repo.listGalleries() #expect(galleries.isEmpty) } @Test func `registered provider galleries are returned`() async throws { - let repo = AggregateGalleryTemplateRepository() + let repo = AggregateGalleryTemplates() let provider = MockGalleryTemplateProvider() given(provider).providerId.willReturn("test") given(provider).galleries().willReturn([ @@ -29,7 +29,7 @@ struct AggregateGalleryTemplateRepositoryTests { } @Test func `multiple providers are aggregated in registration order`() async throws { - let repo = AggregateGalleryTemplateRepository() + let repo = AggregateGalleryTemplates() let providerA = MockGalleryTemplateProvider() given(providerA).providerId.willReturn("a") given(providerA).galleries().willReturn([makeGallery(templateId: "a-1", appName: "A1")]) @@ -50,7 +50,7 @@ struct AggregateGalleryTemplateRepositoryTests { } @Test func `getGallery returns the matching template`() async throws { - let repo = AggregateGalleryTemplateRepository() + let repo = AggregateGalleryTemplates() let provider = MockGalleryTemplateProvider() given(provider).providerId.willReturn("test") given(provider).galleries().willReturn([ @@ -65,7 +65,7 @@ struct AggregateGalleryTemplateRepositoryTests { } @Test func `getGallery returns nil when templateId is unknown`() async throws { - let repo = AggregateGalleryTemplateRepository() + let repo = AggregateGalleryTemplates() let provider = MockGalleryTemplateProvider() given(provider).providerId.willReturn("test") given(provider).galleries().willReturn([makeGallery(templateId: "t-1", appName: "Alpha")]) @@ -76,7 +76,7 @@ struct AggregateGalleryTemplateRepositoryTests { } @Test func `provider errors propagate to caller`() async throws { - let repo = AggregateGalleryTemplateRepository() + let repo = AggregateGalleryTemplates() let provider = MockGalleryTemplateProvider() given(provider).providerId.willReturn("broken") given(provider).galleries().willThrow(StubError.boom) diff --git a/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift b/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplatesTests.swift similarity index 91% rename from Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/AggregateTemplatesTests.swift index 1549359b..ba819652 100644 --- a/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplatesTests.swift @@ -2,17 +2,17 @@ import Foundation import Testing @testable import ASCKit -@Suite("AggregateTemplateRepository") -struct AggregateTemplateRepositoryTests { +@Suite("AggregateTemplates") +struct AggregateTemplatesTests { @Test func `empty repository returns no templates`() async throws { - let repo = AggregateTemplateRepository() + let repo = AggregateTemplates() let templates = try await repo.listTemplates(size: nil) #expect(templates.isEmpty) } @Test func `registered provider templates are returned`() async throws { - let repo = AggregateTemplateRepository() + let repo = AggregateTemplates() let provider = StubTemplateProvider(providerId: "test", templates: [ makeTemplate(id: "t-1", name: "Template One"), makeTemplate(id: "t-2", name: "Template Two"), @@ -26,7 +26,7 @@ struct AggregateTemplateRepositoryTests { } @Test func `multiple providers are aggregated`() async throws { - let repo = AggregateTemplateRepository() + let repo = AggregateTemplates() await repo.register(provider: StubTemplateProvider(providerId: "a", templates: [ makeTemplate(id: "a-1"), ])) @@ -40,7 +40,7 @@ struct AggregateTemplateRepositoryTests { } @Test func `list filters by size`() async throws { - let repo = AggregateTemplateRepository() + let repo = AggregateTemplates() await repo.register(provider: StubTemplateProvider(providerId: "test", templates: [ makeTemplate(id: "portrait-1", supportedSizes: [.portrait]), makeTemplate(id: "landscape-1", supportedSizes: [.landscape]), @@ -59,7 +59,7 @@ struct AggregateTemplateRepositoryTests { } @Test func `get template by id finds across providers`() async throws { - let repo = AggregateTemplateRepository() + let repo = AggregateTemplates() await repo.register(provider: StubTemplateProvider(providerId: "a", templates: [ makeTemplate(id: "a-1", name: "From A"), ])) diff --git a/Tests/ASCKitTests/Screenshots/Internal/AggregateThemeRepositoryTests.swift b/Tests/ASCKitTests/Screenshots/Internal/AggregateThemesTests.swift similarity index 90% rename from Tests/ASCKitTests/Screenshots/Internal/AggregateThemeRepositoryTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/AggregateThemesTests.swift index fc74df8b..a8cce676 100644 --- a/Tests/ASCKitTests/Screenshots/Internal/AggregateThemeRepositoryTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/AggregateThemesTests.swift @@ -3,8 +3,8 @@ import Mockable import Testing @testable import ASCKit -@Suite("AggregateThemeRepository") -struct AggregateThemeRepositoryTests { +@Suite("AggregateThemes") +struct AggregateThemesTests { // MARK: - Helpers @@ -23,13 +23,13 @@ struct AggregateThemeRepositoryTests { } @Test func `listThemes returns empty when no providers registered`() async throws { - let repo = AggregateThemeRepository() + let repo = AggregateThemes() let themes = try await repo.listThemes() #expect(themes.isEmpty) } @Test func `listThemes returns themes from registered provider`() async throws { - let repo = AggregateThemeRepository() + let repo = AggregateThemes() let mockProvider = MockThemeProvider() given(mockProvider).providerId.willReturn("test") given(mockProvider).themes().willReturn([ @@ -45,7 +45,7 @@ struct AggregateThemeRepositoryTests { } @Test func `listThemes aggregates from multiple providers`() async throws { - let repo = AggregateThemeRepository() + let repo = AggregateThemes() let provider1 = MockThemeProvider() given(provider1).providerId.willReturn("blitz") @@ -62,7 +62,7 @@ struct AggregateThemeRepositoryTests { } @Test func `getTheme finds theme by id`() async throws { - let repo = AggregateThemeRepository() + let repo = AggregateThemes() let mockProvider = MockThemeProvider() given(mockProvider).providerId.willReturn("test") given(mockProvider).themes().willReturn([ @@ -76,7 +76,7 @@ struct AggregateThemeRepositoryTests { } @Test func `getTheme returns nil for unknown id`() async throws { - let repo = AggregateThemeRepository() + let repo = AggregateThemes() let mockProvider = MockThemeProvider() given(mockProvider).providerId.willReturn("test") given(mockProvider).themes().willReturn([makeTheme(id: "neon", name: "Neon")]) @@ -89,7 +89,7 @@ struct AggregateThemeRepositoryTests { // MARK: - Compose @Test func `compose delegates to the provider that owns the theme`() async throws { - let repo = AggregateThemeRepository() + let repo = AggregateThemes() let mockProvider = MockThemeProvider() let neonTheme = makeTheme(id: "neon", name: "Neon") given(mockProvider).providerId.willReturn("blitz") @@ -103,7 +103,7 @@ struct AggregateThemeRepositoryTests { } @Test func `compose throws when theme not found`() async throws { - let repo = AggregateThemeRepository() + let repo = AggregateThemes() do { _ = try await repo.compose(themeId: "nonexistent", html: "
", canvasWidth: 1320, canvasHeight: 2868) Issue.record("Expected error") diff --git a/Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorRepositoryTests.swift b/Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorsTests.swift similarity index 85% rename from Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorRepositoryTests.swift rename to Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorsTests.swift index f3301eb6..1e662ec5 100644 --- a/Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorRepositoryTests.swift +++ b/Tests/ASCKitTests/Simulators/Internal/SimctlSimulatorsTests.swift @@ -2,7 +2,7 @@ import Testing @testable import ASCKit @Suite -struct SimctlSimulatorRepositoryTests { +struct SimctlSimulatorsTests { // MARK: - listSimulators @@ -20,7 +20,7 @@ struct SimctlSimulatorRepositoryTests { } } """ - let repo = SimctlSimulatorRepository(shellRunner: StubShellRunner(stdout: json)) + let repo = SimctlSimulators(shellRunner: StubShellRunner(stdout: json)) let sims = try await repo.listSimulators(filter: .available) // Only iOS devices, watchOS filtered out @@ -51,7 +51,7 @@ struct SimctlSimulatorRepositoryTests { } } """ - let repo = SimctlSimulatorRepository(shellRunner: StubShellRunner(stdout: json)) + let repo = SimctlSimulators(shellRunner: StubShellRunner(stdout: json)) let sims = try await repo.listSimulators(filter: .all) #expect(sims.isEmpty) @@ -68,7 +68,7 @@ struct SimctlSimulatorRepositoryTests { } } """ - let repo = SimctlSimulatorRepository(shellRunner: StubShellRunner(stdout: json)) + let repo = SimctlSimulators(shellRunner: StubShellRunner(stdout: json)) let sims = try await repo.listSimulators(filter: .all) #expect(sims.count == 1) @@ -87,7 +87,7 @@ struct SimctlSimulatorRepositoryTests { } } """ - let repo = SimctlSimulatorRepository(shellRunner: StubShellRunner(stdout: json)) + let repo = SimctlSimulators(shellRunner: StubShellRunner(stdout: json)) let sims = try await repo.listSimulators(filter: .all) #expect(sims.map(\.name) == ["Alpha Phone", "Beta Phone", "Zebra Phone"]) @@ -95,7 +95,7 @@ struct SimctlSimulatorRepositoryTests { } @Test func `listSimulators returns empty for invalid json`() async throws { - let repo = SimctlSimulatorRepository(shellRunner: StubShellRunner(stdout: "not json")) + let repo = SimctlSimulators(shellRunner: StubShellRunner(stdout: "not json")) do { _ = try await repo.listSimulators(filter: .all) Issue.record("Expected error") @@ -105,7 +105,7 @@ struct SimctlSimulatorRepositoryTests { } @Test func `listSimulators handles empty json object`() async throws { - let repo = SimctlSimulatorRepository(shellRunner: StubShellRunner(stdout: "{\"devices\":{}}")) + let repo = SimctlSimulators(shellRunner: StubShellRunner(stdout: "{\"devices\":{}}")) let sims = try await repo.listSimulators(filter: .all) #expect(sims.isEmpty) } @@ -115,7 +115,7 @@ struct SimctlSimulatorRepositoryTests { { "devices": { "com.apple.CoreSimulator.SimRuntime.iOS-18-2": [] } } """ let runner = RecordingShellRunner(stdout: json) - let repo = SimctlSimulatorRepository(shellRunner: runner) + let repo = SimctlSimulators(shellRunner: runner) _ = try await repo.listSimulators(filter: .booted) #expect(runner.lastArguments?.contains("booted") == true) @@ -126,7 +126,7 @@ struct SimctlSimulatorRepositoryTests { { "devices": { "com.apple.CoreSimulator.SimRuntime.iOS-18-2": [] } } """ let runner = RecordingShellRunner(stdout: json) - let repo = SimctlSimulatorRepository(shellRunner: runner) + let repo = SimctlSimulators(shellRunner: runner) _ = try await repo.listSimulators(filter: .available) #expect(runner.lastArguments?.contains("available") == true) @@ -136,7 +136,7 @@ struct SimctlSimulatorRepositoryTests { @Test func `bootSimulator calls xcrun simctl boot with udid`() async throws { let runner = RecordingShellRunner(stdout: "") - let repo = SimctlSimulatorRepository(shellRunner: runner) + let repo = SimctlSimulators(shellRunner: runner) try await repo.bootSimulator(udid: "TEST-UDID") #expect(runner.lastCommand == "xcrun") @@ -146,7 +146,7 @@ struct SimctlSimulatorRepositoryTests { @Test func `shutdownSimulator calls xcrun simctl shutdown with udid`() async throws { let runner = RecordingShellRunner(stdout: "") - let repo = SimctlSimulatorRepository(shellRunner: runner) + let repo = SimctlSimulators(shellRunner: runner) try await repo.shutdownSimulator(udid: "TEST-UDID") #expect(runner.lastCommand == "xcrun") @@ -155,7 +155,7 @@ struct SimctlSimulatorRepositoryTests { } @Test func `bootSimulator throws when shell fails`() async throws { - let repo = SimctlSimulatorRepository(shellRunner: StubShellRunner(error: ShellRunnerError.executionFailed(exitCode: 1, stderr: "Already booted"))) + let repo = SimctlSimulators(shellRunner: StubShellRunner(error: ShellRunnerError.executionFailed(exitCode: 1, stderr: "Already booted"))) do { try await repo.bootSimulator(udid: "X") Issue.record("Expected error") diff --git a/Tests/ASCKitTests/Skills/Internal/ProcessSkillRepositoryTests.swift b/Tests/ASCKitTests/Skills/Internal/ProcessSkillsTests.swift similarity index 80% rename from Tests/ASCKitTests/Skills/Internal/ProcessSkillRepositoryTests.swift rename to Tests/ASCKitTests/Skills/Internal/ProcessSkillsTests.swift index 696debef..0201e00b 100644 --- a/Tests/ASCKitTests/Skills/Internal/ProcessSkillRepositoryTests.swift +++ b/Tests/ASCKitTests/Skills/Internal/ProcessSkillsTests.swift @@ -3,67 +3,67 @@ import Testing @testable import ASCKit @Suite -struct ProcessSkillRepositoryTests { +struct ProcessSkillsTests { @Test func `check parses updates available from stdout`() async throws { let runner = StubShellRunner(stdout: "2 update(s) available") - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let result = try await repo.check() #expect(result == .updatesAvailable) } @Test func `check parses all skills are up to date`() async throws { let runner = StubShellRunner(stdout: "All skills are up to date") - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let result = try await repo.check() #expect(result == .upToDate) } @Test func `check parses no updates available`() async throws { let runner = StubShellRunner(stdout: "No updates available") - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let result = try await repo.check() #expect(result == .upToDate) } @Test func `check returns unavailable when runner throws`() async throws { let runner = StubShellRunner(error: ShellRunnerError.commandNotFound) - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let result = try await repo.check() #expect(result == .unavailable) } @Test func `check returns up to date for unknown output`() async throws { let runner = StubShellRunner(stdout: "something unexpected") - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let result = try await repo.check() #expect(result == .upToDate) } @Test func `listAvailable returns stdout from runner`() async throws { let runner = StubShellRunner(stdout: "asc-cli\nasc-auth\nasc-testflight") - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let output = try await repo.listAvailable() #expect(output == "asc-cli\nasc-auth\nasc-testflight") } @Test func `install returns stdout from runner`() async throws { let runner = StubShellRunner(stdout: "Installed asc-cli skill") - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let output = try await repo.install(name: "asc-cli") #expect(output == "Installed asc-cli skill") } @Test func `installAll returns stdout from runner`() async throws { let runner = StubShellRunner(stdout: "Installed 5 skills") - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let output = try await repo.installAll() #expect(output == "Installed 5 skills") } @Test func `update returns stdout from runner`() async throws { let runner = StubShellRunner(stdout: "Updated 3 skills") - let repo = ProcessSkillRepository(runner: runner) + let repo = ProcessSkills(runner: runner) let output = try await repo.update() #expect(output == "Updated 3 skills") } diff --git a/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift index c20e9cd2..7bb76867 100644 --- a/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift @@ -54,7 +54,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let result = try await repo.submitVersion(versionId: "v-1") #expect(result.id == "sub-99") @@ -99,7 +99,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let result = try await repo.submitVersion(versionId: "v-2") #expect(result.platform == .macOS) @@ -153,7 +153,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let result = try await repo.submitVersion(versionId: "v-3") #expect(result.id == "sub-existing") @@ -181,7 +181,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let results = try await repo.listSubmissions(appId: "app-42", states: nil, limit: nil) #expect(results.count == 2) @@ -205,7 +205,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let result = try await repo.getSubmission(id: "sub-77") #expect(result.id == "sub-77") @@ -240,7 +240,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let results = try await repo.listSubmissionItems(submissionId: "sub-1") #expect(results.count == 2) @@ -266,7 +266,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let results = try await repo.listSubmissionItems(submissionId: "sub-1") #expect(results.first?.linkedResourceId == nil) @@ -287,7 +287,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let results = try await repo.listSubmissions( appId: "app-9", states: [.inReview, .waitingForReview], @@ -304,7 +304,7 @@ struct SDKSubmissionRepositoryTests { let stub = StubAPIClient() stub.willReturn(ReviewSubmissionItemsResponse(data: [], links: .init(this: ""))) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) _ = try await repo.listSubmissionItems(submissionId: "sub-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) @@ -340,7 +340,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let items = try await repo.listSubmissionItems(submissionId: "sub-1") #expect(items.map(\.linkedResourceType) == [.inAppPurchaseVersion, .subscriptionVersion, .subscriptionGroupVersion]) @@ -357,7 +357,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let submission = try await repo.createSubmission(appId: "app-1", platform: .iOS) #expect(submission == ASCKit.ReviewSubmission(id: "draft-1", appId: "app-1", platform: .iOS, state: .readyForReview)) @@ -373,7 +373,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let submission = try await repo.createSubmission(appId: "app-1", platform: .iOS) #expect(submission == ASCKit.ReviewSubmission(id: "new-1", appId: "app-1", platform: .iOS, state: .readyForReview)) @@ -396,7 +396,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let item = try await repo.addItem(submissionId: "sub-1", target: target) let post = stub.requests.first { $0.method == "POST" } @@ -413,7 +413,7 @@ struct SDKSubmissionRepositoryTests { @Test func `removing an item deletes it from its submission`() async throws { let stub = StubAPIClient() - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) try await repo.removeItem(itemId: "item-1") #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["DELETE /v1/reviewSubmissionItems/item-1"]) @@ -428,7 +428,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) let submission = try await repo.submit(submissionId: "sub-1") let patch = stub.requests.first { $0.method == "PATCH" } @@ -463,7 +463,7 @@ struct SDKSubmissionRepositoryTests { let stub = StubAPIClient() stub.errorToThrow = appVersionNotReviewable() - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) await #expect { _ = try await repo.addItem(submissionId: "sub-1", target: .appStoreVersion("v-1")) } throws: { error in @@ -479,7 +479,7 @@ struct SDKSubmissionRepositoryTests { let stub = StubAPIClient() stub.errorToThrow = appVersionNotReviewable() - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) await #expect { _ = try await repo.submit(submissionId: "sub-1") } throws: { error in @@ -495,7 +495,7 @@ struct SDKSubmissionRepositoryTests { detail: "An unexpected error occurred on the server side."), ]), nil) - let repo = OpenAPISubmissionRepository(client: stub) + let repo = OpenAPIReviewSubmissions(client: stub) await #expect { _ = try await repo.addItem(submissionId: "sub-1", target: .appStoreVersion("v-1")) } throws: { error in @@ -539,7 +539,7 @@ struct SDKSubmissionRepositoryTests { @Test func `should add the version before submitting when the open draft is empty`() async throws { let stub = submitVersionStub(openDrafts: [openDraft], itemsInDraft: []) - let submission = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") + let submission = try await OpenAPIReviewSubmissions(client: stub).submitVersion(versionId: "v-1") #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ "POST /v1/reviewSubmissionItems", @@ -558,7 +558,7 @@ struct SDKSubmissionRepositoryTests { ), ]) - let submission = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") + let submission = try await OpenAPIReviewSubmissions(client: stub).submitVersion(versionId: "v-1") #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ "PATCH /v1/reviewSubmissions/sub-1", @@ -574,7 +574,7 @@ struct SDKSubmissionRepositoryTests { ), ]) - _ = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") + _ = try await OpenAPIReviewSubmissions(client: stub).submitVersion(versionId: "v-1") #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ "POST /v1/reviewSubmissionItems", @@ -592,7 +592,7 @@ struct SDKSubmissionRepositoryTests { stub.errorsByRequest[refusedRequest] = appVersionNotReviewable() await #expect { - _ = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") + _ = try await OpenAPIReviewSubmissions(client: stub).submitVersion(versionId: "v-1") } throws: { error in String(describing: error) == """ Apple refused the review submission: This resource cannot be reviewed, please check associated errors to see why. diff --git a/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift b/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift index d69e7cbe..5481c8bf 100644 --- a/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift +++ b/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift @@ -11,10 +11,10 @@ struct SubmissionPlannerTests { ) private struct Repos { - let iaps = MockInAppPurchaseRepository() - let groups = MockSubscriptionGroupRepository() - let subscriptions = MockSubscriptionRepository() - let versions = MockProductVersionRepository() + let iaps = MockInAppPurchases() + let groups = MockSubscriptionGroups() + let subscriptions = MockSubscriptions() + let versions = MockProductVersions() var planner: SubmissionPlanner { SubmissionPlanner(iapRepo: iaps, groupRepo: groups, subscriptionRepo: subscriptions, productVersionRepo: versions) @@ -118,7 +118,7 @@ struct SubmissionPlannerTests { PlannedReviewItem(kind: .appStoreVersion, versionId: "v-1", productId: "app-1", name: "1.0"), PlannedReviewItem(kind: .inAppPurchaseVersion, versionId: "iv-1", productId: "iap-1", name: "Lifetime"), ]) - let repo = MockSubmissionRepository() + let repo = MockReviewSubmissions() given(repo).createSubmission(appId: .any, platform: .any).willReturn( MockRepositoryFactory.makeReviewSubmission(id: "sub-1", appId: "app-1", state: .readyForReview) ) @@ -141,7 +141,7 @@ struct SubmissionPlannerTests { PlannedReviewItem(kind: .appStoreVersion, versionId: "v-1", productId: "app-1", name: "1.0"), PlannedReviewItem(kind: .inAppPurchaseVersion, versionId: "iv-1", productId: "iap-1", name: "Lifetime"), ]) - let repo = MockSubmissionRepository() + let repo = MockReviewSubmissions() given(repo).createSubmission(appId: .any, platform: .any).willReturn( MockRepositoryFactory.makeReviewSubmission(id: "sub-1", state: .readyForReview) ) diff --git a/Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift b/Tests/ASCKitTests/Territories/Internal/SDKTerritoriesTests.swift similarity index 90% rename from Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift rename to Tests/ASCKitTests/Territories/Internal/SDKTerritoriesTests.swift index 0f943ade..240d25dd 100644 --- a/Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift +++ b/Tests/ASCKitTests/Territories/Internal/SDKTerritoriesTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKTerritoryRepositoryTests { +struct SDKTerritoriesTests { @Test func `listTerritories maps id and currency from SDK response`() async throws { let stub = StubAPIClient() @@ -16,7 +16,7 @@ struct SDKTerritoryRepositoryTests { links: .init(this: "") )) - let repo = SDKTerritoryRepository(client: stub) + let repo = SDKTerritories(client: stub) let result = try await repo.listTerritories() #expect(result.count == 3) @@ -35,7 +35,7 @@ struct SDKTerritoryRepositoryTests { links: .init(this: "") )) - let repo = SDKTerritoryRepository(client: stub) + let repo = SDKTerritories(client: stub) let result = try await repo.listTerritories() #expect(result[0].id == "USA") diff --git a/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift b/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift index 8d91783e..a38423fc 100644 --- a/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift +++ b/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift @@ -172,7 +172,7 @@ struct MockRepositoryFactory { localizationId: String = "loc-1", displayType: ScreenshotDisplayType = .iphone67, screenshotsCount: Int = 0, - repo: (any ScreenshotRepository)? = nil + repo: (any AppScreenshots)? = nil ) -> AppScreenshotSet { AppScreenshotSet( id: id, diff --git a/Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift b/Tests/ASCKitTests/Users/Internal/SDKUsersTests.swift similarity index 93% rename from Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift rename to Tests/ASCKitTests/Users/Internal/SDKUsersTests.swift index a09f0478..be6076c3 100644 --- a/Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift +++ b/Tests/ASCKitTests/Users/Internal/SDKUsersTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKUserRepositoryTests { +struct SDKUsersTests { @Test func `listUsers maps username roles and visibility`() async throws { let stub = StubAPIClient() @@ -25,7 +25,7 @@ struct SDKUserRepositoryTests { links: .init(this: "") )) - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) let result = try await repo.listUsers(role: nil) #expect(result[0].id == "u-1") @@ -39,7 +39,7 @@ struct SDKUserRepositoryTests { @Test func `removeUser calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) try await repo.removeUser(id: "u-1") @@ -48,7 +48,7 @@ struct SDKUserRepositoryTests { @Test func `cancelUserInvitation calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) try await repo.cancelUserInvitation(id: "inv-1") @@ -76,7 +76,7 @@ struct SDKUserRepositoryTests { links: .init(this: "") )) - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) let result = try await repo.listUserInvitations(role: nil) #expect(result[0].id == "inv-1") @@ -104,7 +104,7 @@ struct SDKUserRepositoryTests { links: .init(this: "") )) - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) let result = try await repo.updateUser(id: "u-1", roles: [.admin]) #expect(result.id == "u-1") @@ -131,7 +131,7 @@ struct SDKUserRepositoryTests { links: .init(this: "") )) - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) let result = try await repo.inviteUser( email: "hire@example.com", firstName: "Alex", @@ -159,7 +159,7 @@ struct SDKUserRepositoryTests { links: .init(this: "") )) - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) let result = try await repo.listUsers(role: .admin) #expect(result[0].roles == [.admin]) @@ -185,7 +185,7 @@ struct SDKUserRepositoryTests { links: .init(this: "") )) - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) let result = try await repo.listUserInvitations(role: .admin) #expect(result[0].roles == [.admin]) @@ -202,7 +202,7 @@ struct SDKUserRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKUserRepository(client: stub) + let repo = SDKUsers(client: stub) let result = try await repo.listUsers(role: nil) #expect(result.count == 75) diff --git a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunsTests.swift similarity index 90% rename from Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunsTests.swift index c8729c90..cb7873c3 100644 --- a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKXcodeCloudBuildRunRepositoryTests { +struct SDKXcodeCloudBuildRunsTests { private func makeSDKBuildRun( id: String = "run-1", @@ -31,7 +31,7 @@ struct SDKXcodeCloudBuildRunRepositoryTests { links: .init(this: "") )) - let repo = SDKXcodeCloudBuildRunRepository(client: stub) + let repo = SDKXcodeCloudBuildRuns(client: stub) let result = try await repo.listBuildRuns(workflowId: "wf-1") #expect(result[0].id == "run-1") @@ -47,7 +47,7 @@ struct SDKXcodeCloudBuildRunRepositoryTests { links: .init(this: "") )) - let repo = SDKXcodeCloudBuildRunRepository(client: stub) + let repo = SDKXcodeCloudBuildRuns(client: stub) let result = try await repo.listBuildRuns(workflowId: "wf-99") #expect(result[0].workflowId == "wf-99") @@ -60,7 +60,7 @@ struct SDKXcodeCloudBuildRunRepositoryTests { links: .init(this: "") )) - let repo = SDKXcodeCloudBuildRunRepository(client: stub) + let repo = SDKXcodeCloudBuildRuns(client: stub) let result = try await repo.getBuildRun(id: "run-42") #expect(result.id == "run-42") @@ -76,7 +76,7 @@ struct SDKXcodeCloudBuildRunRepositoryTests { links: .init(this: "") )) - let repo = SDKXcodeCloudBuildRunRepository(client: stub) + let repo = SDKXcodeCloudBuildRuns(client: stub) let result = try await repo.startBuildRun(workflowId: "wf-1", clean: false) #expect(result.id == "run-new") @@ -95,7 +95,7 @@ struct SDKXcodeCloudBuildRunRepositoryTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKXcodeCloudBuildRunRepository(client: stub) + let repo = SDKXcodeCloudBuildRuns(client: stub) let result = try await repo.listBuildRuns(workflowId: "wf-1") #expect(result.count == 75) diff --git a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductsTests.swift similarity index 88% rename from Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductsTests.swift index e097cd4f..cb1ab3f8 100644 --- a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKXcodeCloudProductRepositoryTests { +struct SDKXcodeCloudProductsTests { @Test func `listProducts maps name and productType from SDK response`() async throws { let stub = StubAPIClient() @@ -21,7 +21,7 @@ struct SDKXcodeCloudProductRepositoryTests { links: .init(this: "") )) - let repo = SDKXcodeCloudProductRepository(client: stub) + let repo = SDKXcodeCloudProducts(client: stub) let result = try await repo.listProducts(appId: nil) #expect(result[0].id == "prod-1") @@ -45,7 +45,7 @@ struct SDKXcodeCloudProductRepositoryTests { links: .init(this: "") )) - let repo = SDKXcodeCloudProductRepository(client: stub) + let repo = SDKXcodeCloudProducts(client: stub) let result = try await repo.listProducts(appId: nil) #expect(result[0].appId == "app-99") @@ -55,7 +55,7 @@ struct SDKXcodeCloudProductRepositoryTests { let stub = StubAPIClient() stub.willReturn(CiProductsResponse(data: [], links: .init(this: ""))) - let repo = SDKXcodeCloudProductRepository(client: stub) + let repo = SDKXcodeCloudProducts(client: stub) let result = try await repo.listProducts(appId: "app-123") #expect(result.isEmpty) diff --git a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowsTests.swift similarity index 90% rename from Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowsTests.swift index 5ad42ad5..8419341d 100644 --- a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowsTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKXcodeCloudWorkflowRepositoryTests { +struct SDKXcodeCloudWorkflowsTests { @Test func `listWorkflows maps name and isEnabled from SDK response`() async throws { let stub = StubAPIClient() @@ -21,7 +21,7 @@ struct SDKXcodeCloudWorkflowRepositoryTests { links: .init(this: "") )) - let repo = SDKXcodeCloudWorkflowRepository(client: stub) + let repo = SDKXcodeCloudWorkflows(client: stub) let result = try await repo.listWorkflows(productId: "prod-1") #expect(result[0].id == "wf-1") @@ -45,7 +45,7 @@ struct SDKXcodeCloudWorkflowRepositoryTests { links: .init(this: "") )) - let repo = SDKXcodeCloudWorkflowRepository(client: stub) + let repo = SDKXcodeCloudWorkflows(client: stub) let result = try await repo.listWorkflows(productId: "prod-42") #expect(result[0].productId == "prod-42") diff --git a/docs/documentation-design/layout.md b/docs/documentation-design/layout.md index 08dc728b..4ccda2e5 100644 --- a/docs/documentation-design/layout.md +++ b/docs/documentation-design/layout.md @@ -52,7 +52,7 @@ They don't care which Swift type, repository method or SDK call changed; that's **Before (0.17.8):** a removed REST route is hidden at the end of an 1,100-char `Added` bullet: -> - **`asc iris iap-submissions delete --submission-id `** — iris-side dequeue of an IAP submission (`DELETE /iris/v1/inAppPurchaseSubmissions/{id}`). Iris-queued submissions don't round-trip through the public-SDK delete; they can only be removed via this iris-cookie-authed path. New `IrisClient.delete`, new `IrisInAppPurchaseSubmissionRepository.deleteSubmission(session:submissionId:)`. REST equivalent: … `RESTPathResolver.resourcePath` now converts spaces … Removed the short-lived public-SDK alias `POST /api/v1/iap/:iapId/unsubmit` (incorrect — …). +> - **`asc iris iap-submissions delete --submission-id `** — iris-side dequeue of an IAP submission (`DELETE /iris/v1/inAppPurchaseSubmissions/{id}`). Iris-queued submissions don't round-trip through the public-SDK delete; they can only be removed via this iris-cookie-authed path. New `IrisClient.delete`, new `IrisInAppPurchaseSubmissions.deleteSubmission(session:submissionId:)`. REST equivalent: … `RESTPathResolver.resourcePath` now converts spaces … Removed the short-lived public-SDK alias `POST /api/v1/iap/:iapId/unsubmit` (incorrect — …). A script calling `POST /api/v1/iap/:iapId/unsubmit` broke, and the only notice was the last sentence of a bullet about something else. diff --git a/docs/features/app-shots-themes/authoring.md b/docs/features/app-shots-themes/authoring.md index dc38721d..3d049b87 100644 --- a/docs/features/app-shots-themes/authoring.md +++ b/docs/features/app-shots-themes/authoring.md @@ -44,10 +44,10 @@ struct MyThemeProvider: ThemeProvider { } // Register at plugin startup: -await AggregateThemeRepository.shared.register(provider: MyThemeProvider()) +await AggregateThemes.shared.register(provider: MyThemeProvider()) ``` -`AggregateThemeRepository` finds which provider owns the requested theme and delegates `compose()` / `design()` to it. +`AggregateThemes` finds which provider owns the requested theme and delegates `compose()` / `design()` to it. For an example of the prompt `buildContext()` produces, for a "Space" theme: diff --git a/docs/features/concept-folders/design.md b/docs/features/concept-folders/design.md index a9075554..5962c88a 100644 --- a/docs/features/concept-folders/design.md +++ b/docs/features/concept-folders/design.md @@ -4,7 +4,7 @@ description: The source layout reworked from layers (Domain/, Infrastructure/) t # Concept folders, not layers -**Status: steps 1–4 BUILT** (one `ASCKit` module, concept folders; docs and skills follow; one composition root, held by a test; every adapter's decisions tested, only the bare call in `Internal/System/`); step 5 not built. asc-cli is split by layer: `Sources/Domain/` +**Status: BUILT** — steps 1–5: one `ASCKit` module in concept folders; docs and skills follow; one composition root, held by a test; every adapter's decisions tested with only the bare call in `Internal/System/`; protocols named for what they are. asc-cli is split by layer: `Sources/Domain/` and `Sources/Infrastructure/` are two modules that mirror each other folder for folder. Every concept therefore lives in two places, and every change to one touches both trees. The goal, stated as a test: @@ -27,7 +27,7 @@ one touches both trees. The goal, stated as a test: | **The two trees already disagree** | `Domain/Screenshots/` is implemented by `Infrastructure/ScreenshotPlans/`; `Infrastructure/Client/`, `Web/` and `Iris/Auth/` have no Domain twin | finding an implementation means knowing a second name | | **The module split is paid for by hand** | 613 `Domain.X` qualifiers in 69 files, to tell a Domain type from the SDK type of the same name (`Domain.Territory` vs the SDK's `Territory`) | every new adapter repeats the qualifier dance | | **Implementations leak to the way in** | `ASCCommand` imports `Infrastructure` in 80 files; outside `ClientProvider`, 14 files name 12 implementation types (22 uses) — `FileAuthStorage()` in 10 auth and report commands, and `RESTRoutes` builds its own `CompositeAuthProvider`, `ClientFactory` and five more | swapping an implementation (keychain auth storage, another renderer) edits every command that names it | -| **The outside call is mixed with decisions** | the SDK adapters are already split right: they depend on the narrow `APIClient` role, whose real implementation is the SDK's own `APIProvider`, and 472 tests drive them through `StubAPIClient`. The rest are not: seven adapters (`ShellRunner`, `IrisClient`, `WebKitHTMLRenderer`, `BrowserIrisCookieProvider`, `IrisSDKAppBundleRepository`, `IrisAuthSDKRepository`, `PluginMarketRepository`, ~860 lines) hold their decisions beside a `Process`, `URLSession`, WebKit or cookie call, and `codecov.yml` skips each by file path | their decisions — argv, environment, status → error, parsing — have no test | +| **The outside call is mixed with decisions** | the SDK adapters are already split right: they depend on the narrow `APIClient` role, whose real implementation is the SDK's own `APIProvider`, and 472 tests drive them through `StubAPIClient`. The rest are not: seven adapters (`ShellRunner`, `IrisClient`, `WebKitHTMLRenderer`, `BrowserIrisCookieProvider`, `IrisSDKAppBundles`, `IrisSDKSignIn`, `MarketplacePlugins`, ~860 lines) hold their decisions beside a `Process`, `URLSession`, WebKit or cookie call, and `codecov.yml` skips each by file path | their decisions — argv, environment, status → error, parsing — have no test | ## 2 · The shape — outside to inside @@ -58,11 +58,11 @@ Sources/ ├── Shared/ the kernel: Affordance, APIError, OutputFormat, pagination, RESTPathResolver │ └── Internal/ APIClient, ClientFactory, HTTPPerforming, SDKFilter, uploads ├── Apps/ - │ ├── App.swift AppRepository.swift App+RESTRoutes.swift public face + │ ├── App.swift Apps.swift App+RESTRoutes.swift public face │ ├── Internal/OpenAPIAppRepository.swift implementation │ ├── Builds/ - │ │ ├── Build.swift BuildRepository.swift … public face - │ │ └── Internal/SDKBuildRepository.swift … implementation + │ │ ├── Build.swift Builds.swift … public face + │ │ └── Internal/SDKBuilds.swift … implementation │ ├── Versions/ TestFlight/ InAppPurchases/ Subscriptions/ … (same shape, nested as today) ├── Auth/ Internal/ (FileAuthProvider, EnvironmentAuthProvider, CompositeAuthProvider) ├── Iris/ Internal/ Internal/Auth/ Internal/Auth/SRP/ @@ -117,7 +117,7 @@ safety net; any step that moves a rule writes its test first. | 2 | **docs and skills follow** ✓ | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | | 3 | **one composition root** ✓ | 22 uses of 12 `Internal/` types in 14 `ASCCommand` files outside `ClientProvider`; `RESTRoutes` wires its own `ClientFactory` | `ClientProvider` gains `makeAuthStorage`, `makeEnvironmentAuthProvider`, `makeXcodeBuildRunner`, `makeProjectConfigStorage`; commands and `RESTRoutes` ask it for the public protocol | "should build every concept's Internal implementation only in the composition root" | | 4 | **`Internal/System/` per adapter** ✓ (one commit each) | seven untested adapters mix decisions with I/O; `codecov.yml` lists each file | each adapter's decisions become a tested value or orchestrator in `Internal/`; only the call stays, ≤100 lines, in `Internal/System/`; the per-file ignores become one `**/Internal/System/**` rule. The SDK adapters stay as they are | per adapter, its decisions: e.g. "should add the given variables on top of the inherited environment" | -| 5 | **names for roles** (several PRs) | 75 `XxxRepository` protocols, `XxxProvider`s | plural collection nouns (`Apps`, `Builds`), role nouns for the rest | per rename — none; behaviour unchanged | +| 5 | **names for roles** ✓ | 75 `XxxRepository` protocols and their ~75 implementations | collections take the plural of the aggregate (`Apps`, `Builds`, `AppStoreVersions`, `AppScreenshots`); the rest a role noun (`IrisSignIn`, `TestFlight`, `GameCenter`, `Reports`, `AppPrices`, `ReviewSubmissions`, `…ReviewAssets`); implementations say how (`SDKBuilds`, `SimctlSimulators`, `MarketplacePlugins`); mocks, `make…` factories and file names follow. `XxxProvider`s stay: providing is what they do, and the rule bans Service / Manager / Port / Helper / Repository | none — behaviour unchanged; 2,958 tests before and after | Step 1 removes most of §1's cost on its own; 3 and 4 make the fence real; 5 is cosmetic and can wait. diff --git a/docs/features/iap-subscriptions/pricing.md b/docs/features/iap-subscriptions/pricing.md index 264a0022..4aec5bd9 100644 --- a/docs/features/iap-subscriptions/pricing.md +++ b/docs/features/iap-subscriptions/pricing.md @@ -81,5 +81,5 @@ IAP pricing endpoints live alongside the IAP resource (see [IAP REST routes](REA ## Testing ```bash -swift test --filter 'SubscriptionPricePoint|SDKSubscriptionPriceRepository|SubscriptionPricesSet' +swift test --filter 'SubscriptionPricePoint|SDKSubscriptionPrices|SubscriptionPricesSet' ``` diff --git a/docs/features/iap-subscriptions/review-assets.md b/docs/features/iap-subscriptions/review-assets.md index 9bee09c0..3d0f4483 100644 --- a/docs/features/iap-subscriptions/review-assets.md +++ b/docs/features/iap-subscriptions/review-assets.md @@ -121,5 +121,5 @@ Upload and delete are CLI-only (multipart-style chunked upload would be a separa ## Testing ```bash -swift test --filter 'ReviewScreenshot|PromotionalImage|SDKInAppPurchaseReviewRepository|SDKSubscriptionReviewRepository' +swift test --filter 'ReviewScreenshot|PromotionalImage|SDKInAppPurchaseReviewAssets|SDKSubscriptionReviewAssets' ``` diff --git a/docs/features/iap-subscriptions/submission-iris-parity.md b/docs/features/iap-subscriptions/submission-iris-parity.md index 88e65ab4..e5609a93 100644 --- a/docs/features/iap-subscriptions/submission-iris-parity.md +++ b/docs/features/iap-subscriptions/submission-iris-parity.md @@ -11,7 +11,7 @@ | Auth | Team API key (`AuthKey_*.p8`) | Browser cookie session (iris) | | First-time IAP submission | Tends to fail (no flag to express "attach to next version") | Works with `submitWithNextAppStoreVersion: true` | -`InAppPurchaseSubmissionCreateRequest` in `appstoreconnect-swift-sdk` exposes only `data.type` + `data.relationships.inAppPurchaseV2` — there's no `attributes` field on the create request at all. Our existing `SDKInAppPurchaseSubmissionRepository.submitInAppPurchase` is built on this shape. +`InAppPurchaseSubmissionCreateRequest` in `appstoreconnect-swift-sdk` exposes only `data.type` + `data.relationships.inAppPurchaseV2` — there's no `attributes` field on the create request at all. Our existing `SDKInAppPurchaseSubmissions.submitInAppPurchase` is built on this shape. The iris request shape Apple's web UI sends (verified via DevTools curl): @@ -42,7 +42,7 @@ The web UI expresses "alongside next version" via `submitWithNextAppStoreVersion - `Sources/ASCKit/Iris/Internal/IrisClient.swift` — handles cookie injection, `[asc-ui]` CSRF header, JSON:API content-type - `Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift` — pulls cookies from the user's logged-in browser -- Working precedent: `IrisSDKAppBundleRepository` already calls iris through `IrisClient` +- Working precedent: `IrisSDKAppBundles` already calls iris through `IrisClient` ## Shipped approach (IAP) @@ -71,7 +71,7 @@ Returns the submission resource with a `_links.viewIAP → /api/v1/iap/:iapId` s ### Domain protocol ```swift -public protocol IrisInAppPurchaseSubmissionRepository: Sendable { +public protocol IrisInAppPurchaseSubmissions: Sendable { func submitInAppPurchase( session: IrisSession, iapId: String, @@ -80,7 +80,7 @@ public protocol IrisInAppPurchaseSubmissionRepository: Sendable { } ``` -Distinct from `InAppPurchaseSubmissionRepository` (public SDK) so the two auth surfaces don't tangle. +Distinct from `InAppPurchaseSubmissions` (public SDK) so the two auth surfaces don't tangle. ### Discoverability @@ -110,8 +110,8 @@ For an established-app IAP that's ready, the agent sees both `submit` and `addTo #### Where the two signals come from -- **`isFirstTimeSubmission`** — derived per-batch in `SDKInAppPurchaseRepository.listInAppPurchases`. Every IAP returned for the app is checked via `InAppPurchaseState.hasBeenApproved` (`approved | developerRemovedFromSale | removedFromSale`); if zero are shipped, every unapproved IAP gets `true`. **Zero extra API calls** — derived from data already in the listing response. -- **`submitWithNextAppStoreVersion`** — best-effort enrichment via `IrisSDKInAppPurchaseStateRepository.fetchSubmitFlags`. One iris call per `iap list`, server-side filtered to `state=READY_TO_SUBMIT` with only the one field. Failures (no iris cookies, network error, malformed response) silently leave the flag `false` so CI scripts using API-key auth keep their existing JSON output unchanged. +- **`isFirstTimeSubmission`** — derived per-batch in `SDKInAppPurchases.listInAppPurchases`. Every IAP returned for the app is checked via `InAppPurchaseState.hasBeenApproved` (`approved | developerRemovedFromSale | removedFromSale`); if zero are shipped, every unapproved IAP gets `true`. **Zero extra API calls** — derived from data already in the listing response. +- **`submitWithNextAppStoreVersion`** — best-effort enrichment via `IrisSDKInAppPurchaseStates.fetchSubmitFlags`. One iris call per `iap list`, server-side filtered to `state=READY_TO_SUBMIT` with only the one field. Failures (no iris cookies, network error, malformed response) silently leave the flag `false` so CI scripts using API-key auth keep their existing JSON output unchanged. **Caveat — only `iap list` has this context.** `isFirstTimeSubmission` and the iris enrichment are computed on the list path only; an IAP returned by any other command (e.g. `iap create` or `iap update`) has `isFirstTimeSubmission` defaulting to `false`. Agents that need the right affordance should `list` first. diff --git a/docs/features/iap-subscriptions/win-back-offers.md b/docs/features/iap-subscriptions/win-back-offers.md index 685ed3e3..5454e526 100644 --- a/docs/features/iap-subscriptions/win-back-offers.md +++ b/docs/features/iap-subscriptions/win-back-offers.md @@ -26,7 +26,7 @@ wait-months # minimum gap between offers shown to the same custo ## SDK gap -The generated `WinBackOfferPriceInlineCreate` is missing `territory` and `subscriptionPricePoint` relationship fields. `SDKWinBackOfferRepository.createWinBackOffer` builds the body manually with a private `AnyCodable` type-erased enum. The ID convention matches ASC web (`${newPromoOfferPrice-N}`, 1-based). +The generated `WinBackOfferPriceInlineCreate` is missing `territory` and `subscriptionPricePoint` relationship fields. `SDKWinBackOffers.createWinBackOffer` builds the body manually with a private `AnyCodable` type-erased enum. The ID convention matches ASC web (`${newPromoOfferPrice-N}`, 1-based). ## Domain model diff --git a/docs/features/iris/iris-srp-login.md b/docs/features/iris/iris-srp-login.md index cdf19cf6..58e67ff8 100644 --- a/docs/features/iris/iris-srp-login.md +++ b/docs/features/iris/iris-srp-login.md @@ -96,8 +96,8 @@ Sources/ ├── ASCKit/Auth/Iris/ (new — pure value types & @Mockable protocols, zero I/O) │ ├── IrisAuthCredentials.swift appleId, password │ ├── IrisAuthSession.swift cookies, scnt, serviceKey, appleIDSessionID, providerID, teamId, userEmail, expiresAt -│ ├── IrisAuthRepository.swift @Mockable: login, requestTwoFactorCode, submitTwoFactorCode, logout -│ ├── IrisSessionRepository.swift @Mockable: save(IrisAuthSession), load() throws -> IrisAuthSession?, clear() +│ ├── IrisSignIn.swift @Mockable: login, requestTwoFactorCode, submitTwoFactorCode, logout +│ ├── IrisSessions.swift @Mockable: save(IrisAuthSession), load() throws -> IrisAuthSession?, clear() │ ├── IrisAuthError.swift invalidCredentials, twoFactorRequired, twoFactorRejected, applePromptRequired, networkError │ ├── TwoFactorChallenge.swift method (trustedDevice/phone), maskedDestination, codeLength │ └── PendingTwoFactorState.swift serialized partial session: scnt, serviceKey, appleIDSessionID, twoFactorCookieBag @@ -108,11 +108,11 @@ Sources/ │ │ └── AppleM1.swift HKDF-SHA256-derived M1 — Apple's variant, distinct from RFC 2945 proof │ ├── IdmsaAPIClient.swift HTTP for idmsa.apple.com (signin/init, signin/complete, verify//securitycode, 2sv/trust); cookie jar & header threading │ ├── OlympusClient.swift olympus/v1/session for team metadata -│ ├── IrisAuthSDKRepository.swift implements `ASCKit.IrisAuthRepository`; composes AppleSRPClient + IdmsaAPIClient + OlympusClient -│ ├── KeychainIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` via macOS Keychain (Security framework) -│ ├── FileIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` via `~/.asc/iris/session.json`, written with `0600` -│ ├── CompositeIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` by trying Keychain first, falling back to file (so macOS gets keychain protection, Linux silently falls through) -│ ├── KeychainIrisCookieProvider.swift implements existing `ASCKit.IrisCookieProvider`; reads from any `IrisSessionRepository` +│ ├── IrisSDKSignIn.swift implements `ASCKit.IrisSignIn`; composes AppleSRPClient + IdmsaAPIClient + OlympusClient +│ ├── KeychainIrisSessionRepository.swift implements `ASCKit.IrisSessions` via macOS Keychain (Security framework) +│ ├── FileIrisSessions.swift implements `ASCKit.IrisSessions` via `~/.asc/iris/session.json`, written with `0600` +│ ├── CompositeIrisSessionRepository.swift implements `ASCKit.IrisSessions` by trying Keychain first, falling back to file (so macOS gets keychain protection, Linux silently falls through) +│ ├── KeychainIrisCookieProvider.swift implements existing `ASCKit.IrisCookieProvider`; reads from any `IrisSessions` │ └── CompositeIrisCookieProvider.swift implements `ASCKit.IrisCookieProvider`; resolution order env → stored → browser │ └── ASCCommand/Commands/Iris/Auth/ (new — CLI) @@ -122,7 +122,7 @@ Sources/ └── IrisAuthLogout.swift `asc iris auth logout` ``` -`IrisCommand.subcommands` gets `IrisAuthCommand.self` appended. `ClientProvider` gets `makeIrisAuthRepository()` and `makeIrisCookieProvider()` updated to return `CompositeIrisCookieProvider`. +`IrisCommand.subcommands` gets `IrisAuthCommand.self` appended. `ClientProvider` gets `makeIrisSignIn()` and `makeIrisCookieProvider()` updated to return `CompositeIrisCookieProvider`. ## Domain models @@ -251,7 +251,7 @@ Strict TDD. Each slice has a red test before any production code. - Keychain tests: macOS-only, conditionally skipped on CI without keychain. ### CLI commands (slice 6) -- Mock `IrisAuthRepository`, exact JSON snapshot per `formatAgentItems`. +- Mock `IrisSignIn`, exact JSON snapshot per `formatAgentItems`. - Two-step flow: `login` returns `twoFactorRequired` → output mentions "verify-code" → `verify-code` succeeds → output shows team info. ## Milestones @@ -259,7 +259,7 @@ Strict TDD. Each slice has a red test before any production code. | # | Slice | Done when | |---|---|---| | 1 | Add `swift-srp` to `Package.swift`; wire `AppleSRPClient` (Apple-x via PBKDF2, S via swift-srp's BigNum + config) and `AppleM1` (HKDF-derived) | Apple-captured test vectors pass; ~150 LoC + tests | -| 2 | Idmsa happy path (no 2FA) | `IrisAuthRepository.login` returns full `IrisAuthSession` against stubbed Apple endpoints | +| 2 | Idmsa happy path (no 2FA) | `IrisSignIn.login` returns full `IrisAuthSession` against stubbed Apple endpoints | | 3 | 2FA flow (trusted-device + phone) | `verifyTwoFactorCode` succeeds; `IrisAuthError.twoFactorRequired` carries the right `PendingTwoFactorState` | | 4 | Olympus + composite cookie provider | iris calls succeed end-to-end against a stubbed test server | | 5 | Keychain / file persistence | Login → restart process → cookies still resolve from storage | diff --git a/docs/features/screenshot-editor/design.md b/docs/features/screenshot-editor/design.md index be423cce..9c0f303c 100644 --- a/docs/features/screenshot-editor/design.md +++ b/docs/features/screenshot-editor/design.md @@ -17,7 +17,7 @@ Contributor notes for the browser editor in `homepage/editor/` and the import co │ │ js/app.js state │ │ (AsyncParsableCommand) │ │ │ │ js/compositor.js Canvas2D │ │ → /usr/bin/unzip │ │ │ │ js/texts.js drag layers │ │ → JSONDecoder → Manifest │ │ -│ │ js/export.js JSZip ZIP │ │ → ScreenshotRepository │ │ +│ │ js/export.js JSZip ZIP │ │ → AppScreenshots │ │ │ │ js/devices.js async load │ └──────────────────────────────┘ │ │ │ frames/devices.json │ │ │ └──────────────────────────────┘ Domain │ @@ -26,7 +26,7 @@ Contributor notes for the browser editor in `homepage/editor/` and the import co │ ASC API │ ├ LocalizationManifest │ │ │ ┌──────────────────────────────┐ │ └ ScreenshotEntry │ │ │ │ listLocalizations │ │ │ │ -│ │ createLocalization │ │ ScreenshotRepository │ │ +│ │ createLocalization │ │ AppScreenshots │ │ │ │ listScreenshotSets │◀──│ + importScreenshots(...) │ │ │ │ createScreenshotSet │ └──────────────────────────────┘ │ │ │ uploadScreenshot (3-step) │ │ @@ -62,13 +62,13 @@ public struct ScreenshotManifest: Codable, Sendable { } ``` -### Updated `ScreenshotRepository` +### Updated `AppScreenshots` `importScreenshots` was added to the existing `@Mockable` protocol: ```swift @Mockable -public protocol ScreenshotRepository: Sendable { +public protocol AppScreenshots: Sendable { // ... existing methods ... func importScreenshots( versionId: String, @@ -149,7 +149,7 @@ homepage/editor/ Web editor source Sources/ ├── ASCKit/Apps/Versions/Localizations/ScreenshotSets/ │ ├── ScreenshotImport.swift ScreenshotManifest + nested types -│ └── ScreenshotRepository.swift Modified: added importScreenshots +│ └── AppScreenshots.swift Modified: added importScreenshots │ ├── ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/ │ └── OpenAPIScreenshotRepository.swift Modified: implements importScreenshots diff --git a/docs/library.md b/docs/library.md index b67d6ef8..261f6671 100644 --- a/docs/library.md +++ b/docs/library.md @@ -46,11 +46,11 @@ struct StaticAuthProvider: AuthProvider { let factory = ClientFactory() let authProvider = StaticAuthProvider(credentials: credentials) -let appRepo = try factory.makeAppRepository(authProvider: authProvider) +let appRepo = try factory.makeApps(authProvider: authProvider) let apps = try await appRepo.listApps(limit: 50) apps.data.forEach { print($0.name, $0.bundleId) } -let buildRepo = try factory.makeBuildRepository(authProvider: authProvider) +let buildRepo = try factory.makeBuilds(authProvider: authProvider) let builds = try await buildRepo.listBuilds(appId: "YOUR_APP_ID", platform: nil, version: nil, limit: 10) ``` From 83d7b0eff9a03f697404a4d203bba108db6b13e3 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:52:29 +0800 Subject: [PATCH 14/18] docs(skill): fix-bug names the renamed protocols Co-Authored-By: Claude Opus 5.5 --- .claude/skills/fix-bug/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude/skills/fix-bug/SKILL.md b/.claude/skills/fix-bug/SKILL.md index 4cff1b8e..f8aeb384 100644 --- a/.claude/skills/fix-bug/SKILL.md +++ b/.claude/skills/fix-bug/SKILL.md @@ -54,7 +54,7 @@ Example — after the SDK bump to 4.5.1, App Store Connect can send `koreaAgeRat ), links: .init(this: "") )) - let repo = SDKAgeRatingDeclarationRepository(client: stub) + let repo = SDKAgeRatingDeclarations(client: stub) // When - the real mapper reads it let declaration = try await repo.getDeclaration(appInfoId: "info-1") @@ -67,7 +67,7 @@ Example — after the SDK bump to 4.5.1, App Store Connect can send `koreaAgeRat Run it and **watch it fail for the right reason** (the assertion, or the missing symbol the test names). Report the red line to the user before touching `Sources/`: ```bash -swift test --filter 'SDKAgeRatingDeclarationRepositoryTests' +swift test --filter 'SDKAgeRatingDeclarationsTests' ``` ## Phase 3: Fix & Verify (Green) From d5d7c09ba3336f7a5d634ef07becd5291ca025ce Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 20:57:23 +0800 Subject: [PATCH 15/18] refactor: Repository for CRUD, role nouns for the 11 workflow protocols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts the blanket rename of step 5 (258cf4203, 83d7b0eff): the 64 protocols that are CRUD over an aggregate keep XxxRepository. The 11 that run a workflow take role nouns — IrisSignIn, Reports, ReviewSubmissions, InAppPurchaseSubmissions, SubscriptionSubmissions, IrisInAppPurchaseSubmissions, AppWall, Simulators, Skills, Plugins, Themes — with their implementations, mocks and make* factories. CLAUDE.md and both implement-feature skills state the rule. No behaviour change: 2,958 tests. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/app-implement-feature/SKILL.md | 40 +-- .../references/architecture-diagrams.md | 32 +-- .../references/domain-models.md | 8 +- .../references/tdd-patterns.md | 14 +- .claude/skills/asc-app-clips | 1 + .claude/skills/asc-app-infos | 1 + .claude/skills/asc-app-previews | 1 + .claude/skills/asc-app-shots | 1 + .claude/skills/asc-app-shots-prompt | 1 + .claude/skills/asc-app-wall | 1 + .claude/skills/asc-appstore-release | 1 + .claude/skills/asc-auth | 1 + .claude/skills/asc-availability | 1 + .claude/skills/asc-beta-review | 1 + .claude/skills/asc-builds-archive | 1 + .claude/skills/asc-builds-upload | 1 + .claude/skills/asc-check-readiness | 1 + .claude/skills/asc-cli | 1 + .claude/skills/asc-code-signing | 1 + .claude/skills/asc-customer-reviews | 1 + .claude/skills/asc-experiments | 1 + .claude/skills/asc-game-center | 1 + .claude/skills/asc-iap | 1 + .claude/skills/asc-init | 1 + .claude/skills/asc-iris | 1 + .claude/skills/asc-new-app-release | 1 + .claude/skills/asc-performance | 1 + .claude/skills/asc-plugin-release | 1 + .claude/skills/asc-plugins | 1 + .claude/skills/asc-promoted-purchases | 1 + .claude/skills/asc-release-workflow | 1 + .claude/skills/asc-reports | 1 + .claude/skills/asc-review-detail | 1 + .claude/skills/asc-skills | 1 + .claude/skills/asc-subscriptions | 1 + .claude/skills/asc-testflight | 1 + .claude/skills/asc-users | 1 + .claude/skills/asc-xcode-cloud | 1 + .claude/skills/fix-bug/SKILL.md | 4 +- .claude/skills/implement-feature/SKILL.md | 10 +- .../references/architecture-diagrams.md | 38 +-- .../references/domain-models.md | 12 +- .../references/swift-concurrency.md | 14 +- .../references/swift-observable.md | 10 +- .../references/tdd-patterns.md | 8 +- CHANGELOG.md | 2 +- CLAUDE.md | 2 +- Sources/ASCCommand/ClientProvider.swift | 252 +++++++++--------- .../Commands/AgeRating/AgeRatingCommand.swift | 8 +- .../AnalyticsReportsDelete.swift | 4 +- .../AnalyticsReportsInstancesList.swift | 4 +- .../AnalyticsReportsList.swift | 4 +- .../AnalyticsReportsReportsList.swift | 4 +- .../AnalyticsReportsRequest.swift | 4 +- .../AnalyticsReportsSegmentsList.swift | 4 +- .../AppCategories/AppCategoriesCommand.swift | 8 +- ...AppClipExperienceLocalizationsCreate.swift | 4 +- ...AppClipExperienceLocalizationsDelete.swift | 4 +- .../AppClipExperienceLocalizationsList.swift | 4 +- .../AppClipExperiencesCreate.swift | 4 +- .../AppClipExperiencesDelete.swift | 4 +- .../AppClipExperiencesList.swift | 4 +- .../Commands/AppClips/AppClipsList.swift | 4 +- .../AppInfoLocalizationsCommand.swift | 16 +- .../Commands/AppInfos/AppInfosCommand.swift | 8 +- .../AppPreviewSetsCommand.swift | 8 +- .../AppPreviews/AppPreviewsCommand.swift | 8 +- .../AppShots/AppShotsGalleryTemplates.swift | 8 +- .../Commands/AppShots/AppShotsTemplates.swift | 12 +- .../Commands/AppShots/AppShotsThemes.swift | 8 +- .../ASCCommand/Commands/Apps/AppsList.swift | 4 +- .../Commands/Apps/AppsPricePointsList.swift | 4 +- .../Commands/Apps/AppsPricesSet.swift | 4 +- .../ASCCommand/Commands/Apps/AppsUpdate.swift | 4 +- .../Availability/AppAvailabilityCreate.swift | 8 +- .../Availability/AppAvailabilityGet.swift | 4 +- .../AssetLibrary/AssetImagesCommand.swift | 16 +- .../AssetLibrary/AssetLibraryCommand.swift | 8 +- .../AssetLibrary/AssetPlacementsCommand.swift | 16 +- .../AssetLibrary/AssetVideosCommand.swift | 16 +- .../BetaAppLocalizationsCreate.swift | 4 +- .../BetaAppLocalizationsDelete.swift | 4 +- .../BetaAppLocalizationsGet.swift | 4 +- .../BetaAppLocalizationsList.swift | 4 +- .../BetaAppLocalizationsUpdate.swift | 4 +- .../BetaReview/BetaReviewDetailGet.swift | 4 +- .../BetaReview/BetaReviewDetailUpdate.swift | 4 +- .../BetaReviewSubmissionsCreate.swift | 4 +- .../BetaReview/BetaReviewSubmissionsGet.swift | 4 +- .../BetaReviewSubmissionsList.swift | 4 +- .../Commands/Builds/BuildsAddBetaGroup.swift | 4 +- .../Commands/Builds/BuildsArchive.swift | 4 +- .../Commands/Builds/BuildsList.swift | 4 +- .../Commands/Builds/BuildsNextNumber.swift | 4 +- .../Builds/BuildsRemoveBetaGroup.swift | 4 +- .../BuildsSetEncryptionCompliance.swift | 4 +- .../Builds/BuildsUpdateBetaNotes.swift | 4 +- .../Commands/Builds/BuildsUpload.swift | 6 +- .../Commands/Builds/BuildsUploadsDelete.swift | 4 +- .../Commands/Builds/BuildsUploadsGet.swift | 4 +- .../Commands/Builds/BuildsUploadsList.swift | 4 +- .../Commands/BundleIDs/BundleIDsCreate.swift | 4 +- .../Commands/BundleIDs/BundleIDsDelete.swift | 4 +- .../Commands/BundleIDs/BundleIDsList.swift | 4 +- .../Certificates/CertificatesCreate.swift | 4 +- .../Certificates/CertificatesList.swift | 4 +- .../Certificates/CertificatesRevoke.swift | 4 +- .../Commands/Devices/DevicesList.swift | 4 +- .../Commands/Devices/DevicesRegister.swift | 4 +- ...perimentTreatmentLocalizationsCreate.swift | 4 +- ...perimentTreatmentLocalizationsDelete.swift | 4 +- ...ExperimentTreatmentLocalizationsList.swift | 4 +- .../ExperimentTreatmentsCreate.swift | 4 +- .../ExperimentTreatmentsDelete.swift | 4 +- .../ExperimentTreatmentsList.swift | 4 +- .../ExperimentTreatmentsUpdate.swift | 4 +- .../Experiments/ExperimentsCreate.swift | 4 +- .../Experiments/ExperimentsDelete.swift | 4 +- .../Commands/Experiments/ExperimentsGet.swift | 4 +- .../Experiments/ExperimentsList.swift | 4 +- .../Experiments/ExperimentsStart.swift | 4 +- .../Experiments/ExperimentsStop.swift | 4 +- .../Experiments/ExperimentsUpdate.swift | 4 +- .../GameCenter/GameCenterCommand.swift | 28 +- .../GameCenterModerationCommand.swift | 24 +- .../Availability/IAPAvailabilityCreate.swift | 4 +- .../IAP/Availability/IAPAvailabilityGet.swift | 4 +- .../ASCCommand/Commands/IAP/IAPCreate.swift | 4 +- .../ASCCommand/Commands/IAP/IAPDelete.swift | 4 +- Sources/ASCCommand/Commands/IAP/IAPList.swift | 4 +- .../Commands/IAP/IAPPricePointsList.swift | 4 +- .../Commands/IAP/IAPPricesSet.swift | 4 +- .../ASCCommand/Commands/IAP/IAPUpdate.swift | 4 +- .../Commands/IAP/IAPVersionsList.swift | 4 +- .../IAPEqualizationsList.swift | 4 +- .../Commands/IAPImages/IAPImagesDelete.swift | 4 +- .../Commands/IAPImages/IAPImagesList.swift | 4 +- .../Commands/IAPImages/IAPImagesUpload.swift | 4 +- .../IAPLocalizationsCreate.swift | 4 +- .../IAPLocalizationsDelete.swift | 4 +- .../IAPLocalizationsList.swift | 4 +- .../IAPLocalizationsUpdate.swift | 4 +- .../IAPOfferCodeCustomCodesCreate.swift | 4 +- .../IAPOfferCodeCustomCodesList.swift | 4 +- .../IAPOfferCodeCustomCodesUpdate.swift | 4 +- .../IAPOfferCodeOneTimeCodesCreate.swift | 4 +- .../IAPOfferCodeOneTimeCodesList.swift | 4 +- .../IAPOfferCodeOneTimeCodesUpdate.swift | 4 +- .../IAPOfferCodeOneTimeCodesValues.swift | 4 +- .../IAPOfferCodes/IAPOfferCodesCreate.swift | 4 +- .../IAPOfferCodes/IAPOfferCodesList.swift | 4 +- .../IAPOfferCodesPricesList.swift | 4 +- .../IAPOfferCodes/IAPOfferCodesUpdate.swift | 4 +- .../IAPPriceScheduleGet.swift | 4 +- .../IAPReviewScreenshotDelete.swift | 4 +- .../IAPReviewScreenshotGet.swift | 4 +- .../IAPReviewScreenshotUpload.swift | 4 +- .../Commands/Init/InitCommand.swift | 4 +- .../Commands/Iris/Auth/IrisAuthLogin.swift | 4 +- .../Commands/Iris/Auth/IrisAuthLogout.swift | 2 +- .../Iris/Auth/IrisAuthVerifyCode.swift | 4 +- .../Commands/Iris/IrisAppsCreate.swift | 4 +- .../Commands/Iris/IrisAppsList.swift | 4 +- .../IrisResolutionCenterGet.swift | 4 +- .../Performance/DiagnosticLogsCommand.swift | 4 +- .../Performance/DiagnosticsCommand.swift | 4 +- .../Performance/PerfMetricsCommand.swift | 4 +- .../Performance/PerfOverviewCommand.swift | 4 +- .../Commands/Profiles/ProfilesCreate.swift | 4 +- .../Commands/Profiles/ProfilesDelete.swift | 4 +- .../Commands/Profiles/ProfilesList.swift | 4 +- .../PromotedPurchasesCreate.swift | 4 +- .../PromotedPurchasesDelete.swift | 4 +- .../PromotedPurchasesList.swift | 4 +- .../PromotedPurchasesUpdate.swift | 4 +- .../Reviews/ReviewResponsesCreate.swift | 4 +- .../Reviews/ReviewResponsesDelete.swift | 4 +- .../Commands/Reviews/ReviewResponsesGet.swift | 4 +- .../Commands/Reviews/ReviewsGet.swift | 4 +- .../Commands/Reviews/ReviewsList.swift | 4 +- .../ScreenshotSetsCommand.swift | 4 +- .../ScreenshotSets/ScreenshotSetsCreate.swift | 4 +- .../ScreenshotSets/ScreenshotSetsDelete.swift | 4 +- .../Screenshots/ScreenshotsCommand.swift | 4 +- .../Screenshots/ScreenshotsDelete.swift | 4 +- .../Screenshots/ScreenshotsImport.swift | 26 +- .../Screenshots/ScreenshotsUpload.swift | 4 +- .../SubscriptionEqualizationsList.swift | 4 +- ...SubscriptionGroupLocalizationsCreate.swift | 4 +- ...SubscriptionGroupLocalizationsDelete.swift | 4 +- .../SubscriptionGroupLocalizationsList.swift | 4 +- ...SubscriptionGroupLocalizationsUpdate.swift | 4 +- .../SubscriptionGroupVersionsList.swift | 4 +- .../SubscriptionGroupsCreate.swift | 4 +- .../SubscriptionGroupsDelete.swift | 4 +- .../SubscriptionGroupsList.swift | 4 +- .../SubscriptionGroupsUpdate.swift | 4 +- .../SubscriptionImagesDelete.swift | 4 +- .../SubscriptionImagesList.swift | 4 +- .../SubscriptionImagesUpload.swift | 4 +- .../SubscriptionLocalizationsCreate.swift | 4 +- .../SubscriptionLocalizationsDelete.swift | 4 +- .../SubscriptionLocalizationsList.swift | 4 +- .../SubscriptionLocalizationsUpdate.swift | 4 +- ...bscriptionOfferCodeCustomCodesCreate.swift | 4 +- ...SubscriptionOfferCodeCustomCodesList.swift | 4 +- ...bscriptionOfferCodeCustomCodesUpdate.swift | 4 +- ...scriptionOfferCodeOneTimeCodesCreate.swift | 4 +- ...ubscriptionOfferCodeOneTimeCodesList.swift | 4 +- ...scriptionOfferCodeOneTimeCodesUpdate.swift | 4 +- ...scriptionOfferCodeOneTimeCodesValues.swift | 4 +- .../SubscriptionOfferCodesCreate.swift | 4 +- .../SubscriptionOfferCodesList.swift | 4 +- .../SubscriptionOfferCodesPricesList.swift | 4 +- .../SubscriptionOfferCodesUpdate.swift | 4 +- .../SubscriptionOffersCreate.swift | 4 +- .../SubscriptionOffersDelete.swift | 4 +- .../SubscriptionOffersList.swift | 4 +- .../SubscriptionPriceScheduleGet.swift | 4 +- .../SubscriptionPromotionalOffersCreate.swift | 4 +- .../SubscriptionPromotionalOffersDelete.swift | 4 +- .../SubscriptionPromotionalOffersList.swift | 4 +- ...scriptionPromotionalOffersPricesList.swift | 4 +- .../SubscriptionReviewScreenshotDelete.swift | 4 +- .../SubscriptionReviewScreenshotGet.swift | 4 +- .../SubscriptionReviewScreenshotUpload.swift | 4 +- .../SubscriptionAvailabilityCreate.swift | 4 +- .../SubscriptionAvailabilityGet.swift | 4 +- .../SubscriptionPricePointsList.swift | 4 +- .../Subscriptions/SubscriptionPricesSet.swift | 4 +- .../SubscriptionPricesSetBatch.swift | 4 +- .../SubscriptionVersionsList.swift | 4 +- .../Subscriptions/SubscriptionsCreate.swift | 4 +- .../Subscriptions/SubscriptionsDelete.swift | 4 +- .../Subscriptions/SubscriptionsList.swift | 4 +- .../Subscriptions/SubscriptionsUpdate.swift | 4 +- Sources/ASCCommand/Commands/TUI/TUIApp.swift | 16 +- .../Territories/TerritoriesList.swift | 4 +- .../TestFlight/TestFlightCommand.swift | 28 +- .../Users/UserInvitationsCancel.swift | 4 +- .../Users/UserInvitationsInvite.swift | 4 +- .../Commands/Users/UserInvitationsList.swift | 4 +- .../ASCCommand/Commands/Users/UsersList.swift | 4 +- .../Commands/Users/UsersRemove.swift | 4 +- .../Commands/Users/UsersUpdate.swift | 4 +- .../VersionLocalizationsCommand.swift | 4 +- .../VersionLocalizationsCreate.swift | 4 +- .../VersionLocalizationsUpdate.swift | 4 +- .../VersionReviewDetailCommand.swift | 8 +- .../Versions/VersionsCheckReadiness.swift | 36 +-- .../Commands/Versions/VersionsCommand.swift | 4 +- .../Commands/Versions/VersionsCreate.swift | 4 +- .../Commands/Versions/VersionsSetBuild.swift | 4 +- .../Commands/Versions/VersionsSubmit.swift | 12 +- .../Commands/Versions/VersionsUpdate.swift | 4 +- .../Web/Controllers/AgeRatingController.swift | 2 +- .../AppAvailabilityController.swift | 4 +- .../Controllers/AppCategoriesController.swift | 2 +- .../Web/Controllers/AppInfosController.swift | 2 +- .../Controllers/AppPricingController.swift | 2 +- .../Web/Controllers/AppShotsController.swift | 4 +- .../Web/Controllers/AppsController.swift | 4 +- .../Controllers/AssetLibraryController.swift | 16 +- .../BetaAppLocalizationsController.swift | 2 +- .../Web/Controllers/BuildsController.swift | 2 +- .../Controllers/CodeSigningController.swift | 8 +- .../CustomerReviewsController.swift | 2 +- .../Controllers/DiagnosticsController.swift | 2 +- .../Controllers/ExperimentsController.swift | 2 +- .../Controllers/GameCenterController.swift | 8 +- .../IAPAvailabilityController.swift | 4 +- .../Web/Controllers/IAPController.swift | 2 +- .../IAPEqualizationsController.swift | 2 +- .../IAPLocalizationsController.swift | 2 +- .../IAPOfferCodeOneTimeCodesController.swift | 2 +- .../Controllers/IAPOfferCodesController.swift | 2 +- .../IAPPricePointsController.swift | 2 +- .../IAPPriceScheduleController.swift | 2 +- .../Web/Controllers/IAPPricesController.swift | 2 +- .../Web/Controllers/IAPReviewController.swift | 2 +- .../IrisResolutionCenterController.swift | 2 +- .../OfferCodePricesController.swift | 4 +- .../Controllers/PerfMetricsController.swift | 2 +- .../Controllers/PerfOverviewController.swift | 2 +- .../ProductVersionsController.swift | 2 +- .../PromotedPurchasesController.swift | 2 +- .../ScreenshotImportController.swift | 10 +- .../ScreenshotSetsController.swift | 2 +- .../Controllers/ScreenshotsController.swift | 2 +- .../SubscriptionAvailabilityController.swift | 4 +- .../SubscriptionEqualizationsController.swift | 2 +- ...criptionGroupLocalizationsController.swift | 2 +- .../SubscriptionGroupsController.swift | 2 +- ...criptionIntroductoryOffersController.swift | 2 +- .../SubscriptionLocalizationsController.swift | 2 +- ...ptionOfferCodeOneTimeCodesController.swift | 2 +- .../SubscriptionOfferCodesController.swift | 2 +- .../SubscriptionPricePointsController.swift | 2 +- .../SubscriptionPriceScheduleController.swift | 2 +- .../SubscriptionPricesController.swift | 2 +- ...scriptionPromotionalOffersController.swift | 2 +- .../SubscriptionReviewController.swift | 2 +- .../Controllers/SubscriptionsController.swift | 4 +- .../Controllers/TerritoriesController.swift | 2 +- .../Controllers/TestFlightController.swift | 2 +- .../VersionLocalizationsController.swift | 2 +- .../VersionSubmissionController.swift | 2 +- .../Web/Controllers/VersionsController.swift | 2 +- .../Controllers/WinBackOffersController.swift | 2 +- .../ASCCommand/Commands/Web/RESTRoutes.swift | 126 ++++----- .../WinBackOffers/WinBackOffersCreate.swift | 4 +- .../WinBackOffers/WinBackOffersDelete.swift | 4 +- .../WinBackOffers/WinBackOffersList.swift | 4 +- .../WinBackOffersPricesList.swift | 4 +- .../WinBackOffers/WinBackOffersUpdate.swift | 4 +- .../XcodeCloud/XcodeCloudCommand.swift | 20 +- ...AppClips.swift => AppClipRepository.swift} | 2 +- ...Clips.swift => SDKAppClipRepository.swift} | 2 +- ...t => AgeRatingDeclarationRepository.swift} | 2 +- .../ASCKit/Apps/AppInfos/AppCategory.swift | 2 +- ...AppInfos.swift => AppInfoRepository.swift} | 2 +- ...> SDKAgeRatingDeclarationRepository.swift} | 2 +- ...s.swift => SDKAppCategoryRepository.swift} | 2 +- ...Infos.swift => SDKAppInfoRepository.swift} | 2 +- .../Apps/{Apps.swift => AppRepository.swift} | 2 +- ...ies.swift => AssetLibraryRepository.swift} | 2 +- ....swift => SDKLibraryImageRepository.swift} | 2 +- ...ges.swift => LibraryImageRepository.swift} | 2 +- .../Import/ScreenshotImportPlan.swift | 6 +- ....swift => SDKAssetLibraryRepository.swift} | 2 +- ...s.swift => AssetPlacementRepository.swift} | 2 +- ...wift => SDKAssetPlacementRepository.swift} | 2 +- ....swift => SDKLibraryVideoRepository.swift} | 2 +- ...eos.swift => LibraryVideoRepository.swift} | 2 +- ....swift => AppAvailabilityRepository.swift} | 2 +- ...ift => SDKAppAvailabilityRepository.swift} | 2 +- ... => BetaBuildLocalizationRepository.swift} | 2 +- .../{Builds.swift => BuildRepository.swift} | 2 +- ...oads.swift => BuildUploadRepository.swift} | 2 +- .../Internal/OpenAPIBuildRepository.swift | 2 +- ... SDKBetaBuildLocalizationRepository.swift} | 2 +- ...s.swift => SDKBuildUploadRepository.swift} | 2 +- ...ments.swift => ExperimentRepository.swift} | 2 +- ...ts.swift => SDKExperimentRepository.swift} | 2 +- ...InAppPurchaseAvailabilityRepository.swift} | 2 +- ...InAppPurchaseAvailabilityRepository.swift} | 2 +- ...ift => InAppPurchasePriceRepository.swift} | 2 +- ...es.swift => InAppPurchaseRepository.swift} | 2 +- ... => SDKInAppPurchasePriceRepository.swift} | 2 +- ...swift => SDKInAppPurchaseRepository.swift} | 2 +- ...InAppPurchaseLocalizationRepository.swift} | 2 +- ...InAppPurchaseLocalizationRepository.swift} | 2 +- ...=> InAppPurchaseOfferCodeRepository.swift} | 2 +- ...SDKInAppPurchaseOfferCodeRepository.swift} | 2 +- ...ft => InAppPurchaseReviewRepository.swift} | 2 +- ...=> SDKInAppPurchaseReviewRepository.swift} | 2 +- .../Apps/Internal/OpenAPIAppRepository.swift | 2 +- ...tics.swift => DiagnosticsRepository.swift} | 2 +- ...s.swift => SDKDiagnosticsRepository.swift} | 2 +- ...s.swift => SDKPerfMetricsRepository.swift} | 2 +- ....swift => SDKPerfOverviewRepository.swift} | 2 +- ...rics.swift => PerfMetricsRepository.swift} | 2 +- ...ews.swift => PerfOverviewRepository.swift} | 2 +- ...rices.swift => SDKPricingRepository.swift} | 2 +- ...ppPrices.swift => PricingRepository.swift} | 2 +- ...wift => SDKProductVersionRepository.swift} | 2 +- ...s.swift => ProductVersionRepository.swift} | 2 +- ...ft => SDKPromotedPurchaseRepository.swift} | 2 +- ...swift => PromotedPurchaseRepository.swift} | 2 +- ...s.swift => CustomerReviewRepository.swift} | 2 +- ...wift => SDKCustomerReviewRepository.swift} | 2 +- ...KSubscriptionAvailabilityRepository.swift} | 4 +- ... SubscriptionAvailabilityRepository.swift} | 4 +- ...t => SDKSubscriptionGroupRepository.swift} | 2 +- ...t => SDKSubscriptionPriceRepository.swift} | 2 +- ....swift => SDKSubscriptionRepository.swift} | 2 +- ...criptionIntroductoryOfferRepository.swift} | 2 +- ...criptionIntroductoryOfferRepository.swift} | 2 +- ...criptionGroupLocalizationRepository.swift} | 2 +- ...KSubscriptionLocalizationRepository.swift} | 2 +- ...criptionGroupLocalizationRepository.swift} | 2 +- ... SubscriptionLocalizationRepository.swift} | 2 +- ... SDKSubscriptionOfferCodeRepository.swift} | 2 +- ... => SubscriptionOfferCodeRepository.swift} | 2 +- ...scriptionPromotionalOfferRepository.swift} | 2 +- ...scriptionPromotionalOfferRepository.swift} | 2 +- ... => SDKSubscriptionReviewRepository.swift} | 2 +- ...ift => SubscriptionReviewRepository.swift} | 2 +- ...wift => SubscriptionGroupRepository.swift} | 2 +- ...wift => SubscriptionPriceRepository.swift} | 2 +- ...ons.swift => SubscriptionRepository.swift} | 2 +- ....swift => SDKWinBackOfferRepository.swift} | 2 +- ...ers.swift => WinBackOfferRepository.swift} | 2 +- ...ft => BetaAppLocalizationRepository.swift} | 2 +- ...ws.swift => BetaAppReviewRepository.swift} | 2 +- .../OpenAPITestFlightRepository.swift | 2 +- ...=> SDKBetaAppLocalizationRepository.swift} | 2 +- ...swift => SDKBetaAppReviewRepository.swift} | 2 +- ...light.swift => TestFlightRepository.swift} | 2 +- ....swift => SDKReviewDetailRepository.swift} | 2 +- ...sions.swift => SDKVersionRepository.swift} | 2 +- ....swift => SDKLocalizationRepository.swift} | 2 +- ...s.swift => OpenAPIPreviewRepository.swift} | 2 +- ...Previews.swift => PreviewRepository.swift} | 2 +- .../ScreenshotSets/AppScreenshotSet.swift | 4 +- .../OpenAPIScreenshotRepository.swift | 2 +- ...shots.swift => ScreenshotRepository.swift} | 2 +- ...ft => VersionLocalizationRepository.swift} | 2 +- ...ils.swift => ReviewDetailRepository.swift} | 2 +- ...Versions.swift => VersionRepository.swift} | 2 +- ...ions.swift => IrisSessionRepository.swift} | 4 +- ...ndleIDs.swift => BundleIDRepository.swift} | 2 +- ...ates.swift => CertificateRepository.swift} | 2 +- .../{Devices.swift => DeviceRepository.swift} | 2 +- ...eIDs.swift => SDKBundleIDRepository.swift} | 2 +- ...s.swift => SDKCertificateRepository.swift} | 2 +- ...evices.swift => SDKDeviceRepository.swift} | 2 +- ...files.swift => SDKProfileRepository.swift} | 2 +- ...Profiles.swift => ProfileRepository.swift} | 2 +- ...enter.swift => GameCenterRepository.swift} | 2 +- ...er.swift => SDKGameCenterRepository.swift} | 2 +- ...t => GameCenterModerationRepository.swift} | 2 +- ...> SDKGameCenterModerationRepository.swift} | 2 +- ...swift => IrisSDKAppBundleRepository.swift} | 4 +- ...es.swift => IrisAppBundleRepository.swift} | 2 +- ...IrisSDKInAppPurchaseStateRepository.swift} | 4 +- ...=> IrisInAppPurchaseStateRepository.swift} | 4 +- ....swift => FileIrisSessionRepository.swift} | 4 +- .../Auth/StoredSRPIrisCookieProvider.swift | 4 +- ...> IrisSDKResolutionCenterRepository.swift} | 4 +- ...t => IrisResolutionCenterRepository.swift} | 2 +- ....swift => AnalyticsReportRepository.swift} | 2 +- ...ift => SDKAnalyticsReportRepository.swift} | 2 +- ....swift => GalleryTemplateRepository.swift} | 2 +- ... AggregateGalleryTemplateRepository.swift} | 4 +- ...wift => AggregateTemplateRepository.swift} | 6 +- ...mplates.swift => TemplateRepository.swift} | 2 +- .../Shared/Internal/ClientFactory.swift | 242 ++++++++--------- .../ASCKit/Submissions/SubmissionPlan.swift | 16 +- ...ies.swift => SDKTerritoryRepository.swift} | 2 +- ...tories.swift => TerritoryRepository.swift} | 2 +- ...SDKUsers.swift => SDKUserRepository.swift} | 2 +- .../{Users.swift => UserRepository.swift} | 2 +- ... => SDKXcodeCloudBuildRunRepository.swift} | 2 +- ...t => SDKXcodeCloudProductRepository.swift} | 2 +- ... => SDKXcodeCloudWorkflowRepository.swift} | 2 +- ...ift => XcodeCloudBuildRunRepository.swift} | 2 +- ...wift => XcodeCloudProductRepository.swift} | 2 +- ...ift => XcodeCloudWorkflowRepository.swift} | 2 +- .../AgeRating/AgeRatingGetTests.swift | 4 +- .../AgeRating/AgeRatingUpdateTests.swift | 10 +- .../AnalyticsReportsTests.swift | 12 +- .../AppCategoriesListTests.swift | 4 +- .../AppClipExperienceLocalizationsTests.swift | 10 +- .../AppClipExperiencesTests.swift | 12 +- .../Commands/AppClips/AppClipsListTests.swift | 6 +- .../AppInfoLocalizationsCreateTests.swift | 4 +- .../AppInfoLocalizationsDeleteTests.swift | 2 +- .../AppInfoLocalizationsListTests.swift | 2 +- .../AppInfoLocalizationsUpdateTests.swift | 4 +- .../Commands/AppInfos/AppInfosListTests.swift | 2 +- .../AppInfos/AppInfosUpdateTests.swift | 4 +- .../AppPreviewSetsCommandTests.swift | 12 +- .../AppPreviews/AppPreviewsCommandTests.swift | 12 +- .../AppShotsGalleryTemplatesTests.swift | 10 +- .../AppShots/AppShotsTemplatesTests.swift | 16 +- .../AppShots/AppShotsThemesTests.swift | 10 +- .../Apps/AppPricingCommandsTests.swift | 6 +- .../Commands/Apps/AppsListTests.swift | 4 +- .../Commands/Apps/AppsUpdateTests.swift | 2 +- .../AppAvailabilityCreateTests.swift | 12 +- .../AppAvailabilityGetTests.swift | 4 +- .../AssetImagesCommandTests.swift | 14 +- .../AssetLibraryCommandTests.swift | 4 +- .../AssetPlacementsCommandTests.swift | 22 +- .../AssetVideosCommandTests.swift | 8 +- .../BetaAppLocalizationsCreateTests.swift | 2 +- .../BetaAppLocalizationsDeleteTests.swift | 2 +- .../BetaAppLocalizationsGetTests.swift | 2 +- .../BetaAppLocalizationsListTests.swift | 2 +- .../BetaAppLocalizationsUpdateTests.swift | 2 +- .../BetaReview/BetaReviewDetailGetTests.swift | 4 +- .../BetaReviewDetailUpdateTests.swift | 2 +- .../BetaReviewSubmissionsCreateTests.swift | 2 +- .../BetaReviewSubmissionsGetTests.swift | 2 +- .../BetaReviewSubmissionsListTests.swift | 4 +- .../Builds/BuildsAddBetaGroupTests.swift | 2 +- .../Commands/Builds/BuildsArchiveTests.swift | 2 +- .../Commands/Builds/BuildsListTests.swift | 10 +- .../Builds/BuildsNextNumberTests.swift | 6 +- .../Builds/BuildsRemoveBetaGroupTests.swift | 2 +- .../BuildsSetEncryptionComplianceTests.swift | 4 +- .../Builds/BuildsUpdateBetaNotesTests.swift | 4 +- .../Commands/Builds/BuildsUploadTests.swift | 16 +- .../Builds/BuildsUploadsDeleteTests.swift | 2 +- .../Builds/BuildsUploadsGetTests.swift | 4 +- .../Builds/BuildsUploadsListTests.swift | 4 +- .../BundleIDs/BundleIDsCreateTests.swift | 6 +- .../BundleIDs/BundleIDsDeleteTests.swift | 2 +- .../BundleIDs/BundleIDsListTests.swift | 6 +- .../CertificatesCreateTests.swift | 8 +- .../Certificates/CertificatesListTests.swift | 14 +- .../CertificatesRevokeTests.swift | 2 +- .../Commands/Devices/DevicesListTests.swift | 4 +- .../Devices/DevicesRegisterTests.swift | 6 +- ...xperimentTreatmentLocalizationsTests.swift | 6 +- .../ExperimentTreatmentsTests.swift | 10 +- .../Experiments/ExperimentsTests.swift | 28 +- .../GameCenter/GameCenterCommandTests.swift | 24 +- .../GameCenterModerationCommandTests.swift | 14 +- .../IAPAvailabilityCreateTests.swift | 2 +- .../IAPAvailabilityGetTests.swift | 2 +- .../Commands/IAP/IAPCreateTests.swift | 4 +- .../Commands/IAP/IAPDeleteTests.swift | 2 +- .../Commands/IAP/IAPListTests.swift | 6 +- .../IAP/IAPPricePointsListTests.swift | 4 +- .../Commands/IAP/IAPPricesSetTests.swift | 2 +- .../Commands/IAP/IAPUpdateTests.swift | 6 +- .../Commands/IAP/IAPVersionsListTests.swift | 2 +- .../IAPLocalizationsCreateTests.swift | 4 +- .../IAPLocalizationsDeleteTests.swift | 2 +- .../IAPLocalizationsListTests.swift | 4 +- .../IAPLocalizationsUpdateTests.swift | 4 +- .../IAPOfferCodeCustomCodesCreateTests.swift | 2 +- .../IAPOfferCodeCustomCodesListTests.swift | 4 +- .../IAPOfferCodeCustomCodesUpdateTests.swift | 4 +- .../IAPOfferCodeOneTimeCodesCreateTests.swift | 6 +- .../IAPOfferCodeOneTimeCodesListTests.swift | 4 +- .../IAPOfferCodeOneTimeCodesUpdateTests.swift | 4 +- .../IAPOfferCodeOneTimeCodesValuesTests.swift | 2 +- .../IAPOfferCodesCreateTests.swift | 10 +- .../IAPOfferCodesListTests.swift | 4 +- .../IAPOfferCodesPricesListTests.swift | 2 +- .../IAPOfferCodesUpdateTests.swift | 4 +- .../IAPReviewScreenshotTests.swift | 10 +- .../Commands/Init/InitCommandTests.swift | 16 +- .../Commands/Iris/IrisAppsCreateTests.swift | 2 +- .../Commands/Iris/IrisAppsListTests.swift | 2 +- .../IrisResolutionCenterGetTests.swift | 6 +- .../Performance/DiagnosticLogsListTests.swift | 2 +- .../Performance/DiagnosticsListTests.swift | 4 +- .../Performance/PerfMetricsListTests.swift | 6 +- .../Performance/PerfOverviewGetTests.swift | 4 +- .../Profiles/ProfilesCreateTests.swift | 6 +- .../Profiles/ProfilesDeleteTests.swift | 2 +- .../Commands/Profiles/ProfilesListTests.swift | 6 +- .../PromotedPurchasesTests.swift | 14 +- .../Reviews/ReviewResponsesCreateTests.swift | 2 +- .../Reviews/ReviewResponsesDeleteTests.swift | 2 +- .../Reviews/ReviewResponsesGetTests.swift | 2 +- .../Commands/Reviews/ReviewsGetTests.swift | 2 +- .../Commands/Reviews/ReviewsListTests.swift | 2 +- .../ScreenshotSetsCreateTests.swift | 6 +- .../ScreenshotSetsDeleteTests.swift | 4 +- .../ScreenshotSetsListTests.swift | 2 +- .../Screenshots/ScreenshotsDeleteTests.swift | 4 +- .../Screenshots/ScreenshotsImportTests.swift | 24 +- .../ScreenshotsImportToLibraryTests.swift | 10 +- .../Screenshots/ScreenshotsListTests.swift | 6 +- .../Screenshots/ScreenshotsUploadTests.swift | 4 +- .../SubscriptionGroupLocalizationsTests.swift | 8 +- .../SubscriptionGroupVersionsListTests.swift | 2 +- .../SubscriptionGroupsCreateTests.swift | 2 +- .../SubscriptionGroupsDeleteTests.swift | 2 +- .../SubscriptionGroupsListTests.swift | 2 +- .../SubscriptionGroupsUpdateTests.swift | 2 +- ...SubscriptionLocalizationsCreateTests.swift | 4 +- ...SubscriptionLocalizationsDeleteTests.swift | 2 +- .../SubscriptionLocalizationsListTests.swift | 2 +- ...SubscriptionLocalizationsUpdateTests.swift | 2 +- ...ptionOfferCodeCustomCodesCreateTests.swift | 2 +- ...riptionOfferCodeCustomCodesListTests.swift | 4 +- ...ptionOfferCodeCustomCodesUpdateTests.swift | 4 +- ...tionOfferCodeOneTimeCodesCreateTests.swift | 6 +- ...iptionOfferCodeOneTimeCodesListTests.swift | 4 +- ...tionOfferCodeOneTimeCodesUpdateTests.swift | 4 +- ...tionOfferCodeOneTimeCodesValuesTests.swift | 2 +- .../SubscriptionOfferCodesCreateTests.swift | 14 +- .../SubscriptionOfferCodesListTests.swift | 4 +- ...ubscriptionOfferCodesPricesListTests.swift | 2 +- .../SubscriptionOfferCodesUpdateTests.swift | 4 +- .../SubscriptionOffersCreateTests.swift | 12 +- .../SubscriptionOffersDeleteTests.swift | 2 +- .../SubscriptionOffersListTests.swift | 4 +- .../SubscriptionPromotionalOffersTests.swift | 10 +- .../SubscriptionReviewScreenshotTests.swift | 4 +- .../SubscriptionAvailabilityCreateTests.swift | 2 +- .../SubscriptionAvailabilityGetTests.swift | 2 +- .../SubscriptionPricePointsListTests.swift | 4 +- .../SubscriptionPricesSetTests.swift | 4 +- .../SubscriptionVersionsListTests.swift | 2 +- .../SubscriptionsCreateTests.swift | 4 +- .../SubscriptionsDeleteTests.swift | 2 +- .../SubscriptionsListTests.swift | 8 +- .../SubscriptionsUpdateTests.swift | 10 +- .../Territories/TerritoriesListTests.swift | 2 +- .../TestFlight/TestFlightCommandTests.swift | 22 +- .../Users/UserInvitationsCancelTests.swift | 2 +- .../Users/UserInvitationsInviteTests.swift | 8 +- .../Users/UserInvitationsListTests.swift | 2 +- .../Commands/Users/UsersListTests.swift | 6 +- .../Commands/Users/UsersRemoveTests.swift | 2 +- .../Commands/Users/UsersUpdateTests.swift | 6 +- .../VersionLocalizationsCreateTests.swift | 4 +- .../VersionLocalizationsListTests.swift | 2 +- .../VersionLocalizationsUpdateTests.swift | 4 +- .../VersionReviewDetailTests.swift | 6 +- .../VersionsCheckReadinessTests.swift | 110 ++++---- .../Versions/VersionsCreateTests.swift | 4 +- .../Commands/Versions/VersionsListTests.swift | 2 +- .../Versions/VersionsSetBuildTests.swift | 2 +- .../Versions/VersionsSubmitTests.swift | 16 +- .../Versions/VersionsUpdateTests.swift | 8 +- .../Web/AppShotsControllerTests.swift | 2 +- .../Commands/Web/AppsControllerTests.swift | 12 +- .../Web/AssetLibraryControllerTests.swift | 14 +- .../Controllers/AgeRatingRoutesTests.swift | 2 +- ...ustomProductPagePlacementRoutesTests.swift | 10 +- .../ScreenshotDeleteRoutesTests.swift | 4 +- .../Web/GameCenterControllerTests.swift | 14 +- .../Commands/Web/RESTRoutesTests.swift | 162 +++++------ .../Web/SubscriptionsControllerTests.swift | 4 +- .../WinBackOffers/WinBackOffersTests.swift | 12 +- .../XcodeCloud/XcodeCloudCommandTests.swift | 14 +- ....swift => SDKAppClipRepositoryTests.swift} | 18 +- ...AgeRatingDeclarationRepositoryTests.swift} | 26 +- ...ft => SDKAppCategoryRepositoryTests.swift} | 12 +- ....swift => SDKAppInfoRepositoryTests.swift} | 26 +- ...psTests.swift => AppRepositoryTests.swift} | 12 +- ...t => SDKLibraryImageRepositoryTests.swift} | 6 +- .../Import/ScreenshotImportExecuteTests.swift | 4 +- ...t => SDKAssetLibraryRepositoryTests.swift} | 12 +- ...=> SDKAssetPlacementRepositoryTests.swift} | 26 +- ...t => SDKLibraryVideoRepositoryTests.swift} | 6 +- ...> SDKAppAvailabilityRepositoryTests.swift} | 14 +- ...etaBuildLocalizationRepositoryTests.swift} | 8 +- ...ts.swift => SDKBuildRepositoryTests.swift} | 24 +- ...ft => SDKBuildUploadRepositoryTests.swift} | 16 +- .../SDKBuildUploadRepositoryUploadTests.swift | 6 +- ...ift => SDKExperimentRepositoryTests.swift} | 36 +-- ...PurchaseAvailabilityRepositoryTests.swift} | 12 +- ...PurchaseLocalizationRepositoryTests.swift} | 16 +- ...DKInAppPurchasePriceRepositoryTests.swift} | 24 +- ... => SDKInAppPurchaseRepositoryTests.swift} | 38 +-- ...AppPurchaseOfferCodeRepositoryTests.swift} | 34 +-- ...KInAppPurchaseReviewRepositoryTests.swift} | 16 +- ...ests.swift => SDKAppRepositoryTests.swift} | 10 +- ...ft => SDKDiagnosticsRepositoryTests.swift} | 28 +- ...ft => SDKPerfMetricsRepositoryTests.swift} | 30 +-- ...t => SDKPerfOverviewRepositoryTests.swift} | 6 +- ....swift => SDKPricingRepositoryTests.swift} | 10 +- ...=> SDKProductVersionRepositoryTests.swift} | 10 +- ... SDKPromotedPurchaseRepositoryTests.swift} | 14 +- ...=> SDKCustomerReviewRepositoryTests.swift} | 20 +- ...criptionAvailabilityRepositoryTests.swift} | 12 +- ...ionGroupLocalizationRepositoryTests.swift} | 12 +- ...SDKSubscriptionGroupRepositoryTests.swift} | 12 +- ...criptionLocalizationRepositoryTests.swift} | 16 +- ...SDKSubscriptionPriceRepositoryTests.swift} | 20 +- ...tionPromotionalOfferRepositoryTests.swift} | 16 +- ...t => SDKSubscriptionRepositoryTests.swift} | 30 +-- ...t => SDKWinBackOfferRepositoryTests.swift} | 18 +- ...ionIntroductoryOfferRepositoryTests.swift} | 12 +- ...ubscriptionOfferCodeRepositoryTests.swift} | 34 +-- ...DKSubscriptionReviewRepositoryTests.swift} | 10 +- ...scriptionReviewRepositoryUploadTests.swift | 4 +- ...KBetaAppLocalizationRepositoryTests.swift} | 12 +- ... => SDKBetaAppReviewRepositoryTests.swift} | 14 +- ...ift => SDKTestFlightRepositoryTests.swift} | 18 +- ...t => SDKReviewDetailRepositoryTests.swift} | 12 +- .../SDKVersionRepositoryCreateTests.swift | 8 +- ....swift => SDKVersionRepositoryTests.swift} | 16 +- ...t => SDKLocalizationRepositoryTests.swift} | 12 +- ...ft => OpenAPIPreviewRepositoryTests.swift} | 16 +- .../OpenAPIPreviewRepositoryUploadTests.swift | 6 +- .../AppScreenshotSetTests.swift | 10 +- .../SDKScreenshotRepositoryCreateTests.swift | 6 +- ...ift => SDKScreenshotRepositoryTests.swift} | 16 +- .../SDKScreenshotRepositoryUploadTests.swift | 6 +- ....swift => ScreenshotRepositoryTests.swift} | 8 +- ... VersionLocalizationRepositoryTests.swift} | 12 +- ...sts.swift => VersionRepositoryTests.swift} | 6 +- ...swift => SDKBundleIDRepositoryTests.swift} | 10 +- ...ft => SDKCertificateRepositoryTests.swift} | 8 +- ...s.swift => SDKDeviceRepositoryTests.swift} | 8 +- ....swift => SDKProfileRepositoryTests.swift} | 14 +- ...ift => SDKGameCenterRepositoryTests.swift} | 18 +- ...GameCenterModerationRepositoryTests.swift} | 22 +- ... => IrisSDKAppBundleRepositoryTests.swift} | 8 +- ...DKInAppPurchaseStateRepositoryTests.swift} | 8 +- ...t => FileIrisSessionRepositoryTests.swift} | 10 +- .../StoredSRPIrisCookieProviderTests.swift | 8 +- .../Internal/IrisResponseDecodingTests.swift | 10 +- ...sSDKResolutionCenterRepositoryTests.swift} | 6 +- ...> SDKAnalyticsReportRepositoryTests.swift} | 14 +- ...t => GalleryTemplateRepositoryTests.swift} | 10 +- ...egateGalleryTemplateRepositoryTests.swift} | 16 +- ...=> AggregateTemplateRepositoryTests.swift} | 14 +- .../Submissions/SubmissionPlannerTests.swift | 8 +- ...wift => SDKTerritoryRepositoryTests.swift} | 6 +- .../TestHelpers/MockRepositoryFactory.swift | 2 +- ...sts.swift => SDKUserRepositoryTests.swift} | 20 +- ...DKXcodeCloudBuildRunRepositoryTests.swift} | 12 +- ...SDKXcodeCloudProductRepositoryTests.swift} | 8 +- ...DKXcodeCloudWorkflowRepositoryTests.swift} | 6 +- docs/documentation-design/layout.md | 2 +- docs/features/concept-folders/design.md | 12 +- docs/features/iap-subscriptions/pricing.md | 2 +- .../iap-subscriptions/review-assets.md | 2 +- .../submission-iris-parity.md | 6 +- .../iap-subscriptions/win-back-offers.md | 2 +- docs/features/iris/iris-srp-login.md | 10 +- docs/features/screenshot-editor/design.md | 10 +- docs/library.md | 4 +- 714 files changed, 2455 insertions(+), 2421 deletions(-) create mode 120000 .claude/skills/asc-app-clips create mode 120000 .claude/skills/asc-app-infos create mode 120000 .claude/skills/asc-app-previews create mode 120000 .claude/skills/asc-app-shots create mode 120000 .claude/skills/asc-app-shots-prompt create mode 120000 .claude/skills/asc-app-wall create mode 120000 .claude/skills/asc-appstore-release create mode 120000 .claude/skills/asc-auth create mode 120000 .claude/skills/asc-availability create mode 120000 .claude/skills/asc-beta-review create mode 120000 .claude/skills/asc-builds-archive create mode 120000 .claude/skills/asc-builds-upload create mode 120000 .claude/skills/asc-check-readiness create mode 120000 .claude/skills/asc-cli create mode 120000 .claude/skills/asc-code-signing create mode 120000 .claude/skills/asc-customer-reviews create mode 120000 .claude/skills/asc-experiments create mode 120000 .claude/skills/asc-game-center create mode 120000 .claude/skills/asc-iap create mode 120000 .claude/skills/asc-init create mode 120000 .claude/skills/asc-iris create mode 120000 .claude/skills/asc-new-app-release create mode 120000 .claude/skills/asc-performance create mode 120000 .claude/skills/asc-plugin-release create mode 120000 .claude/skills/asc-plugins create mode 120000 .claude/skills/asc-promoted-purchases create mode 120000 .claude/skills/asc-release-workflow create mode 120000 .claude/skills/asc-reports create mode 120000 .claude/skills/asc-review-detail create mode 120000 .claude/skills/asc-skills create mode 120000 .claude/skills/asc-subscriptions create mode 120000 .claude/skills/asc-testflight create mode 120000 .claude/skills/asc-users create mode 120000 .claude/skills/asc-xcode-cloud rename Sources/ASCKit/Apps/AppClips/{AppClips.swift => AppClipRepository.swift} (93%) rename Sources/ASCKit/Apps/AppClips/Internal/{SDKAppClips.swift => SDKAppClipRepository.swift} (98%) rename Sources/ASCKit/Apps/AppInfos/{AgeRatingDeclarations.swift => AgeRatingDeclarationRepository.swift} (78%) rename Sources/ASCKit/Apps/AppInfos/{AppInfos.swift => AppInfoRepository.swift} (94%) rename Sources/ASCKit/Apps/AppInfos/Internal/{SDKAgeRatingDeclarations.swift => SDKAgeRatingDeclarationRepository.swift} (98%) rename Sources/ASCKit/Apps/AppInfos/Internal/{SDKAppCategories.swift => SDKAppCategoryRepository.swift} (95%) rename Sources/ASCKit/Apps/AppInfos/Internal/{SDKAppInfos.swift => SDKAppInfoRepository.swift} (98%) rename Sources/ASCKit/Apps/{Apps.swift => AppRepository.swift} (88%) rename Sources/ASCKit/Apps/AssetLibrary/{AssetLibraries.swift => AssetLibraryRepository.swift} (87%) rename Sources/ASCKit/Apps/AssetLibrary/Images/Internal/{SDKLibraryImages.swift => SDKLibraryImageRepository.swift} (98%) rename Sources/ASCKit/Apps/AssetLibrary/Images/{LibraryImages.swift => LibraryImageRepository.swift} (93%) rename Sources/ASCKit/Apps/AssetLibrary/Internal/{SDKAssetLibraries.swift => SDKAssetLibraryRepository.swift} (97%) rename Sources/ASCKit/Apps/AssetLibrary/Placements/{AssetPlacements.swift => AssetPlacementRepository.swift} (94%) rename Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/{SDKAssetPlacements.swift => SDKAssetPlacementRepository.swift} (99%) rename Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/{SDKLibraryVideos.swift => SDKLibraryVideoRepository.swift} (98%) rename Sources/ASCKit/Apps/AssetLibrary/Videos/{LibraryVideos.swift => LibraryVideoRepository.swift} (93%) rename Sources/ASCKit/Apps/Availability/{AppAvailabilities.swift => AppAvailabilityRepository.swift} (88%) rename Sources/ASCKit/Apps/Availability/Internal/{SDKAppAvailabilities.swift => SDKAppAvailabilityRepository.swift} (98%) rename Sources/ASCKit/Apps/Builds/{BetaBuildLocalizations.swift => BetaBuildLocalizationRepository.swift} (80%) rename Sources/ASCKit/Apps/Builds/{Builds.swift => BuildRepository.swift} (93%) rename Sources/ASCKit/Apps/Builds/{BuildUploads.swift => BuildUploadRepository.swift} (88%) rename Sources/ASCKit/Apps/Builds/Internal/{SDKBetaBuildLocalizations.swift => SDKBetaBuildLocalizationRepository.swift} (95%) rename Sources/ASCKit/Apps/Builds/Internal/{SDKBuildUploads.swift => SDKBuildUploadRepository.swift} (98%) rename Sources/ASCKit/Apps/Experiments/{Experiments.swift => ExperimentRepository.swift} (96%) rename Sources/ASCKit/Apps/Experiments/Internal/{SDKExperiments.swift => SDKExperimentRepository.swift} (99%) rename Sources/ASCKit/Apps/InAppPurchases/Availability/{InAppPurchaseAvailabilities.swift => InAppPurchaseAvailabilityRepository.swift} (87%) rename Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/{SDKInAppPurchaseAvailabilities.swift => SDKInAppPurchaseAvailabilityRepository.swift} (96%) rename Sources/ASCKit/Apps/InAppPurchases/{InAppPurchasePrices.swift => InAppPurchasePriceRepository.swift} (94%) rename Sources/ASCKit/Apps/InAppPurchases/{InAppPurchases.swift => InAppPurchaseRepository.swift} (91%) rename Sources/ASCKit/Apps/InAppPurchases/Internal/{SDKInAppPurchasePrices.swift => SDKInAppPurchasePriceRepository.swift} (99%) rename Sources/ASCKit/Apps/InAppPurchases/Internal/{SDKInAppPurchases.swift => SDKInAppPurchaseRepository.swift} (98%) rename Sources/ASCKit/Apps/InAppPurchases/Localizations/{InAppPurchaseLocalizations.swift => InAppPurchaseLocalizationRepository.swift} (88%) rename Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/{SDKInAppPurchaseLocalizations.swift => SDKInAppPurchaseLocalizationRepository.swift} (96%) rename Sources/ASCKit/Apps/InAppPurchases/OfferCodes/{InAppPurchaseOfferCodes.swift => InAppPurchaseOfferCodeRepository.swift} (96%) rename Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/{SDKInAppPurchaseOfferCodes.swift => SDKInAppPurchaseOfferCodeRepository.swift} (99%) rename Sources/ASCKit/Apps/InAppPurchases/Review/{InAppPurchaseReviewAssets.swift => InAppPurchaseReviewRepository.swift} (90%) rename Sources/ASCKit/Apps/InAppPurchases/Review/Internal/{SDKInAppPurchaseReviewAssets.swift => SDKInAppPurchaseReviewRepository.swift} (99%) rename Sources/ASCKit/Apps/Performance/{Diagnostics.swift => DiagnosticsRepository.swift} (81%) rename Sources/ASCKit/Apps/Performance/Internal/{SDKDiagnostics.swift => SDKDiagnosticsRepository.swift} (98%) rename Sources/ASCKit/Apps/Performance/Internal/{SDKPerfMetrics.swift => SDKPerfMetricsRepository.swift} (98%) rename Sources/ASCKit/Apps/Performance/Internal/{SDKPerfOverviews.swift => SDKPerfOverviewRepository.swift} (97%) rename Sources/ASCKit/Apps/Performance/{PerfMetrics.swift => PerfMetricsRepository.swift} (84%) rename Sources/ASCKit/Apps/Performance/{PerfOverviews.swift => PerfOverviewRepository.swift} (70%) rename Sources/ASCKit/Apps/Pricing/Internal/{SDKAppPrices.swift => SDKPricingRepository.swift} (96%) rename Sources/ASCKit/Apps/Pricing/{AppPrices.swift => PricingRepository.swift} (90%) rename Sources/ASCKit/Apps/ProductVersions/Internal/{SDKProductVersions.swift => SDKProductVersionRepository.swift} (96%) rename Sources/ASCKit/Apps/ProductVersions/{ProductVersions.swift => ProductVersionRepository.swift} (84%) rename Sources/ASCKit/Apps/PromotedPurchases/Internal/{SDKPromotedPurchases.swift => SDKPromotedPurchaseRepository.swift} (97%) rename Sources/ASCKit/Apps/PromotedPurchases/{PromotedPurchases.swift => PromotedPurchaseRepository.swift} (91%) rename Sources/ASCKit/Apps/Reviews/{CustomerReviews.swift => CustomerReviewRepository.swift} (88%) rename Sources/ASCKit/Apps/Reviews/Internal/{SDKCustomerReviews.swift => SDKCustomerReviewRepository.swift} (97%) rename Sources/ASCKit/Apps/Subscriptions/Availability/Internal/{SDKSubscriptionAvailabilities.swift => SDKSubscriptionAvailabilityRepository.swift} (95%) rename Sources/ASCKit/Apps/Subscriptions/Availability/{SubscriptionAvailabilities.swift => SubscriptionAvailabilityRepository.swift} (71%) rename Sources/ASCKit/Apps/Subscriptions/Internal/{SDKSubscriptionGroups.swift => SDKSubscriptionGroupRepository.swift} (95%) rename Sources/ASCKit/Apps/Subscriptions/Internal/{SDKSubscriptionPrices.swift => SDKSubscriptionPriceRepository.swift} (98%) rename Sources/ASCKit/Apps/Subscriptions/Internal/{SDKSubscriptions.swift => SDKSubscriptionRepository.swift} (98%) rename Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/{SDKSubscriptionIntroductoryOffers.swift => SDKSubscriptionIntroductoryOfferRepository.swift} (96%) rename Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/{SubscriptionIntroductoryOffers.swift => SubscriptionIntroductoryOfferRepository.swift} (88%) rename Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/{SDKSubscriptionGroupLocalizations.swift => SDKSubscriptionGroupLocalizationRepository.swift} (95%) rename Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/{SDKSubscriptionLocalizations.swift => SDKSubscriptionLocalizationRepository.swift} (96%) rename Sources/ASCKit/Apps/Subscriptions/Localizations/{SubscriptionGroupLocalizations.swift => SubscriptionGroupLocalizationRepository.swift} (88%) rename Sources/ASCKit/Apps/Subscriptions/Localizations/{SubscriptionLocalizations.swift => SubscriptionLocalizationRepository.swift} (89%) rename Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/{SDKSubscriptionOfferCodes.swift => SDKSubscriptionOfferCodeRepository.swift} (99%) rename Sources/ASCKit/Apps/Subscriptions/OfferCodes/{SubscriptionOfferCodes.swift => SubscriptionOfferCodeRepository.swift} (97%) rename Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/{SDKSubscriptionPromotionalOffers.swift => SDKSubscriptionPromotionalOfferRepository.swift} (97%) rename Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/{SubscriptionPromotionalOffers.swift => SubscriptionPromotionalOfferRepository.swift} (90%) rename Sources/ASCKit/Apps/Subscriptions/Review/Internal/{SDKSubscriptionReviewAssets.swift => SDKSubscriptionReviewRepository.swift} (99%) rename Sources/ASCKit/Apps/Subscriptions/Review/{SubscriptionReviewAssets.swift => SubscriptionReviewRepository.swift} (90%) rename Sources/ASCKit/Apps/Subscriptions/{SubscriptionGroups.swift => SubscriptionGroupRepository.swift} (88%) rename Sources/ASCKit/Apps/Subscriptions/{SubscriptionPrices.swift => SubscriptionPriceRepository.swift} (97%) rename Sources/ASCKit/Apps/Subscriptions/{Subscriptions.swift => SubscriptionRepository.swift} (93%) rename Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/{SDKWinBackOffers.swift => SDKWinBackOfferRepository.swift} (99%) rename Sources/ASCKit/Apps/Subscriptions/WinBackOffers/{WinBackOffers.swift => WinBackOfferRepository.swift} (96%) rename Sources/ASCKit/Apps/TestFlight/{BetaAppLocalizations.swift => BetaAppLocalizationRepository.swift} (91%) rename Sources/ASCKit/Apps/TestFlight/{BetaAppReviews.swift => BetaAppReviewRepository.swift} (89%) rename Sources/ASCKit/Apps/TestFlight/Internal/{SDKBetaAppLocalizations.swift => SDKBetaAppLocalizationRepository.swift} (97%) rename Sources/ASCKit/Apps/TestFlight/Internal/{SDKBetaAppReviews.swift => SDKBetaAppReviewRepository.swift} (97%) rename Sources/ASCKit/Apps/TestFlight/{TestFlight.swift => TestFlightRepository.swift} (92%) rename Sources/ASCKit/Apps/Versions/Internal/{SDKReviewDetails.swift => SDKReviewDetailRepository.swift} (97%) rename Sources/ASCKit/Apps/Versions/Internal/{SDKAppStoreVersions.swift => SDKVersionRepository.swift} (98%) rename Sources/ASCKit/Apps/Versions/Localizations/Internal/{SDKVersionLocalizations.swift => SDKLocalizationRepository.swift} (96%) rename Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/{OpenAPIAppPreviews.swift => OpenAPIPreviewRepository.swift} (98%) rename Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/{AppPreviews.swift => PreviewRepository.swift} (89%) rename Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/{AppScreenshots.swift => ScreenshotRepository.swift} (92%) rename Sources/ASCKit/Apps/Versions/Localizations/{VersionLocalizations.swift => VersionLocalizationRepository.swift} (89%) rename Sources/ASCKit/Apps/Versions/{ReviewDetails.swift => ReviewDetailRepository.swift} (81%) rename Sources/ASCKit/Apps/Versions/{AppStoreVersions.swift => VersionRepository.swift} (95%) rename Sources/ASCKit/Auth/Iris/{IrisSessions.swift => IrisSessionRepository.swift} (84%) rename Sources/ASCKit/CodeSigning/BundleIDs/{BundleIDs.swift => BundleIDRepository.swift} (86%) rename Sources/ASCKit/CodeSigning/Certificates/{Certificates.swift => CertificateRepository.swift} (85%) rename Sources/ASCKit/CodeSigning/Devices/{Devices.swift => DeviceRepository.swift} (82%) rename Sources/ASCKit/CodeSigning/Internal/{SDKBundleIDs.swift => SDKBundleIDRepository.swift} (96%) rename Sources/ASCKit/CodeSigning/Internal/{SDKCertificates.swift => SDKCertificateRepository.swift} (96%) rename Sources/ASCKit/CodeSigning/Internal/{SDKDevices.swift => SDKDeviceRepository.swift} (96%) rename Sources/ASCKit/CodeSigning/Internal/{SDKProfiles.swift => SDKProfileRepository.swift} (98%) rename Sources/ASCKit/CodeSigning/Profiles/{Profiles.swift => ProfileRepository.swift} (89%) rename Sources/ASCKit/GameCenter/{GameCenter.swift => GameCenterRepository.swift} (94%) rename Sources/ASCKit/GameCenter/Internal/{SDKGameCenter.swift => SDKGameCenterRepository.swift} (98%) rename Sources/ASCKit/GameCenter/Moderation/{GameCenterModeration.swift => GameCenterModerationRepository.swift} (90%) rename Sources/ASCKit/GameCenter/Moderation/Internal/{SDKGameCenterModeration.swift => SDKGameCenterModerationRepository.swift} (97%) rename Sources/ASCKit/Iris/AppBundles/Internal/{IrisSDKAppBundles.swift => IrisSDKAppBundleRepository.swift} (94%) rename Sources/ASCKit/Iris/AppBundles/{IrisAppBundles.swift => IrisAppBundleRepository.swift} (88%) rename Sources/ASCKit/Iris/InAppPurchases/Internal/{IrisSDKInAppPurchaseStates.swift => IrisSDKInAppPurchaseStateRepository.swift} (91%) rename Sources/ASCKit/Iris/InAppPurchases/{IrisInAppPurchaseStates.swift => IrisInAppPurchaseStateRepository.swift} (85%) rename Sources/ASCKit/Iris/Internal/Auth/{FileIrisSessions.swift => FileIrisSessionRepository.swift} (91%) rename Sources/ASCKit/Iris/ResolutionCenter/Internal/{IrisSDKResolutionCenter.swift => IrisSDKResolutionCenterRepository.swift} (97%) rename Sources/ASCKit/Iris/ResolutionCenter/{IrisResolutionCenter.swift => IrisResolutionCenterRepository.swift} (94%) rename Sources/ASCKit/Reports/Analytics/{AnalyticsReports.swift => AnalyticsReportRepository.swift} (91%) rename Sources/ASCKit/Reports/Analytics/Internal/{SDKAnalyticsReports.swift => SDKAnalyticsReportRepository.swift} (98%) rename Sources/ASCKit/Screenshots/Gallery/{GalleryTemplates.swift => GalleryTemplateRepository.swift} (89%) rename Sources/ASCKit/Screenshots/Internal/{AggregateGalleryTemplates.swift => AggregateGalleryTemplateRepository.swift} (82%) rename Sources/ASCKit/Screenshots/Internal/{AggregateTemplates.swift => AggregateTemplateRepository.swift} (83%) rename Sources/ASCKit/Screenshots/{Templates.swift => TemplateRepository.swift} (95%) rename Sources/ASCKit/Territories/Internal/{SDKTerritories.swift => SDKTerritoryRepository.swift} (87%) rename Sources/ASCKit/Territories/{Territories.swift => TerritoryRepository.swift} (63%) rename Sources/ASCKit/Users/Internal/{SDKUsers.swift => SDKUserRepository.swift} (98%) rename Sources/ASCKit/Users/{Users.swift => UserRepository.swift} (92%) rename Sources/ASCKit/XcodeCloud/Internal/{SDKXcodeCloudBuildRuns.swift => SDKXcodeCloudBuildRunRepository.swift} (96%) rename Sources/ASCKit/XcodeCloud/Internal/{SDKXcodeCloudProducts.swift => SDKXcodeCloudProductRepository.swift} (91%) rename Sources/ASCKit/XcodeCloud/Internal/{SDKXcodeCloudWorkflows.swift => SDKXcodeCloudWorkflowRepository.swift} (90%) rename Sources/ASCKit/XcodeCloud/{XcodeCloudBuildRuns.swift => XcodeCloudBuildRunRepository.swift} (82%) rename Sources/ASCKit/XcodeCloud/{XcodeCloudProducts.swift => XcodeCloudProductRepository.swift} (64%) rename Sources/ASCKit/XcodeCloud/{XcodeCloudWorkflows.swift => XcodeCloudWorkflowRepository.swift} (65%) rename Tests/ASCKitTests/Apps/AppClips/Internal/{SDKAppClipsTests.swift => SDKAppClipRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/AppInfos/Internal/{SDKAgeRatingDeclarationsTests.swift => SDKAgeRatingDeclarationRepositoryTests.swift} (89%) rename Tests/ASCKitTests/Apps/AppInfos/Internal/{SDKAppCategoriesTests.swift => SDKAppCategoryRepositoryTests.swift} (90%) rename Tests/ASCKitTests/Apps/AppInfos/Internal/{SDKAppInfosTests.swift => SDKAppInfoRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/{AppsTests.swift => AppRepositoryTests.swift} (90%) rename Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/{SDKLibraryImagesTests.swift => SDKLibraryImageRepositoryTests.swift} (97%) rename Tests/ASCKitTests/Apps/AssetLibrary/Internal/{SDKAssetLibrariesTests.swift => SDKAssetLibraryRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/{SDKAssetPlacementsTests.swift => SDKAssetPlacementRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/{SDKLibraryVideosTests.swift => SDKLibraryVideoRepositoryTests.swift} (96%) rename Tests/ASCKitTests/Apps/Availability/Internal/{SDKAppAvailabilitiesTests.swift => SDKAppAvailabilityRepositoryTests.swift} (94%) rename Tests/ASCKitTests/Apps/Builds/Internal/{SDKBetaBuildLocalizationsTests.swift => SDKBetaBuildLocalizationRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/Builds/Internal/{SDKBuildsTests.swift => SDKBuildRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/Builds/Internal/{SDKBuildUploadsTests.swift => SDKBuildUploadRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/Experiments/Internal/{SDKExperimentsTests.swift => SDKExperimentRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/{SDKInAppPurchaseAvailabilitiesTests.swift => SDKInAppPurchaseAvailabilityRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/InAppPurchases/Internal/{SDKInAppPurchaseLocalizationsTests.swift => SDKInAppPurchaseLocalizationRepositoryTests.swift} (89%) rename Tests/ASCKitTests/Apps/InAppPurchases/Internal/{SDKInAppPurchasePricesTests.swift => SDKInAppPurchasePriceRepositoryTests.swift} (94%) rename Tests/ASCKitTests/Apps/InAppPurchases/Internal/{SDKInAppPurchasesTests.swift => SDKInAppPurchaseRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/{SDKInAppPurchaseOfferCodesTests.swift => SDKInAppPurchaseOfferCodeRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/{SDKInAppPurchaseReviewAssetsTests.swift => SDKInAppPurchaseReviewRepositoryTests.swift} (90%) rename Tests/ASCKitTests/Apps/Internal/{SDKAppsTests.swift => SDKAppRepositoryTests.swift} (93%) rename Tests/ASCKitTests/Apps/Performance/Internal/{SDKDiagnosticsTests.swift => SDKDiagnosticsRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/Performance/Internal/{SDKPerfMetricsTests.swift => SDKPerfMetricsRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/Performance/Internal/{SDKPerfOverviewsTests.swift => SDKPerfOverviewRepositoryTests.swift} (97%) rename Tests/ASCKitTests/Apps/Pricing/Internal/{SDKAppPricesTests.swift => SDKPricingRepositoryTests.swift} (93%) rename Tests/ASCKitTests/Apps/ProductVersions/Internal/{SDKProductVersionsTests.swift => SDKProductVersionRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/PromotedPurchases/Internal/{SDKPromotedPurchasesTests.swift => SDKPromotedPurchaseRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/Reviews/Internal/{SDKCustomerReviewsTests.swift => SDKCustomerReviewRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/{SDKSubscriptionAvailabilitiesTests.swift => SDKSubscriptionAvailabilityRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionGroupLocalizationsTests.swift => SDKSubscriptionGroupLocalizationRepositoryTests.swift} (89%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionGroupsTests.swift => SDKSubscriptionGroupRepositoryTests.swift} (89%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionLocalizationsTests.swift => SDKSubscriptionLocalizationRepositoryTests.swift} (90%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionPricesTests.swift => SDKSubscriptionPriceRepositoryTests.swift} (94%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionPromotionalOffersTests.swift => SDKSubscriptionPromotionalOfferRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionsTests.swift => SDKSubscriptionRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKWinBackOffersTests.swift => SDKWinBackOfferRepositoryTests.swift} (94%) rename Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/{SDKSubscriptionIntroductoryOffersTests.swift => SDKSubscriptionIntroductoryOfferRepositoryTests.swift} (90%) rename Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/{SDKSubscriptionOfferCodesTests.swift => SDKSubscriptionOfferCodeRepositoryTests.swift} (93%) rename Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/{SDKSubscriptionReviewAssetsTests.swift => SDKSubscriptionReviewRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/TestFlight/Internal/{SDKBetaAppLocalizationsTests.swift => SDKBetaAppLocalizationRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/TestFlight/Internal/{SDKBetaAppReviewsTests.swift => SDKBetaAppReviewRepositoryTests.swift} (93%) rename Tests/ASCKitTests/Apps/TestFlight/Internal/{SDKTestFlightTests.swift => SDKTestFlightRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/Versions/Internal/{SDKReviewDetailsTests.swift => SDKReviewDetailRepositoryTests.swift} (95%) rename Tests/ASCKitTests/Apps/Versions/Internal/{SDKAppStoreVersionsTests.swift => SDKVersionRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/Versions/Localizations/Internal/{SDKVersionLocalizationsTests.swift => SDKLocalizationRepositoryTests.swift} (93%) rename Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/{OpenAPIAppPreviewsTests.swift => OpenAPIPreviewRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/{SDKAppScreenshotsTests.swift => SDKScreenshotRepositoryTests.swift} (89%) rename Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/{AppScreenshotsTests.swift => ScreenshotRepositoryTests.swift} (89%) rename Tests/ASCKitTests/Apps/Versions/Localizations/{VersionLocalizationsTests.swift => VersionLocalizationRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Apps/Versions/{AppStoreVersionsTests.swift => VersionRepositoryTests.swift} (89%) rename Tests/ASCKitTests/CodeSigning/Internal/{SDKBundleIDsTests.swift => SDKBundleIDRepositoryTests.swift} (90%) rename Tests/ASCKitTests/CodeSigning/Internal/{SDKCertificatesTests.swift => SDKCertificateRepositoryTests.swift} (90%) rename Tests/ASCKitTests/CodeSigning/Internal/{SDKDevicesTests.swift => SDKDeviceRepositoryTests.swift} (93%) rename Tests/ASCKitTests/CodeSigning/Internal/{SDKProfilesTests.swift => SDKProfileRepositoryTests.swift} (92%) rename Tests/ASCKitTests/GameCenter/Internal/{SDKGameCenterTests.swift => SDKGameCenterRepositoryTests.swift} (93%) rename Tests/ASCKitTests/GameCenter/Moderation/Internal/{SDKGameCenterModerationTests.swift => SDKGameCenterModerationRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Iris/AppBundles/Internal/{IrisSDKAppBundlesTests.swift => IrisSDKAppBundleRepositoryTests.swift} (90%) rename Tests/ASCKitTests/Iris/InAppPurchases/Internal/{IrisSDKInAppPurchaseStatesTests.swift => IrisSDKInAppPurchaseStateRepositoryTests.swift} (94%) rename Tests/ASCKitTests/Iris/Internal/Auth/{FileIrisSessionsTests.swift => FileIrisSessionRepositoryTests.swift} (86%) rename Tests/ASCKitTests/Iris/ResolutionCenter/Internal/{IrisSDKResolutionCenterTests.swift => IrisSDKResolutionCenterRepositoryTests.swift} (98%) rename Tests/ASCKitTests/Reports/Internal/{SDKAnalyticsReportsTests.swift => SDKAnalyticsReportRepositoryTests.swift} (92%) rename Tests/ASCKitTests/Screenshots/Gallery/{GalleryTemplatesTests.swift => GalleryTemplateRepositoryTests.swift} (86%) rename Tests/ASCKitTests/Screenshots/Internal/{AggregateGalleryTemplatesTests.swift => AggregateGalleryTemplateRepositoryTests.swift} (88%) rename Tests/ASCKitTests/Screenshots/Internal/{AggregateTemplatesTests.swift => AggregateTemplateRepositoryTests.swift} (91%) rename Tests/ASCKitTests/Territories/Internal/{SDKTerritoriesTests.swift => SDKTerritoryRepositoryTests.swift} (90%) rename Tests/ASCKitTests/Users/Internal/{SDKUsersTests.swift => SDKUserRepositoryTests.swift} (93%) rename Tests/ASCKitTests/XcodeCloud/Internal/{SDKXcodeCloudBuildRunsTests.swift => SDKXcodeCloudBuildRunRepositoryTests.swift} (90%) rename Tests/ASCKitTests/XcodeCloud/Internal/{SDKXcodeCloudProductsTests.swift => SDKXcodeCloudProductRepositoryTests.swift} (88%) rename Tests/ASCKitTests/XcodeCloud/Internal/{SDKXcodeCloudWorkflowsTests.swift => SDKXcodeCloudWorkflowRepositoryTests.swift} (90%) diff --git a/.claude/skills/app-implement-feature/SKILL.md b/.claude/skills/app-implement-feature/SKILL.md index c274db7a..1cbd8223 100644 --- a/.claude/skills/app-implement-feature/SKILL.md +++ b/.claude/skills/app-implement-feature/SKILL.md @@ -75,9 +75,9 @@ what sits in `Internal/`, and the one bare call in `Internal/System/`: ``` Sources/Orders/ Orders/Internal/ Orders/Internal/System/ ┌──────────────────┐ ┌──────────────────────┐ any ┌────────────────────────┐ -│ Order, OrderItem │ │ APIOrders │ HTTP │ URLSessionHTTP │ +│ Order, OrderItem │ │ APIOrderRepository │ HTTP │ URLSessionHTTP │ │ (values + rules) │ ◀──────── │ (request, decode, │ ───────▶ │ (≤100 lines: only the │ -│ Orders │ implements│ map DTO → Order, │ │ URLSession call) │ +│ OrderRepository │ implements│ map DTO → Order, │ │ URLSession call) │ │ (@Mockable role) │ │ error mapping) │ ◀─ Mock └────────────────────────┘ │ OrderBook (actor)│ └──────────────────────┘ HTTP └──────────────────┘ in tests @@ -97,8 +97,8 @@ List each component with: ``` | Component | Purpose | Inputs | Outputs | Dependencies | |------------|-----------------------|--------------|--------------|--------------| -| Users | Find and save users | UserId | User | HTTP | -| OrderBook | Keep orders current | Order, User | Order | Orders | +| UserRepository | Find and save users | UserId | User | HTTP | +| OrderBook | Keep orders current | Order, User | Order | OrderRepository | ``` ### Step 4: Show the design, then build @@ -167,7 +167,7 @@ struct OrderRow: View { ```swift @Mockable -public protocol Orders: Sendable { +public protocol OrderRepository: Sendable { func all() async throws -> [Order] func fetch(id: OrderId) async throws -> Order func save(_ order: Order) async throws @@ -188,12 +188,12 @@ domain**, never for its architectural pattern: one, the abstraction isn't named yet — keep going until the noun describes what the thing *is* (`OrderBook`, `Checkout`, `HTTP`, `Subprocess`). If no noun comes, the abstraction probably shouldn't exist yet. -- **Aggregate persistence takes the plural of the aggregate** — `Orders`, - `Users`, `Books` — never the suffix `XxxRepository`. This carve-out is only - for collection-like load / save / delete by identity; anything else (an - adapter, an event source, a process) gets a role noun. -- **Implementations are named for how they do it**: `APIOrders`, - `SQLiteOrders`, `URLSessionHTTP`, `InMemoryOrders` — each plays the role it +- **`XxxRepository` is for CRUD only** — `OrderRepository`, `UserRepository`: + load / save / delete an aggregate by identity. Anything that does more than + CRUD — a workflow (sign in, submit for review, boot), an adapter, an event + source, a process — gets a role noun (`Checkout`, `SignIn`, `Subprocess`). +- **Implementations are named for how they do it**: `APIOrderRepository`, + `SQLiteOrderRepository`, `URLSessionHTTP`, `InMemoryOrderRepository` — each plays the role it is named after. - **Tests are named for the outcome**, in the user's words: `` `should show the new status after an update` ``, never the method or @@ -211,16 +211,16 @@ Sources/ ├── Orders/ # one folder per concept (nest sub-concepts: Orders/Items/) │ ├── Order.swift # PUBLIC FACE — values with behaviour, │ ├── OrderStatus.swift # @Mockable roles, actors; what other folders may use -│ ├── Orders.swift # (Orders = the collection of Order: load / save by id) +│ ├── OrderRepository.swift # (CRUD for Order: load / save / delete by id) │ └── Internal/ # IMPLEMENTATIONS — adapters that play the roles, -│ ├── APIOrders.swift # DTOs, mappers, wire formats; decisions, unit-tested +│ ├── APIOrderRepository.swift# DTOs, mappers, wire formats; decisions, unit-tested │ ├── OrderDTO.swift │ └── System/ # THE BARE OUTSIDE CALL — URLSession, a DB driver, │ └── URLSessionHTTP.swift # Process, a private symbol; ≤100 lines, no decisions └── App/ # THE WAY IN — SwiftUI views (no ViewModel), entry point, wiring Tests/Tests/ # mirrors Sources/ folder for folder ├── Orders/OrderTests.swift -└── Orders/Internal/APIOrdersTests.swift +└── Orders/Internal/APIOrderRepositoryTests.swift ``` | Part | Location | Holds | Tested how | @@ -237,7 +237,7 @@ Tests/Tests/ # mirrors Sources/ folder for folder - **A concept that fits no folder is a missing word** — ask before inventing a folder. **Key patterns:** -- **Collections of aggregates** - Data access behind a plural-noun protocol (`Orders`) in the public face +- **Repository for CRUD only** - Aggregate load / save / delete behind `XxxRepository` in the public face; a workflow (sign in, submit, boot) takes a role noun - **Protocol-Based DI** - `@Mockable` for testing - **Chicago School TDD** - Test state, not interactions - **No ViewModel layer** - Views consume the public face directly @@ -283,7 +283,7 @@ An actor in the public face is tested against a stubbed role: @Suite struct OrderBookTests { @Test func `should give back the order it was asked for`() async throws { - let orders = MockOrders() + let orders = MockOrderRepository() given(orders).fetch(id: any()).willReturn(Order(items: [], status: .pending)) let book = OrderBook(orders: orders) @@ -301,14 +301,14 @@ mock (`MockHTTP`) and assert on the domain value it produces: ```swift @Suite -struct APIOrdersTests { +struct APIOrderRepositoryTests { @Test func `should load an order when the API answers`() async throws { let http = MockHTTP() given(http).request(any()).willReturn( OrderDTO(id: "123", status: "pending", items: []) ) - let order = try await APIOrders(http: http).fetch(id: OrderId("123")) + let order = try await APIOrderRepository(http: http).fetch(id: OrderId("123")) #expect(order.id.value == "123") #expect(order.status == .pending) @@ -319,7 +319,7 @@ struct APIOrdersTests { given(http).request(any()).willThrow(NetworkError.connectionFailed) await #expect(throws: OrdersError.networkError) { - try await APIOrders(http: http).fetch(id: OrderId("123")) + try await APIOrderRepository(http: http).fetch(id: OrderId("123")) } } } @@ -360,7 +360,7 @@ Wire the `Internal/` implementations into their roles at the app entry point (th ### Design (Phase 0) - [ ] Place the change in `docs/CANONICAL_MODEL.md` (concept, owner of every law it adds); update the doc first if it doesn't cover it - [ ] Ask the five questions of every type touched ([domain-shape](references/domain-shape.md)) -- [ ] Name every new type for its domain role — no `Service` / `Manager` / `Port` / `Repository` suffixes +- [ ] Name every new type for its domain role — no `Service` / `Manager` / `Port` suffixes; `Repository` only for CRUD - [ ] Create ASCII diagram: public face · `Internal/` · `Internal/System/` - [ ] Show the design and files to touch, then proceed (no approval question) diff --git a/.claude/skills/app-implement-feature/references/architecture-diagrams.md b/.claude/skills/app-implement-feature/references/architecture-diagrams.md index 95b23900..1d587883 100644 --- a/.claude/skills/app-implement-feature/references/architecture-diagrams.md +++ b/.claude/skills/app-implement-feature/references/architecture-diagrams.md @@ -53,10 +53,10 @@ outside call in `Internal/System/`. │ ┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────┐ │ │ │ Orders/ │ │ Users/ │ │ [NewConcept]/ │ │ │ │ Order, OrderStatus │ │ User │ │ [Model] │ │ -│ │ Orders │ │ Users │ │ [Role] │ │ +│ │ OrderRepository │ │ UserRepository │ │ [Role] │ │ │ │ OrderBook (actor) │ │ │ │ │ │ │ │ Internal/ │ │ Internal/ │ │ Internal/ │ │ -│ │ APIOrders │ │ APIUsers │ │ [Adapter] │ │ +│ │ APIOrderRepository │ │ APIUserRepository │ │ [Adapter] │ │ │ │ OrderDTO │ │ System/ │ │ System/ │ │ │ └──────────────────────┘ └──────────────────────┘ └──────────────────┘ │ │ │ every concept may use │ @@ -72,11 +72,11 @@ Concepts never reach into each other's `Internal/`. ## Data Flow Diagrams -### Collection Data Flow (Orders → APIOrders) +### Collection Data Flow (OrderRepository → APIOrderRepository) ``` ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ -│ API/DB │────▶│ APIOrders │────▶│ Mapper │────▶│ Domain │ +│ API/DB │────▶│ APIOrderRepository │────▶│ Mapper │────▶│ Domain │ │ Response │ │ Fetch │ │ Logic │ │ Model │ └───────────┘ └───────────┘ └───────────┘ └───────────┘ Raw Fetch Parse Domain @@ -90,7 +90,7 @@ Concepts never reach into each other's `Internal/`. │ ACTOR FLOW │ ├─────────────────────────────────────────────────────────────────────┤ │ │ -│ View ──▶ OrderBook (actor) ──▶ Orders.fetch() ──▶ API/DB │ +│ View ──▶ OrderBook (actor) ──▶ OrderRepository.fetch() ──▶ API/DB │ │ │ │ │ │ │ ▼ │ │ │ ┌─────────────────┐ │ @@ -119,7 +119,7 @@ Concepts never reach into each other's `Internal/`. ``` ┌─────────┐ ┌───────────┐ ┌─────────────┐ ┌──────────────┐ -│ Orders │────▶│ Try Fetch │────▶│ Success │────▶│ Return Data │ +│ OrderRepository │────▶│ Try Fetch │────▶│ Success │────▶│ Return Data │ └─────────┘ └───────────┘ └─────────────┘ └──────────────┘ │ ▼ (failure) @@ -142,7 +142,7 @@ Concepts never reach into each other's `Internal/`. ### User Action Flow ``` -User View OrderBook Orders API +User View OrderBook OrderRepository API │ │ │ │ │ │──tap()──────▶│ │ │ │ │ │──action()────▶│ │ │ @@ -160,7 +160,7 @@ User View OrderBook Orders API ### State Change Notification ``` -Orders OrderBook @Observable View +OrderRepository OrderBook @Observable View │ │ │ │ │──model─────────▶│ │ │ │ │──update()────▶│ │ @@ -181,9 +181,9 @@ Orders OrderBook @Observable View ``` | Component | Purpose | Inputs | Outputs | Dependencies | |--------------|----------------------------|----------------|----------------|--------------| -| Orders | The collection of orders | OrderId | Order | - | -| APIOrders | Plays Orders over the API | OrderId | Order | HTTP | -| OrderBook | Keeps orders current | Order, Status | Updated Order | Orders | +| OrderRepository | The collection of orders | OrderId | Order | - | +| APIOrderRepository | Plays OrderRepository over the API | OrderId | Order | HTTP | +| OrderBook | Keeps orders current | Order, Status | Updated Order | OrderRepository | | OrderMapper | Converts DTO to an Order | OrderDTO | Order | None | ``` @@ -192,7 +192,7 @@ Orders OrderBook @Observable View ``` | Component | Place | Protocol | Creates/Modifies | Test File | |-----------------|------------------------|----------|------------------|-------------------------| -| APIOrders | Orders/Internal/ | Orders | Creates | APIOrdersTests.swift | +| APIOrderRepository | Orders/Internal/ | OrderRepository | Creates | APIOrderRepositoryTests.swift | | OrderMapper | Orders/Internal/ | - | Creates | OrderMapperTests.swift | | URLSessionHTTP | Core/Internal/System/ | HTTP | Creates | (integration only) | | OrderBook | Orders/ (public face) | - | Manages | OrderBookTests.swift | @@ -205,13 +205,13 @@ Orders OrderBook @Observable View | File Path | Action | Description | |------------------------------------------------------|--------|---------------------------------| | docs/CANONICAL_MODEL.md | Modify | Orders in the tree, laws, words | -| Sources/Orders/Orders.swift | Create | @Mockable collection (face) | +| Sources/Orders/OrderRepository.swift | Create | @Mockable collection (face) | | Sources/Orders/OrderBook.swift | Create | Actor keeping orders current | -| Sources/Orders/Internal/APIOrders.swift | Create | Plays Orders over the API | +| Sources/Orders/Internal/APIOrderRepository.swift | Create | Plays OrderRepository over the API | | Tests/AppTests/Orders/OrderBookTests.swift | Create | Actor behavior tests | -| Tests/AppTests/Orders/Internal/APIOrdersTests.swift | Create | Adapter behavior tests | +| Tests/AppTests/Orders/Internal/APIOrderRepositoryTests.swift | Create | Adapter behavior tests | | Sources/App/Views/OrderListView.swift | Create | SwiftUI view for orders | -| Sources/App/App.swift | Modify | Wire APIOrders into Orders | +| Sources/App/App.swift | Modify | Wire APIOrderRepository into OrderRepository | ``` --- diff --git a/.claude/skills/app-implement-feature/references/domain-models.md b/.claude/skills/app-implement-feature/references/domain-models.md index 42762ce0..3e1985f9 100644 --- a/.claude/skills/app-implement-feature/references/domain-models.md +++ b/.claude/skills/app-implement-feature/references/domain-models.md @@ -87,9 +87,9 @@ public protocol PaymentProcessor: Sendable { func refund(transactionId: String, amount: Decimal) async throws -> RefundResult } -// Aggregate persistence takes the plural of the aggregate — never `XxxRepository`. +// CRUD for an aggregate: XxxRepository. Anything more than CRUD takes a role noun. @Mockable -public protocol Orders: Sendable { +public protocol OrderRepository: Sendable { func all() async throws -> [Order] func fetch(id: OrderId) async throws -> Order func save(_ order: Order) async throws @@ -199,10 +199,10 @@ Use actors for stateful domain objects (named for what they are, never `XxxManag ```swift public actor OrderBook { - private let orders: any Orders + private let orders: any OrderRepository private var cachedOrders: [OrderId: Order] = [:] - public init(orders: any Orders) { + public init(orders: any OrderRepository) { self.orders = orders } diff --git a/.claude/skills/app-implement-feature/references/tdd-patterns.md b/.claude/skills/app-implement-feature/references/tdd-patterns.md index f25b0b04..79628092 100644 --- a/.claude/skills/app-implement-feature/references/tdd-patterns.md +++ b/.claude/skills/app-implement-feature/references/tdd-patterns.md @@ -54,7 +54,7 @@ Define mockable protocols for external dependencies: import Mockable @Mockable -public protocol Orders: Sendable { +public protocol OrderRepository: Sendable { func all() async throws -> [Order] func fetch(id: OrderId) async throws -> Order func save(_ order: Order) async throws @@ -75,7 +75,7 @@ import Mockable struct OrderBookTests { @Test func `should give back the order it was asked for`() async throws { // Given - STUB dependencies to return data - let mockOrders = MockOrders() + let mockOrders = MockOrderRepository() let expectedOrder = Order( id: OrderId("123"), items: [OrderItem(price: 10, quantity: 1)], @@ -147,7 +147,7 @@ struct OrderStatusTests { given(mockHTTP).request(any()).willReturn( OrderDTO(id: "123", status: "pending", items: []) ) - let orders = APIOrders(http: mockHTTP) + let orders = APIOrderRepository(http: mockHTTP) // When let order = try await orders.fetch(id: OrderId("123")) @@ -161,7 +161,7 @@ struct OrderStatusTests { // Given let mockHTTP = MockHTTP() given(mockHTTP).request(any()).willThrow(NetworkError.connectionFailed) - let orders = APIOrders(http: mockHTTP) + let orders = APIOrderRepository(http: mockHTTP) // When/Then await #expect(throws: OrdersError.networkError) { @@ -177,7 +177,7 @@ struct OrderStatusTests { struct OrderBookTests { @Test func `should serve an order again without refetching it`() async throws { // Given - let mockOrders = MockOrders() + let mockOrders = MockOrderRepository() let order = Order(id: OrderId("123"), items: [], status: .pending) given(mockOrders).fetch(id: any()).willReturn(order) @@ -193,7 +193,7 @@ struct OrderBookTests { @Test func `should show the new status after an update`() async throws { // Given - let mockOrders = MockOrders() + let mockOrders = MockOrderRepository() var order = Order(id: OrderId("123"), items: [], status: .pending) given(mockOrders).fetch(id: any()).willReturn(order) given(mockOrders).save(any()).willReturn(()) @@ -221,7 +221,7 @@ Tests/AppTests/ # mirrors Sources/ folder for folder ├── OrderStatusTests.swift # Enum behavior ├── OrderBookTests.swift # Actor behavior └── Internal/ - ├── APIOrdersTests.swift # Adapter behavior via MockHTTP + ├── APIOrderRepositoryTests.swift # Adapter behavior via MockHTTP ├── OrderParsingTests.swift # Parsing logic └── System/ └── URLSessionHTTPTests.swift # Integration only (real call, time-limited) diff --git a/.claude/skills/asc-app-clips b/.claude/skills/asc-app-clips new file mode 120000 index 00000000..b8092f7f --- /dev/null +++ b/.claude/skills/asc-app-clips @@ -0,0 +1 @@ +../../.agents/skills/asc-app-clips \ No newline at end of file diff --git a/.claude/skills/asc-app-infos b/.claude/skills/asc-app-infos new file mode 120000 index 00000000..50c0202f --- /dev/null +++ b/.claude/skills/asc-app-infos @@ -0,0 +1 @@ +../../.agents/skills/asc-app-infos \ No newline at end of file diff --git a/.claude/skills/asc-app-previews b/.claude/skills/asc-app-previews new file mode 120000 index 00000000..05f53a73 --- /dev/null +++ b/.claude/skills/asc-app-previews @@ -0,0 +1 @@ +../../.agents/skills/asc-app-previews \ No newline at end of file diff --git a/.claude/skills/asc-app-shots b/.claude/skills/asc-app-shots new file mode 120000 index 00000000..6dec088e --- /dev/null +++ b/.claude/skills/asc-app-shots @@ -0,0 +1 @@ +../../.agents/skills/asc-app-shots \ No newline at end of file diff --git a/.claude/skills/asc-app-shots-prompt b/.claude/skills/asc-app-shots-prompt new file mode 120000 index 00000000..9ea2aeda --- /dev/null +++ b/.claude/skills/asc-app-shots-prompt @@ -0,0 +1 @@ +../../.agents/skills/asc-app-shots-prompt \ No newline at end of file diff --git a/.claude/skills/asc-app-wall b/.claude/skills/asc-app-wall new file mode 120000 index 00000000..94d66c4a --- /dev/null +++ b/.claude/skills/asc-app-wall @@ -0,0 +1 @@ +../../.agents/skills/asc-app-wall \ No newline at end of file diff --git a/.claude/skills/asc-appstore-release b/.claude/skills/asc-appstore-release new file mode 120000 index 00000000..7fe8c116 --- /dev/null +++ b/.claude/skills/asc-appstore-release @@ -0,0 +1 @@ +../../.agents/skills/asc-appstore-release \ No newline at end of file diff --git a/.claude/skills/asc-auth b/.claude/skills/asc-auth new file mode 120000 index 00000000..10ae2781 --- /dev/null +++ b/.claude/skills/asc-auth @@ -0,0 +1 @@ +../../.agents/skills/asc-auth \ No newline at end of file diff --git a/.claude/skills/asc-availability b/.claude/skills/asc-availability new file mode 120000 index 00000000..d1602a7b --- /dev/null +++ b/.claude/skills/asc-availability @@ -0,0 +1 @@ +../../.agents/skills/asc-availability \ No newline at end of file diff --git a/.claude/skills/asc-beta-review b/.claude/skills/asc-beta-review new file mode 120000 index 00000000..98fe7dca --- /dev/null +++ b/.claude/skills/asc-beta-review @@ -0,0 +1 @@ +../../.agents/skills/asc-beta-review \ No newline at end of file diff --git a/.claude/skills/asc-builds-archive b/.claude/skills/asc-builds-archive new file mode 120000 index 00000000..5cf4ac2b --- /dev/null +++ b/.claude/skills/asc-builds-archive @@ -0,0 +1 @@ +../../.agents/skills/asc-builds-archive \ No newline at end of file diff --git a/.claude/skills/asc-builds-upload b/.claude/skills/asc-builds-upload new file mode 120000 index 00000000..0f1ecaf6 --- /dev/null +++ b/.claude/skills/asc-builds-upload @@ -0,0 +1 @@ +../../.agents/skills/asc-builds-upload \ No newline at end of file diff --git a/.claude/skills/asc-check-readiness b/.claude/skills/asc-check-readiness new file mode 120000 index 00000000..65754e95 --- /dev/null +++ b/.claude/skills/asc-check-readiness @@ -0,0 +1 @@ +../../.agents/skills/asc-check-readiness \ No newline at end of file diff --git a/.claude/skills/asc-cli b/.claude/skills/asc-cli new file mode 120000 index 00000000..ea4035a9 --- /dev/null +++ b/.claude/skills/asc-cli @@ -0,0 +1 @@ +../../.agents/skills/asc-cli \ No newline at end of file diff --git a/.claude/skills/asc-code-signing b/.claude/skills/asc-code-signing new file mode 120000 index 00000000..8e543601 --- /dev/null +++ b/.claude/skills/asc-code-signing @@ -0,0 +1 @@ +../../.agents/skills/asc-code-signing \ No newline at end of file diff --git a/.claude/skills/asc-customer-reviews b/.claude/skills/asc-customer-reviews new file mode 120000 index 00000000..6fa98c3e --- /dev/null +++ b/.claude/skills/asc-customer-reviews @@ -0,0 +1 @@ +../../.agents/skills/asc-customer-reviews \ No newline at end of file diff --git a/.claude/skills/asc-experiments b/.claude/skills/asc-experiments new file mode 120000 index 00000000..b502c9fb --- /dev/null +++ b/.claude/skills/asc-experiments @@ -0,0 +1 @@ +../../.agents/skills/asc-experiments \ No newline at end of file diff --git a/.claude/skills/asc-game-center b/.claude/skills/asc-game-center new file mode 120000 index 00000000..a55810dd --- /dev/null +++ b/.claude/skills/asc-game-center @@ -0,0 +1 @@ +../../.agents/skills/asc-game-center \ No newline at end of file diff --git a/.claude/skills/asc-iap b/.claude/skills/asc-iap new file mode 120000 index 00000000..7d1dc92a --- /dev/null +++ b/.claude/skills/asc-iap @@ -0,0 +1 @@ +../../.agents/skills/asc-iap \ No newline at end of file diff --git a/.claude/skills/asc-init b/.claude/skills/asc-init new file mode 120000 index 00000000..066d5b2f --- /dev/null +++ b/.claude/skills/asc-init @@ -0,0 +1 @@ +../../.agents/skills/asc-init \ No newline at end of file diff --git a/.claude/skills/asc-iris b/.claude/skills/asc-iris new file mode 120000 index 00000000..9f5bbf5a --- /dev/null +++ b/.claude/skills/asc-iris @@ -0,0 +1 @@ +../../.agents/skills/asc-iris \ No newline at end of file diff --git a/.claude/skills/asc-new-app-release b/.claude/skills/asc-new-app-release new file mode 120000 index 00000000..5d17156a --- /dev/null +++ b/.claude/skills/asc-new-app-release @@ -0,0 +1 @@ +../../.agents/skills/asc-new-app-release \ No newline at end of file diff --git a/.claude/skills/asc-performance b/.claude/skills/asc-performance new file mode 120000 index 00000000..abf1b15e --- /dev/null +++ b/.claude/skills/asc-performance @@ -0,0 +1 @@ +../../.agents/skills/asc-performance \ No newline at end of file diff --git a/.claude/skills/asc-plugin-release b/.claude/skills/asc-plugin-release new file mode 120000 index 00000000..c5dd9c55 --- /dev/null +++ b/.claude/skills/asc-plugin-release @@ -0,0 +1 @@ +../../.agents/skills/asc-plugin-release \ No newline at end of file diff --git a/.claude/skills/asc-plugins b/.claude/skills/asc-plugins new file mode 120000 index 00000000..5baecbec --- /dev/null +++ b/.claude/skills/asc-plugins @@ -0,0 +1 @@ +../../.agents/skills/asc-plugins \ No newline at end of file diff --git a/.claude/skills/asc-promoted-purchases b/.claude/skills/asc-promoted-purchases new file mode 120000 index 00000000..ce8e659f --- /dev/null +++ b/.claude/skills/asc-promoted-purchases @@ -0,0 +1 @@ +../../.agents/skills/asc-promoted-purchases \ No newline at end of file diff --git a/.claude/skills/asc-release-workflow b/.claude/skills/asc-release-workflow new file mode 120000 index 00000000..b7535d88 --- /dev/null +++ b/.claude/skills/asc-release-workflow @@ -0,0 +1 @@ +../../.agents/skills/asc-release-workflow \ No newline at end of file diff --git a/.claude/skills/asc-reports b/.claude/skills/asc-reports new file mode 120000 index 00000000..a95a3c6c --- /dev/null +++ b/.claude/skills/asc-reports @@ -0,0 +1 @@ +../../.agents/skills/asc-reports \ No newline at end of file diff --git a/.claude/skills/asc-review-detail b/.claude/skills/asc-review-detail new file mode 120000 index 00000000..14025a71 --- /dev/null +++ b/.claude/skills/asc-review-detail @@ -0,0 +1 @@ +../../.agents/skills/asc-review-detail \ No newline at end of file diff --git a/.claude/skills/asc-skills b/.claude/skills/asc-skills new file mode 120000 index 00000000..46647347 --- /dev/null +++ b/.claude/skills/asc-skills @@ -0,0 +1 @@ +../../.agents/skills/asc-skills \ No newline at end of file diff --git a/.claude/skills/asc-subscriptions b/.claude/skills/asc-subscriptions new file mode 120000 index 00000000..129b8882 --- /dev/null +++ b/.claude/skills/asc-subscriptions @@ -0,0 +1 @@ +../../.agents/skills/asc-subscriptions \ No newline at end of file diff --git a/.claude/skills/asc-testflight b/.claude/skills/asc-testflight new file mode 120000 index 00000000..129e66bb --- /dev/null +++ b/.claude/skills/asc-testflight @@ -0,0 +1 @@ +../../.agents/skills/asc-testflight \ No newline at end of file diff --git a/.claude/skills/asc-users b/.claude/skills/asc-users new file mode 120000 index 00000000..74fcc92d --- /dev/null +++ b/.claude/skills/asc-users @@ -0,0 +1 @@ +../../.agents/skills/asc-users \ No newline at end of file diff --git a/.claude/skills/asc-xcode-cloud b/.claude/skills/asc-xcode-cloud new file mode 120000 index 00000000..9ac94057 --- /dev/null +++ b/.claude/skills/asc-xcode-cloud @@ -0,0 +1 @@ +../../.agents/skills/asc-xcode-cloud \ No newline at end of file diff --git a/.claude/skills/fix-bug/SKILL.md b/.claude/skills/fix-bug/SKILL.md index f8aeb384..4cff1b8e 100644 --- a/.claude/skills/fix-bug/SKILL.md +++ b/.claude/skills/fix-bug/SKILL.md @@ -54,7 +54,7 @@ Example — after the SDK bump to 4.5.1, App Store Connect can send `koreaAgeRat ), links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) // When - the real mapper reads it let declaration = try await repo.getDeclaration(appInfoId: "info-1") @@ -67,7 +67,7 @@ Example — after the SDK bump to 4.5.1, App Store Connect can send `koreaAgeRat Run it and **watch it fail for the right reason** (the assertion, or the missing symbol the test names). Report the red line to the user before touching `Sources/`: ```bash -swift test --filter 'SDKAgeRatingDeclarationsTests' +swift test --filter 'SDKAgeRatingDeclarationRepositoryTests' ``` ## Phase 3: Fix & Verify (Green) diff --git a/.claude/skills/implement-feature/SKILL.md b/.claude/skills/implement-feature/SKILL.md index 2d8100bc..758d1335 100644 --- a/.claude/skills/implement-feature/SKILL.md +++ b/.claude/skills/implement-feature/SKILL.md @@ -108,13 +108,13 @@ See [command-affordances.md](references/command-affordances.md) for: - `formatAgentItems` vs `formatItems` - JSON output shape `{"data":[{...,"affordances":{...}}]}` -### 4. The collection protocol — primitives only, but allow composition in adapters +### 4. Repository protocol — primitives only, but allow composition in adapters -Name it for what it holds: the **plural of the aggregate** (`Apps`, `Builds`, `AppStoreVersions`), never `XxxRepository`. A protocol that isn't a collection takes a role noun (`IrisSignIn`, `TestFlight`, `Reports`). Its implementations are named for how they do it (`SDKBuilds`, `SimctlSimulators`). +`XxxRepository` is for CRUD over an aggregate only. A protocol whose job is a workflow (sign in, submit for review, boot, download) takes a role noun instead: `IrisSignIn`, `ReviewSubmissions`, `Simulators`, `Reports`. ```swift @Mockable -public protocol MyModels: Sendable { +public protocol MyRepository: Sendable { func listMyModels(parentId: String) async throws -> [MyModel] } ``` @@ -404,12 +404,12 @@ Docs follow `docs/documentation-design/README.md`: each fact has one home, and n - [ ] `Presentable` conformance (`tableHeaders`, `tableRow`) - [ ] `AffordanceProviding` via `structuredAffordances` (NOT raw `affordances`) - [ ] State enum with semantic booleans (`isLive`, `isEditable`, `isPendingReview`, etc.) -- [ ] `Xs.swift` — `@Mockable` collection protocol named as the plural (`Builds`), primitive methods only +- [ ] `XRepository.swift` — `@Mockable` protocol with primitive methods only - [ ] `make*` factory added to `MockRepositoryFactory.swift` - [ ] Public-face tests: model fields, semantic booleans, affordances, **and `apiLinks`** for the new keys ### Phase 2: Adapter (`Internal/`) -- [ ] `Internal/SDKXs.swift` — implements the protocol, injects parent IDs in mappers +- [ ] `SDKXRepository.swift` — implements protocol, injects parent IDs in mappers - [ ] Multi-call composition where needed (relationships paginate at ~10 — use dedicated endpoints with `limit:`) - [ ] Factory registered in `ClientFactory.swift` - [ ] `_xRoutes` registered AND touched in `RESTPathResolver.ensureInitialized()` diff --git a/.claude/skills/implement-feature/references/architecture-diagrams.md b/.claude/skills/implement-feature/references/architecture-diagrams.md index ffb4f657..9a292fed 100644 --- a/.claude/skills/implement-feature/references/architecture-diagrams.md +++ b/.claude/skills/implement-feature/references/architecture-diagrams.md @@ -47,13 +47,13 @@ ``` ASCKit// (public face) App AppStoreVersion AppStoreVersionLocalization - Apps (+ affordances) AppScreenshotSet - Builds AppStoreVersionState AppScreenshot - TestFlight repos AppScreenshots AffordanceProviding + AppRepository (+ affordances) AppScreenshotSet + BuildRepository AppStoreVersionState AppScreenshot + TestFlight repos ScreenshotRepository AffordanceProviding ASCKit//Internal/ (implements the face's protocols) - SDKApps SDKBuilds - SDKTestFlight SDKAppScreenshots + SDKAppRepository SDKBuildRepository + SDKTestFlightRepository SDKScreenshotRepository ClientFactory EnvironmentAuthProvider ASCCommand (the way in) @@ -75,15 +75,15 @@ ASCCommand (the way in) ``` asc -├── apps list [--limit N] Apps.listApps() -├── versions list --app-id Apps.listVersions() -├── localizations list --version-id AppScreenshots.listLocalizations() -├── screenshot-sets list --localization-id AppScreenshots.listScreenshotSets() -├── screenshots list --set-id AppScreenshots.listScreenshots() -├── builds list [--app-id ] Builds.listBuilds() +├── apps list [--limit N] AppRepository.listApps() +├── versions list --app-id AppRepository.listVersions() +├── localizations list --version-id ScreenshotRepository.listLocalizations() +├── screenshot-sets list --localization-id ScreenshotRepository.listScreenshotSets() +├── screenshots list --set-id ScreenshotRepository.listScreenshots() +├── builds list [--app-id ] BuildRepository.listBuilds() ├── testflight -│ ├── groups [--app-id ] TestFlight.listBetaGroups() -│ └── testers [--group-id ] TestFlight.listBetaTesters() +│ ├── groups [--app-id ] TestFlightRepository.listBetaGroups() +│ └── testers [--group-id ] TestFlightRepository.listBetaTesters() ├── auth check ├── version └── tui @@ -108,7 +108,7 @@ CLI args ▼ AsyncParsableCommand.run() │ - ├─ ClientProvider.makeXs() + ├─ ClientProvider.makeXRepository() │ │ │ ▼ │ OpenAPI call → map SDK types → ASCKit structs (with parentId injected) @@ -142,14 +142,14 @@ AsyncParsableCommand.run() | File | Action | Notes | |-------------------------------------------------------------|----------|----------------------------------------------| | `Sources/ASCKit/X/XModel.swift` | Create | Struct + AffordanceProviding | -| `Sources/ASCKit/X/Xs.swift` | Create | @Mockable protocol | -| `Sources/ASCKit/X/Internal/SDKXs.swift` | Create | Implements Xs, injects parent IDs | -| `Sources/ASCKit/Shared/Internal/ClientFactory.swift` | Modify | Add `makeXs()` factory | +| `Sources/ASCKit/X/XRepository.swift` | Create | @Mockable protocol | +| `Sources/ASCKit/X/Internal/SDKXRepository.swift` | Create | Implements XRepository, injects parent IDs | +| `Sources/ASCKit/Shared/Internal/ClientFactory.swift` | Modify | Add `makeXRepository()` factory | | `Sources/ASCCommand/Commands/X/XCommand.swift` | Create | AsyncParsableCommand group + List subcommand | | `Sources/ASCCommand/ASC.swift` | Modify | Add XCommand to subcommands | -| `Sources/ASCCommand/ClientProvider.swift` | Modify | Add `makeXs()` static factory | +| `Sources/ASCCommand/ClientProvider.swift` | Modify | Add `makeXRepository()` static factory | | `Tests/ASCKitTests/X/XModelTests.swift` | Create | State, computed props, Codable | -| `Tests/ASCKitTests/X/SDKXsTests.swift` | Create | Mock-based repository tests | +| `Tests/ASCKitTests/X/XRepositoryTests.swift` | Create | Mock-based repository tests | | `Tests/ASCKitTests/Apps/AffordancesTests.swift` | Modify | Add affordance tests for new model | | `Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift`| Modify | Add `makeX(...)` factory method | diff --git a/.claude/skills/implement-feature/references/domain-models.md b/.claude/skills/implement-feature/references/domain-models.md index be91f4fb..9df20579 100644 --- a/.claude/skills/implement-feature/references/domain-models.md +++ b/.claude/skills/implement-feature/references/domain-models.md @@ -103,13 +103,13 @@ public struct AppScreenshot: Sendable, Equatable, Identifiable, Codable { ```swift @Mockable -public protocol Apps: Sendable { +public protocol AppRepository: Sendable { func listApps(limit: Int?) async throws -> PaginatedResponse func listVersions(appId: String) async throws -> [AppStoreVersion] } @Mockable -public protocol AppScreenshots: Sendable { +public protocol ScreenshotRepository: Sendable { func listLocalizations(versionId: String) async throws -> [AppStoreVersionLocalization] func listScreenshotSets(localizationId: String) async throws -> [AppScreenshotSet] func listScreenshots(setId: String) async throws -> [AppScreenshot] @@ -152,7 +152,7 @@ Add new `make*` methods to `MockRepositoryFactory` whenever you add a new domain Use private mapper functions (not static factory methods on the domain type): ```swift -// In Internal/SDKXxxs.swift (in the concept's Internal/) +// In OpenAPIXxxRepository.swift (in the concept's Internal/) private func mapVersion( _ sdkVersion: AppStoreConnect_Swift_SDK.AppStoreVersion, appId: String @@ -182,14 +182,14 @@ public final class AppScreenshotSet: Sendable, Equatable, Identifiable, Codable public let screenshotDisplayType: ScreenshotDisplayType public let screenshotsCount: Int - private let repo: any AppScreenshots + private let repo: any ScreenshotRepository public init( id: String, localizationId: String, screenshotDisplayType: ScreenshotDisplayType, screenshotsCount: Int = 0, - repo: any AppScreenshots + repo: any ScreenshotRepository ) { self.id = id self.localizationId = localizationId @@ -240,7 +240,7 @@ public final class AppScreenshotSet: Sendable, Equatable, Identifiable, Codable ```swift @Test func `importScreenshots uploads entries sorted by order`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).uploadScreenshot(setId: .value("set-1"), fileURL: .any) .willReturn(MockRepositoryFactory.makeScreenshot(id: "img-1")) diff --git a/.claude/skills/implement-feature/references/swift-concurrency.md b/.claude/skills/implement-feature/references/swift-concurrency.md index a5c2e55c..1078f0d6 100644 --- a/.claude/skills/implement-feature/references/swift-concurrency.md +++ b/.claude/skills/implement-feature/references/swift-concurrency.md @@ -23,16 +23,16 @@ public enum ProcessingState: String, Sendable { ## Async Repository Methods -All collection protocols use `async throws`: +All repository protocols use `async throws`: ```swift @Mockable -public protocol Apps: Sendable { +public protocol AppRepository: Sendable { func fetchApps(limit: Int?) async throws -> [App] } @Mockable -public protocol Builds: Sendable { +public protocol BuildRepository: Sendable { func fetchBuilds(appId: String?, limit: Int?) async throws -> [Build] } ``` @@ -53,7 +53,7 @@ struct AppsList: AsyncParsableCommand { var limit: Int = 50 func run() async throws { - let repo = ClientProvider.makeApps(globalOptions) + let repo = ClientProvider.makeAppRepository(globalOptions) let apps = try await repo.fetchApps(limit: limit) OutputFormatter.print(apps, format: globalOptions.output) } @@ -105,7 +105,7 @@ func run() async throws { ```swift // Use async throws in @Test functions @Test func `fetchApps returns apps`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).fetchApps(limit: .any).willReturn([ App(id: "1", name: "Test App", bundleId: "com.test.app", sku: nil, primaryLocale: "en-US") ]) @@ -116,7 +116,7 @@ func run() async throws { // Test error throwing with await #expect(throws:) @Test func `fetchApps propagates auth error`() async { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).fetchApps(limit: .any).willThrow(APIError.unauthorized) await #expect(throws: APIError.unauthorized) { @@ -128,7 +128,7 @@ func run() async throws { ## Swift 6.2 Strict Concurrency Checklist - [ ] Domain models are `struct` + `Sendable` (not `class`) -- [ ] Collection protocols conform to `Sendable` +- [ ] Repository protocols conform to `Sendable` - [ ] `Internal/` structs are stateless or explicitly `Sendable` - [ ] Commands use `AsyncParsableCommand` for async entry points - [ ] No `@unchecked Sendable` unless absolutely necessary with documented reason diff --git a/.claude/skills/implement-feature/references/swift-observable.md b/.claude/skills/implement-feature/references/swift-observable.md index 894607b6..a665a05c 100644 --- a/.claude/skills/implement-feature/references/swift-observable.md +++ b/.claude/skills/implement-feature/references/swift-observable.md @@ -3,7 +3,7 @@ ## Key Rules - All domain models: `Sendable` (struct is implicitly Sendable when all stored props are Sendable) -- Collection protocols: `: Sendable` (required for `@Mockable` compatibility) +- Repository protocols: `: Sendable` (required for `@Mockable` compatibility) - `Internal/` repos: `@unchecked Sendable` (hold `APIProvider` which is a reference type) - Commands: `AsyncParsableCommand` with `async throws func run()` @@ -25,7 +25,7 @@ public struct AppStoreVersion: Sendable, Equatable, Identifiable, Codable { ```swift @Mockable -public protocol Apps: Sendable { +public protocol AppRepository: Sendable { func listApps(limit: Int?) async throws -> PaginatedResponse func listVersions(appId: String) async throws -> [AppStoreVersion] } @@ -35,7 +35,7 @@ public protocol Apps: Sendable { ```swift // @unchecked Sendable because APIProvider is a reference type -public struct SDKApps: Apps, @unchecked Sendable { +public struct SDKAppRepository: AppRepository, @unchecked Sendable { private let provider: APIProvider public func listVersions(appId: String) async throws -> [AppStoreVersion] { @@ -54,7 +54,7 @@ struct VersionsList: AsyncParsableCommand { @Option(name: .long) var appId: String func run() async throws { - let repo = try ClientProvider.makeApps() + let repo = try ClientProvider.makeAppRepository() let versions = try await repo.listVersions(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) let output = try formatter.formatAgentItems( @@ -74,7 +74,7 @@ struct VersionsList: AsyncParsableCommand { final class TUIApp { func loadVersions(for app: App) { Task { @MainActor in - let repo = try ClientProvider.makeApps() + let repo = try ClientProvider.makeAppRepository() let versions = try await repo.listVersions(appId: app.id) // update UI } diff --git a/.claude/skills/implement-feature/references/tdd-patterns.md b/.claude/skills/implement-feature/references/tdd-patterns.md index 95a56eaa..b4344351 100644 --- a/.claude/skills/implement-feature/references/tdd-patterns.md +++ b/.claude/skills/implement-feature/references/tdd-patterns.md @@ -21,7 +21,7 @@ should [when any Apps { + static func makeAppRepository() throws -> any AppRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeApps(authProvider: authProvider) + return try factory.makeAppRepository(authProvider: authProvider) } - static func makeAppStoreVersions() throws -> any AppStoreVersions { + static func makeVersionRepository() throws -> any VersionRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppStoreVersions(authProvider: authProvider) + return try factory.makeVersionRepository(authProvider: authProvider) } - static func makeBuilds() throws -> any Builds { + static func makeBuildRepository() throws -> any BuildRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBuilds(authProvider: authProvider) + return try factory.makeBuildRepository(authProvider: authProvider) } - static func makeTestFlight() throws -> any TestFlight { + static func makeTestFlightRepository() throws -> any TestFlightRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeTestFlight(authProvider: authProvider) + return try factory.makeTestFlightRepository(authProvider: authProvider) } - static func makeVersionLocalizations() throws -> any VersionLocalizations { + static func makeVersionLocalizationRepository() throws -> any VersionLocalizationRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeVersionLocalizations(authProvider: authProvider) + return try factory.makeVersionLocalizationRepository(authProvider: authProvider) } - static func makeAppScreenshots() throws -> any AppScreenshots { + static func makeScreenshotRepository() throws -> any ScreenshotRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppScreenshots(authProvider: authProvider) + return try factory.makeScreenshotRepository(authProvider: authProvider) } - static func makeAppInfos() throws -> any AppInfos { + static func makeAppInfoRepository() throws -> any AppInfoRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppInfos(authProvider: authProvider) + return try factory.makeAppInfoRepository(authProvider: authProvider) } - static func makeAppCategories() throws -> any AppCategories { + static func makeAppCategoryRepository() throws -> any AppCategoryRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppCategories(authProvider: authProvider) + return try factory.makeAppCategoryRepository(authProvider: authProvider) } static func makeReviewSubmissions() throws -> any ReviewSubmissions { @@ -56,94 +56,94 @@ struct ClientProvider { return try factory.makeReviewSubmissions(authProvider: authProvider) } - static func makeBundleIDs() throws -> any BundleIDs { + static func makeBundleIDRepository() throws -> any BundleIDRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBundleIDs(authProvider: authProvider) + return try factory.makeBundleIDRepository(authProvider: authProvider) } - static func makeCertificates() throws -> any Certificates { + static func makeCertificateRepository() throws -> any CertificateRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeCertificates(authProvider: authProvider) + return try factory.makeCertificateRepository(authProvider: authProvider) } - static func makeDevices() throws -> any Devices { + static func makeDeviceRepository() throws -> any DeviceRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeDevices(authProvider: authProvider) + return try factory.makeDeviceRepository(authProvider: authProvider) } - static func makeProfiles() throws -> any Profiles { + static func makeProfileRepository() throws -> any ProfileRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeProfiles(authProvider: authProvider) + return try factory.makeProfileRepository(authProvider: authProvider) } - static func makeBuildUploads() throws -> any BuildUploads { + static func makeBuildUploadRepository() throws -> any BuildUploadRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBuildUploads(authProvider: authProvider) + return try factory.makeBuildUploadRepository(authProvider: authProvider) } - static func makeBetaBuildLocalizations() throws -> any BetaBuildLocalizations { + static func makeBetaBuildLocalizationRepository() throws -> any BetaBuildLocalizationRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBetaBuildLocalizations(authProvider: authProvider) + return try factory.makeBetaBuildLocalizationRepository(authProvider: authProvider) } - static func makeReviewDetails() throws -> any ReviewDetails { + static func makeReviewDetailRepository() throws -> any ReviewDetailRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeReviewDetails(authProvider: authProvider) + return try factory.makeReviewDetailRepository(authProvider: authProvider) } - static func makeAppPrices() throws -> any AppPrices { + static func makePricingRepository() throws -> any PricingRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppPrices(authProvider: authProvider) + return try factory.makePricingRepository(authProvider: authProvider) } - static func makeAppPreviews() throws -> any AppPreviews { + static func makePreviewRepository() throws -> any PreviewRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppPreviews(authProvider: authProvider) + return try factory.makePreviewRepository(authProvider: authProvider) } - static func makeInAppPurchases() throws -> any InAppPurchases { + static func makeInAppPurchaseRepository() throws -> any InAppPurchaseRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchases(authProvider: authProvider) + return try factory.makeInAppPurchaseRepository(authProvider: authProvider) } - static func makeInAppPurchaseLocalizations() throws -> any InAppPurchaseLocalizations { + static func makeInAppPurchaseLocalizationRepository() throws -> any InAppPurchaseLocalizationRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseLocalizations(authProvider: authProvider) + return try factory.makeInAppPurchaseLocalizationRepository(authProvider: authProvider) } - static func makeSubscriptionGroups() throws -> any SubscriptionGroups { + static func makeSubscriptionGroupRepository() throws -> any SubscriptionGroupRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionGroups(authProvider: authProvider) + return try factory.makeSubscriptionGroupRepository(authProvider: authProvider) } - static func makeSubscriptions() throws -> any Subscriptions { + static func makeSubscriptionRepository() throws -> any SubscriptionRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptions(authProvider: authProvider) + return try factory.makeSubscriptionRepository(authProvider: authProvider) } - static func makeSubscriptionLocalizations() throws -> any SubscriptionLocalizations { + static func makeSubscriptionLocalizationRepository() throws -> any SubscriptionLocalizationRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionLocalizations(authProvider: authProvider) + return try factory.makeSubscriptionLocalizationRepository(authProvider: authProvider) } - static func makeSubscriptionGroupLocalizations() throws -> any SubscriptionGroupLocalizations { + static func makeSubscriptionGroupLocalizationRepository() throws -> any SubscriptionGroupLocalizationRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionGroupLocalizations(authProvider: authProvider) + return try factory.makeSubscriptionGroupLocalizationRepository(authProvider: authProvider) } static func makeInAppPurchaseSubmissions() throws -> any InAppPurchaseSubmissions { @@ -152,22 +152,22 @@ struct ClientProvider { return try factory.makeInAppPurchaseSubmissions(authProvider: authProvider) } - static func makeProductVersions() throws -> any ProductVersions { + static func makeProductVersionRepository() throws -> any ProductVersionRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeProductVersions(authProvider: authProvider) + return try factory.makeProductVersionRepository(authProvider: authProvider) } - static func makeInAppPurchasePrices() throws -> any InAppPurchasePrices { + static func makeInAppPurchasePriceRepository() throws -> any InAppPurchasePriceRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchasePrices(authProvider: authProvider) + return try factory.makeInAppPurchasePriceRepository(authProvider: authProvider) } - static func makeSubscriptionPrices() throws -> any SubscriptionPrices { + static func makeSubscriptionPriceRepository() throws -> any SubscriptionPriceRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionPrices(authProvider: authProvider) + return try factory.makeSubscriptionPriceRepository(authProvider: authProvider) } static func makeSubscriptionSubmissions() throws -> any SubscriptionSubmissions { @@ -176,116 +176,116 @@ struct ClientProvider { return try factory.makeSubscriptionSubmissions(authProvider: authProvider) } - static func makeSubscriptionPromotionalOffers() throws -> any SubscriptionPromotionalOffers { + static func makeSubscriptionPromotionalOfferRepository() throws -> any SubscriptionPromotionalOfferRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionPromotionalOffers(authProvider: authProvider) + return try factory.makeSubscriptionPromotionalOfferRepository(authProvider: authProvider) } - static func makeWinBackOffers() throws -> any WinBackOffers { + static func makeWinBackOfferRepository() throws -> any WinBackOfferRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeWinBackOffers(authProvider: authProvider) + return try factory.makeWinBackOfferRepository(authProvider: authProvider) } - static func makeAssetLibraries() throws -> any AssetLibraries { - try ClientFactory().makeAssetLibraries(authProvider: CompositeAuthProvider()) + static func makeAssetLibraryRepository() throws -> any AssetLibraryRepository { + try ClientFactory().makeAssetLibraryRepository(authProvider: CompositeAuthProvider()) } - static func makeLibraryImages() throws -> any LibraryImages { - try ClientFactory().makeLibraryImages(authProvider: CompositeAuthProvider()) + static func makeLibraryImageRepository() throws -> any LibraryImageRepository { + try ClientFactory().makeLibraryImageRepository(authProvider: CompositeAuthProvider()) } - static func makeLibraryVideos() throws -> any LibraryVideos { - try ClientFactory().makeLibraryVideos(authProvider: CompositeAuthProvider()) + static func makeLibraryVideoRepository() throws -> any LibraryVideoRepository { + try ClientFactory().makeLibraryVideoRepository(authProvider: CompositeAuthProvider()) } - static func makeAssetPlacements() throws -> any AssetPlacements { - try ClientFactory().makeAssetPlacements(authProvider: CompositeAuthProvider()) + static func makeAssetPlacementRepository() throws -> any AssetPlacementRepository { + try ClientFactory().makeAssetPlacementRepository(authProvider: CompositeAuthProvider()) } - static func makeExperiments() throws -> any Experiments { + static func makeExperimentRepository() throws -> any ExperimentRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeExperiments(authProvider: authProvider) + return try factory.makeExperimentRepository(authProvider: authProvider) } - static func makePromotedPurchases() throws -> any PromotedPurchases { + static func makePromotedPurchaseRepository() throws -> any PromotedPurchaseRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makePromotedPurchases(authProvider: authProvider) + return try factory.makePromotedPurchaseRepository(authProvider: authProvider) } - static func makeInAppPurchaseReviewAssets() throws -> any InAppPurchaseReviewAssets { + static func makeInAppPurchaseReviewRepository() throws -> any InAppPurchaseReviewRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseReviewAssets(authProvider: authProvider) + return try factory.makeInAppPurchaseReviewRepository(authProvider: authProvider) } - static func makeSubscriptionReviewAssets() throws -> any SubscriptionReviewAssets { + static func makeSubscriptionReviewRepository() throws -> any SubscriptionReviewRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionReviewAssets(authProvider: authProvider) + return try factory.makeSubscriptionReviewRepository(authProvider: authProvider) } - static func makeSubscriptionIntroductoryOffers() throws -> any SubscriptionIntroductoryOffers { + static func makeSubscriptionIntroductoryOfferRepository() throws -> any SubscriptionIntroductoryOfferRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionIntroductoryOffers(authProvider: authProvider) + return try factory.makeSubscriptionIntroductoryOfferRepository(authProvider: authProvider) } - static func makeSubscriptionOfferCodes() throws -> any SubscriptionOfferCodes { + static func makeSubscriptionOfferCodeRepository() throws -> any SubscriptionOfferCodeRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionOfferCodes(authProvider: authProvider) + return try factory.makeSubscriptionOfferCodeRepository(authProvider: authProvider) } - static func makeInAppPurchaseOfferCodes() throws -> any InAppPurchaseOfferCodes { + static func makeInAppPurchaseOfferCodeRepository() throws -> any InAppPurchaseOfferCodeRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseOfferCodes(authProvider: authProvider) + return try factory.makeInAppPurchaseOfferCodeRepository(authProvider: authProvider) } - static func makeAgeRatingDeclarations() throws -> any AgeRatingDeclarations { + static func makeAgeRatingDeclarationRepository() throws -> any AgeRatingDeclarationRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAgeRatingDeclarations(authProvider: authProvider) + return try factory.makeAgeRatingDeclarationRepository(authProvider: authProvider) } - static func makeBetaAppReviews() throws -> any BetaAppReviews { + static func makeBetaAppReviewRepository() throws -> any BetaAppReviewRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBetaAppReviews(authProvider: authProvider) + return try factory.makeBetaAppReviewRepository(authProvider: authProvider) } - static func makeBetaAppLocalizations() throws -> any BetaAppLocalizations { + static func makeBetaAppLocalizationRepository() throws -> any BetaAppLocalizationRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeBetaAppLocalizations(authProvider: authProvider) + return try factory.makeBetaAppLocalizationRepository(authProvider: authProvider) } - static func makeAppAvailabilities() throws -> any AppAvailabilities { + static func makeAppAvailabilityRepository() throws -> any AppAvailabilityRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppAvailabilities(authProvider: authProvider) + return try factory.makeAppAvailabilityRepository(authProvider: authProvider) } - static func makeInAppPurchaseAvailabilities() throws -> any InAppPurchaseAvailabilities { + static func makeInAppPurchaseAvailabilityRepository() throws -> any InAppPurchaseAvailabilityRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseAvailabilities(authProvider: authProvider) + return try factory.makeInAppPurchaseAvailabilityRepository(authProvider: authProvider) } - static func makeSubscriptionAvailabilities() throws -> any SubscriptionAvailabilities { + static func makeSubscriptionAvailabilityRepository() throws -> any SubscriptionAvailabilityRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionAvailabilities(authProvider: authProvider) + return try factory.makeSubscriptionAvailabilityRepository(authProvider: authProvider) } - static func makeTerritories() throws -> any Territories { + static func makeTerritoryRepository() throws -> any TerritoryRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeTerritories(authProvider: authProvider) + return try factory.makeTerritoryRepository(authProvider: authProvider) } // MARK: - Simulators @@ -312,12 +312,12 @@ struct ClientProvider { ClientFactory().makePlugins() } - static func makeTemplates() -> AggregateTemplates { - AggregateTemplates.shared + static func makeTemplateRepository() -> AggregateTemplateRepository { + AggregateTemplateRepository.shared } - static func makeGalleryTemplates() -> AggregateGalleryTemplates { - AggregateGalleryTemplates.shared + static func makeGalleryTemplateRepository() -> AggregateGalleryTemplateRepository { + AggregateGalleryTemplateRepository.shared } static func makeThemes() -> AggregateThemes { @@ -352,46 +352,46 @@ struct ClientProvider { GitHubAppWall(token: token) } - static func makeUsers() throws -> any Users { + static func makeUserRepository() throws -> any UserRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeUsers(authProvider: authProvider) + return try factory.makeUserRepository(authProvider: authProvider) } - static func makeXcodeCloudProducts() throws -> any XcodeCloudProducts { + static func makeXcodeCloudProductRepository() throws -> any XcodeCloudProductRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeXcodeCloudProducts(authProvider: authProvider) + return try factory.makeXcodeCloudProductRepository(authProvider: authProvider) } - static func makeXcodeCloudWorkflows() throws -> any XcodeCloudWorkflows { + static func makeXcodeCloudWorkflowRepository() throws -> any XcodeCloudWorkflowRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeXcodeCloudWorkflows(authProvider: authProvider) + return try factory.makeXcodeCloudWorkflowRepository(authProvider: authProvider) } - static func makeXcodeCloudBuildRuns() throws -> any XcodeCloudBuildRuns { + static func makeXcodeCloudBuildRunRepository() throws -> any XcodeCloudBuildRunRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeXcodeCloudBuildRuns(authProvider: authProvider) + return try factory.makeXcodeCloudBuildRunRepository(authProvider: authProvider) } - static func makeGameCenter() throws -> any GameCenter { + static func makeGameCenterRepository() throws -> any GameCenterRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeGameCenter(authProvider: authProvider) + return try factory.makeGameCenterRepository(authProvider: authProvider) } - static func makeGameCenterModeration() throws -> any GameCenterModeration { + static func makeGameCenterModerationRepository() throws -> any GameCenterModerationRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeGameCenterModeration(authProvider: authProvider) + return try factory.makeGameCenterModerationRepository(authProvider: authProvider) } - static func makeAppClips() throws -> any AppClips { + static func makeAppClipRepository() throws -> any AppClipRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAppClips(authProvider: authProvider) + return try factory.makeAppClipRepository(authProvider: authProvider) } static func makeReports() throws -> any Reports { @@ -400,48 +400,48 @@ struct ClientProvider { return try factory.makeReports(authProvider: authProvider) } - static func makeAnalyticsReports() throws -> any AnalyticsReports { + static func makeAnalyticsReportRepository() throws -> any AnalyticsReportRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeAnalyticsReports(authProvider: authProvider) + return try factory.makeAnalyticsReportRepository(authProvider: authProvider) } - static func makeCustomerReviews() throws -> any CustomerReviews { + static func makeCustomerReviewRepository() throws -> any CustomerReviewRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeCustomerReviews(authProvider: authProvider) + return try factory.makeCustomerReviewRepository(authProvider: authProvider) } - static func makePerfMetrics() throws -> any PerfMetrics { + static func makePerfMetricsRepository() throws -> any PerfMetricsRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makePerfMetrics(authProvider: authProvider) + return try factory.makePerfMetricsRepository(authProvider: authProvider) } - static func makePerfOverviews() throws -> any PerfOverviews { + static func makePerfOverviewRepository() throws -> any PerfOverviewRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makePerfOverviews(authProvider: authProvider) + return try factory.makePerfOverviewRepository(authProvider: authProvider) } - static func makeDiagnostics() throws -> any Diagnostics { + static func makeDiagnosticsRepository() throws -> any DiagnosticsRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeDiagnostics(authProvider: authProvider) + return try factory.makeDiagnosticsRepository(authProvider: authProvider) } // MARK: - Iris (private API, cookie-based auth) - static func makeIrisAppBundles() -> any IrisAppBundles { - ClientFactory().makeIrisAppBundles() + static func makeIrisAppBundleRepository() -> any IrisAppBundleRepository { + ClientFactory().makeIrisAppBundleRepository() } static func makeIrisInAppPurchaseSubmissions() -> any IrisInAppPurchaseSubmissions { ClientFactory().makeIrisInAppPurchaseSubmissions() } - static func makeIrisResolutionCenter() -> any IrisResolutionCenter { - ClientFactory().makeIrisResolutionCenter() + static func makeIrisResolutionCenterRepository() -> any IrisResolutionCenterRepository { + ClientFactory().makeIrisResolutionCenterRepository() } static func makeIrisCookieProvider() -> any IrisCookieProvider { @@ -452,8 +452,8 @@ struct ClientProvider { IrisSDKSignIn() } - static func makeIrisSessions() -> any IrisSessions { - FileIrisSessions() + static func makeIrisSessionRepository() -> any IrisSessionRepository { + FileIrisSessionRepository() } /// File path for the half-finished login state between `login` and `verify-code`. diff --git a/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift b/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift index 20710990..0df6b8df 100644 --- a/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift +++ b/Sources/ASCCommand/Commands/AgeRating/AgeRatingCommand.swift @@ -23,11 +23,11 @@ struct AgeRatingGet: AsyncParsableCommand { var appInfoId: String func run() async throws { - let repo = try ClientProvider.makeAgeRatingDeclarations() + let repo = try ClientProvider.makeAgeRatingDeclarationRepository() print(try await execute(repo: repo)) } - func execute(repo: any AgeRatingDeclarations) async throws -> String { + func execute(repo: any AgeRatingDeclarationRepository) async throws -> String { let declaration = try await repo.getDeclaration(appInfoId: appInfoId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -142,11 +142,11 @@ struct AgeRatingUpdate: AsyncParsableCommand { var developerAgeRatingInfoUrl: String? func run() async throws { - let repo = try ClientProvider.makeAgeRatingDeclarations() + let repo = try ClientProvider.makeAgeRatingDeclarationRepository() print(try await execute(repo: repo)) } - func execute(repo: any AgeRatingDeclarations, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AgeRatingDeclarationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { var update = AgeRatingDeclarationUpdate() update.isAdvertising = advertising update.isGambling = gambling diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift index 43f35c62..47bd8902 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsDelete.swift @@ -13,11 +13,11 @@ struct AnalyticsReportsDelete: AsyncParsableCommand { var requestId: String func run() async throws { - let repo = try ClientProvider.makeAnalyticsReports() + let repo = try ClientProvider.makeAnalyticsReportRepository() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReports) async throws -> String { + func execute(repo: any AnalyticsReportRepository) async throws -> String { try await repo.deleteRequest(id: requestId) return "Deleted analytics report request \(requestId)" } diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift index 0100a49b..739b134c 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsInstancesList.swift @@ -16,11 +16,11 @@ struct AnalyticsReportsInstancesList: AsyncParsableCommand { var granularity: String? func run() async throws { - let repo = try ClientProvider.makeAnalyticsReports() + let repo = try ClientProvider.makeAnalyticsReportRepository() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReports) async throws -> String { + func execute(repo: any AnalyticsReportRepository) async throws -> String { let parsed = granularity.flatMap { AnalyticsGranularity(cliArgument: $0) } let instances = try await repo.listInstances(reportId: reportId, granularity: parsed) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift index 828f2e5d..3ff56f2f 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsList.swift @@ -16,11 +16,11 @@ struct AnalyticsReportsList: AsyncParsableCommand { var accessType: String? func run() async throws { - let repo = try ClientProvider.makeAnalyticsReports() + let repo = try ClientProvider.makeAnalyticsReportRepository() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReports) async throws -> String { + func execute(repo: any AnalyticsReportRepository) async throws -> String { let parsed = accessType.flatMap { AnalyticsAccessType(cliArgument: $0) } let requests = try await repo.listRequests(appId: appId, accessType: parsed) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift index 7c56ca71..ca83d0a5 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsReportsList.swift @@ -16,11 +16,11 @@ struct AnalyticsReportsReportsList: AsyncParsableCommand { var category: String? func run() async throws { - let repo = try ClientProvider.makeAnalyticsReports() + let repo = try ClientProvider.makeAnalyticsReportRepository() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReports) async throws -> String { + func execute(repo: any AnalyticsReportRepository) async throws -> String { let parsed = category.flatMap { AnalyticsCategory(cliArgument: $0) } let reports = try await repo.listReports(requestId: requestId, category: parsed) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift index 5f217479..67e1c51a 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsRequest.swift @@ -16,11 +16,11 @@ struct AnalyticsReportsRequest: AsyncParsableCommand { var accessType: String func run() async throws { - let repo = try ClientProvider.makeAnalyticsReports() + let repo = try ClientProvider.makeAnalyticsReportRepository() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReports) async throws -> String { + func execute(repo: any AnalyticsReportRepository) async throws -> String { guard let parsed = AnalyticsAccessType(cliArgument: accessType) else { throw ValidationError("Invalid access type: \(accessType)") } diff --git a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift index b3aeeb44..a1c0e4e3 100644 --- a/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift +++ b/Sources/ASCCommand/Commands/AnalyticsReports/AnalyticsReportsSegmentsList.swift @@ -13,11 +13,11 @@ struct AnalyticsReportsSegmentsList: AsyncParsableCommand { var instanceId: String func run() async throws { - let repo = try ClientProvider.makeAnalyticsReports() + let repo = try ClientProvider.makeAnalyticsReportRepository() print(try await execute(repo: repo)) } - func execute(repo: any AnalyticsReports) async throws -> String { + func execute(repo: any AnalyticsReportRepository) async throws -> String { let segments = try await repo.listSegments(instanceId: instanceId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(segments) diff --git a/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift b/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift index 48d400be..a875cc4a 100644 --- a/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift +++ b/Sources/ASCCommand/Commands/AppCategories/AppCategoriesCommand.swift @@ -21,11 +21,11 @@ struct AppCategoriesGet: AsyncParsableCommand { var categoryId: String func run() async throws { - let repo = try ClientProvider.makeAppCategories() + let repo = try ClientProvider.makeAppCategoryRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppCategories, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppCategoryRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let category = try await repo.getCategory(id: categoryId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([category], affordanceMode: affordanceMode) @@ -44,11 +44,11 @@ struct AppCategoriesList: AsyncParsableCommand { var platform: String? func run() async throws { - let repo = try ClientProvider.makeAppCategories() + let repo = try ClientProvider.makeAppCategoryRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppCategories) async throws -> String { + func execute(repo: any AppCategoryRepository) async throws -> String { let categories = try await repo.listCategories(platform: platform) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift index 4f6226be..4ab8aa6d 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsCreate.swift @@ -19,11 +19,11 @@ struct AppClipExperienceLocalizationsCreate: AsyncParsableCommand { var subtitle: String? func run() async throws { - let repo = try ClientProvider.makeAppClips() + let repo = try ClientProvider.makeAppClipRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppClips) async throws -> String { + func execute(repo: any AppClipRepository) async throws -> String { let localization = try await repo.createLocalization(experienceId: experienceId, locale: locale, subtitle: subtitle) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift index 9c2ee4a4..8fc3c857 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct AppClipExperienceLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeAppClips() + let repo = try ClientProvider.makeAppClipRepository() try await execute(repo: repo) } - func execute(repo: any AppClips) async throws { + func execute(repo: any AppClipRepository) async throws { try await repo.deleteLocalization(id: localizationId) } } diff --git a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift index 578687bc..fbfcff2a 100644 --- a/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsList.swift @@ -13,11 +13,11 @@ struct AppClipExperienceLocalizationsList: AsyncParsableCommand { var experienceId: String func run() async throws { - let repo = try ClientProvider.makeAppClips() + let repo = try ClientProvider.makeAppClipRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppClips) async throws -> String { + func execute(repo: any AppClipRepository) async throws -> String { let localizations = try await repo.listLocalizations(experienceId: experienceId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(localizations) diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift index 834b32b2..3d26ae73 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesCreate.swift @@ -16,11 +16,11 @@ struct AppClipExperiencesCreate: AsyncParsableCommand { var action: String? func run() async throws { - let repo = try ClientProvider.makeAppClips() + let repo = try ClientProvider.makeAppClipRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppClips) async throws -> String { + func execute(repo: any AppClipRepository) async throws -> String { let parsedAction = try resolveAction() let experience = try await repo.createExperience(appClipId: appClipId, action: parsedAction) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift index 78d31a75..560d53fb 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesDelete.swift @@ -13,11 +13,11 @@ struct AppClipExperiencesDelete: AsyncParsableCommand { var experienceId: String func run() async throws { - let repo = try ClientProvider.makeAppClips() + let repo = try ClientProvider.makeAppClipRepository() try await execute(repo: repo) } - func execute(repo: any AppClips) async throws { + func execute(repo: any AppClipRepository) async throws { try await repo.deleteExperience(id: experienceId) } } diff --git a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift index b5f21da0..eb376219 100644 --- a/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift +++ b/Sources/ASCCommand/Commands/AppClipExperiences/AppClipExperiencesList.swift @@ -13,11 +13,11 @@ struct AppClipExperiencesList: AsyncParsableCommand { var appClipId: String func run() async throws { - let repo = try ClientProvider.makeAppClips() + let repo = try ClientProvider.makeAppClipRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppClips) async throws -> String { + func execute(repo: any AppClipRepository) async throws -> String { let experiences = try await repo.listExperiences(appClipId: appClipId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(experiences) diff --git a/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift b/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift index 239938ac..53e1fe3d 100644 --- a/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift +++ b/Sources/ASCCommand/Commands/AppClips/AppClipsList.swift @@ -13,11 +13,11 @@ struct AppClipsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAppClips() + let repo = try ClientProvider.makeAppClipRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppClips) async throws -> String { + func execute(repo: any AppClipRepository) async throws -> String { let clips = try await repo.listAppClips(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(clips) diff --git a/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift b/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift index 9dfe4975..ec37c8b0 100644 --- a/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift +++ b/Sources/ASCCommand/Commands/AppInfoLocalizations/AppInfoLocalizationsCommand.swift @@ -26,11 +26,11 @@ struct AppInfoLocalizationsList: AsyncParsableCommand { var appInfoId: String func run() async throws { - let repo = try ClientProvider.makeAppInfos() + let repo = try ClientProvider.makeAppInfoRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppInfos) async throws -> String { + func execute(repo: any AppInfoRepository) async throws -> String { let locs = try await repo.listLocalizations(appInfoId: appInfoId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -59,11 +59,11 @@ struct AppInfoLocalizationsCreate: AsyncParsableCommand { var name: String func run() async throws { - let repo = try ClientProvider.makeAppInfos() + let repo = try ClientProvider.makeAppInfoRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppInfos) async throws -> String { + func execute(repo: any AppInfoRepository) async throws -> String { let loc = try await repo.createLocalization(appInfoId: appInfoId, locale: locale, name: name) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -101,11 +101,11 @@ struct AppInfoLocalizationsUpdate: AsyncParsableCommand { var privacyPolicyText: String? func run() async throws { - let repo = try ClientProvider.makeAppInfos() + let repo = try ClientProvider.makeAppInfoRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppInfos) async throws -> String { + func execute(repo: any AppInfoRepository) async throws -> String { let loc = try await repo.updateLocalization( id: localizationId, name: name, @@ -135,11 +135,11 @@ struct AppInfoLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeAppInfos() + let repo = try ClientProvider.makeAppInfoRepository() try await execute(repo: repo) } - func execute(repo: any AppInfos) async throws { + func execute(repo: any AppInfoRepository) async throws { try await repo.deleteLocalization(id: localizationId) print("{\"deleted\": \"\(localizationId)\"}") } diff --git a/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift b/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift index 476563cd..f9344c8b 100644 --- a/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift +++ b/Sources/ASCCommand/Commands/AppInfos/AppInfosCommand.swift @@ -21,11 +21,11 @@ struct AppInfosList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAppInfos() + let repo = try ClientProvider.makeAppInfoRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppInfos) async throws -> String { + func execute(repo: any AppInfoRepository) async throws -> String { let infos = try await repo.listAppInfos(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -66,11 +66,11 @@ struct AppInfosUpdate: AsyncParsableCommand { var secondarySubcategoryTwo: String? func run() async throws { - let repo = try ClientProvider.makeAppInfos() + let repo = try ClientProvider.makeAppInfoRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppInfos) async throws -> String { + func execute(repo: any AppInfoRepository) async throws -> String { let info = try await repo.updateCategories( id: appInfoId, primaryCategoryId: primaryCategory, diff --git a/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift b/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift index 119c1e18..bffbc7b1 100644 --- a/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift +++ b/Sources/ASCCommand/Commands/AppPreviewSets/AppPreviewSetsCommand.swift @@ -22,11 +22,11 @@ struct AppPreviewSetsList: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeAppPreviews() + let repo = try ClientProvider.makePreviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppPreviews) async throws -> String { + func execute(repo: any PreviewRepository) async throws -> String { let sets = try await repo.listPreviewSets(localizationId: localizationId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -52,11 +52,11 @@ struct AppPreviewSetsCreate: AsyncParsableCommand { var previewType: String func run() async throws { - let repo = try ClientProvider.makeAppPreviews() + let repo = try ClientProvider.makePreviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppPreviews) async throws -> String { + func execute(repo: any PreviewRepository) async throws -> String { guard let type = PreviewType(rawValue: previewType) else { throw ValidationError("Invalid preview type '\(previewType)'. Use a raw value like IPHONE_67, IPAD_PRO_3GEN_129, APPLE_TV, APPLE_VISION_PRO.") } diff --git a/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift b/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift index 306dd429..27368ba8 100644 --- a/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift +++ b/Sources/ASCCommand/Commands/AppPreviews/AppPreviewsCommand.swift @@ -22,11 +22,11 @@ struct AppPreviewsList: AsyncParsableCommand { var setId: String func run() async throws { - let repo = try ClientProvider.makeAppPreviews() + let repo = try ClientProvider.makePreviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppPreviews) async throws -> String { + func execute(repo: any PreviewRepository) async throws -> String { let previews = try await repo.listPreviews(setId: setId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -63,11 +63,11 @@ struct AppPreviewsUpload: AsyncParsableCommand { var previewFrameTimeCode: String? func run() async throws { - let repo = try ClientProvider.makeAppPreviews() + let repo = try ClientProvider.makePreviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppPreviews) async throws -> String { + func execute(repo: any PreviewRepository) async throws -> String { let fileURL = URL(fileURLWithPath: file) let preview = try await repo.uploadPreview( setId: setId, diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift index 91afff41..d205b177 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsGalleryTemplates.swift @@ -21,11 +21,11 @@ struct AppShotsGalleryTemplatesList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = ClientProvider.makeGalleryTemplates() + let repo = ClientProvider.makeGalleryTemplateRepository() print(try await execute(repo: repo)) } - func execute(repo: any GalleryTemplates, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GalleryTemplateRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let galleries = try await repo.listGalleries() let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -54,11 +54,11 @@ struct AppShotsGalleryTemplatesGet: AsyncParsableCommand { var preview: Bool = false func run() async throws { - let repo = ClientProvider.makeGalleryTemplates() + let repo = ClientProvider.makeGalleryTemplateRepository() print(try await execute(repo: repo)) } - func execute(repo: any GalleryTemplates) async throws -> String { + func execute(repo: any GalleryTemplateRepository) async throws -> String { guard let gallery = try await repo.getGallery(templateId: id) else { throw ValidationError("Gallery template '\(id)' not found. Run `asc app-shots gallery-templates list` to see available templates.") } diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift index fe0845af..a2d88d38 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsTemplates.swift @@ -27,11 +27,11 @@ struct AppShotsTemplatesList: AsyncParsableCommand { var preview: Bool = false func run() async throws { - let repo = ClientProvider.makeTemplates() + let repo = ClientProvider.makeTemplateRepository() print(try await execute(repo: repo)) } - func execute(repo: any Templates, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any TemplateRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let templates = try await repo.listTemplates(size: size) if preview { @@ -82,11 +82,11 @@ struct AppShotsTemplatesGet: AsyncParsableCommand { var preview: Bool = false func run() async throws { - let repo = ClientProvider.makeTemplates() + let repo = ClientProvider.makeTemplateRepository() print(try await execute(repo: repo)) } - func execute(repo: any Templates) async throws -> String { + func execute(repo: any TemplateRepository) async throws -> String { guard let template = try await repo.getTemplate(id: id) else { throw ValidationError("Template '\(id)' not found. Run `asc app-shots templates list` to see available templates.") } @@ -145,7 +145,7 @@ struct AppShotsTemplatesApply: AsyncParsableCommand { var imageOutput: String? func run() async throws { - let repo = ClientProvider.makeTemplates() + let repo = ClientProvider.makeTemplateRepository() if preview == .image { let renderer = ClientProvider.makeHTMLRenderer() print(try await execute(repo: repo, renderer: renderer)) @@ -154,7 +154,7 @@ struct AppShotsTemplatesApply: AsyncParsableCommand { } } - func execute(repo: any Templates, renderer: (any HTMLRenderer)? = nil) async throws -> String { + func execute(repo: any TemplateRepository, renderer: (any HTMLRenderer)? = nil) async throws -> String { guard let template = try await repo.getTemplate(id: id) else { throw ValidationError("Template '\(id)' not found. Run `asc app-shots templates list` to see available templates.") } diff --git a/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift b/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift index 90966caf..a5644026 100644 --- a/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift +++ b/Sources/ASCCommand/Commands/AppShots/AppShotsThemes.swift @@ -150,7 +150,7 @@ struct AppShotsThemesApplyDesign: AsyncParsableCommand { var canvasHeight: Int = 2868 func run() async throws { - let templateRepo = ClientProvider.makeTemplates() + let templateRepo = ClientProvider.makeTemplateRepository() if preview == .image { let renderer = ClientProvider.makeHTMLRenderer() print(try await execute(templateRepo: templateRepo, renderer: renderer)) @@ -159,7 +159,7 @@ struct AppShotsThemesApplyDesign: AsyncParsableCommand { } } - func execute(templateRepo: any Templates, renderer: (any HTMLRenderer)? = nil) async throws -> String { + func execute(templateRepo: any TemplateRepository, renderer: (any HTMLRenderer)? = nil) async throws -> String { let designData = try Data(contentsOf: URL(fileURLWithPath: design)) let themeDesign = try JSONDecoder().decode(ThemeDesign.self, from: designData) @@ -237,7 +237,7 @@ struct AppShotsThemesApply: AsyncParsableCommand { func run() async throws { let themeRepo = ClientProvider.makeThemes() - let templateRepo = ClientProvider.makeTemplates() + let templateRepo = ClientProvider.makeTemplateRepository() if preview == .image { let renderer = ClientProvider.makeHTMLRenderer() print(try await execute(themeRepo: themeRepo, templateRepo: templateRepo, renderer: renderer)) @@ -246,7 +246,7 @@ struct AppShotsThemesApply: AsyncParsableCommand { } } - func execute(themeRepo: any Themes, templateRepo: any Templates, renderer: (any HTMLRenderer)? = nil) async throws -> String { + func execute(themeRepo: any Themes, templateRepo: any TemplateRepository, renderer: (any HTMLRenderer)? = nil) async throws -> String { guard let tmpl = try await templateRepo.getTemplate(id: template) else { throw ValidationError("Template '\(template)' not found. Run `asc app-shots templates list` to see available templates.") } diff --git a/Sources/ASCCommand/Commands/Apps/AppsList.swift b/Sources/ASCCommand/Commands/Apps/AppsList.swift index 0887ac75..712607d3 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsList.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsList.swift @@ -13,11 +13,11 @@ struct AppsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeApps() + let repo = try ClientProvider.makeAppRepository() print(try await execute(repo: repo)) } - func execute(repo: any Apps, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let response = try await repo.listApps(limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift b/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift index 7c5b5ab4..b49c32a1 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsPricePointsList.swift @@ -16,11 +16,11 @@ struct AppsPricePointsList: AsyncParsableCommand { var territory: String = "USA" func run() async throws { - let repo = try ClientProvider.makeAppPrices() + let repo = try ClientProvider.makePricingRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppPrices, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any PricingRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let points = try await repo.listPricePoints(appId: appId, territory: territory) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(points, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift b/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift index e91d0b3b..d5a43977 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsPricesSet.swift @@ -19,11 +19,11 @@ struct AppsPricesSet: AsyncParsableCommand { var pricePointId: String func run() async throws { - let repo = try ClientProvider.makeAppPrices() + let repo = try ClientProvider.makePricingRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppPrices, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any PricingRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let schedule = try await repo.setPriceSchedule(appId: appId, baseTerritory: baseTerritory, pricePointId: pricePointId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([schedule], affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift b/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift index 8abb22aa..80933c49 100644 --- a/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift +++ b/Sources/ASCCommand/Commands/Apps/AppsUpdate.swift @@ -19,11 +19,11 @@ struct AppsUpdate: AsyncParsableCommand { var contentRightsDeclaration: String? func run() async throws { - let repo = try ClientProvider.makeApps() + let repo = try ClientProvider.makeAppRepository() print(try await execute(repo: repo)) } - func execute(repo: any Apps, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let declaration = try validateDeclaration() let updated = try await repo.updateContentRights(appId: appId, declaration: declaration) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift index b735debc..8100feb1 100644 --- a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityCreate.swift @@ -23,14 +23,14 @@ struct AppAvailabilityCreate: AsyncParsableCommand { func run() async throws { print(try await execute( - repo: try ClientProvider.makeAppAvailabilities(), - territoryRepo: try ClientProvider.makeTerritories() + repo: try ClientProvider.makeAppAvailabilityRepository(), + territoryRepo: try ClientProvider.makeTerritoryRepository() )) } func execute( - repo: any AppAvailabilities, - territoryRepo: any Territories, + repo: any AppAvailabilityRepository, + territoryRepo: any TerritoryRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard allTerritories != !territory.isEmpty else { diff --git a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift index 1db3d46a..59023faa 100644 --- a/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/Apps/Availability/AppAvailabilityGet.swift @@ -14,7 +14,7 @@ struct AppAvailabilityGet: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAppAvailabilities() + let repo = try ClientProvider.makeAppAvailabilityRepository() let output = try await execute(repo: repo) print(output) if output.contains("\"data\" : [\n\n ]") || output.contains("\"data\":[]") { @@ -25,7 +25,7 @@ struct AppAvailabilityGet: AsyncParsableCommand { } } - func execute(repo: any AppAvailabilities, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AppAvailabilityRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let availability = try await repo.getAppAvailability(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) // nil → empty data array: availability was never set up (mirrors `iap-availability get`). diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift index 7a269f01..9ee18d77 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetImagesCommand.swift @@ -31,11 +31,11 @@ struct AssetImagesList: AsyncParsableCommand { var category: AssetCategory? func run() async throws { - let repo = try ClientProvider.makeLibraryImages() + let repo = try ClientProvider.makeLibraryImageRepository() print(try await execute(repo: repo)) } - func execute(repo: any LibraryImages, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any LibraryImageRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let images = try await repo.listImages(libraryId: libraryId, imageId: imageId, state: state, category: category) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(images, affordanceMode: affordanceMode) @@ -66,12 +66,12 @@ struct AssetImagesUpload: AsyncParsableCommand { var wait: Bool = false func run() async throws { - let repo = try ClientProvider.makeLibraryImages() + let repo = try ClientProvider.makeLibraryImageRepository() print(try await execute(repo: repo)) } func execute( - repo: any LibraryImages, + repo: any LibraryImageRepository, affordanceMode: AffordanceMode = .cli, sleep: @Sendable (UInt64) async throws -> Void = { try await Task.sleep(nanoseconds: $0) } ) async throws -> String { @@ -115,11 +115,11 @@ struct AssetImagesUpdate: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeLibraryImages() + let repo = try ClientProvider.makeLibraryImageRepository() print(try await execute(repo: repo)) } - func execute(repo: any LibraryImages, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any LibraryImageRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let image = try await repo.updateImage(libraryId: libraryId, imageId: imageId, referenceName: referenceName, isArchived: archived) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([image], affordanceMode: affordanceMode) @@ -138,11 +138,11 @@ struct AssetImagesDelete: AsyncParsableCommand { var imageId: String func run() async throws { - let repo = try ClientProvider.makeLibraryImages() + let repo = try ClientProvider.makeLibraryImageRepository() try await execute(repo: repo) } - func execute(repo: any LibraryImages) async throws { + func execute(repo: any LibraryImageRepository) async throws { try await repo.deleteImage(imageId: imageId) } } diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift index 9db60ebc..98836752 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetLibraryCommand.swift @@ -25,11 +25,11 @@ struct AssetLibraryGet: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAssetLibraries() + let repo = try ClientProvider.makeAssetLibraryRepository() print(try await execute(repo: repo)) } - func execute(repo: any AssetLibraries, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetLibraryRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let library = try await repo.getAssetLibrary(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([library], affordanceMode: affordanceMode) @@ -59,11 +59,11 @@ struct AssetPlacementGroupsList: AsyncParsableCommand { var feature: String? func run() async throws { - let repo = try ClientProvider.makeAssetLibraries() + let repo = try ClientProvider.makeAssetLibraryRepository() print(try await execute(repo: repo)) } - func execute(repo: any AssetLibraries, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetLibraryRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let groups = try await repo.listPlacementGroups(placementType: placementType, feature: feature) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(groups, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift index b8b922a5..73c7d085 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetPlacementsCommand.swift @@ -41,11 +41,11 @@ struct AssetPlacementsList: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeAssetPlacements() + let repo = try ClientProvider.makeAssetPlacementRepository() print(try await execute(repo: repo)) } - func execute(repo: any AssetPlacements, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetPlacementRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let placements: [AssetPlacement] if let (surface, localizationId) = surface.selected { placements = try await repo.listPlacements( @@ -91,11 +91,11 @@ struct AssetPlacementsCreate: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeAssetPlacements() + let repo = try ClientProvider.makeAssetPlacementRepository() print(try await execute(repo: repo)) } - func execute(repo: any AssetPlacements, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetPlacementRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { guard let (surface, localizationId) = surface.selected else { throw ValidationError("Pass a localization") } let (mediaType, assetId): (AssetMediaType, String) = videoId.map { (.video, $0) } ?? (.image, imageId ?? "") let placement = try await repo.createPlacement( @@ -119,11 +119,11 @@ struct AssetPlacementsDelete: AsyncParsableCommand { var placementId: String func run() async throws { - let repo = try ClientProvider.makeAssetPlacements() + let repo = try ClientProvider.makeAssetPlacementRepository() try await execute(repo: repo) } - func execute(repo: any AssetPlacements) async throws { + func execute(repo: any AssetPlacementRepository) async throws { try await repo.deletePlacement(placementId: placementId) } } @@ -148,11 +148,11 @@ struct AssetPlacementsReorder: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeAssetPlacements() + let repo = try ClientProvider.makeAssetPlacementRepository() print(try await execute(repo: repo)) } - func execute(repo: any AssetPlacements, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any AssetPlacementRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let ids = placementIds.split(separator: ",").map { $0.trimmingCharacters(in: .whitespaces) }.filter { !$0.isEmpty } guard let (surface, localizationId) = surface.selected else { throw ValidationError("Pass a localization") } let placements = try await repo.reorderPlacements( diff --git a/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift b/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift index 89285d43..7fc08e2d 100644 --- a/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift +++ b/Sources/ASCCommand/Commands/AssetLibrary/AssetVideosCommand.swift @@ -31,11 +31,11 @@ struct AssetVideosList: AsyncParsableCommand { var category: AssetCategory? func run() async throws { - let repo = try ClientProvider.makeLibraryVideos() + let repo = try ClientProvider.makeLibraryVideoRepository() print(try await execute(repo: repo)) } - func execute(repo: any LibraryVideos, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any LibraryVideoRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let videos = try await repo.listVideos(libraryId: libraryId, videoId: videoId, state: state, category: category) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(videos, affordanceMode: affordanceMode) @@ -69,12 +69,12 @@ struct AssetVideosUpload: AsyncParsableCommand { var wait: Bool = false func run() async throws { - let repo = try ClientProvider.makeLibraryVideos() + let repo = try ClientProvider.makeLibraryVideoRepository() print(try await execute(repo: repo)) } func execute( - repo: any LibraryVideos, + repo: any LibraryVideoRepository, affordanceMode: AffordanceMode = .cli, sleep: @Sendable (UInt64) async throws -> Void = { try await Task.sleep(nanoseconds: $0) } ) async throws -> String { @@ -119,11 +119,11 @@ struct AssetVideosUpdate: AsyncParsableCommand { } func run() async throws { - let repo = try ClientProvider.makeLibraryVideos() + let repo = try ClientProvider.makeLibraryVideoRepository() print(try await execute(repo: repo)) } - func execute(repo: any LibraryVideos, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any LibraryVideoRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let video = try await repo.updateVideo(libraryId: libraryId, videoId: videoId, referenceName: referenceName, isArchived: archived) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([video], affordanceMode: affordanceMode) @@ -142,11 +142,11 @@ struct AssetVideosDelete: AsyncParsableCommand { var videoId: String func run() async throws { - let repo = try ClientProvider.makeLibraryVideos() + let repo = try ClientProvider.makeLibraryVideoRepository() try await execute(repo: repo) } - func execute(repo: any LibraryVideos) async throws { + func execute(repo: any LibraryVideoRepository) async throws { try await repo.deleteVideo(videoId: videoId) } } diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift index d89df7c1..8481708a 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsCreate.swift @@ -31,12 +31,12 @@ struct BetaAppLocalizationsCreate: AsyncParsableCommand { var tvOsPrivacyPolicy: String? func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizations() + let repo = try ClientProvider.makeBetaAppLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any BetaAppLocalizations, + repo: any BetaAppLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let update = BetaAppLocalizationUpdate( diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift index 36bbb68a..2162131f 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct BetaAppLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizations() + let repo = try ClientProvider.makeBetaAppLocalizationRepository() try await execute(repo: repo) } - func execute(repo: any BetaAppLocalizations) async throws { + func execute(repo: any BetaAppLocalizationRepository) async throws { try await repo.deleteBetaAppLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift index 84cbf6a2..11de68b9 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsGet.swift @@ -13,12 +13,12 @@ struct BetaAppLocalizationsGet: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizations() + let repo = try ClientProvider.makeBetaAppLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any BetaAppLocalizations, + repo: any BetaAppLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.getBetaAppLocalization(localizationId: localizationId) diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift index 1eb21201..5259cc6a 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsList.swift @@ -13,12 +13,12 @@ struct BetaAppLocalizationsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizations() + let repo = try ClientProvider.makeBetaAppLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any BetaAppLocalizations, + repo: any BetaAppLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listBetaAppLocalizations(appId: appId) diff --git a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift index b132fa74..89002b60 100644 --- a/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdate.swift @@ -28,12 +28,12 @@ struct BetaAppLocalizationsUpdate: AsyncParsableCommand { var tvOsPrivacyPolicy: String? func run() async throws { - let repo = try ClientProvider.makeBetaAppLocalizations() + let repo = try ClientProvider.makeBetaAppLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any BetaAppLocalizations, + repo: any BetaAppLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let update = BetaAppLocalizationUpdate( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift index a55f1821..647f46c9 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailGet.swift @@ -13,11 +13,11 @@ struct BetaReviewDetailGet: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppReviews() + let repo = try ClientProvider.makeBetaAppReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviews) async throws -> String { + func execute(repo: any BetaAppReviewRepository) async throws -> String { let detail = try await repo.getDetail(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift index 48c33946..fe5b7574 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewDetailUpdate.swift @@ -37,11 +37,11 @@ struct BetaReviewDetailUpdate: AsyncParsableCommand { var notes: String? func run() async throws { - let repo = try ClientProvider.makeBetaAppReviews() + let repo = try ClientProvider.makeBetaAppReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviews) async throws -> String { + func execute(repo: any BetaAppReviewRepository) async throws -> String { let update = ASCKit.BetaAppReviewDetailUpdate( contactFirstName: contactFirstName, contactLastName: contactLastName, diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift index 6839e273..1f1f62db 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsCreate.swift @@ -13,11 +13,11 @@ struct BetaReviewSubmissionsCreate: AsyncParsableCommand { var buildId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppReviews() + let repo = try ClientProvider.makeBetaAppReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviews) async throws -> String { + func execute(repo: any BetaAppReviewRepository) async throws -> String { let submission = try await repo.createSubmission(buildId: buildId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift index 3b351be9..9637cfcf 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsGet.swift @@ -13,11 +13,11 @@ struct BetaReviewSubmissionsGet: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppReviews() + let repo = try ClientProvider.makeBetaAppReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviews) async throws -> String { + func execute(repo: any BetaAppReviewRepository) async throws -> String { let submission = try await repo.getSubmission(id: submissionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift index c7871aeb..22002c43 100644 --- a/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift +++ b/Sources/ASCCommand/Commands/BetaReview/BetaReviewSubmissionsList.swift @@ -13,11 +13,11 @@ struct BetaReviewSubmissionsList: AsyncParsableCommand { var buildId: String func run() async throws { - let repo = try ClientProvider.makeBetaAppReviews() + let repo = try ClientProvider.makeBetaAppReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any BetaAppReviews) async throws -> String { + func execute(repo: any BetaAppReviewRepository) async throws -> String { let submissions = try await repo.listSubmissions(buildId: buildId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(submissions) diff --git a/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift b/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift index 1edf5a1d..32e88b12 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsAddBetaGroup.swift @@ -16,11 +16,11 @@ struct BuildsAddBetaGroup: AsyncParsableCommand { var betaGroupId: String func run() async throws { - let repo = try ClientProvider.makeBuilds() + let repo = try ClientProvider.makeBuildRepository() try await execute(repo: repo) } - func execute(repo: any Builds) async throws { + func execute(repo: any BuildRepository) async throws { try await repo.addBetaGroups(buildId: buildId, betaGroupIds: [betaGroupId]) } } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift b/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift index 18ed5533..5c3bf9b4 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsArchive.swift @@ -53,13 +53,13 @@ struct BuildsArchive: AsyncParsableCommand { func run() async throws { let runner = ClientProvider.makeXcodeBuildRunner() - let uploadRepo = upload ? try ClientProvider.makeBuildUploads() : nil + let uploadRepo = upload ? try ClientProvider.makeBuildUploadRepository() : nil print(try await execute(runner: runner, uploadRepo: uploadRepo)) } func execute( runner: any XcodeBuildRunner, - uploadRepo: (any BuildUploads)? = nil + uploadRepo: (any BuildUploadRepository)? = nil ) async throws -> String { // Resolve platform let resolvedPlatform: BuildUploadPlatform diff --git a/Sources/ASCCommand/Commands/Builds/BuildsList.swift b/Sources/ASCCommand/Commands/Builds/BuildsList.swift index 323c540c..015d5f21 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsList.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsList.swift @@ -22,11 +22,11 @@ struct BuildsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeBuilds() + let repo = try ClientProvider.makeBuildRepository() print(try await execute(repo: repo)) } - func execute(repo: any Builds, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any BuildRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let platformFilter = platform.flatMap { BuildUploadPlatform(cliArgument: $0) } let response = try await repo.listBuilds(appId: appId, platform: platformFilter, version: version, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift b/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift index d0eef3d4..5b3c42f1 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsNextNumber.swift @@ -19,11 +19,11 @@ struct BuildsNextNumber: AsyncParsableCommand { var platform: String func run() async throws { - let repo = try ClientProvider.makeBuilds() + let repo = try ClientProvider.makeBuildRepository() print(try await execute(repo: repo)) } - func execute(repo: any Builds) async throws -> String { + func execute(repo: any BuildRepository) async throws -> String { guard let platformValue = BuildUploadPlatform(cliArgument: platform) else { throw ValidationError("Invalid platform '\(platform)'. Use: ios, macos, tvos, visionos") } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift b/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift index c405e18d..58192ebc 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsRemoveBetaGroup.swift @@ -16,11 +16,11 @@ struct BuildsRemoveBetaGroup: AsyncParsableCommand { var betaGroupId: String func run() async throws { - let repo = try ClientProvider.makeBuilds() + let repo = try ClientProvider.makeBuildRepository() try await execute(repo: repo) } - func execute(repo: any Builds) async throws { + func execute(repo: any BuildRepository) async throws { try await repo.removeBetaGroups(buildId: buildId, betaGroupIds: [betaGroupId]) } } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift b/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift index c7462a99..f610c471 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsSetEncryptionCompliance.swift @@ -16,12 +16,12 @@ struct BuildsSetEncryptionCompliance: AsyncParsableCommand { var usesNonExemptEncryption: Bool func run() async throws { - let repo = try ClientProvider.makeBuilds() + let repo = try ClientProvider.makeBuildRepository() print(try await execute(repo: repo)) } func execute( - repo: any Builds, + repo: any BuildRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let build = try await repo.updateBuildEncryptionCompliance( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift b/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift index de131596..c0a0145c 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUpdateBetaNotes.swift @@ -19,11 +19,11 @@ struct BuildsUpdateBetaNotes: AsyncParsableCommand { var notes: String func run() async throws { - let repo = try ClientProvider.makeBetaBuildLocalizations() + let repo = try ClientProvider.makeBetaBuildLocalizationRepository() print(try await execute(repo: repo)) } - func execute(repo: any BetaBuildLocalizations) async throws -> String { + func execute(repo: any BetaBuildLocalizationRepository) async throws -> String { let loc = try await repo.upsertBetaBuildLocalization(buildId: buildId, locale: locale, whatsNew: notes) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift b/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift index 13952bcb..8fe67264 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUpload.swift @@ -29,11 +29,11 @@ struct BuildsUpload: AsyncParsableCommand { var wait: Bool = false func run() async throws { - let repo = try ClientProvider.makeBuildUploads() + let repo = try ClientProvider.makeBuildUploadRepository() print(try await execute(repo: repo)) } - func execute(repo: any BuildUploads) async throws -> String { + func execute(repo: any BuildUploadRepository) async throws -> String { let fileURL = URL(fileURLWithPath: file) let resolvedPlatform: BuildUploadPlatform @@ -66,7 +66,7 @@ struct BuildsUpload: AsyncParsableCommand { ) } - private func poll(uploadId: String, repo: any BuildUploads) async throws -> BuildUpload { + private func poll(uploadId: String, repo: any BuildUploadRepository) async throws -> BuildUpload { while true { let upload = try await repo.getBuildUpload(id: uploadId) if upload.state.hasFailed { diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift index 175051bf..e480fd02 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsDelete.swift @@ -13,11 +13,11 @@ struct BuildsUploadsDelete: AsyncParsableCommand { var uploadId: String func run() async throws { - let repo = try ClientProvider.makeBuildUploads() + let repo = try ClientProvider.makeBuildUploadRepository() try await execute(repo: repo) } - func execute(repo: any BuildUploads) async throws { + func execute(repo: any BuildUploadRepository) async throws { try await repo.deleteBuildUpload(id: uploadId) } } diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift index 73e3dd78..ee8117a0 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsGet.swift @@ -13,11 +13,11 @@ struct BuildsUploadsGet: AsyncParsableCommand { var uploadId: String func run() async throws { - let repo = try ClientProvider.makeBuildUploads() + let repo = try ClientProvider.makeBuildUploadRepository() print(try await execute(repo: repo)) } - func execute(repo: any BuildUploads) async throws -> String { + func execute(repo: any BuildUploadRepository) async throws -> String { let upload = try await repo.getBuildUpload(id: uploadId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift b/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift index fbd8b51a..23464f54 100644 --- a/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift +++ b/Sources/ASCCommand/Commands/Builds/BuildsUploadsList.swift @@ -13,11 +13,11 @@ struct BuildsUploadsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeBuildUploads() + let repo = try ClientProvider.makeBuildUploadRepository() print(try await execute(repo: repo)) } - func execute(repo: any BuildUploads) async throws -> String { + func execute(repo: any BuildUploadRepository) async throws -> String { let uploads = try await repo.listBuildUploads(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(uploads) diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift index 59ac7b1c..bcb71487 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsCreate.swift @@ -19,11 +19,11 @@ struct BundleIDsCreate: AsyncParsableCommand { var platform: String func run() async throws { - let repo = try ClientProvider.makeBundleIDs() + let repo = try ClientProvider.makeBundleIDRepository() print(try await execute(repo: repo)) } - func execute(repo: any BundleIDs) async throws -> String { + func execute(repo: any BundleIDRepository) async throws -> String { guard let domainPlatform = BundleIDPlatform(cliArgument: platform) else { throw ValidationError("Invalid platform '\(platform)'. Use ios, macos, or universal.") } diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift index 9bb782a7..53df1d4a 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsDelete.swift @@ -13,11 +13,11 @@ struct BundleIDsDelete: AsyncParsableCommand { var bundleIdId: String func run() async throws { - let repo = try ClientProvider.makeBundleIDs() + let repo = try ClientProvider.makeBundleIDRepository() try await execute(repo: repo) } - func execute(repo: any BundleIDs) async throws { + func execute(repo: any BundleIDRepository) async throws { try await repo.deleteBundleID(id: bundleIdId) } } diff --git a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift index 385896fa..88f94743 100644 --- a/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift +++ b/Sources/ASCCommand/Commands/BundleIDs/BundleIDsList.swift @@ -16,11 +16,11 @@ struct BundleIDsList: AsyncParsableCommand { var identifier: String? func run() async throws { - let repo = try ClientProvider.makeBundleIDs() + let repo = try ClientProvider.makeBundleIDRepository() print(try await execute(repo: repo)) } - func execute(repo: any BundleIDs, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any BundleIDRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let domainPlatform = platform.flatMap { BundleIDPlatform(cliArgument: $0) } let items = try await repo.listBundleIDs(platform: domainPlatform, identifier: identifier) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift index ede6f789..9c4908ce 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesCreate.swift @@ -20,11 +20,11 @@ struct CertificatesCreate: AsyncParsableCommand { var csrContent: String? func run() async throws { - let repo = try ClientProvider.makeCertificates() + let repo = try ClientProvider.makeCertificateRepository() print(try await execute(repo: repo)) } - func execute(repo: any Certificates) async throws -> String { + func execute(repo: any CertificateRepository) async throws -> String { guard let certType = CertificateType(rawValue: type.uppercased()) else { throw ValidationError("Invalid certificate type '\(type)'.") } diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift index ed60b9dd..01b01589 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesList.swift @@ -23,11 +23,11 @@ struct CertificatesList: AsyncParsableCommand { var before: String? func run() async throws { - let repo = try ClientProvider.makeCertificates() + let repo = try ClientProvider.makeCertificateRepository() print(try await execute(repo: repo)) } - func execute(repo: any Certificates, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any CertificateRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let certType = type.flatMap { CertificateType(rawValue: $0.uppercased()) } var items = try await repo.listCertificates(certificateType: certType, limit: limit) diff --git a/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift b/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift index bf83c6c0..dce7e140 100644 --- a/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift +++ b/Sources/ASCCommand/Commands/Certificates/CertificatesRevoke.swift @@ -13,11 +13,11 @@ struct CertificatesRevoke: AsyncParsableCommand { var certificateId: String func run() async throws { - let repo = try ClientProvider.makeCertificates() + let repo = try ClientProvider.makeCertificateRepository() try await execute(repo: repo) } - func execute(repo: any Certificates) async throws { + func execute(repo: any CertificateRepository) async throws { try await repo.revokeCertificate(id: certificateId) } } diff --git a/Sources/ASCCommand/Commands/Devices/DevicesList.swift b/Sources/ASCCommand/Commands/Devices/DevicesList.swift index 0e7e1d12..92b3a364 100644 --- a/Sources/ASCCommand/Commands/Devices/DevicesList.swift +++ b/Sources/ASCCommand/Commands/Devices/DevicesList.swift @@ -13,11 +13,11 @@ struct DevicesList: AsyncParsableCommand { var platform: String? func run() async throws { - let repo = try ClientProvider.makeDevices() + let repo = try ClientProvider.makeDeviceRepository() print(try await execute(repo: repo)) } - func execute(repo: any Devices, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any DeviceRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let domainPlatform = platform.flatMap { BundleIDPlatform(cliArgument: $0) } let items = try await repo.listDevices(platform: domainPlatform) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift b/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift index 05b5f647..f7e380c9 100644 --- a/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift +++ b/Sources/ASCCommand/Commands/Devices/DevicesRegister.swift @@ -19,11 +19,11 @@ struct DevicesRegister: AsyncParsableCommand { var platform: String func run() async throws { - let repo = try ClientProvider.makeDevices() + let repo = try ClientProvider.makeDeviceRepository() print(try await execute(repo: repo)) } - func execute(repo: any Devices) async throws -> String { + func execute(repo: any DeviceRepository) async throws -> String { guard let domainPlatform = BundleIDPlatform(cliArgument: platform) else { throw ValidationError("Invalid platform '\(platform)'. Use ios or macos.") } diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift index 74a17c94..0088dd49 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsCreate.swift @@ -16,12 +16,12 @@ struct ExperimentTreatmentLocalizationsCreate: AsyncParsableCommand { var locale: String func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let created = try await repo.createTreatmentLocalization(treatmentId: treatmentId, locale: locale) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift index 2cca4775..e6a1c079 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct ExperimentTreatmentLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() try await execute(repo: repo) } - func execute(repo: any Experiments) async throws { + func execute(repo: any ExperimentRepository) async throws { try await repo.deleteTreatmentLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift index ff5a7450..35e84b78 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentLocalizationsList.swift @@ -16,12 +16,12 @@ struct ExperimentTreatmentLocalizationsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listTreatmentLocalizations(treatmentId: treatmentId, limit: limit) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift index 2b647ed1..71a47135 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsCreate.swift @@ -19,12 +19,12 @@ struct ExperimentTreatmentsCreate: AsyncParsableCommand { var appIconName: String? func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let created = try await repo.createTreatment(experimentId: experimentId, name: name, appIconName: appIconName) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift index 5e2b6bd7..403a2a04 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsDelete.swift @@ -13,11 +13,11 @@ struct ExperimentTreatmentsDelete: AsyncParsableCommand { var treatmentId: String func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() try await execute(repo: repo) } - func execute(repo: any Experiments) async throws { + func execute(repo: any ExperimentRepository) async throws { try await repo.deleteTreatment(treatmentId: treatmentId) } } diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift index 25f67950..e39f2458 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsList.swift @@ -16,12 +16,12 @@ struct ExperimentTreatmentsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listTreatments(experimentId: experimentId, limit: limit) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift index 93c255b6..346da740 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentTreatmentsUpdate.swift @@ -19,12 +19,12 @@ struct ExperimentTreatmentsUpdate: AsyncParsableCommand { var appIconName: String? func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard name != nil || appIconName != nil else { diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift index c60e9192..5d9e4faa 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsCreate.swift @@ -22,12 +22,12 @@ struct ExperimentsCreate: AsyncParsableCommand { var trafficProportion: Int func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard let appStorePlatform = AppStorePlatform(cliArgument: platform) else { diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift index 8abf0889..bbbba8dd 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsDelete.swift @@ -13,11 +13,11 @@ struct ExperimentsDelete: AsyncParsableCommand { var experimentId: String func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() try await execute(repo: repo) } - func execute(repo: any Experiments) async throws { + func execute(repo: any ExperimentRepository) async throws { try await repo.deleteExperiment(experimentId: experimentId) } } diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift index a8d7b3f1..41fad093 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsGet.swift @@ -13,12 +13,12 @@ struct ExperimentsGet: AsyncParsableCommand { var experimentId: String func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let experiment = try await repo.getExperiment(experimentId: experimentId) diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift index a7b80250..dcd28eb8 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsList.swift @@ -19,12 +19,12 @@ struct ExperimentsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { var stateFilter: AppStoreVersionExperimentState? diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift index 3971c0ff..0fe823c2 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsStart.swift @@ -13,12 +13,12 @@ struct ExperimentsStart: AsyncParsableCommand { var experimentId: String func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let updated = try await repo.updateExperiment( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift index 58a44623..59596f0e 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsStop.swift @@ -13,12 +13,12 @@ struct ExperimentsStop: AsyncParsableCommand { var experimentId: String func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let updated = try await repo.updateExperiment( diff --git a/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift b/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift index 963bf412..f462291d 100644 --- a/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift +++ b/Sources/ASCCommand/Commands/Experiments/ExperimentsUpdate.swift @@ -19,12 +19,12 @@ struct ExperimentsUpdate: AsyncParsableCommand { var trafficProportion: Int? func run() async throws { - let repo = try ClientProvider.makeExperiments() + let repo = try ClientProvider.makeExperimentRepository() print(try await execute(repo: repo)) } func execute( - repo: any Experiments, + repo: any ExperimentRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard name != nil || trafficProportion != nil else { diff --git a/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift b/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift index 1efecd6f..21c9e372 100644 --- a/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift +++ b/Sources/ASCCommand/Commands/GameCenter/GameCenterCommand.swift @@ -40,11 +40,11 @@ struct GameCenterDetailGet: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeGameCenter() + let repo = try ClientProvider.makeGameCenterRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenter, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let detail = try await repo.getDetail(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([detail], affordanceMode: affordanceMode) @@ -77,11 +77,11 @@ struct GameCenterAchievementsList: AsyncParsableCommand { var detailId: String func run() async throws { - let repo = try ClientProvider.makeGameCenter() + let repo = try ClientProvider.makeGameCenterRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenter) async throws -> String { + func execute(repo: any GameCenterRepository) async throws -> String { let items = try await repo.listAchievements(gameCenterDetailId: detailId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -119,11 +119,11 @@ struct GameCenterAchievementsCreate: AsyncParsableCommand { var repeatable: Bool = false func run() async throws { - let repo = try ClientProvider.makeGameCenter() + let repo = try ClientProvider.makeGameCenterRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenter) async throws -> String { + func execute(repo: any GameCenterRepository) async throws -> String { let item = try await repo.createAchievement( gameCenterDetailId: detailId, referenceName: referenceName, @@ -153,11 +153,11 @@ struct GameCenterAchievementsDelete: AsyncParsableCommand { var achievementId: String func run() async throws { - let repo = try ClientProvider.makeGameCenter() + let repo = try ClientProvider.makeGameCenterRepository() try await execute(repo: repo) } - func execute(repo: any GameCenter) async throws { + func execute(repo: any GameCenterRepository) async throws { try await repo.deleteAchievement(id: achievementId) } } @@ -188,11 +188,11 @@ struct GameCenterLeaderboardsList: AsyncParsableCommand { var detailId: String func run() async throws { - let repo = try ClientProvider.makeGameCenter() + let repo = try ClientProvider.makeGameCenterRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenter, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = try await repo.listLeaderboards(gameCenterDetailId: detailId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -223,11 +223,11 @@ struct GameCenterLeaderboardsCreate: AsyncParsableCommand { var submissionType: String = "BEST_SCORE" func run() async throws { - let repo = try ClientProvider.makeGameCenter() + let repo = try ClientProvider.makeGameCenterRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenter) async throws -> String { + func execute(repo: any GameCenterRepository) async throws -> String { guard let sortType = ScoreSortType(rawValue: scoreSortType.uppercased()) else { throw ValidationError("Invalid --score-sort-type '\(scoreSortType)'. Use: ASC or DESC") } @@ -262,11 +262,11 @@ struct GameCenterLeaderboardsDelete: AsyncParsableCommand { var leaderboardId: String func run() async throws { - let repo = try ClientProvider.makeGameCenter() + let repo = try ClientProvider.makeGameCenterRepository() try await execute(repo: repo) } - func execute(repo: any GameCenter) async throws { + func execute(repo: any GameCenterRepository) async throws { try await repo.deleteLeaderboard(id: leaderboardId) } } diff --git a/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift b/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift index b4e6c90e..97d637a0 100644 --- a/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift +++ b/Sources/ASCCommand/Commands/GameCenter/GameCenterModerationCommand.swift @@ -30,11 +30,11 @@ struct GameCenterScoreModerationsList: AsyncParsableCommand { var blockedOnly: Bool = false func run() async throws { - let repo = try ClientProvider.makeGameCenterModeration() + let repo = try ClientProvider.makeGameCenterModerationRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = try await repo.listScoreModerations(leaderboardId: leaderboardId, blockedOnly: blockedOnly) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -53,11 +53,11 @@ struct GameCenterScoreModerationsBlock: AsyncParsableCommand { var moderationId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModeration() + let repo = try ClientProvider.makeGameCenterModerationRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = [try await repo.updateScoreModeration(id: moderationId, isBlocked: true)] let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -76,11 +76,11 @@ struct GameCenterScoreModerationsUnblock: AsyncParsableCommand { var moderationId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModeration() + let repo = try ClientProvider.makeGameCenterModerationRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = [try await repo.updateScoreModeration(id: moderationId, isBlocked: false)] let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -109,11 +109,11 @@ struct GameCenterBlockedPlayersList: AsyncParsableCommand { var detailId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModeration() + let repo = try ClientProvider.makeGameCenterModerationRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = try await repo.listBlockedPlayers(gameCenterDetailId: detailId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -142,11 +142,11 @@ struct GameCenterPlayersBlock: AsyncParsableCommand { var playerId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModeration() + let repo = try ClientProvider.makeGameCenterModerationRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = [try await repo.updatePlayer(id: playerId, isBlocked: true)] let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) @@ -165,11 +165,11 @@ struct GameCenterPlayersUnblock: AsyncParsableCommand { var playerId: String func run() async throws { - let repo = try ClientProvider.makeGameCenterModeration() + let repo = try ClientProvider.makeGameCenterModerationRepository() print(try await execute(repo: repo)) } - func execute(repo: any GameCenterModeration, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any GameCenterModerationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let items = [try await repo.updatePlayer(id: playerId, isBlocked: false)] let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift index a6bc2ceb..e17aa1e4 100644 --- a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityCreate.swift @@ -19,12 +19,12 @@ struct IAPAvailabilityCreate: AsyncParsableCommand { var territory: [String] = [] func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseAvailabilities() + let repo = try ClientProvider.makeInAppPurchaseAvailabilityRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseAvailabilities, + repo: any InAppPurchaseAvailabilityRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let availability = try await repo.createAvailability( diff --git a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift index 9f28398f..4181fa8e 100644 --- a/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/IAP/Availability/IAPAvailabilityGet.swift @@ -13,12 +13,12 @@ struct IAPAvailabilityGet: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseAvailabilities() + let repo = try ClientProvider.makeInAppPurchaseAvailabilityRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseAvailabilities, + repo: any InAppPurchaseAvailabilityRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let availability = try await repo.getAvailability(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAP/IAPCreate.swift b/Sources/ASCCommand/Commands/IAP/IAPCreate.swift index 6fe33897..d528a5d6 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPCreate.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPCreate.swift @@ -22,11 +22,11 @@ struct IAPCreate: AsyncParsableCommand { var type: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchases() + let repo = try ClientProvider.makeInAppPurchaseRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchases) async throws -> String { + func execute(repo: any InAppPurchaseRepository) async throws -> String { guard let iapType = InAppPurchaseType(cliArgument: type) else { throw ValidationError("Invalid type '\(type)'. Use: consumable, non-consumable, non-renewing-subscription") } diff --git a/Sources/ASCCommand/Commands/IAP/IAPDelete.swift b/Sources/ASCCommand/Commands/IAP/IAPDelete.swift index a877510f..448f09e7 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPDelete.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPDelete.swift @@ -13,11 +13,11 @@ struct IAPDelete: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchases() + let repo = try ClientProvider.makeInAppPurchaseRepository() try await execute(repo: repo) } - func execute(repo: any InAppPurchases) async throws { + func execute(repo: any InAppPurchaseRepository) async throws { try await repo.deleteInAppPurchase(iapId: iapId) } } diff --git a/Sources/ASCCommand/Commands/IAP/IAPList.swift b/Sources/ASCCommand/Commands/IAP/IAPList.swift index 93731e9a..d93ae9e8 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPList.swift @@ -16,11 +16,11 @@ struct IAPList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeInAppPurchases() + let repo = try ClientProvider.makeInAppPurchaseRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchases, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any InAppPurchaseRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let response = try await repo.listInAppPurchases(appId: appId, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift b/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift index 3f53c34b..02874deb 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPPricePointsList.swift @@ -22,12 +22,12 @@ struct IAPPricePointsList: AsyncParsableCommand { var cursor: String? func run() async throws { - let repo = try ClientProvider.makeInAppPurchasePrices() + let repo = try ClientProvider.makeInAppPurchasePriceRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchasePrices, + repo: any InAppPurchasePriceRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listPricePoints( diff --git a/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift b/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift index 9ca40b01..42c9cf7b 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPPricesSet.swift @@ -19,11 +19,11 @@ struct IAPPricesSet: AsyncParsableCommand { var pricePointId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchasePrices() + let repo = try ClientProvider.makeInAppPurchasePriceRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchasePrices) async throws -> String { + func execute(repo: any InAppPurchasePriceRepository) async throws -> String { let schedule = try await repo.setPriceSchedule( iapId: iapId, baseTerritory: baseTerritory, diff --git a/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift b/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift index 73cf0703..4989d987 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPUpdate.swift @@ -25,11 +25,11 @@ struct IAPUpdate: AsyncParsableCommand { var notFamilySharable: Bool = false func run() async throws { - let repo = try ClientProvider.makeInAppPurchases() + let repo = try ClientProvider.makeInAppPurchaseRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchases) async throws -> String { + func execute(repo: any InAppPurchaseRepository) async throws -> String { let isFamilySharable: Bool? = familySharable ? true : (notFamilySharable ? false : nil) let item = try await repo.updateInAppPurchase( iapId: iapId, diff --git a/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift b/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift index 9f337261..764ba9a4 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPVersionsList.swift @@ -13,12 +13,12 @@ struct IAPVersionsList: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeProductVersions() + let repo = try ClientProvider.makeProductVersionRepository() print(try await execute(repo: repo)) } func execute( - repo: any ProductVersions, + repo: any ProductVersionRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let versions = try await repo.listInAppPurchaseVersions(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift b/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift index 032ebe6c..8ad5aacd 100644 --- a/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift +++ b/Sources/ASCCommand/Commands/IAPEqualizations/IAPEqualizationsList.swift @@ -16,12 +16,12 @@ struct IAPEqualizationsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeInAppPurchasePrices() + let repo = try ClientProvider.makeInAppPurchasePriceRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchasePrices, + repo: any InAppPurchasePriceRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listEqualizations(pricePointId: pricePointId, limit: limit) diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift index 6f574e5c..5a3d444d 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesDelete.swift @@ -13,11 +13,11 @@ struct IAPImagesDelete: AsyncParsableCommand { var imageId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewAssets() + let repo = try ClientProvider.makeInAppPurchaseReviewRepository() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseReviewAssets) async throws { + func execute(repo: any InAppPurchaseReviewRepository) async throws { try await repo.deleteImage(imageId: imageId) } } diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift index e3017df2..e74006cb 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesList.swift @@ -13,12 +13,12 @@ struct IAPImagesList: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewAssets() + let repo = try ClientProvider.makeInAppPurchaseReviewRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseReviewAssets, + repo: any InAppPurchaseReviewRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listImages(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift b/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift index 71b8189d..8c46a8da 100644 --- a/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift +++ b/Sources/ASCCommand/Commands/IAPImages/IAPImagesUpload.swift @@ -17,12 +17,12 @@ struct IAPImagesUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewAssets() + let repo = try ClientProvider.makeInAppPurchaseReviewRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseReviewAssets, + repo: any InAppPurchaseReviewRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let url = URL(fileURLWithPath: file) diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift index 7606dadc..c5a54112 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsCreate.swift @@ -22,11 +22,11 @@ struct IAPLocalizationsCreate: AsyncParsableCommand { var description: String? func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseLocalizations() + let repo = try ClientProvider.makeInAppPurchaseLocalizationRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseLocalizations) async throws -> String { + func execute(repo: any InAppPurchaseLocalizationRepository) async throws -> String { let item = try await repo.createLocalization( iapId: iapId, locale: locale, diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift index 0836feae..bf1d8db6 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct IAPLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseLocalizations() + let repo = try ClientProvider.makeInAppPurchaseLocalizationRepository() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseLocalizations) async throws { + func execute(repo: any InAppPurchaseLocalizationRepository) async throws { try await repo.deleteLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift index dfa10287..12dd6ee6 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsList.swift @@ -13,12 +13,12 @@ struct IAPLocalizationsList: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseLocalizations() + let repo = try ClientProvider.makeInAppPurchaseLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseLocalizations, + repo: any InAppPurchaseLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listLocalizations(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift index ca9d2cd9..c4f59e64 100644 --- a/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPLocalizations/IAPLocalizationsUpdate.swift @@ -19,11 +19,11 @@ struct IAPLocalizationsUpdate: AsyncParsableCommand { var description: String? func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseLocalizations() + let repo = try ClientProvider.makeInAppPurchaseLocalizationRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseLocalizations) async throws -> String { + func execute(repo: any InAppPurchaseLocalizationRepository) async throws -> String { let item = try await repo.updateLocalization( localizationId: localizationId, name: name, diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift index d576d4cb..d579b54b 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreate.swift @@ -22,11 +22,11 @@ struct IAPOfferCodeCustomCodesCreate: AsyncParsableCommand { var expirationDate: String? func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { let item = try await repo.createCustomCode( offerCodeId: offerCodeId, customCode: customCode, diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift index f41708b7..7ab74073 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesList.swift @@ -13,11 +13,11 @@ struct IAPOfferCodeCustomCodesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { let items = try await repo.listCustomCodes(offerCodeId: offerCodeId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items) diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift index a2bd0bec..89e44883 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdate.swift @@ -16,11 +16,11 @@ struct IAPOfferCodeCustomCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { guard let isActive = Bool(active) else { throw ValidationError("Invalid value '\(active)' for --active. Use: true, false") } diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift index 7c2af3e5..b1b752b6 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreate.swift @@ -32,12 +32,12 @@ struct IAPOfferCodeOneTimeCodesCreate: AsyncParsableCommand { var environment: OfferCodeEnvironment = .production func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodes, + repo: any InAppPurchaseOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.createOneTimeUseCode( diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift index ebf6b411..503d2848 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesList.swift @@ -13,12 +13,12 @@ struct IAPOfferCodeOneTimeCodesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodes, + repo: any InAppPurchaseOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listOneTimeUseCodes(offerCodeId: offerCodeId) diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift index 8b58e3d9..3d11201e 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdate.swift @@ -16,12 +16,12 @@ struct IAPOfferCodeOneTimeCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodes, + repo: any InAppPurchaseOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard let isActive = Bool(active) else { diff --git a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift index eb302a2a..a5a2e6d5 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValues.swift @@ -13,11 +13,11 @@ struct IAPOfferCodeOneTimeCodesValues: AsyncParsableCommand { var oneTimeCodeId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { try await repo.fetchOneTimeUseCodeValues(oneTimeCodeId: oneTimeCodeId) } } diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift index d6664dc1..b1932b14 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesCreate.swift @@ -31,12 +31,12 @@ struct IAPOfferCodesCreate: AsyncParsableCommand { var freeTerritory: [String] = [] func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodes, + repo: any InAppPurchaseOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { var customerEligibilities: [IAPCustomerEligibility] = [] diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift index ed06231f..36b30481 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesList.swift @@ -13,12 +13,12 @@ struct IAPOfferCodesList: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodes, + repo: any InAppPurchaseOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listOfferCodes(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift index 2474354f..801a9e95 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesPricesList.swift @@ -13,12 +13,12 @@ struct IAPOfferCodesPricesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseOfferCodes, + repo: any InAppPurchaseOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPrices(offerCodeId: offerCodeId) diff --git a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift index 98554e32..48af2c55 100644 --- a/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/IAPOfferCodes/IAPOfferCodesUpdate.swift @@ -16,11 +16,11 @@ struct IAPOfferCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseOfferCodes() + let repo = try ClientProvider.makeInAppPurchaseOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseOfferCodes) async throws -> String { + func execute(repo: any InAppPurchaseOfferCodeRepository) async throws -> String { guard let isActive = Bool(active) else { throw ValidationError("Invalid value '\(active)' for --active. Use: true, false") } diff --git a/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift b/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift index c3c32e1f..e19fea02 100644 --- a/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift +++ b/Sources/ASCCommand/Commands/IAPPriceSchedule/IAPPriceScheduleGet.swift @@ -13,12 +13,12 @@ struct IAPPriceScheduleGet: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchasePrices() + let repo = try ClientProvider.makeInAppPurchasePriceRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchasePrices, + repo: any InAppPurchasePriceRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let schedule = try await repo.getPriceSchedule(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift index e14f45c2..e0c20362 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotDelete.swift @@ -13,11 +13,11 @@ struct IAPReviewScreenshotDelete: AsyncParsableCommand { var screenshotId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewAssets() + let repo = try ClientProvider.makeInAppPurchaseReviewRepository() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseReviewAssets) async throws { + func execute(repo: any InAppPurchaseReviewRepository) async throws { try await repo.deleteReviewScreenshot(screenshotId: screenshotId) } } diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift index 5c6029d0..9a1aa19f 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotGet.swift @@ -13,12 +13,12 @@ struct IAPReviewScreenshotGet: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewAssets() + let repo = try ClientProvider.makeInAppPurchaseReviewRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseReviewAssets, + repo: any InAppPurchaseReviewRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.getReviewScreenshot(iapId: iapId) diff --git a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift index bc97a18c..be6b84fa 100644 --- a/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift +++ b/Sources/ASCCommand/Commands/IAPReviewScreenshot/IAPReviewScreenshotUpload.swift @@ -17,12 +17,12 @@ struct IAPReviewScreenshotUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseReviewAssets() + let repo = try ClientProvider.makeInAppPurchaseReviewRepository() print(try await execute(repo: repo)) } func execute( - repo: any InAppPurchaseReviewAssets, + repo: any InAppPurchaseReviewRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let url = URL(fileURLWithPath: file) diff --git a/Sources/ASCCommand/Commands/Init/InitCommand.swift b/Sources/ASCCommand/Commands/Init/InitCommand.swift index 127c81c6..16c220dd 100644 --- a/Sources/ASCCommand/Commands/Init/InitCommand.swift +++ b/Sources/ASCCommand/Commands/Init/InitCommand.swift @@ -29,13 +29,13 @@ struct InitCommand: AsyncParsableCommand { var contactEmail: String? func run() async throws { - let repo = try ClientProvider.makeApps() + let repo = try ClientProvider.makeAppRepository() let storage = ClientProvider.makeProjectConfigStorage() print(try await execute(repo: repo, storage: storage)) } func execute( - repo: any Apps, + repo: any AppRepository, storage: any ProjectConfigStorage, bundleIdScanner: (String) -> [String] = { XcodeProjectScanner.scan(directory: $0) } ) async throws -> String { diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift index 974e260e..09a7c413 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogin.swift @@ -23,7 +23,7 @@ struct IrisAuthLogin: AsyncParsableCommand { let resolvedPassword = try password ?? promptForPassword() let creds = IrisAuthCredentials(appleId: appleId, password: resolvedPassword) let authRepo = ClientProvider.makeIrisSignIn() - let sessionRepo = ClientProvider.makeIrisSessions() + let sessionRepo = ClientProvider.makeIrisSessionRepository() let pendingURL = ClientProvider.pendingTwoFactorURL() let codePrompt: (() throws -> String)? if interactive { @@ -40,7 +40,7 @@ struct IrisAuthLogin: AsyncParsableCommand { func execute( credentials: IrisAuthCredentials, authRepo: any IrisSignIn, - sessionRepo: any IrisSessions, + sessionRepo: any IrisSessionRepository, pendingURL: URL, interactivePromptForCode: (() throws -> String)? = nil, affordanceMode: AffordanceMode = .cli diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift index d8ab9177..fa8e452a 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthLogout.swift @@ -11,7 +11,7 @@ struct IrisAuthLogout: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let sessionRepo = ClientProvider.makeIrisSessions() + let sessionRepo = ClientProvider.makeIrisSessionRepository() let pendingURL = ClientProvider.pendingTwoFactorURL() try sessionRepo.delete() try? FileManager.default.removeItem(at: pendingURL) diff --git a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift index 5633e146..6207dd0d 100644 --- a/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift +++ b/Sources/ASCCommand/Commands/Iris/Auth/IrisAuthVerifyCode.swift @@ -15,7 +15,7 @@ struct IrisAuthVerifyCode: AsyncParsableCommand { func run() async throws { let authRepo = ClientProvider.makeIrisSignIn() - let sessionRepo = ClientProvider.makeIrisSessions() + let sessionRepo = ClientProvider.makeIrisSessionRepository() let pendingURL = ClientProvider.pendingTwoFactorURL() print(try await execute(code: code, authRepo: authRepo, sessionRepo: sessionRepo, pendingURL: pendingURL)) } @@ -23,7 +23,7 @@ struct IrisAuthVerifyCode: AsyncParsableCommand { func execute( code: String, authRepo: any IrisSignIn, - sessionRepo: any IrisSessions, + sessionRepo: any IrisSessionRepository, pendingURL: URL, affordanceMode: AffordanceMode = .cli ) async throws -> String { diff --git a/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift b/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift index aefd933c..41865a76 100644 --- a/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift +++ b/Sources/ASCCommand/Commands/Iris/IrisAppsCreate.swift @@ -29,13 +29,13 @@ struct IrisAppsCreate: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisAppBundles() + let repo = ClientProvider.makeIrisAppBundleRepository() print(try await execute(cookieProvider: cookieProvider, repo: repo)) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisAppBundles + repo: any IrisAppBundleRepository ) async throws -> String { let session = try cookieProvider.resolveSession() let app = try await repo.createApp( diff --git a/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift b/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift index 4cee899e..bb06ee14 100644 --- a/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift +++ b/Sources/ASCCommand/Commands/Iris/IrisAppsList.swift @@ -11,13 +11,13 @@ struct IrisAppsList: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisAppBundles() + let repo = ClientProvider.makeIrisAppBundleRepository() print(try await execute(cookieProvider: cookieProvider, repo: repo)) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisAppBundles + repo: any IrisAppBundleRepository ) async throws -> String { let session = try cookieProvider.resolveSession() let apps = try await repo.listAppBundles(session: session) diff --git a/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift b/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift index 70df3d7c..171625bd 100644 --- a/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift +++ b/Sources/ASCCommand/Commands/Iris/ResolutionCenter/IrisResolutionCenterGet.swift @@ -25,13 +25,13 @@ struct IrisResolutionCenterGet: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisResolutionCenter() + let repo = ClientProvider.makeIrisResolutionCenterRepository() print(try await execute(cookieProvider: cookieProvider, repo: repo)) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisResolutionCenter, + repo: any IrisResolutionCenterRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let session = try cookieProvider.resolveSession() diff --git a/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift b/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift index 487e6dbb..8f6fa34f 100644 --- a/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/DiagnosticLogsCommand.swift @@ -22,11 +22,11 @@ struct DiagnosticLogsList: AsyncParsableCommand { var signatureId: String func run() async throws { - let repo = try ClientProvider.makeDiagnostics() + let repo = try ClientProvider.makeDiagnosticsRepository() print(try await execute(repo: repo)) } - func execute(repo: any Diagnostics, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any DiagnosticsRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let logs = try await repo.listLogs(signatureId: signatureId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(logs, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift b/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift index 5fbbe9f3..2ec66f0c 100644 --- a/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/DiagnosticsCommand.swift @@ -25,11 +25,11 @@ struct DiagnosticsList: AsyncParsableCommand { var diagnosticType: String? func run() async throws { - let repo = try ClientProvider.makeDiagnostics() + let repo = try ClientProvider.makeDiagnosticsRepository() print(try await execute(repo: repo)) } - func execute(repo: any Diagnostics, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any DiagnosticsRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let filter = diagnosticType.flatMap { DiagnosticType(rawValue: $0) } let signatures = try await repo.listSignatures(buildId: buildId, diagnosticType: filter) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift b/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift index 0de26f82..c2a68dcc 100644 --- a/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/PerfMetricsCommand.swift @@ -28,11 +28,11 @@ struct PerfMetricsList: AsyncParsableCommand { var metricType: String? func run() async throws { - let repo = try ClientProvider.makePerfMetrics() + let repo = try ClientProvider.makePerfMetricsRepository() print(try await execute(repo: repo)) } - func execute(repo: any PerfMetrics, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any PerfMetricsRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let filter = metricType.flatMap { PerformanceMetricCategory(rawValue: $0) } let metrics: [PerformanceMetric] diff --git a/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift b/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift index 72acfcde..a13c3fe3 100644 --- a/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift +++ b/Sources/ASCCommand/Commands/Performance/PerfOverviewCommand.swift @@ -25,11 +25,11 @@ struct PerfOverviewGet: AsyncParsableCommand { var deviceType: String? func run() async throws { - let repo = try ClientProvider.makePerfOverviews() + let repo = try ClientProvider.makePerfOverviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any PerfOverviews, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any PerfOverviewRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let overview = try await repo.getOverview(appId: appId, deviceType: deviceType) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([overview], affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift index 63008220..ac17f210 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesCreate.swift @@ -33,11 +33,11 @@ struct ProfilesCreate: AsyncParsableCommand { var deviceIds: [String] = [] func run() async throws { - let repo = try ClientProvider.makeProfiles() + let repo = try ClientProvider.makeProfileRepository() print(try await execute(repo: repo)) } - func execute(repo: any Profiles) async throws -> String { + func execute(repo: any ProfileRepository) async throws -> String { guard let profileType = ProfileType(rawValue: type.uppercased()) else { throw ValidationError("Invalid profile type '\(type)'.") } diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift index 035a78cc..2e65537c 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesDelete.swift @@ -13,11 +13,11 @@ struct ProfilesDelete: AsyncParsableCommand { var profileId: String func run() async throws { - let repo = try ClientProvider.makeProfiles() + let repo = try ClientProvider.makeProfileRepository() try await execute(repo: repo) } - func execute(repo: any Profiles) async throws { + func execute(repo: any ProfileRepository) async throws { try await repo.deleteProfile(id: profileId) } } diff --git a/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift b/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift index 081a0b4e..7168cb60 100644 --- a/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift +++ b/Sources/ASCCommand/Commands/Profiles/ProfilesList.swift @@ -16,11 +16,11 @@ struct ProfilesList: AsyncParsableCommand { var type: String? func run() async throws { - let repo = try ClientProvider.makeProfiles() + let repo = try ClientProvider.makeProfileRepository() print(try await execute(repo: repo)) } - func execute(repo: any Profiles, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any ProfileRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let profileType = type.flatMap { ProfileType(rawValue: $0.uppercased()) } let items = try await repo.listProfiles(bundleIdId: bundleIdId, profileType: profileType) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift index ff57a533..334c360d 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesCreate.swift @@ -31,11 +31,11 @@ struct PromotedPurchasesCreate: AsyncParsableCommand { var disabled: Bool = false func run() async throws { - let repo = try ClientProvider.makePromotedPurchases() + let repo = try ClientProvider.makePromotedPurchaseRepository() print(try await execute(repo: repo)) } - func execute(repo: any PromotedPurchases) async throws -> String { + func execute(repo: any PromotedPurchaseRepository) async throws -> String { guard iapId != nil || subscriptionId != nil else { throw ValidationError("Either --iap-id or --subscription-id is required") } diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift index 4a051539..ddcc7c1b 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesDelete.swift @@ -13,11 +13,11 @@ struct PromotedPurchasesDelete: AsyncParsableCommand { var promotedId: String func run() async throws { - let repo = try ClientProvider.makePromotedPurchases() + let repo = try ClientProvider.makePromotedPurchaseRepository() try await execute(repo: repo) } - func execute(repo: any PromotedPurchases) async throws { + func execute(repo: any PromotedPurchaseRepository) async throws { try await repo.deletePromotedPurchase(promotedId: promotedId) } } diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift index 9643e7b6..8a2453c3 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesList.swift @@ -16,12 +16,12 @@ struct PromotedPurchasesList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makePromotedPurchases() + let repo = try ClientProvider.makePromotedPurchaseRepository() print(try await execute(repo: repo)) } func execute( - repo: any PromotedPurchases, + repo: any PromotedPurchaseRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listPromotedPurchases(appId: appId, limit: limit) diff --git a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift index 048327d6..c531f309 100644 --- a/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift +++ b/Sources/ASCCommand/Commands/PromotedPurchases/PromotedPurchasesUpdate.swift @@ -25,11 +25,11 @@ struct PromotedPurchasesUpdate: AsyncParsableCommand { var disabled: Bool = false func run() async throws { - let repo = try ClientProvider.makePromotedPurchases() + let repo = try ClientProvider.makePromotedPurchaseRepository() print(try await execute(repo: repo)) } - func execute(repo: any PromotedPurchases) async throws -> String { + func execute(repo: any PromotedPurchaseRepository) async throws -> String { let isVisible: Bool? = visible ? true : (hidden ? false : nil) let isEnabled: Bool? = enabled ? true : (disabled ? false : nil) diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift index 309442da..9f69b085 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesCreate.swift @@ -16,11 +16,11 @@ struct ReviewResponsesCreate: AsyncParsableCommand { var responseBody: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviews() + let repo = try ClientProvider.makeCustomerReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any CustomerReviews) async throws -> String { + func execute(repo: any CustomerReviewRepository) async throws -> String { let response = try await repo.createResponse(reviewId: reviewId, responseBody: responseBody) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift index 0ee2963a..c523a9d0 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesDelete.swift @@ -13,11 +13,11 @@ struct ReviewResponsesDelete: AsyncParsableCommand { var responseId: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviews() + let repo = try ClientProvider.makeCustomerReviewRepository() try await execute(repo: repo) } - func execute(repo: any CustomerReviews) async throws { + func execute(repo: any CustomerReviewRepository) async throws { try await repo.deleteResponse(responseId: responseId) } } diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift index e5f2cea6..6777b0a4 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewResponsesGet.swift @@ -13,11 +13,11 @@ struct ReviewResponsesGet: AsyncParsableCommand { var reviewId: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviews() + let repo = try ClientProvider.makeCustomerReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any CustomerReviews) async throws -> String { + func execute(repo: any CustomerReviewRepository) async throws -> String { let response = try await repo.getResponse(reviewId: reviewId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift b/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift index 0cce8d92..a0072370 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewsGet.swift @@ -13,11 +13,11 @@ struct ReviewsGet: AsyncParsableCommand { var reviewId: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviews() + let repo = try ClientProvider.makeCustomerReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any CustomerReviews) async throws -> String { + func execute(repo: any CustomerReviewRepository) async throws -> String { let review = try await repo.getReview(reviewId: reviewId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift b/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift index d8718903..59accf88 100644 --- a/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift +++ b/Sources/ASCCommand/Commands/Reviews/ReviewsList.swift @@ -13,11 +13,11 @@ struct ReviewsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeCustomerReviews() + let repo = try ClientProvider.makeCustomerReviewRepository() print(try await execute(repo: repo)) } - func execute(repo: any CustomerReviews, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any CustomerReviewRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let reviews = try await repo.listReviews(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(reviews, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift index 85ecd04a..7546d7d7 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCommand.swift @@ -21,11 +21,11 @@ struct ScreenshotSetsList: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeAppScreenshots() + let repo = try ClientProvider.makeScreenshotRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppScreenshots) async throws -> String { + func execute(repo: any ScreenshotRepository) async throws -> String { let sets = try await repo.listScreenshotSets(localizationId: localizationId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift index a781fb00..d474b58b 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsCreate.swift @@ -16,11 +16,11 @@ struct ScreenshotSetsCreate: AsyncParsableCommand { var displayType: String func run() async throws { - let repo = try ClientProvider.makeAppScreenshots() + let repo = try ClientProvider.makeScreenshotRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppScreenshots) async throws -> String { + func execute(repo: any ScreenshotRepository) async throws -> String { guard let screenshotDisplayType = ScreenshotDisplayType(rawValue: displayType) else { throw ValidationError("Unknown display type '\(displayType)'") } diff --git a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift index 447de11d..79cc8c64 100644 --- a/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift +++ b/Sources/ASCCommand/Commands/ScreenshotSets/ScreenshotSetsDelete.swift @@ -13,11 +13,11 @@ struct ScreenshotSetsDelete: AsyncParsableCommand { var setId: String func run() async throws { - let repo = try ClientProvider.makeAppScreenshots() + let repo = try ClientProvider.makeScreenshotRepository() try await execute(repo: repo) } - func execute(repo: any AppScreenshots) async throws { + func execute(repo: any ScreenshotRepository) async throws { try await repo.deleteScreenshotSet(setId: setId) } } diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift index 09c582ea..1dd0f856 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsCommand.swift @@ -21,11 +21,11 @@ struct ScreenshotsList: AsyncParsableCommand { var setId: String func run() async throws { - let repo = try ClientProvider.makeAppScreenshots() + let repo = try ClientProvider.makeScreenshotRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppScreenshots) async throws -> String { + func execute(repo: any ScreenshotRepository) async throws -> String { let screenshots = try await repo.listScreenshots(setId: setId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift index a19e310b..06190109 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsDelete.swift @@ -13,11 +13,11 @@ struct ScreenshotsDelete: AsyncParsableCommand { var screenshotId: String func run() async throws { - let repo = try ClientProvider.makeAppScreenshots() + let repo = try ClientProvider.makeScreenshotRepository() try await execute(repo: repo) } - func execute(repo: any AppScreenshots) async throws { + func execute(repo: any ScreenshotRepository) async throws { try await repo.deleteScreenshot(screenshotId: screenshotId) } } diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift index b7b655ac..0ec12128 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsImport.swift @@ -50,14 +50,14 @@ struct ScreenshotsImport: AsyncParsableCommand { func run() async throws { let (manifest, imageURLs, tempDir) = try Self.unzipAndParse(zipURL: URL(fileURLWithPath: from)) defer { try? FileManager.default.removeItem(at: tempDir) } - let localizationRepo = try ClientProvider.makeVersionLocalizations() + let localizationRepo = try ClientProvider.makeVersionLocalizationRepository() guard toLibrary else { FileHandle.standardError.write(Data(( "Note: screenshot sets are deprecated in App Store Connect API 4.5.1 — " + "add --to-library to import into the app's asset library instead.\n" ).utf8)) - let screenshotRepo = try ClientProvider.makeAppScreenshots() + let screenshotRepo = try ClientProvider.makeScreenshotRepository() print(try await execute(localizationRepo: localizationRepo, screenshotRepo: screenshotRepo, manifest: manifest, imageURLs: imageURLs)) return } @@ -65,11 +65,11 @@ struct ScreenshotsImport: AsyncParsableCommand { let report = try await executeToLibrary( manifest: manifest, files: try ScreenshotImportFiles.read(manifest: manifest, imageURLs: imageURLs), - versionRepo: try ClientProvider.makeAppStoreVersions(), + versionRepo: try ClientProvider.makeVersionRepository(), localizationRepo: localizationRepo, - libraryRepo: try ClientProvider.makeAssetLibraries(), - imageRepo: try ClientProvider.makeLibraryImages(), - placementRepo: try ClientProvider.makeAssetPlacements() + libraryRepo: try ClientProvider.makeAssetLibraryRepository(), + imageRepo: try ClientProvider.makeLibraryImageRepository(), + placementRepo: try ClientProvider.makeAssetPlacementRepository() ) print(report.output) if !report.isSuccess { throw ExitCode.failure } @@ -78,8 +78,8 @@ struct ScreenshotsImport: AsyncParsableCommand { // MARK: - Testable core (no I/O) func execute( - localizationRepo: any VersionLocalizations, - screenshotRepo: any AppScreenshots, + localizationRepo: any VersionLocalizationRepository, + screenshotRepo: any ScreenshotRepository, manifest: ScreenshotManifest, imageURLs: [String: URL] ) async throws -> String { @@ -130,11 +130,11 @@ struct ScreenshotsImport: AsyncParsableCommand { func executeToLibrary( manifest: ScreenshotManifest, files: [ScreenshotImportFile], - versionRepo: any AppStoreVersions, - localizationRepo: any VersionLocalizations, - libraryRepo: any AssetLibraries, - imageRepo: any LibraryImages, - placementRepo: any AssetPlacements, + versionRepo: any VersionRepository, + localizationRepo: any VersionLocalizationRepository, + libraryRepo: any AssetLibraryRepository, + imageRepo: any LibraryImageRepository, + placementRepo: any AssetPlacementRepository, affordanceMode: AffordanceMode = .cli, sleep: @Sendable (UInt64) async throws -> Void = { try await Task.sleep(nanoseconds: $0) } ) async throws -> ScreenshotImportReport { diff --git a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift index 6687b4b4..3d7ac9e8 100644 --- a/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift +++ b/Sources/ASCCommand/Commands/Screenshots/ScreenshotsUpload.swift @@ -17,11 +17,11 @@ struct ScreenshotsUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeAppScreenshots() + let repo = try ClientProvider.makeScreenshotRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppScreenshots) async throws -> String { + func execute(repo: any ScreenshotRepository) async throws -> String { let fileURL = URL(fileURLWithPath: file) let screenshot = try await repo.uploadScreenshot(setId: setId, fileURL: fileURL) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift index 7395f74c..af144c5a 100644 --- a/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionEqualizations/SubscriptionEqualizationsList.swift @@ -16,12 +16,12 @@ struct SubscriptionEqualizationsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeSubscriptionPrices() + let repo = try ClientProvider.makeSubscriptionPriceRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPrices, + repo: any SubscriptionPriceRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listEqualizations(pricePointId: pricePointId, limit: limit) diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift index 0fe29d2a..4df0f986 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsCreate.swift @@ -22,12 +22,12 @@ struct SubscriptionGroupLocalizationsCreate: AsyncParsableCommand { var customAppName: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupLocalizations() + let repo = try ClientProvider.makeSubscriptionGroupLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionGroupLocalizations, + repo: any SubscriptionGroupLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.createLocalization( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift index 73d32afa..4fcfc0c0 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionGroupLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupLocalizations() + let repo = try ClientProvider.makeSubscriptionGroupLocalizationRepository() try await execute(repo: repo) } - func execute(repo: any SubscriptionGroupLocalizations) async throws { + func execute(repo: any SubscriptionGroupLocalizationRepository) async throws { try await repo.deleteLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift index 02d9db01..e66fc1f9 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsList.swift @@ -13,12 +13,12 @@ struct SubscriptionGroupLocalizationsList: AsyncParsableCommand { var groupId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupLocalizations() + let repo = try ClientProvider.makeSubscriptionGroupLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionGroupLocalizations, + repo: any SubscriptionGroupLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listLocalizations(groupId: groupId) diff --git a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift index ed7a6fdc..78122687 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsUpdate.swift @@ -19,12 +19,12 @@ struct SubscriptionGroupLocalizationsUpdate: AsyncParsableCommand { var customAppName: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroupLocalizations() + let repo = try ClientProvider.makeSubscriptionGroupLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionGroupLocalizations, + repo: any SubscriptionGroupLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.updateLocalization( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift index 75d92add..5e7ea110 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupVersionsList.swift @@ -13,12 +13,12 @@ struct SubscriptionGroupVersionsList: AsyncParsableCommand { var groupId: String func run() async throws { - let repo = try ClientProvider.makeProductVersions() + let repo = try ClientProvider.makeProductVersionRepository() print(try await execute(repo: repo)) } func execute( - repo: any ProductVersions, + repo: any ProductVersionRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let versions = try await repo.listSubscriptionGroupVersions(groupId: groupId) diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift index 0720c6b9..8c076b29 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsCreate.swift @@ -16,11 +16,11 @@ struct SubscriptionGroupsCreate: AsyncParsableCommand { var referenceName: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroups() + let repo = try ClientProvider.makeSubscriptionGroupRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionGroups) async throws -> String { + func execute(repo: any SubscriptionGroupRepository) async throws -> String { let item = try await repo.createSubscriptionGroup(appId: appId, referenceName: referenceName) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift index c13223f0..5da749a6 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionGroupsDelete: AsyncParsableCommand { var groupId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroups() + let repo = try ClientProvider.makeSubscriptionGroupRepository() try await execute(repo: repo) } - func execute(repo: any SubscriptionGroups) async throws { + func execute(repo: any SubscriptionGroupRepository) async throws { try await repo.deleteSubscriptionGroup(groupId: groupId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift index d599f366..28e6553b 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsList.swift @@ -16,11 +16,11 @@ struct SubscriptionGroupsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroups() + let repo = try ClientProvider.makeSubscriptionGroupRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionGroups, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any SubscriptionGroupRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let response = try await repo.listSubscriptionGroups(appId: appId, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift index 17284e6d..6cd7aa23 100644 --- a/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionGroups/SubscriptionGroupsUpdate.swift @@ -16,11 +16,11 @@ struct SubscriptionGroupsUpdate: AsyncParsableCommand { var referenceName: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionGroups() + let repo = try ClientProvider.makeSubscriptionGroupRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionGroups) async throws -> String { + func execute(repo: any SubscriptionGroupRepository) async throws -> String { let item = try await repo.updateSubscriptionGroup(groupId: groupId, referenceName: referenceName) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift index e93e74cb..a73b9669 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionImagesDelete: AsyncParsableCommand { var imageId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewAssets() + let repo = try ClientProvider.makeSubscriptionReviewRepository() try await execute(repo: repo) } - func execute(repo: any SubscriptionReviewAssets) async throws { + func execute(repo: any SubscriptionReviewRepository) async throws { try await repo.deleteImage(imageId: imageId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift index 0082b350..c57c2d38 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesList.swift @@ -13,12 +13,12 @@ struct SubscriptionImagesList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewAssets() + let repo = try ClientProvider.makeSubscriptionReviewRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionReviewAssets, + repo: any SubscriptionReviewRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listImages(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift index 40281897..c40c5364 100644 --- a/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift +++ b/Sources/ASCCommand/Commands/SubscriptionImages/SubscriptionImagesUpload.swift @@ -17,12 +17,12 @@ struct SubscriptionImagesUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewAssets() + let repo = try ClientProvider.makeSubscriptionReviewRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionReviewAssets, + repo: any SubscriptionReviewRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let url = URL(fileURLWithPath: file) diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift index 950a8e2a..b4c504da 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreate.swift @@ -22,11 +22,11 @@ struct SubscriptionLocalizationsCreate: AsyncParsableCommand { var description: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionLocalizations() + let repo = try ClientProvider.makeSubscriptionLocalizationRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionLocalizations) async throws -> String { + func execute(repo: any SubscriptionLocalizationRepository) async throws -> String { let item = try await repo.createLocalization( subscriptionId: subscriptionId, locale: locale, diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift index 772c6309..00182753 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionLocalizationsDelete: AsyncParsableCommand { var localizationId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionLocalizations() + let repo = try ClientProvider.makeSubscriptionLocalizationRepository() try await execute(repo: repo) } - func execute(repo: any SubscriptionLocalizations) async throws { + func execute(repo: any SubscriptionLocalizationRepository) async throws { try await repo.deleteLocalization(localizationId: localizationId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift index 7f1a0bcf..8c7da946 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsList.swift @@ -13,12 +13,12 @@ struct SubscriptionLocalizationsList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionLocalizations() + let repo = try ClientProvider.makeSubscriptionLocalizationRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionLocalizations, + repo: any SubscriptionLocalizationRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listLocalizations(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift index 2533ccff..75e1fd8f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdate.swift @@ -19,11 +19,11 @@ struct SubscriptionLocalizationsUpdate: AsyncParsableCommand { var description: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionLocalizations() + let repo = try ClientProvider.makeSubscriptionLocalizationRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionLocalizations) async throws -> String { + func execute(repo: any SubscriptionLocalizationRepository) async throws -> String { let item = try await repo.updateLocalization( localizationId: localizationId, name: name, diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift index 27b7175c..819844a8 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreate.swift @@ -22,11 +22,11 @@ struct SubscriptionOfferCodeCustomCodesCreate: AsyncParsableCommand { var expirationDate: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodes) async throws -> String { + func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { let item = try await repo.createCustomCode( offerCodeId: offerCodeId, customCode: customCode, diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift index 0cb50172..3bef1272 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesList.swift @@ -13,11 +13,11 @@ struct SubscriptionOfferCodeCustomCodesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodes) async throws -> String { + func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { let items = try await repo.listCustomCodes(offerCodeId: offerCodeId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(items) diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift index 1c0b48e4..790970aa 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdate.swift @@ -16,11 +16,11 @@ struct SubscriptionOfferCodeCustomCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodes) async throws -> String { + func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { guard let isActive = Bool(active) else { throw ValidationError("Invalid value '\(active)' for --active. Use: true, false") } diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift index 2f0d6174..37b0eaae 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreate.swift @@ -22,12 +22,12 @@ struct SubscriptionOfferCodeOneTimeCodesCreate: AsyncParsableCommand { var environment: OfferCodeEnvironment = .production func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodes, + repo: any SubscriptionOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.createOneTimeUseCode( diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift index ffcb661f..bfdbcc9e 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesList.swift @@ -13,12 +13,12 @@ struct SubscriptionOfferCodeOneTimeCodesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodes, + repo: any SubscriptionOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listOneTimeUseCodes(offerCodeId: offerCodeId) diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift index a9650aeb..ae57b2b4 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdate.swift @@ -16,12 +16,12 @@ struct SubscriptionOfferCodeOneTimeCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodes, + repo: any SubscriptionOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard let isActive = Bool(active) else { diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift index 18e6026a..930d23cf 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValues.swift @@ -13,11 +13,11 @@ struct SubscriptionOfferCodeOneTimeCodesValues: AsyncParsableCommand { var oneTimeCodeId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodes) async throws -> String { + func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { try await repo.fetchOneTimeUseCodeValues(oneTimeCodeId: oneTimeCodeId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift index 10b51579..1e4446bc 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreate.swift @@ -47,12 +47,12 @@ struct SubscriptionOfferCodesCreate: AsyncParsableCommand { var freeTerritory: [String] = [] func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodes, + repo: any SubscriptionOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { guard let offerDuration = SubscriptionOfferDuration(rawValue: duration) else { diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift index 4acf6999..b6c25f1d 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesList.swift @@ -13,12 +13,12 @@ struct SubscriptionOfferCodesList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodes, + repo: any SubscriptionOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listOfferCodes(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift index 25b05f33..0e816cd8 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesList.swift @@ -13,12 +13,12 @@ struct SubscriptionOfferCodesPricesList: AsyncParsableCommand { var offerCodeId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionOfferCodes, + repo: any SubscriptionOfferCodeRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPrices(offerCodeId: offerCodeId) diff --git a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift index f31bd932..640343ba 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdate.swift @@ -16,11 +16,11 @@ struct SubscriptionOfferCodesUpdate: AsyncParsableCommand { var active: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionOfferCodes() + let repo = try ClientProvider.makeSubscriptionOfferCodeRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionOfferCodes) async throws -> String { + func execute(repo: any SubscriptionOfferCodeRepository) async throws -> String { guard let isActive = Bool(active) else { throw ValidationError("Invalid value '\(active)' for --active. Use: true, false") } diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift index 21862b46..56de892d 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersCreate.swift @@ -34,11 +34,11 @@ struct SubscriptionOffersCreate: AsyncParsableCommand { var endDate: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionIntroductoryOffers() + let repo = try ClientProvider.makeSubscriptionIntroductoryOfferRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionIntroductoryOffers) async throws -> String { + func execute(repo: any SubscriptionIntroductoryOfferRepository) async throws -> String { guard let offerDuration = SubscriptionOfferDuration(rawValue: duration) else { throw ValidationError("Invalid duration '\(duration)'. Use: THREE_DAYS, ONE_WEEK, TWO_WEEKS, ONE_MONTH, TWO_MONTHS, THREE_MONTHS, SIX_MONTHS, ONE_YEAR") } diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift index b3e51344..86b4926d 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionOffersDelete: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionIntroductoryOffers() + let repo = try ClientProvider.makeSubscriptionIntroductoryOfferRepository() try await execute(repo: repo) } - func execute(repo: any SubscriptionIntroductoryOffers) async throws { + func execute(repo: any SubscriptionIntroductoryOfferRepository) async throws { try await repo.deleteIntroductoryOffer(offerId: offerId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift index 05168544..3431672f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionOffers/SubscriptionOffersList.swift @@ -13,12 +13,12 @@ struct SubscriptionOffersList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionIntroductoryOffers() + let repo = try ClientProvider.makeSubscriptionIntroductoryOfferRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionIntroductoryOffers, + repo: any SubscriptionIntroductoryOfferRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listIntroductoryOffers(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift b/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift index 8ab256f5..44413a7f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPriceSchedule/SubscriptionPriceScheduleGet.swift @@ -13,12 +13,12 @@ struct SubscriptionPriceScheduleGet: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionPrices() + let repo = try ClientProvider.makeSubscriptionPriceRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPrices, + repo: any SubscriptionPriceRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let schedule = try await repo.getPriceSchedule(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift index 27ef57d8..e7e66b93 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersCreate.swift @@ -33,11 +33,11 @@ struct SubscriptionPromotionalOffersCreate: AsyncParsableCommand { var price: [String] = [] func run() async throws { - let repo = try ClientProvider.makeSubscriptionPromotionalOffers() + let repo = try ClientProvider.makeSubscriptionPromotionalOfferRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionPromotionalOffers) async throws -> String { + func execute(repo: any SubscriptionPromotionalOfferRepository) async throws -> String { guard let durationEnum = SubscriptionOfferDuration(rawValue: duration) else { throw ValidationError("Invalid duration: \(duration)") } diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift index ac894490..ed42e06e 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionPromotionalOffersDelete: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionPromotionalOffers() + let repo = try ClientProvider.makeSubscriptionPromotionalOfferRepository() try await execute(repo: repo) } - func execute(repo: any SubscriptionPromotionalOffers) async throws { + func execute(repo: any SubscriptionPromotionalOfferRepository) async throws { try await repo.deletePromotionalOffer(offerId: offerId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift index 13bf68cf..6d425915 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersList.swift @@ -13,12 +13,12 @@ struct SubscriptionPromotionalOffersList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionPromotionalOffers() + let repo = try ClientProvider.makeSubscriptionPromotionalOfferRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPromotionalOffers, + repo: any SubscriptionPromotionalOfferRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPromotionalOffers(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift index 38a3c938..a1c86865 100644 --- a/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift +++ b/Sources/ASCCommand/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersPricesList.swift @@ -13,12 +13,12 @@ struct SubscriptionPromotionalOffersPricesList: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionPromotionalOffers() + let repo = try ClientProvider.makeSubscriptionPromotionalOfferRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPromotionalOffers, + repo: any SubscriptionPromotionalOfferRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPrices(offerId: offerId) diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift index 478aa69e..f6469565 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionReviewScreenshotDelete: AsyncParsableCommand { var screenshotId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewAssets() + let repo = try ClientProvider.makeSubscriptionReviewRepository() try await execute(repo: repo) } - func execute(repo: any SubscriptionReviewAssets) async throws { + func execute(repo: any SubscriptionReviewRepository) async throws { try await repo.deleteReviewScreenshot(screenshotId: screenshotId) } } diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift index 664bfbe2..dc0da55f 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotGet.swift @@ -13,12 +13,12 @@ struct SubscriptionReviewScreenshotGet: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewAssets() + let repo = try ClientProvider.makeSubscriptionReviewRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionReviewAssets, + repo: any SubscriptionReviewRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let item = try await repo.getReviewScreenshot(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift index 37e90fe4..1808eee6 100644 --- a/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift +++ b/Sources/ASCCommand/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotUpload.swift @@ -17,12 +17,12 @@ struct SubscriptionReviewScreenshotUpload: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionReviewAssets() + let repo = try ClientProvider.makeSubscriptionReviewRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionReviewAssets, + repo: any SubscriptionReviewRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let url = URL(fileURLWithPath: file) diff --git a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift index 6a679c43..d22f19f7 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreate.swift @@ -19,11 +19,11 @@ struct SubscriptionAvailabilityCreate: AsyncParsableCommand { var territory: [String] = [] func run() async throws { - let repo = try ClientProvider.makeSubscriptionAvailabilities() + let repo = try ClientProvider.makeSubscriptionAvailabilityRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionAvailabilities) async throws -> String { + func execute(repo: any SubscriptionAvailabilityRepository) async throws -> String { let availability = try await repo.createAvailability( subscriptionId: subscriptionId, isAvailableInNewTerritories: availableInNewTerritories, diff --git a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift index 068544c2..e578904e 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/Availability/SubscriptionAvailabilityGet.swift @@ -13,12 +13,12 @@ struct SubscriptionAvailabilityGet: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionAvailabilities() + let repo = try ClientProvider.makeSubscriptionAvailabilityRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionAvailabilities, + repo: any SubscriptionAvailabilityRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let availability = try await repo.getAvailability(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift index bed24288..7fa946ff 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricePointsList.swift @@ -22,12 +22,12 @@ struct SubscriptionPricePointsList: AsyncParsableCommand { var cursor: String? func run() async throws { - let repo = try ClientProvider.makeSubscriptionPrices() + let repo = try ClientProvider.makeSubscriptionPriceRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPrices, + repo: any SubscriptionPriceRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listPricePoints( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift index f2bd2622..418368be 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSet.swift @@ -25,11 +25,11 @@ struct SubscriptionPricesSet: AsyncParsableCommand { var preserveCurrentPrice: Bool = false func run() async throws { - let repo = try ClientProvider.makeSubscriptionPrices() + let repo = try ClientProvider.makeSubscriptionPriceRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionPrices) async throws -> String { + func execute(repo: any SubscriptionPriceRepository) async throws -> String { let preserveFlag: Bool? = preserveCurrentPrice ? true : nil let item = try await repo.setPrice( subscriptionId: subscriptionId, diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift index 152f0514..5f6b4301 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionPricesSetBatch.swift @@ -25,12 +25,12 @@ struct SubscriptionPricesSetBatch: AsyncParsableCommand { var preserveCurrentPrice: Bool = false func run() async throws { - let repo = try ClientProvider.makeSubscriptionPrices() + let repo = try ClientProvider.makeSubscriptionPriceRepository() print(try await execute(repo: repo)) } func execute( - repo: any SubscriptionPrices, + repo: any SubscriptionPriceRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let inputs = try price.map { entry -> SubscriptionPriceInput in diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift index 281951c2..1fd9d37a 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionVersionsList.swift @@ -13,12 +13,12 @@ struct SubscriptionVersionsList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeProductVersions() + let repo = try ClientProvider.makeProductVersionRepository() print(try await execute(repo: repo)) } func execute( - repo: any ProductVersions, + repo: any ProductVersionRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let versions = try await repo.listSubscriptionVersions(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift index 2dfd93f9..b1a1cdcf 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsCreate.swift @@ -28,11 +28,11 @@ struct SubscriptionsCreate: AsyncParsableCommand { var groupLevel: Int? func run() async throws { - let repo = try ClientProvider.makeSubscriptions() + let repo = try ClientProvider.makeSubscriptionRepository() print(try await execute(repo: repo)) } - func execute(repo: any Subscriptions) async throws -> String { + func execute(repo: any SubscriptionRepository) async throws -> String { guard let subscriptionPeriod = SubscriptionPeriod(rawValue: period) else { throw ValidationError("Invalid period '\(period)'. Use: ONE_WEEK, ONE_MONTH, TWO_MONTHS, THREE_MONTHS, SIX_MONTHS, ONE_YEAR") } diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift index 371f359a..b1be83f8 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsDelete.swift @@ -13,11 +13,11 @@ struct SubscriptionsDelete: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptions() + let repo = try ClientProvider.makeSubscriptionRepository() try await execute(repo: repo) } - func execute(repo: any Subscriptions) async throws { + func execute(repo: any SubscriptionRepository) async throws { try await repo.deleteSubscription(subscriptionId: subscriptionId) } } diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift index c80ccfb6..935185eb 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsList.swift @@ -16,12 +16,12 @@ struct SubscriptionsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeSubscriptions() + let repo = try ClientProvider.makeSubscriptionRepository() print(try await execute(repo: repo)) } func execute( - repo: any Subscriptions, + repo: any SubscriptionRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let response = try await repo.listSubscriptions(groupId: groupId, limit: limit) diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift index 73abb6c1..1dbee4e5 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUpdate.swift @@ -41,11 +41,11 @@ struct SubscriptionsUpdate: AsyncParsableCommand { var marketSetting: [SubscriptionMarketSetting] = [] func run() async throws { - let repo = try ClientProvider.makeSubscriptions() + let repo = try ClientProvider.makeSubscriptionRepository() print(try await execute(repo: repo)) } - func execute(repo: any Subscriptions) async throws -> String { + func execute(repo: any SubscriptionRepository) async throws -> String { let isFamilySharable: Bool? = familySharable ? true : (notFamilySharable ? false : nil) let item = try await repo.updateSubscription( subscriptionId: subscriptionId, diff --git a/Sources/ASCCommand/Commands/TUI/TUIApp.swift b/Sources/ASCCommand/Commands/TUI/TUIApp.swift index b5f85c86..0b1bfea3 100644 --- a/Sources/ASCCommand/Commands/TUI/TUIApp.swift +++ b/Sources/ASCCommand/Commands/TUI/TUIApp.swift @@ -171,7 +171,7 @@ final class TUIApp { private func loadApps() async { do { - let repo = try ClientProvider.makeApps() + let repo = try ClientProvider.makeAppRepository() let response = try await repo.listApps(limit: nil) let items = response.data.map { app in SelectItem(value: app.id, label: app.displayName, description: app.bundleId) @@ -233,7 +233,7 @@ final class TUIApp { private func loadVersions(for app: App) async { do { - let repo = try ClientProvider.makeAppStoreVersions() + let repo = try ClientProvider.makeVersionRepository() let versions = try await repo.listVersions(appId: app.id) guard !versions.isEmpty else { @@ -267,7 +267,7 @@ final class TUIApp { private func loadLocalizations(for version: AppStoreVersion) async { do { - let repo = try ClientProvider.makeVersionLocalizations() + let repo = try ClientProvider.makeVersionLocalizationRepository() let localizations = try await repo.listLocalizations(versionId: version.id) guard !localizations.isEmpty else { @@ -307,7 +307,7 @@ final class TUIApp { private func loadScreenshotSets(for localization: AppStoreVersionLocalization) async { do { - let repo = try ClientProvider.makeAppScreenshots() + let repo = try ClientProvider.makeScreenshotRepository() let sets = try await repo.listScreenshotSets(localizationId: localization.id) guard !sets.isEmpty else { @@ -343,7 +343,7 @@ final class TUIApp { private func loadScreenshots(for set: AppScreenshotSet) async { do { - let repo = try ClientProvider.makeAppScreenshots() + let repo = try ClientProvider.makeScreenshotRepository() let screenshots = try await repo.listScreenshots(setId: set.id) let header = [ @@ -372,7 +372,7 @@ final class TUIApp { private func loadBuilds() async { do { - let repo = try ClientProvider.makeBuilds() + let repo = try ClientProvider.makeBuildRepository() let response = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) let items = response.data.map { build in let state = build.processingState.rawValue @@ -441,7 +441,7 @@ final class TUIApp { private func loadBetaGroups() async { do { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() let response = try await repo.listBetaGroups(appId: nil, limit: nil) let items = response.data.map { group in let type = group.isInternalGroup ? "Internal" : "External" @@ -476,7 +476,7 @@ final class TUIApp { return } do { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() let response = try await repo.listBetaTesters(groupId: groupId, limit: nil) let items = response.data.map { tester in SelectItem( diff --git a/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift b/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift index 7a978d76..9e1f6281 100644 --- a/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift +++ b/Sources/ASCCommand/Commands/Territories/TerritoriesList.swift @@ -10,11 +10,11 @@ struct TerritoriesList: AsyncParsableCommand { @OptionGroup var globals: GlobalOptions func run() async throws { - let repo = try ClientProvider.makeTerritories() + let repo = try ClientProvider.makeTerritoryRepository() print(try await execute(repo: repo)) } - func execute(repo: any Territories, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any TerritoryRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let territories = try await repo.listTerritories() let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(territories, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift b/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift index 88384046..bf550d2a 100644 --- a/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift +++ b/Sources/ASCCommand/Commands/TestFlight/TestFlightCommand.swift @@ -35,11 +35,11 @@ struct BetaGroupsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() print(try await execute(repo: repo)) } - func execute(repo: any TestFlight, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any TestFlightRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let response = try await repo.listBetaGroups(appId: appId, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data, affordanceMode: affordanceMode) @@ -70,11 +70,11 @@ struct BetaGroupsCreate: AsyncParsableCommand { var feedbackEnabled: Bool = false func run() async throws { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() print(try await execute(repo: repo)) } - func execute(repo: any TestFlight) async throws -> String { + func execute(repo: any TestFlightRepository) async throws -> String { let group = try await repo.createBetaGroup( appId: appId, name: name, @@ -118,11 +118,11 @@ struct BetaTestersList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() print(try await execute(repo: repo)) } - func execute(repo: any TestFlight) async throws -> String { + func execute(repo: any TestFlightRepository) async throws -> String { let response = try await repo.listBetaTesters(groupId: betaGroupId, limit: limit) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(response.data) @@ -150,11 +150,11 @@ struct BetaTestersAdd: AsyncParsableCommand { var lastName: String? func run() async throws { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() print(try await execute(repo: repo)) } - func execute(repo: any TestFlight) async throws -> String { + func execute(repo: any TestFlightRepository) async throws -> String { let tester = try await repo.addBetaTester(groupId: betaGroupId, email: email, firstName: firstName, lastName: lastName) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([tester]) @@ -176,11 +176,11 @@ struct BetaTestersRemove: AsyncParsableCommand { var testerId: String func run() async throws { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() print(try await execute(repo: repo)) } - func execute(repo: any TestFlight) async throws -> String { + func execute(repo: any TestFlightRepository) async throws -> String { try await repo.removeBetaTester(groupId: betaGroupId, testerId: testerId) return "Removed tester \(testerId) from group \(betaGroupId)" } @@ -201,12 +201,12 @@ struct BetaTestersImport: AsyncParsableCommand { var file: String func run() async throws { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() let content = try String(contentsOfFile: file, encoding: .utf8) print(try await execute(repo: repo, csvContent: content)) } - func execute(repo: any TestFlight, csvContent: String) async throws -> String { + func execute(repo: any TestFlightRepository, csvContent: String) async throws -> String { let entries = parseCSV(csvContent) var added: [BetaTester] = [] @@ -263,11 +263,11 @@ struct BetaTestersExport: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeTestFlight() + let repo = try ClientProvider.makeTestFlightRepository() print(try await execute(repo: repo)) } - func execute(repo: any TestFlight) async throws -> String { + func execute(repo: any TestFlightRepository) async throws -> String { let response = try await repo.listBetaTesters(groupId: betaGroupId, limit: limit) return formatCSV(response.data) } diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift index 7bac2829..a0780d8a 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsCancel.swift @@ -13,11 +13,11 @@ struct UserInvitationsCancel: AsyncParsableCommand { var invitationId: String func run() async throws { - let repo = try ClientProvider.makeUsers() + let repo = try ClientProvider.makeUserRepository() try await execute(repo: repo) } - func execute(repo: any Users) async throws { + func execute(repo: any UserRepository) async throws { try await repo.cancelUserInvitation(id: invitationId) } } diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift index ba77b11f..2fd2a5ef 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsInvite.swift @@ -25,11 +25,11 @@ struct UserInvitationsInvite: AsyncParsableCommand { var allAppsVisible: Bool = false func run() async throws { - let repo = try ClientProvider.makeUsers() + let repo = try ClientProvider.makeUserRepository() print(try await execute(repo: repo)) } - func execute(repo: any Users) async throws -> String { + func execute(repo: any UserRepository) async throws -> String { let domainRoles = try role.map { raw -> UserRole in guard let r = UserRole(cliArgument: raw) else { throw ValidationError("Invalid role '\(raw)'. Valid values: \(UserRole.allCases.map(\.rawValue).joined(separator: ", "))") diff --git a/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift b/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift index 46a4dce3..97f64c9d 100644 --- a/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift +++ b/Sources/ASCCommand/Commands/Users/UserInvitationsList.swift @@ -13,11 +13,11 @@ struct UserInvitationsList: AsyncParsableCommand { var role: String? func run() async throws { - let repo = try ClientProvider.makeUsers() + let repo = try ClientProvider.makeUserRepository() print(try await execute(repo: repo)) } - func execute(repo: any Users) async throws -> String { + func execute(repo: any UserRepository) async throws -> String { let domainRole = role.flatMap { UserRole(cliArgument: $0) } let items = try await repo.listUserInvitations(role: domainRole) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Users/UsersList.swift b/Sources/ASCCommand/Commands/Users/UsersList.swift index 5c276dfe..13f1e8af 100644 --- a/Sources/ASCCommand/Commands/Users/UsersList.swift +++ b/Sources/ASCCommand/Commands/Users/UsersList.swift @@ -13,11 +13,11 @@ struct UsersList: AsyncParsableCommand { var role: String? func run() async throws { - let repo = try ClientProvider.makeUsers() + let repo = try ClientProvider.makeUserRepository() print(try await execute(repo: repo)) } - func execute(repo: any Users) async throws -> String { + func execute(repo: any UserRepository) async throws -> String { let domainRole = role.flatMap { UserRole(cliArgument: $0) } let items = try await repo.listUsers(role: domainRole) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) diff --git a/Sources/ASCCommand/Commands/Users/UsersRemove.swift b/Sources/ASCCommand/Commands/Users/UsersRemove.swift index b841d1e3..963a3af5 100644 --- a/Sources/ASCCommand/Commands/Users/UsersRemove.swift +++ b/Sources/ASCCommand/Commands/Users/UsersRemove.swift @@ -13,11 +13,11 @@ struct UsersRemove: AsyncParsableCommand { var userId: String func run() async throws { - let repo = try ClientProvider.makeUsers() + let repo = try ClientProvider.makeUserRepository() try await execute(repo: repo) } - func execute(repo: any Users) async throws { + func execute(repo: any UserRepository) async throws { try await repo.removeUser(id: userId) } } diff --git a/Sources/ASCCommand/Commands/Users/UsersUpdate.swift b/Sources/ASCCommand/Commands/Users/UsersUpdate.swift index 1336c0fd..99586232 100644 --- a/Sources/ASCCommand/Commands/Users/UsersUpdate.swift +++ b/Sources/ASCCommand/Commands/Users/UsersUpdate.swift @@ -16,11 +16,11 @@ struct UsersUpdate: AsyncParsableCommand { var role: [String] func run() async throws { - let repo = try ClientProvider.makeUsers() + let repo = try ClientProvider.makeUserRepository() print(try await execute(repo: repo)) } - func execute(repo: any Users) async throws -> String { + func execute(repo: any UserRepository) async throws -> String { let domainRoles = try role.map { raw -> UserRole in guard let r = UserRole(cliArgument: raw) else { throw ValidationError("Invalid role '\(raw)'. Valid values: \(UserRole.allCases.map(\.rawValue).joined(separator: ", "))") diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift index dba1b07b..a59ebc88 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCommand.swift @@ -21,11 +21,11 @@ struct VersionLocalizationsList: AsyncParsableCommand { var versionId: String func run() async throws { - let repo = try ClientProvider.makeVersionLocalizations() + let repo = try ClientProvider.makeVersionLocalizationRepository() print(try await execute(repo: repo)) } - func execute(repo: any VersionLocalizations, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any VersionLocalizationRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let localizations = try await repo.listLocalizations(versionId: versionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems(localizations, affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift index 24c057c7..9fde0ec5 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsCreate.swift @@ -16,11 +16,11 @@ struct VersionLocalizationsCreate: AsyncParsableCommand { var locale: String func run() async throws { - let repo = try ClientProvider.makeVersionLocalizations() + let repo = try ClientProvider.makeVersionLocalizationRepository() print(try await execute(repo: repo)) } - func execute(repo: any VersionLocalizations) async throws -> String { + func execute(repo: any VersionLocalizationRepository) async throws -> String { let created = try await repo.createLocalization(versionId: versionId, locale: locale) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift index 595c811e..94bc83d6 100644 --- a/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift +++ b/Sources/ASCCommand/Commands/VersionLocalizations/VersionLocalizationsUpdate.swift @@ -31,11 +31,11 @@ struct VersionLocalizationsUpdate: AsyncParsableCommand { var promotionalText: String? func run() async throws { - let repo = try ClientProvider.makeVersionLocalizations() + let repo = try ClientProvider.makeVersionLocalizationRepository() print(try await execute(repo: repo)) } - func execute(repo: any VersionLocalizations) async throws -> String { + func execute(repo: any VersionLocalizationRepository) async throws -> String { let updated = try await repo.updateLocalization( localizationId: localizationId, whatsNew: whatsNew, diff --git a/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift b/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift index eb3000d4..79436c7e 100644 --- a/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift +++ b/Sources/ASCCommand/Commands/VersionReviewDetail/VersionReviewDetailCommand.swift @@ -23,11 +23,11 @@ struct VersionReviewDetailGet: AsyncParsableCommand { var versionId: String func run() async throws { - let repo = try ClientProvider.makeReviewDetails() + let repo = try ClientProvider.makeReviewDetailRepository() print(try await execute(repo: repo)) } - func execute(repo: any ReviewDetails) async throws -> String { + func execute(repo: any ReviewDetailRepository) async throws -> String { let detail = try await repo.getReviewDetail(versionId: versionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -81,11 +81,11 @@ struct VersionReviewDetailUpdate: AsyncParsableCommand { var notes: String? func run() async throws { - let repo = try ClientProvider.makeReviewDetails() + let repo = try ClientProvider.makeReviewDetailRepository() print(try await execute(repo: repo)) } - func execute(repo: any ReviewDetails) async throws -> String { + func execute(repo: any ReviewDetailRepository) async throws -> String { let update = ReviewDetailUpdate( contactFirstName: contactFirstName, contactLastName: contactLastName, diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift b/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift index 99fa1496..bf4dbfc5 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCheckReadiness.swift @@ -13,15 +13,15 @@ struct VersionsCheckReadiness: AsyncParsableCommand { var versionId: String func run() async throws { - let versionRepo = try ClientProvider.makeAppStoreVersions() - let appRepo = try ClientProvider.makeApps() - let buildRepo = try ClientProvider.makeBuilds() - let reviewDetailRepo = try ClientProvider.makeReviewDetails() - let localizationRepo = try ClientProvider.makeVersionLocalizations() - let screenshotRepo = try ClientProvider.makeAppScreenshots() - let pricingRepo = try ClientProvider.makeAppPrices() - let appInfoRepo = try ClientProvider.makeAppInfos() - let ageRatingRepo = try ClientProvider.makeAgeRatingDeclarations() + let versionRepo = try ClientProvider.makeVersionRepository() + let appRepo = try ClientProvider.makeAppRepository() + let buildRepo = try ClientProvider.makeBuildRepository() + let reviewDetailRepo = try ClientProvider.makeReviewDetailRepository() + let localizationRepo = try ClientProvider.makeVersionLocalizationRepository() + let screenshotRepo = try ClientProvider.makeScreenshotRepository() + let pricingRepo = try ClientProvider.makePricingRepository() + let appInfoRepo = try ClientProvider.makeAppInfoRepository() + let ageRatingRepo = try ClientProvider.makeAgeRatingDeclarationRepository() print(try await execute( versionRepo: versionRepo, appRepo: appRepo, @@ -36,15 +36,15 @@ struct VersionsCheckReadiness: AsyncParsableCommand { } func execute( - versionRepo: any AppStoreVersions, - appRepo: any Apps, - buildRepo: any Builds, - reviewDetailRepo: any ReviewDetails, - localizationRepo: any VersionLocalizations, - screenshotRepo: any AppScreenshots, - pricingRepo: any AppPrices, - appInfoRepo: any AppInfos, - ageRatingRepo: any AgeRatingDeclarations + versionRepo: any VersionRepository, + appRepo: any AppRepository, + buildRepo: any BuildRepository, + reviewDetailRepo: any ReviewDetailRepository, + localizationRepo: any VersionLocalizationRepository, + screenshotRepo: any ScreenshotRepository, + pricingRepo: any PricingRepository, + appInfoRepo: any AppInfoRepository, + ageRatingRepo: any AgeRatingDeclarationRepository ) async throws -> String { // 1. Fetch version (includes appId + buildId) let version = try await versionRepo.getVersion(id: versionId) diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift b/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift index 7835da16..145d26de 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCommand.swift @@ -21,11 +21,11 @@ struct VersionsList: AsyncParsableCommand { var appId: String func run() async throws { - let repo = try ClientProvider.makeAppStoreVersions() + let repo = try ClientProvider.makeVersionRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppStoreVersions, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any VersionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let versions = try await repo.listVersions(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift b/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift index e1fa5048..201dfb8d 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsCreate.swift @@ -19,11 +19,11 @@ struct VersionsCreate: AsyncParsableCommand { var platform: String func run() async throws { - let repo = try ClientProvider.makeAppStoreVersions() + let repo = try ClientProvider.makeVersionRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppStoreVersions) async throws -> String { + func execute(repo: any VersionRepository) async throws -> String { guard let appStorePlatform = AppStorePlatform(cliArgument: platform) else { throw ValidationError("Unknown platform '\(platform)'. Use: ios, macos, tvos, watchos, visionos") } diff --git a/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift b/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift index 0165d916..ac3eab01 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsSetBuild.swift @@ -16,11 +16,11 @@ struct VersionsSetBuild: AsyncParsableCommand { var buildId: String func run() async throws { - let repo = try ClientProvider.makeAppStoreVersions() + let repo = try ClientProvider.makeVersionRepository() try await execute(repo: repo) } - func execute(repo: any AppStoreVersions) async throws { + func execute(repo: any VersionRepository) async throws { try await repo.setBuild(versionId: versionId, buildId: buildId) } } diff --git a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift index 9b9a2ad1..2ceb1ae8 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift @@ -27,14 +27,14 @@ struct VersionsSubmit: AsyncParsableCommand { func run() async throws { if withProducts || dryRun { let planner = SubmissionPlanner( - iapRepo: try ClientProvider.makeInAppPurchases(), - groupRepo: try ClientProvider.makeSubscriptionGroups(), - subscriptionRepo: try ClientProvider.makeSubscriptions(), - productVersionRepo: try ClientProvider.makeProductVersions() + iapRepo: try ClientProvider.makeInAppPurchaseRepository(), + groupRepo: try ClientProvider.makeSubscriptionGroupRepository(), + subscriptionRepo: try ClientProvider.makeSubscriptionRepository(), + productVersionRepo: try ClientProvider.makeProductVersionRepository() ) print(try await executeWithProducts( submissionRepo: try ClientProvider.makeReviewSubmissions(), - versionRepo: try ClientProvider.makeAppStoreVersions(), + versionRepo: try ClientProvider.makeVersionRepository(), planner: planner )) } else { @@ -55,7 +55,7 @@ struct VersionsSubmit: AsyncParsableCommand { func executeWithProducts( submissionRepo: any ReviewSubmissions, - versionRepo: any AppStoreVersions, + versionRepo: any VersionRepository, planner: SubmissionPlanner, affordanceMode: AffordanceMode = .cli ) async throws -> String { diff --git a/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift b/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift index 553e74fa..c421935d 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsUpdate.swift @@ -25,11 +25,11 @@ struct VersionsUpdate: AsyncParsableCommand { var earliestReleaseDate: String? func run() async throws { - let repo = try ClientProvider.makeAppStoreVersions() + let repo = try ClientProvider.makeVersionRepository() print(try await execute(repo: repo)) } - func execute(repo: any AppStoreVersions, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any VersionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let updated = try await repo.updateVersion( id: versionId, versionString: version, diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift index eae770fa..dc3bc158 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AgeRatingController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `AgeRatingDeclaration` resources. struct AgeRatingController: Sendable { - let repo: any AgeRatingDeclarations + let repo: any AgeRatingDeclarationRepository func addRoutes(to group: RouterGroup) { // Canonical nested path matches the resolver's `_links.getAgeRating`. diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift index 0ebcb9f4..b92c9fb6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppAvailabilityController.swift @@ -8,8 +8,8 @@ import HummingbirdWebSocket /// `{"territory": ["USA", "JPN"]}` or `{"all-territories": true}`, plus optional /// `"available-in-new-territories": true`. struct AppAvailabilityController: Sendable { - let repo: any AppAvailabilities - let territoryRepo: any Territories + let repo: any AppAvailabilityRepository + let territoryRepo: any TerritoryRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/availability") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift index ef16d1d8..5560b1bc 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppCategoriesController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `AppCategory` resources. struct AppCategoriesController: Sendable { - let repo: any AppCategories + let repo: any AppCategoryRepository func addRoutes(to group: RouterGroup) { group.get("/app-categories") { request, _ -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift index 84926bc6..1baacdc4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppInfosController.swift @@ -12,7 +12,7 @@ private func optionalString(_ value: Any?) -> String? { /// Routes that return `AppInfo` and `AppInfoLocalization` resources. struct AppInfosController: Sendable { - let repo: any AppInfos + let repo: any AppInfoRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/app-infos") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift index 069b4086..49b4b0c6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppPricingController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// `GET /apps/:appId/price-points?territory=USA` and `POST /apps/:appId/prices/set` /// with body `{"base-territory": "USA", "price-point-id": "…"}` (camelCase keys also accepted). struct AppPricingController: Sendable { - let repo: any AppPrices + let repo: any PricingRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/price-points") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift index e4ead6c7..69bb1c3f 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppShotsController.swift @@ -7,11 +7,11 @@ import Foundation /// /api/v1/app-shots — Screenshot template, theme, export, and AI generation. struct AppShotsController: Sendable { - let templateRepo: any Templates + let templateRepo: any TemplateRepository let themeRepo: any Themes let htmlRenderer: any HTMLRenderer let configStorage: any AppShotsConfigStorage - let galleryTemplateRepo: any GalleryTemplates + let galleryTemplateRepo: any GalleryTemplateRepository func addRoutes(to group: RouterGroup) { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift index 0143e34a..4f63bfd5 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AppsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `App` resources. struct AppsController: Sendable { - let repo: any Apps + let repo: any AppRepository func addRoutes(to group: RouterGroup) { group.get("/apps") { request, _ -> Response in @@ -43,7 +43,7 @@ struct AppsController: Sendable { /// Load apps and, when requested, enrich each one with its icon asset. /// Icon fetch is parallel across apps; nil icons are tolerated. - static func loadApps(repo: any Apps, includeIcon: Bool) async throws -> [App] { + static func loadApps(repo: any AppRepository, includeIcon: Bool) async throws -> [App] { let apps = try await repo.listApps(limit: nil).data guard includeIcon else { return apps } diff --git a/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift b/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift index c3314e60..f7ec7ebe 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/AssetLibraryController.swift @@ -9,10 +9,10 @@ import HummingbirdWebSocket /// JSON bodies use the flags in camelCase (`imageId`/`videoId`, `placementType`, `placementGroup`, /// `placementIds`, `libraryId`, `referenceName`, `archived`). struct AssetLibraryController: Sendable { - let libraryRepo: any AssetLibraries - let imageRepo: any LibraryImages - let videoRepo: any LibraryVideos - let placementRepo: any AssetPlacements + let libraryRepo: any AssetLibraryRepository + let imageRepo: any LibraryImageRepository + let videoRepo: any LibraryVideoRepository + let placementRepo: any AssetPlacementRepository struct BadRequest: Error, Equatable { let message: String @@ -222,7 +222,7 @@ struct AssetLibraryController: Sendable { surface: PlacementSurface, localizationId: String, json: [String: Any], - repo: any AssetPlacements + repo: any AssetPlacementRepository ) async throws -> AssetPlacement { let asset: (AssetMediaType, String)? = (json["videoId"] as? String).map { (.video, $0) } ?? (json["imageId"] as? String).map { (.image, $0) } @@ -237,7 +237,7 @@ struct AssetLibraryController: Sendable { } /// Body: `{"libraryId", "referenceName"?, "archived"?}` — the `asset-images update` flags. - static func updateImage(imageId: String, json: [String: Any], repo: any LibraryImages) async throws -> LibraryImage { + static func updateImage(imageId: String, json: [String: Any], repo: any LibraryImageRepository) async throws -> LibraryImage { let (referenceName, archived) = try updateFields(json) return try await repo.updateImage( libraryId: json["libraryId"] as? String ?? "", imageId: imageId, referenceName: referenceName, isArchived: archived @@ -245,7 +245,7 @@ struct AssetLibraryController: Sendable { } /// Body: `{"libraryId", "referenceName"?, "archived"?}` — the `asset-videos update` flags. - static func updateVideo(videoId: String, json: [String: Any], repo: any LibraryVideos) async throws -> LibraryVideo { + static func updateVideo(videoId: String, json: [String: Any], repo: any LibraryVideoRepository) async throws -> LibraryVideo { let (referenceName, archived) = try updateFields(json) return try await repo.updateVideo( libraryId: json["libraryId"] as? String ?? "", videoId: videoId, referenceName: referenceName, isArchived: archived @@ -264,7 +264,7 @@ struct AssetLibraryController: Sendable { surface: PlacementSurface, localizationId: String, json: [String: Any], - repo: any AssetPlacements + repo: any AssetPlacementRepository ) async throws -> [AssetPlacement] { guard let placementGroup = json["placementGroup"] as? String, let placementIds = json["placementIds"] as? [String], !placementIds.isEmpty diff --git a/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift index 7cc258c6..038dc5db 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/BetaAppLocalizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `BetaAppLocalization` resources. struct BetaAppLocalizationsController: Sendable { - let repo: any BetaAppLocalizations + let repo: any BetaAppLocalizationRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/beta-app-localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift index 60bb2a70..7e227c99 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/BuildsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `Build` resources (both fleet and per-app listings). struct BuildsController: Sendable { - let repo: any Builds + let repo: any BuildRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/builds") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift b/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift index 9b59b9dc..58af6aaa 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/CodeSigningController.swift @@ -6,10 +6,10 @@ import ASCKit /// /api/v1/certificates, bundle-ids, devices, profiles — Code signing routes. struct CodeSigningController: Sendable { - let certRepo: any Certificates - let bundleIDRepo: any BundleIDs - let deviceRepo: any Devices - let profileRepo: any Profiles + let certRepo: any CertificateRepository + let bundleIDRepo: any BundleIDRepository + let deviceRepo: any DeviceRepository + let profileRepo: any ProfileRepository func addRoutes(to group: RouterGroup) { group.get("/certificates") { request, _ -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift index a56a0456..d56bad33 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/CustomerReviewsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `CustomerReview` resources. struct CustomerReviewsController: Sendable { - let repo: any CustomerReviews + let repo: any CustomerReviewRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/reviews") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift index d418b444..b7562711 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/DiagnosticsController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// `GET /diagnostics/:signatureId/logs` — the logs behind one signature. /// The query param matches the CLI flag `--diagnostic-type`. struct DiagnosticsController: Sendable { - let repo: any Diagnostics + let repo: any DiagnosticsRepository func addRoutes(to group: RouterGroup) { group.get("/builds/:buildId/diagnostics") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift index cb0c7684..a8895e9d 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ExperimentsController.swift @@ -8,7 +8,7 @@ import HummingbirdWebSocket /// /// Query-param names match the CLI flags: `?state=&limit=`. struct ExperimentsController: Sendable { - let repo: any Experiments + let repo: any ExperimentRepository func addRoutes(to group: RouterGroup) { // MARK: Experiments diff --git a/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift b/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift index 6972dc0c..0197a514 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/GameCenterController.swift @@ -8,8 +8,8 @@ import HummingbirdWebSocket /// /// Query-param names match the CLI flags: `?blocked-only=true`. struct GameCenterController: Sendable { - let repo: any GameCenter - let moderationRepo: any GameCenterModeration + let repo: any GameCenterRepository + let moderationRepo: any GameCenterModerationRepository /// A request body missing a required field; surfaced to the client as a 400. struct BadRequest: Error, Equatable { @@ -110,7 +110,7 @@ struct GameCenterController: Sendable { static func createAchievement( detailId: String, json: [String: Any], - repo: any GameCenter + repo: any GameCenterRepository ) async throws -> GameCenterAchievement { guard let referenceName = json["referenceName"] as? String, let vendorIdentifier = json["vendorIdentifier"] as? String, @@ -131,7 +131,7 @@ struct GameCenterController: Sendable { static func createLeaderboard( detailId: String, json: [String: Any], - repo: any GameCenter + repo: any GameCenterRepository ) async throws -> GameCenterLeaderboard { guard let referenceName = json["referenceName"] as? String, let vendorIdentifier = json["vendorIdentifier"] as? String, diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift index 5f431d15..76e7fdb4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPAvailabilityController.swift @@ -5,11 +5,11 @@ import HummingbirdWebSocket /// Routes that return the per-territory availability of an in-app purchase. struct IAPAvailabilityController: Sendable { - let repo: any InAppPurchaseAvailabilities + let repo: any InAppPurchaseAvailabilityRepository /// Used to seed a synthetic "all 175 territories available" response when ASC has no /// availability resource yet — matches the iOS app's default UX for fresh IAPs (the /// view defaults `selectedIds = Set(app.territories.map(\.id))`). - let territoryRepo: any Territories + let territoryRepo: any TerritoryRepository func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/availability") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift index a0168014..3ed9407a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `InAppPurchase` resources. struct IAPController: Sendable { - let repo: any InAppPurchases + let repo: any InAppPurchaseRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/iap") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift index 9b0ea884..8dda8a05 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPEqualizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return Apple's auto-equalized territory prices for an IAP price point. struct IAPEqualizationsController: Sendable { - let repo: any InAppPurchasePrices + let repo: any InAppPurchasePriceRepository func addRoutes(to group: RouterGroup) { group.get("/iap-price-points/:pricePointId/equalizations") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift index 48ad31a3..eda48c00 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPLocalizationsController.swift @@ -18,7 +18,7 @@ private func clamp(_ value: String, to limit: Int) -> String { /// Routes that return `InAppPurchaseLocalization` resources. struct IAPLocalizationsController: Sendable { - let repo: any InAppPurchaseLocalizations + let repo: any InAppPurchaseLocalizationRepository func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift index 331f6d08..e7126be8 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodeOneTimeCodesController.swift @@ -8,7 +8,7 @@ import HummingbirdWebSocket /// Mirrors `asc iap-offer-code-one-time-codes list/create/update` so REST clients can /// generate sandbox or production redemption batches and toggle individual batches active. struct IAPOfferCodeOneTimeCodesController: Sendable { - let repo: any InAppPurchaseOfferCodes + let repo: any InAppPurchaseOfferCodeRepository func addRoutes(to group: RouterGroup) { group.get("/iap-offer-codes/:offerCodeId/one-time-codes") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift index 0596183c..9732dbcd 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPOfferCodesController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `InAppPurchaseOfferCode` resources. struct IAPOfferCodesController: Sendable { - let repo: any InAppPurchaseOfferCodes + let repo: any InAppPurchaseOfferCodeRepository func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/offer-codes") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift index b7087ef1..52296638 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricePointsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `InAppPurchasePricePoint` resources. struct IAPPricePointsController: Sendable { - let repo: any InAppPurchasePrices + let repo: any InAppPurchasePriceRepository func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/price-points") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift index 72bb7e21..8e2f1052 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPriceScheduleController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return the manual price schedule for an in-app purchase. struct IAPPriceScheduleController: Sendable { - let repo: any InAppPurchasePrices + let repo: any InAppPurchasePriceRepository func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/price-schedule") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift index a6ce62f9..5d97799b 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPPricesController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// `baseTerritory` is how the iOS app implements "Change Base Territory" — ASC replaces /// the previous schedule with a new one and equalizes other territories from the new base. struct IAPPricesController: Sendable { - let repo: any InAppPurchasePrices + let repo: any InAppPurchasePriceRepository func addRoutes(to group: RouterGroup) { group.post("/iap/:iapId/prices/set") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift index 7619d28f..7010cf4e 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPReviewController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return IAP review screenshot + promotional images. struct IAPReviewController: Sendable { - let repo: any InAppPurchaseReviewAssets + let repo: any InAppPurchaseReviewRepository func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/review-screenshot") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift index 138bf67d..1ca59c0e 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IrisResolutionCenterController.swift @@ -11,7 +11,7 @@ import HummingbirdWebSocket /// `?plain-text=true` mirrors the CLI's `--plain-text` flag (HTML → text). struct IrisResolutionCenterController: Sendable { let cookieProvider: any IrisCookieProvider - let repo: any IrisResolutionCenter + let repo: any IrisResolutionCenterRepository func addRoutes(to group: RouterGroup) { group.get("/iris/review-submissions/:submissionId/resolution-center") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift index e2e3e31a..5d861ad7 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/OfferCodePricesController.swift @@ -4,8 +4,8 @@ import HummingbirdWebSocket /// Routes that return per-territory prices attached to IAP and subscription offer codes. struct OfferCodePricesController: Sendable { - let iapRepo: any InAppPurchaseOfferCodes - let subRepo: any SubscriptionOfferCodes + let iapRepo: any InAppPurchaseOfferCodeRepository + let subRepo: any SubscriptionOfferCodeRepository func addRoutes(to group: RouterGroup) { group.get("/iap-offer-codes/:offerCodeId/prices") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift index 94a49692..552dab76 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PerfMetricsController.swift @@ -6,7 +6,7 @@ import HummingbirdWebSocket /// `GET /apps/:appId/perf-metrics` and `GET /builds/:buildId/perf-metrics` — power and /// performance metrics. The `metric-type` query param matches the CLI flag `--metric-type`. struct PerfMetricsController: Sendable { - let repo: any PerfMetrics + let repo: any PerfMetricsRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/perf-metrics") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift index f271b34a..f8959bef 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PerfOverviewController.swift @@ -6,7 +6,7 @@ import HummingbirdWebSocket /// `GET /apps/:appId/perf-overview?device-type=…` — the app's Xcode Organizer overview. /// The query param matches the CLI flag `--device-type`. struct PerfOverviewController: Sendable { - let repo: any PerfOverviews + let repo: any PerfOverviewRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/perf-overview") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift index 7ef14fe2..154659c1 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ProductVersionsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Review versions of in-app purchases, subscriptions and subscription groups. /// A submittable version is sent to review by adding it to a review submission. struct ProductVersionsController: Sendable { - let repo: any ProductVersions + let repo: any ProductVersionRepository func addRoutes(to group: RouterGroup) { group.get("/iap/:iapId/versions") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift index 9aa418a5..db70d4b0 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/PromotedPurchasesController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `PromotedPurchase` resources (App Store product page promoted slots). struct PromotedPurchasesController: Sendable { - let repo: any PromotedPurchases + let repo: any PromotedPurchaseRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/promoted-purchases") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift index 47978f47..a7694c58 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotImportController.swift @@ -8,11 +8,11 @@ import HummingbirdWebSocket /// export ZIP. Query params match the CLI flags (`existing`, `dry-run`, repeated /// `placement-group`). Synchronous: the response arrives once every group is placed. struct ScreenshotImportController: Sendable { - let versionRepo: any AppStoreVersions - let localizationRepo: any VersionLocalizations - let libraryRepo: any AssetLibraries - let imageRepo: any LibraryImages - let placementRepo: any AssetPlacements + let versionRepo: any VersionRepository + let localizationRepo: any VersionLocalizationRepository + let libraryRepo: any AssetLibraryRepository + let imageRepo: any LibraryImageRepository + let placementRepo: any AssetPlacementRepository /// Export ZIPs hold every locale's screenshots. static let maxZipBytes = 500 * 1024 * 1024 diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift index e664db3d..818b7984 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotSetsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `AppScreenshotSet` resources. struct ScreenshotSetsController: Sendable { - let repo: any AppScreenshots + let repo: any ScreenshotRepository func addRoutes(to group: RouterGroup) { group.get("/version-localizations/:localizationId/screenshot-sets") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift index 44a37f08..4fdec0a4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ScreenshotsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `AppScreenshot` resources. struct ScreenshotsController: Sendable { - let repo: any AppScreenshots + let repo: any ScreenshotRepository func addRoutes(to group: RouterGroup) { group.get("/screenshot-sets/:setId/screenshots") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift index 12f46ea3..457fcf1c 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionAvailabilityController.swift @@ -4,9 +4,9 @@ import HummingbirdWebSocket /// Routes that return the per-territory availability of a subscription. struct SubscriptionAvailabilityController: Sendable { - let repo: any SubscriptionAvailabilities + let repo: any SubscriptionAvailabilityRepository /// Same synthetic-default rationale as `IAPAvailabilityController.territoryRepo`. - let territoryRepo: any Territories + let territoryRepo: any TerritoryRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/availability") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift index 43da3a7c..5dc25e5a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionEqualizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return Apple's auto-equalized territory prices for a subscription price point. struct SubscriptionEqualizationsController: Sendable { - let repo: any SubscriptionPrices + let repo: any SubscriptionPriceRepository func addRoutes(to group: RouterGroup) { group.get("/subscription-price-points/:pricePointId/equalizations") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift index 0f66df15..05032d8f 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupLocalizationsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionGroupLocalization` resources. struct SubscriptionGroupLocalizationsController: Sendable { - let repo: any SubscriptionGroupLocalizations + let repo: any SubscriptionGroupLocalizationRepository func addRoutes(to group: RouterGroup) { group.get("/subscription-groups/:groupId/subscription-group-localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift index 4de6a855..ec8aaeba 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionGroupsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionGroup` resources. struct SubscriptionGroupsController: Sendable { - let repo: any SubscriptionGroups + let repo: any SubscriptionGroupRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/subscription-groups") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift index 24c28e0a..0854f765 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionIntroductoryOffersController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionIntroductoryOffer` resources. struct SubscriptionIntroductoryOffersController: Sendable { - let repo: any SubscriptionIntroductoryOffers + let repo: any SubscriptionIntroductoryOfferRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/introductory-offers") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift index 3cca6c89..72c0cfae 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionLocalizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionLocalization` resources. struct SubscriptionLocalizationsController: Sendable { - let repo: any SubscriptionLocalizations + let repo: any SubscriptionLocalizationRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift index 1921ab5b..a158b7aa 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodeOneTimeCodesController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// /// Mirrors `asc subscription-offer-code-one-time-codes list/create/update`. struct SubscriptionOfferCodeOneTimeCodesController: Sendable { - let repo: any SubscriptionOfferCodes + let repo: any SubscriptionOfferCodeRepository func addRoutes(to group: RouterGroup) { group.get("/subscription-offer-codes/:offerCodeId/one-time-codes") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift index d65ad501..b240465d 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionOfferCodesController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionOfferCode` resources. struct SubscriptionOfferCodesController: Sendable { - let repo: any SubscriptionOfferCodes + let repo: any SubscriptionOfferCodeRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/offer-codes") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift index ae8ed36b..151b294f 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricePointsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionPricePoint` resources. struct SubscriptionPricePointsController: Sendable { - let repo: any SubscriptionPrices + let repo: any SubscriptionPriceRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/price-points") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift index cb13a90b..d46d0f02 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPriceScheduleController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return the per-territory price schedule for a subscription. struct SubscriptionPriceScheduleController: Sendable { - let repo: any SubscriptionPrices + let repo: any SubscriptionPriceRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/price-schedule") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift index fe17fe88..ffeff1e0 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPricesController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes for batch-setting per-territory prices on a subscription. struct SubscriptionPricesController: Sendable { - let repo: any SubscriptionPrices + let repo: any SubscriptionPriceRepository func addRoutes(to group: RouterGroup) { group.post("/subscriptions/:subscriptionId/prices/set-batch") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift index f022f4c2..457928de 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionPromotionalOffersController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `SubscriptionPromotionalOffer` resources and their per-territory prices. struct SubscriptionPromotionalOffersController: Sendable { - let repo: any SubscriptionPromotionalOffers + let repo: any SubscriptionPromotionalOfferRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/subscription-promotional-offers") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift index f5052d71..3baff3fb 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionReviewController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return the subscription review screenshot and promotional images. struct SubscriptionReviewController: Sendable { - let repo: any SubscriptionReviewAssets + let repo: any SubscriptionReviewRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/review-screenshot") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift index 5d77a896..9a346430 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `Subscription` resources nested under a subscription group. struct SubscriptionsController: Sendable { - let repo: any Subscriptions + let repo: any SubscriptionRepository func addRoutes(to group: RouterGroup) { group.get("/subscription-groups/:groupId/subscriptions") { request, context -> Response in @@ -27,7 +27,7 @@ struct SubscriptionsController: Sendable { static func update( subscriptionId: String, json: [String: Any], - repo: any Subscriptions + repo: any SubscriptionRepository ) async throws -> Subscription { let marketSettings = (json["marketSetting"] as? [String])?.compactMap(SubscriptionMarketSetting.init(rawValue:)) return try await repo.updateSubscription( diff --git a/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift b/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift index 1259081a..f0509d58 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/TerritoriesController.swift @@ -5,7 +5,7 @@ import ASCKit /// /api/v1/territories — Territory routes. struct TerritoriesController: Sendable { - let repo: any Territories + let repo: any TerritoryRepository func addRoutes(to group: RouterGroup) { group.get("/territories") { _, _ -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift b/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift index 303c0da4..b8071ba7 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/TestFlightController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return TestFlight `BetaGroup` resources. struct TestFlightController: Sendable { - let repo: any TestFlight + let repo: any TestFlightRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/testflight") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift index 1fd8bd40..183273c6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionLocalizationsController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `AppStoreVersionLocalization` resources. struct VersionLocalizationsController: Sendable { - let repo: any VersionLocalizations + let repo: any VersionLocalizationRepository func addRoutes(to group: RouterGroup) { group.get("/versions/:versionId/localizations") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift index 2a7d1b01..a39fd92a 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift @@ -8,7 +8,7 @@ import HummingbirdWebSocket /// submits nothing. Query names match the CLI's `--with-products` / `--dry-run`. struct VersionSubmissionController: Sendable { let submissionRepo: any ReviewSubmissions - let versionRepo: any AppStoreVersions + let versionRepo: any VersionRepository let planner: SubmissionPlanner func addRoutes(to group: RouterGroup) { diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift index c5d6d9e3..23cfd7ac 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionsController.swift @@ -5,7 +5,7 @@ import HummingbirdWebSocket /// Routes that return `AppStoreVersion` resources. struct VersionsController: Sendable { - let repo: any AppStoreVersions + let repo: any VersionRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/versions") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift b/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift index 8a6060ae..9baf0039 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/WinBackOffersController.swift @@ -4,7 +4,7 @@ import HummingbirdWebSocket /// Routes that return `WinBackOffer` resources and their per-territory prices. struct WinBackOffersController: Sendable { - let repo: any WinBackOffers + let repo: any WinBackOfferRepository func addRoutes(to group: RouterGroup) { group.get("/subscriptions/:subscriptionId/win-back-offers") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift index 048cbec4..5b8c3b54 100644 --- a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift +++ b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift @@ -19,72 +19,72 @@ enum RESTRoutes { // App resource hierarchy — one focused controller per resource type. // Order is incidental; each controller registers its own routes. - if let appRepo = try? ClientProvider.makeApps() { + if let appRepo = try? ClientProvider.makeAppRepository() { AppsController(repo: appRepo).addRoutes(to: v1) } - if let versionRepo = try? ClientProvider.makeAppStoreVersions() { + if let versionRepo = try? ClientProvider.makeVersionRepository() { VersionsController(repo: versionRepo).addRoutes(to: v1) } - if let localizationRepo = try? ClientProvider.makeVersionLocalizations() { + if let localizationRepo = try? ClientProvider.makeVersionLocalizationRepository() { VersionLocalizationsController(repo: localizationRepo).addRoutes(to: v1) } - if let screenshotRepo = try? ClientProvider.makeAppScreenshots() { + if let screenshotRepo = try? ClientProvider.makeScreenshotRepository() { ScreenshotSetsController(repo: screenshotRepo).addRoutes(to: v1) ScreenshotsController(repo: screenshotRepo).addRoutes(to: v1) } - if let libraryRepo = try? ClientProvider.makeAssetLibraries(), - let imageRepo = try? ClientProvider.makeLibraryImages(), - let videoRepo = try? ClientProvider.makeLibraryVideos(), - let placementRepo = try? ClientProvider.makeAssetPlacements() { + if let libraryRepo = try? ClientProvider.makeAssetLibraryRepository(), + let imageRepo = try? ClientProvider.makeLibraryImageRepository(), + let videoRepo = try? ClientProvider.makeLibraryVideoRepository(), + let placementRepo = try? ClientProvider.makeAssetPlacementRepository() { AssetLibraryController( libraryRepo: libraryRepo, imageRepo: imageRepo, videoRepo: videoRepo, placementRepo: placementRepo ).addRoutes(to: v1) - if let versionRepo = try? ClientProvider.makeAppStoreVersions(), - let localizationRepo = try? ClientProvider.makeVersionLocalizations() { + if let versionRepo = try? ClientProvider.makeVersionRepository(), + let localizationRepo = try? ClientProvider.makeVersionLocalizationRepository() { ScreenshotImportController( versionRepo: versionRepo, localizationRepo: localizationRepo, libraryRepo: libraryRepo, imageRepo: imageRepo, placementRepo: placementRepo ).addRoutes(to: v1) } } - if let buildRepo = try? ClientProvider.makeBuilds() { + if let buildRepo = try? ClientProvider.makeBuildRepository() { BuildsController(repo: buildRepo).addRoutes(to: v1) } - if let testFlightRepo = try? ClientProvider.makeTestFlight() { + if let testFlightRepo = try? ClientProvider.makeTestFlightRepository() { TestFlightController(repo: testFlightRepo).addRoutes(to: v1) } - if let betaAppLocRepo = try? ClientProvider.makeBetaAppLocalizations() { + if let betaAppLocRepo = try? ClientProvider.makeBetaAppLocalizationRepository() { BetaAppLocalizationsController(repo: betaAppLocRepo).addRoutes(to: v1) } - if let reviewRepo = try? ClientProvider.makeCustomerReviews() { + if let reviewRepo = try? ClientProvider.makeCustomerReviewRepository() { CustomerReviewsController(repo: reviewRepo).addRoutes(to: v1) } - if let iapRepo = try? ClientProvider.makeInAppPurchases() { + if let iapRepo = try? ClientProvider.makeInAppPurchaseRepository() { IAPController(repo: iapRepo).addRoutes(to: v1) } - if let subscriptionGroupRepo = try? ClientProvider.makeSubscriptionGroups() { + if let subscriptionGroupRepo = try? ClientProvider.makeSubscriptionGroupRepository() { SubscriptionGroupsController(repo: subscriptionGroupRepo).addRoutes(to: v1) } - if let subscriptionRepo = try? ClientProvider.makeSubscriptions() { + if let subscriptionRepo = try? ClientProvider.makeSubscriptionRepository() { SubscriptionsController(repo: subscriptionRepo).addRoutes(to: v1) } - if let promotedRepo = try? ClientProvider.makePromotedPurchases() { + if let promotedRepo = try? ClientProvider.makePromotedPurchaseRepository() { PromotedPurchasesController(repo: promotedRepo).addRoutes(to: v1) } - if let availabilityRepo = try? ClientProvider.makeAppAvailabilities(), - let territoryRepo = try? ClientProvider.makeTerritories() { + if let availabilityRepo = try? ClientProvider.makeAppAvailabilityRepository(), + let territoryRepo = try? ClientProvider.makeTerritoryRepository() { AppAvailabilityController(repo: availabilityRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let pricingRepo = try? ClientProvider.makeAppPrices() { + if let pricingRepo = try? ClientProvider.makePricingRepository() { AppPricingController(repo: pricingRepo).addRoutes(to: v1) } - if let productVersionRepo = try? ClientProvider.makeProductVersions() { + if let productVersionRepo = try? ClientProvider.makeProductVersionRepository() { ProductVersionsController(repo: productVersionRepo).addRoutes(to: v1) if let submissionRepo = try? ClientProvider.makeReviewSubmissions(), - let versionRepo = try? ClientProvider.makeAppStoreVersions(), - let iapRepo = try? ClientProvider.makeInAppPurchases(), - let groupRepo = try? ClientProvider.makeSubscriptionGroups(), - let subscriptionRepo = try? ClientProvider.makeSubscriptions() { + let versionRepo = try? ClientProvider.makeVersionRepository(), + let iapRepo = try? ClientProvider.makeInAppPurchaseRepository(), + let groupRepo = try? ClientProvider.makeSubscriptionGroupRepository(), + let subscriptionRepo = try? ClientProvider.makeSubscriptionRepository() { VersionSubmissionController( submissionRepo: submissionRepo, versionRepo: versionRepo, @@ -93,51 +93,51 @@ enum RESTRoutes { ).addRoutes(to: v1) } } - if let perfOverviewRepo = try? ClientProvider.makePerfOverviews() { + if let perfOverviewRepo = try? ClientProvider.makePerfOverviewRepository() { PerfOverviewController(repo: perfOverviewRepo).addRoutes(to: v1) } - if let perfMetricsRepo = try? ClientProvider.makePerfMetrics() { + if let perfMetricsRepo = try? ClientProvider.makePerfMetricsRepository() { PerfMetricsController(repo: perfMetricsRepo).addRoutes(to: v1) } - if let diagnosticsRepo = try? ClientProvider.makeDiagnostics() { + if let diagnosticsRepo = try? ClientProvider.makeDiagnosticsRepository() { DiagnosticsController(repo: diagnosticsRepo).addRoutes(to: v1) } - if let experimentRepo = try? ClientProvider.makeExperiments() { + if let experimentRepo = try? ClientProvider.makeExperimentRepository() { ExperimentsController(repo: experimentRepo).addRoutes(to: v1) } - if let gameCenterRepo = try? ClientProvider.makeGameCenter(), - let moderationRepo = try? ClientProvider.makeGameCenterModeration() { + if let gameCenterRepo = try? ClientProvider.makeGameCenterRepository(), + let moderationRepo = try? ClientProvider.makeGameCenterModerationRepository() { GameCenterController(repo: gameCenterRepo, moderationRepo: moderationRepo).addRoutes(to: v1) } - if let groupLocRepo = try? ClientProvider.makeSubscriptionGroupLocalizations() { + if let groupLocRepo = try? ClientProvider.makeSubscriptionGroupLocalizationRepository() { SubscriptionGroupLocalizationsController(repo: groupLocRepo).addRoutes(to: v1) } - if let promoRepo = try? ClientProvider.makeSubscriptionPromotionalOffers() { + if let promoRepo = try? ClientProvider.makeSubscriptionPromotionalOfferRepository() { SubscriptionPromotionalOffersController(repo: promoRepo).addRoutes(to: v1) } - if let winBackRepo = try? ClientProvider.makeWinBackOffers() { + if let winBackRepo = try? ClientProvider.makeWinBackOfferRepository() { WinBackOffersController(repo: winBackRepo).addRoutes(to: v1) } - if let subPriceRepo = try? ClientProvider.makeSubscriptionPrices() { + if let subPriceRepo = try? ClientProvider.makeSubscriptionPriceRepository() { SubscriptionPricePointsController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionPriceScheduleController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionEqualizationsController(repo: subPriceRepo).addRoutes(to: v1) SubscriptionPricesController(repo: subPriceRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodes(), - let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodes() { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository(), + let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { OfferCodePricesController(iapRepo: iapOfferCodeRepo, subRepo: subOfferCodeRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodes() { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository() { IAPOfferCodeOneTimeCodesController(repo: iapOfferCodeRepo).addRoutes(to: v1) } - if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodes() { + if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { SubscriptionOfferCodeOneTimeCodesController(repo: subOfferCodeRepo).addRoutes(to: v1) } - if let iapReviewRepo = try? ClientProvider.makeInAppPurchaseReviewAssets() { + if let iapReviewRepo = try? ClientProvider.makeInAppPurchaseReviewRepository() { IAPReviewController(repo: iapReviewRepo).addRoutes(to: v1) } - if let subReviewRepo = try? ClientProvider.makeSubscriptionReviewAssets() { + if let subReviewRepo = try? ClientProvider.makeSubscriptionReviewRepository() { SubscriptionReviewController(repo: subReviewRepo).addRoutes(to: v1) } if let iapSubmissionRepo = try? ClientProvider.makeInAppPurchaseSubmissions() { @@ -149,24 +149,24 @@ enum RESTRoutes { ).addRoutes(to: v1) IrisResolutionCenterController( cookieProvider: ClientProvider.makeIrisCookieProvider(), - repo: ClientProvider.makeIrisResolutionCenter() + repo: ClientProvider.makeIrisResolutionCenterRepository() ).addRoutes(to: v1) if let subSubmissionRepo = try? ClientProvider.makeSubscriptionSubmissions() { SubscriptionSubmissionController(repo: subSubmissionRepo).addRoutes(to: v1) } // IAP detail listings - if let iapLocRepo = try? ClientProvider.makeInAppPurchaseLocalizations() { + if let iapLocRepo = try? ClientProvider.makeInAppPurchaseLocalizationRepository() { IAPLocalizationsController(repo: iapLocRepo).addRoutes(to: v1) } - if let iapAvailRepo = try? ClientProvider.makeInAppPurchaseAvailabilities(), - let territoryRepo = try? ClientProvider.makeTerritories() { + if let iapAvailRepo = try? ClientProvider.makeInAppPurchaseAvailabilityRepository(), + let territoryRepo = try? ClientProvider.makeTerritoryRepository() { IAPAvailabilityController(repo: iapAvailRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodes() { + if let iapOfferCodeRepo = try? ClientProvider.makeInAppPurchaseOfferCodeRepository() { IAPOfferCodesController(repo: iapOfferCodeRepo).addRoutes(to: v1) } - if let iapPriceRepo = try? ClientProvider.makeInAppPurchasePrices() { + if let iapPriceRepo = try? ClientProvider.makeInAppPurchasePriceRepository() { IAPPricePointsController(repo: iapPriceRepo).addRoutes(to: v1) IAPPriceScheduleController(repo: iapPriceRepo).addRoutes(to: v1) IAPEqualizationsController(repo: iapPriceRepo).addRoutes(to: v1) @@ -174,35 +174,35 @@ enum RESTRoutes { } // Subscription detail listings - if let subLocRepo = try? ClientProvider.makeSubscriptionLocalizations() { + if let subLocRepo = try? ClientProvider.makeSubscriptionLocalizationRepository() { SubscriptionLocalizationsController(repo: subLocRepo).addRoutes(to: v1) } - if let subAvailRepo = try? ClientProvider.makeSubscriptionAvailabilities(), - let territoryRepo = try? ClientProvider.makeTerritories() { + if let subAvailRepo = try? ClientProvider.makeSubscriptionAvailabilityRepository(), + let territoryRepo = try? ClientProvider.makeTerritoryRepository() { SubscriptionAvailabilityController(repo: subAvailRepo, territoryRepo: territoryRepo).addRoutes(to: v1) } - if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodes() { + if let subOfferCodeRepo = try? ClientProvider.makeSubscriptionOfferCodeRepository() { SubscriptionOfferCodesController(repo: subOfferCodeRepo).addRoutes(to: v1) } - if let subIntroRepo = try? ClientProvider.makeSubscriptionIntroductoryOffers() { + if let subIntroRepo = try? ClientProvider.makeSubscriptionIntroductoryOfferRepository() { SubscriptionIntroductoryOffersController(repo: subIntroRepo).addRoutes(to: v1) } - if let appInfoRepo = try? ClientProvider.makeAppInfos() { + if let appInfoRepo = try? ClientProvider.makeAppInfoRepository() { AppInfosController(repo: appInfoRepo).addRoutes(to: v1) } - if let appCategoryRepo = try? ClientProvider.makeAppCategories() { + if let appCategoryRepo = try? ClientProvider.makeAppCategoryRepository() { AppCategoriesController(repo: appCategoryRepo).addRoutes(to: v1) } - if let ageRatingRepo = try? ClientProvider.makeAgeRatingDeclarations() { + if let ageRatingRepo = try? ClientProvider.makeAgeRatingDeclarationRepository() { AgeRatingController(repo: ageRatingRepo).addRoutes(to: v1) } // Code signing if let signing = try? CodeSigningController( - certRepo: ClientProvider.makeCertificates(), - bundleIDRepo: ClientProvider.makeBundleIDs(), - deviceRepo: ClientProvider.makeDevices(), - profileRepo: ClientProvider.makeProfiles() + certRepo: ClientProvider.makeCertificateRepository(), + bundleIDRepo: ClientProvider.makeBundleIDRepository(), + deviceRepo: ClientProvider.makeDeviceRepository(), + profileRepo: ClientProvider.makeProfileRepository() ) { signing.addRoutes(to: v1) } // Review submissions @@ -218,16 +218,16 @@ enum RESTRoutes { PluginsController(repo: ClientProvider.makePlugins()).addRoutes(to: v1) if let territories = try? TerritoriesController( - repo: ClientProvider.makeTerritories() + repo: ClientProvider.makeTerritoryRepository() ) { territories.addRoutes(to: v1) } // App Shots AppShotsController( - templateRepo: ClientProvider.makeTemplates(), + templateRepo: ClientProvider.makeTemplateRepository(), themeRepo: ClientProvider.makeThemes(), htmlRenderer: ClientProvider.makeHTMLRenderer(), configStorage: ClientProvider.makeAppShotsConfigStorage(), - galleryTemplateRepo: ClientProvider.makeGalleryTemplates() + galleryTemplateRepo: ClientProvider.makeGalleryTemplateRepository() ).addRoutes(to: v1) } } diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift index e309126f..367bf709 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersCreate.swift @@ -56,11 +56,11 @@ struct WinBackOffersCreate: AsyncParsableCommand { var price: [String] = [] func run() async throws { - let repo = try ClientProvider.makeWinBackOffers() + let repo = try ClientProvider.makeWinBackOfferRepository() print(try await execute(repo: repo)) } - func execute(repo: any WinBackOffers) async throws -> String { + func execute(repo: any WinBackOfferRepository) async throws -> String { guard let durationEnum = SubscriptionOfferDuration(rawValue: duration) else { throw ValidationError("Invalid duration: \(duration)") } diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift index 3c0442ec..26e6fb6a 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersDelete.swift @@ -13,11 +13,11 @@ struct WinBackOffersDelete: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeWinBackOffers() + let repo = try ClientProvider.makeWinBackOfferRepository() try await execute(repo: repo) } - func execute(repo: any WinBackOffers) async throws { + func execute(repo: any WinBackOfferRepository) async throws { try await repo.deleteWinBackOffer(offerId: offerId) } } diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift index 56721ad8..856973f1 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersList.swift @@ -13,12 +13,12 @@ struct WinBackOffersList: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeWinBackOffers() + let repo = try ClientProvider.makeWinBackOfferRepository() print(try await execute(repo: repo)) } func execute( - repo: any WinBackOffers, + repo: any WinBackOfferRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listWinBackOffers(subscriptionId: subscriptionId) diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift index c0183560..942680a7 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersPricesList.swift @@ -13,12 +13,12 @@ struct WinBackOffersPricesList: AsyncParsableCommand { var offerId: String func run() async throws { - let repo = try ClientProvider.makeWinBackOffers() + let repo = try ClientProvider.makeWinBackOfferRepository() print(try await execute(repo: repo)) } func execute( - repo: any WinBackOffers, + repo: any WinBackOfferRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let items = try await repo.listPrices(offerId: offerId) diff --git a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift index 526ac541..cd542e18 100644 --- a/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift +++ b/Sources/ASCCommand/Commands/WinBackOffers/WinBackOffersUpdate.swift @@ -37,11 +37,11 @@ struct WinBackOffersUpdate: AsyncParsableCommand { var waitMonths: Int? func run() async throws { - let repo = try ClientProvider.makeWinBackOffers() + let repo = try ClientProvider.makeWinBackOfferRepository() print(try await execute(repo: repo)) } - func execute(repo: any WinBackOffers) async throws -> String { + func execute(repo: any WinBackOfferRepository) async throws -> String { let priorityEnum: WinBackOfferPriority? = try priority.map { raw in guard let v = WinBackOfferPriority(rawValue: raw) else { throw ValidationError("Invalid priority: \(raw)") diff --git a/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift b/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift index df37792a..4cc56a55 100644 --- a/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift +++ b/Sources/ASCCommand/Commands/XcodeCloud/XcodeCloudCommand.swift @@ -36,11 +36,11 @@ struct XcodeCloudProductsList: AsyncParsableCommand { var appId: String? func run() async throws { - let repo = try ClientProvider.makeXcodeCloudProducts() + let repo = try ClientProvider.makeXcodeCloudProductRepository() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudProducts) async throws -> String { + func execute(repo: any XcodeCloudProductRepository) async throws -> String { let products = try await repo.listProducts(appId: appId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -73,11 +73,11 @@ struct XcodeCloudWorkflowsList: AsyncParsableCommand { var productId: String func run() async throws { - let repo = try ClientProvider.makeXcodeCloudWorkflows() + let repo = try ClientProvider.makeXcodeCloudWorkflowRepository() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudWorkflows) async throws -> String { + func execute(repo: any XcodeCloudWorkflowRepository) async throws -> String { let workflows = try await repo.listWorkflows(productId: productId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -114,11 +114,11 @@ struct XcodeCloudBuildsList: AsyncParsableCommand { var workflowId: String func run() async throws { - let repo = try ClientProvider.makeXcodeCloudBuildRuns() + let repo = try ClientProvider.makeXcodeCloudBuildRunRepository() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudBuildRuns) async throws -> String { + func execute(repo: any XcodeCloudBuildRunRepository) async throws -> String { let runs = try await repo.listBuildRuns(workflowId: workflowId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -141,11 +141,11 @@ struct XcodeCloudBuildsGet: AsyncParsableCommand { var buildRunId: String func run() async throws { - let repo = try ClientProvider.makeXcodeCloudBuildRuns() + let repo = try ClientProvider.makeXcodeCloudBuildRunRepository() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudBuildRuns) async throws -> String { + func execute(repo: any XcodeCloudBuildRunRepository) async throws -> String { let run = try await repo.getBuildRun(id: buildRunId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( @@ -171,11 +171,11 @@ struct XcodeCloudBuildsStart: AsyncParsableCommand { var clean: Bool = false func run() async throws { - let repo = try ClientProvider.makeXcodeCloudBuildRuns() + let repo = try ClientProvider.makeXcodeCloudBuildRunRepository() print(try await execute(repo: repo)) } - func execute(repo: any XcodeCloudBuildRuns) async throws -> String { + func execute(repo: any XcodeCloudBuildRunRepository) async throws -> String { let run = try await repo.startBuildRun(workflowId: workflowId, clean: clean) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCKit/Apps/AppClips/AppClips.swift b/Sources/ASCKit/Apps/AppClips/AppClipRepository.swift similarity index 93% rename from Sources/ASCKit/Apps/AppClips/AppClips.swift rename to Sources/ASCKit/Apps/AppClips/AppClipRepository.swift index 3a1389e9..06d4bdd9 100644 --- a/Sources/ASCKit/Apps/AppClips/AppClips.swift +++ b/Sources/ASCKit/Apps/AppClips/AppClipRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppClips: Sendable { +public protocol AppClipRepository: Sendable { func listAppClips(appId: String) async throws -> [AppClip] func listExperiences(appClipId: String) async throws -> [AppClipDefaultExperience] func createExperience(appClipId: String, action: AppClipAction?) async throws -> AppClipDefaultExperience diff --git a/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClips.swift b/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/AppClips/Internal/SDKAppClips.swift rename to Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift index 4eae7ada..553a1d34 100644 --- a/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClips.swift +++ b/Sources/ASCKit/Apps/AppClips/Internal/SDKAppClipRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppClips: AppClips, @unchecked Sendable { +public struct SDKAppClipRepository: AppClipRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarations.swift b/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarationRepository.swift similarity index 78% rename from Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarations.swift rename to Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarationRepository.swift index 4521219c..e290f01b 100644 --- a/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarations.swift +++ b/Sources/ASCKit/Apps/AppInfos/AgeRatingDeclarationRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AgeRatingDeclarations: Sendable { +public protocol AgeRatingDeclarationRepository: Sendable { func getDeclaration(appInfoId: String) async throws -> AgeRatingDeclaration func updateDeclaration(id: String, update: AgeRatingDeclarationUpdate) async throws -> AgeRatingDeclaration } diff --git a/Sources/ASCKit/Apps/AppInfos/AppCategory.swift b/Sources/ASCKit/Apps/AppInfos/AppCategory.swift index 4fc3e962..fada2004 100644 --- a/Sources/ASCKit/Apps/AppInfos/AppCategory.swift +++ b/Sources/ASCKit/Apps/AppInfos/AppCategory.swift @@ -32,7 +32,7 @@ extension AppCategory: AffordanceProviding { } @Mockable -public protocol AppCategories: Sendable { +public protocol AppCategoryRepository: Sendable { func listCategories(platform: String?) async throws -> [AppCategory] func getCategory(id: String) async throws -> AppCategory } diff --git a/Sources/ASCKit/Apps/AppInfos/AppInfos.swift b/Sources/ASCKit/Apps/AppInfos/AppInfoRepository.swift similarity index 94% rename from Sources/ASCKit/Apps/AppInfos/AppInfos.swift rename to Sources/ASCKit/Apps/AppInfos/AppInfoRepository.swift index c26fa07b..7912626d 100644 --- a/Sources/ASCKit/Apps/AppInfos/AppInfos.swift +++ b/Sources/ASCKit/Apps/AppInfos/AppInfoRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppInfos: Sendable { +public protocol AppInfoRepository: Sendable { func listAppInfos(appId: String) async throws -> [AppInfo] func listLocalizations(appInfoId: String) async throws -> [AppInfoLocalization] func createLocalization(appInfoId: String, locale: String, name: String) async throws -> AppInfoLocalization diff --git a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarations.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarations.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift index 2e99cb21..b40a1c3e 100644 --- a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarations.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAgeRatingDeclarations: AgeRatingDeclarations, @unchecked Sendable { +public struct SDKAgeRatingDeclarationRepository: AgeRatingDeclarationRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategories.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift similarity index 95% rename from Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategories.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift index 70de5039..2382553d 100644 --- a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategories.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppCategoryRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppCategories: AppCategories, @unchecked Sendable { +public struct SDKAppCategoryRepository: AppCategoryRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfos.swift b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfos.swift rename to Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift index 9044176d..2117245a 100644 --- a/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfos.swift +++ b/Sources/ASCKit/Apps/AppInfos/Internal/SDKAppInfoRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppInfos: AppInfos, @unchecked Sendable { +public struct SDKAppInfoRepository: AppInfoRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Apps.swift b/Sources/ASCKit/Apps/AppRepository.swift similarity index 88% rename from Sources/ASCKit/Apps/Apps.swift rename to Sources/ASCKit/Apps/AppRepository.swift index 4019009b..fb166860 100644 --- a/Sources/ASCKit/Apps/Apps.swift +++ b/Sources/ASCKit/Apps/AppRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol Apps: Sendable { +public protocol AppRepository: Sendable { func listApps(limit: Int?) async throws -> PaginatedResponse func getApp(id: String) async throws -> App func fetchAppIcon(appId: String) async throws -> ImageAsset? diff --git a/Sources/ASCKit/Apps/AssetLibrary/AssetLibraries.swift b/Sources/ASCKit/Apps/AssetLibrary/AssetLibraryRepository.swift similarity index 87% rename from Sources/ASCKit/Apps/AssetLibrary/AssetLibraries.swift rename to Sources/ASCKit/Apps/AssetLibrary/AssetLibraryRepository.swift index 939d0a87..214a3163 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/AssetLibraries.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/AssetLibraryRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AssetLibraries: Sendable { +public protocol AssetLibraryRepository: Sendable { /// The app's one asset library. func getAssetLibrary(appId: String) async throws -> AppAssetLibrary /// Placement groups from App Store Connect's reference data, one row per placement type and group. diff --git a/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImages.swift b/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImages.swift rename to Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift index b9841a46..2d25f56d 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImages.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKLibraryImages: LibraryImages, @unchecked Sendable { +public struct SDKLibraryImageRepository: LibraryImageRepository, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImages.swift b/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImageRepository.swift similarity index 93% rename from Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImages.swift rename to Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImageRepository.swift index e400c1df..7bf92bf2 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImages.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Images/LibraryImageRepository.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol LibraryImages: Sendable { +public protocol LibraryImageRepository: Sendable { /// Images in the library, optionally narrowed to one image, a state or a category. func listImages(libraryId: String, imageId: String?, state: LibraryAssetState?, category: AssetCategory?) async throws -> [LibraryImage] /// Reserves, uploads and commits the file; returns the image as App Store Connect sees it after the commit. diff --git a/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift b/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift index a5eab8c5..558bb675 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Import/ScreenshotImportPlan.swift @@ -162,8 +162,8 @@ extension ScreenshotImportPlan { /// reported as `failed`; the others carry on. public func execute( libraryId: String, - imageRepo: any LibraryImages, - placementRepo: any AssetPlacements, + imageRepo: any LibraryImageRepository, + placementRepo: any AssetPlacementRepository, sleep: @Sendable (UInt64) async throws -> Void ) async -> [ScreenshotImportGroupResult] { var imageIds: [String: String] = [:] @@ -218,7 +218,7 @@ extension ScreenshotImportPlan { _ group: PlannedGroup, imageIds: [String: String], failures: [String: String], - placementRepo: any AssetPlacements + placementRepo: any AssetPlacementRepository ) async -> ScreenshotImportGroupResult { func failed(_ message: String) -> ScreenshotImportGroupResult { ScreenshotImportGroupResult( diff --git a/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraries.swift b/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraries.swift rename to Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift index 571e2f3e..bcc09963 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraries.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Internal/SDKAssetLibraryRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAssetLibraries: AssetLibraries, @unchecked Sendable { +public struct SDKAssetLibraryRepository: AssetLibraryRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacements.swift b/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift similarity index 94% rename from Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacements.swift rename to Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift index 8d65ac6f..9f1e42c0 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacements.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Placements/AssetPlacementRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AssetPlacements: Sendable { +public protocol AssetPlacementRepository: Sendable { /// Placements on one localization, in display order within each group. func listPlacements(surface: PlacementSurface, localizationId: String, placementType: AssetPlacementType?, placementGroup: String?) async throws -> [AssetPlacement] /// Every placement that shows one asset, across all localizations. diff --git a/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacements.swift b/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift similarity index 99% rename from Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacements.swift rename to Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift index bca8cb4e..54b44d0d 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacements.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAssetPlacements: AssetPlacements, @unchecked Sendable { +public struct SDKAssetPlacementRepository: AssetPlacementRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideos.swift b/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideos.swift rename to Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift index fda6b13b..ebfeb464 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideos.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKLibraryVideos: LibraryVideos, @unchecked Sendable { +public struct SDKLibraryVideoRepository: LibraryVideoRepository, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideos.swift b/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift similarity index 93% rename from Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideos.swift rename to Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift index 05450857..c0b243be 100644 --- a/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideos.swift +++ b/Sources/ASCKit/Apps/AssetLibrary/Videos/LibraryVideoRepository.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol LibraryVideos: Sendable { +public protocol LibraryVideoRepository: Sendable { /// Videos in the library, optionally narrowed to one video, a state or a category. func listVideos(libraryId: String, videoId: String?, state: LibraryAssetState?, category: AssetCategory?) async throws -> [LibraryVideo] /// Reserves, uploads (streamed from disk) and commits the file. diff --git a/Sources/ASCKit/Apps/Availability/AppAvailabilities.swift b/Sources/ASCKit/Apps/Availability/AppAvailabilityRepository.swift similarity index 88% rename from Sources/ASCKit/Apps/Availability/AppAvailabilities.swift rename to Sources/ASCKit/Apps/Availability/AppAvailabilityRepository.swift index 136d4457..dec72c0e 100644 --- a/Sources/ASCKit/Apps/Availability/AppAvailabilities.swift +++ b/Sources/ASCKit/Apps/Availability/AppAvailabilityRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppAvailabilities: Sendable { +public protocol AppAvailabilityRepository: Sendable { /// `nil` when the app's availability hasn't been set up yet. func getAppAvailability(appId: String) async throws -> AppAvailability? /// Sets up the app's availability: available in `territoryIds`. diff --git a/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilities.swift b/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilities.swift rename to Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift index d319eef0..6fc45449 100644 --- a/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilities.swift +++ b/Sources/ASCKit/Apps/Availability/Internal/SDKAppAvailabilityRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppAvailabilities: AppAvailabilities, @unchecked Sendable { +public struct SDKAppAvailabilityRepository: AppAvailabilityRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Builds/BetaBuildLocalizations.swift b/Sources/ASCKit/Apps/Builds/BetaBuildLocalizationRepository.swift similarity index 80% rename from Sources/ASCKit/Apps/Builds/BetaBuildLocalizations.swift rename to Sources/ASCKit/Apps/Builds/BetaBuildLocalizationRepository.swift index 8ca6aa1f..3a6c37e2 100644 --- a/Sources/ASCKit/Apps/Builds/BetaBuildLocalizations.swift +++ b/Sources/ASCKit/Apps/Builds/BetaBuildLocalizationRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BetaBuildLocalizations: Sendable { +public protocol BetaBuildLocalizationRepository: Sendable { func listBetaBuildLocalizations(buildId: String) async throws -> [BetaBuildLocalization] func upsertBetaBuildLocalization(buildId: String, locale: String, whatsNew: String) async throws -> BetaBuildLocalization } diff --git a/Sources/ASCKit/Apps/Builds/Builds.swift b/Sources/ASCKit/Apps/Builds/BuildRepository.swift similarity index 93% rename from Sources/ASCKit/Apps/Builds/Builds.swift rename to Sources/ASCKit/Apps/Builds/BuildRepository.swift index 14bb4a11..815f0fdc 100644 --- a/Sources/ASCKit/Apps/Builds/Builds.swift +++ b/Sources/ASCKit/Apps/Builds/BuildRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol Builds: Sendable { +public protocol BuildRepository: Sendable { func listBuilds(appId: String?, platform: BuildUploadPlatform?, version: String?, limit: Int?) async throws -> PaginatedResponse func getBuild(id: String) async throws -> Build func addBetaGroups(buildId: String, betaGroupIds: [String]) async throws diff --git a/Sources/ASCKit/Apps/Builds/BuildUploads.swift b/Sources/ASCKit/Apps/Builds/BuildUploadRepository.swift similarity index 88% rename from Sources/ASCKit/Apps/Builds/BuildUploads.swift rename to Sources/ASCKit/Apps/Builds/BuildUploadRepository.swift index 42e5897d..d339b8e2 100644 --- a/Sources/ASCKit/Apps/Builds/BuildUploads.swift +++ b/Sources/ASCKit/Apps/Builds/BuildUploadRepository.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol BuildUploads: Sendable { +public protocol BuildUploadRepository: Sendable { func uploadBuild(appId: String, version: String, buildNumber: String, platform: BuildUploadPlatform, fileURL: URL) async throws -> BuildUpload func listBuildUploads(appId: String) async throws -> [BuildUpload] func getBuildUpload(id: String) async throws -> BuildUpload diff --git a/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift b/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift index 9381389c..8f2adc0c 100644 --- a/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/OpenAPIBuildRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBuilds: Builds, @unchecked Sendable { +public struct SDKBuildRepository: BuildRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizations.swift b/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift similarity index 95% rename from Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizations.swift rename to Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift index 8589322c..89741ff3 100644 --- a/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizations.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/SDKBetaBuildLocalizationRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBetaBuildLocalizations: BetaBuildLocalizations, @unchecked Sendable { +public struct SDKBetaBuildLocalizationRepository: BetaBuildLocalizationRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploads.swift b/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploads.swift rename to Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift index 4945b22d..7a274264 100644 --- a/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploads.swift +++ b/Sources/ASCKit/Apps/Builds/Internal/SDKBuildUploadRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKBuildUploads: BuildUploads, @unchecked Sendable { +public struct SDKBuildUploadRepository: BuildUploadRepository, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/Experiments/Experiments.swift b/Sources/ASCKit/Apps/Experiments/ExperimentRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/Experiments/Experiments.swift rename to Sources/ASCKit/Apps/Experiments/ExperimentRepository.swift index 2c62558e..10e693c9 100644 --- a/Sources/ASCKit/Apps/Experiments/Experiments.swift +++ b/Sources/ASCKit/Apps/Experiments/ExperimentRepository.swift @@ -2,7 +2,7 @@ import Mockable /// Product Page Optimization tests, treatments and treatment localizations. @Mockable -public protocol Experiments: Sendable { +public protocol ExperimentRepository: Sendable { // Experiments (app-scoped) func listExperiments(appId: String, state: AppStoreVersionExperimentState?, limit: Int?) async throws -> PaginatedResponse func getExperiment(experimentId: String) async throws -> AppStoreVersionExperiment diff --git a/Sources/ASCKit/Apps/Experiments/Internal/SDKExperiments.swift b/Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift similarity index 99% rename from Sources/ASCKit/Apps/Experiments/Internal/SDKExperiments.swift rename to Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift index 54db28ba..fb1ae744 100644 --- a/Sources/ASCKit/Apps/Experiments/Internal/SDKExperiments.swift +++ b/Sources/ASCKit/Apps/Experiments/Internal/SDKExperimentRepository.swift @@ -3,7 +3,7 @@ import Foundation /// Adapts the App Store Connect "product page optimization" endpoints /// (`appStoreVersionExperiments` v2 + treatments + treatment localizations). -public struct SDKExperiments: Experiments, @unchecked Sendable { +public struct SDKExperimentRepository: ExperimentRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilities.swift b/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift similarity index 87% rename from Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilities.swift rename to Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift index 40ebd2d3..9770e5c5 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilities.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Availability/InAppPurchaseAvailabilityRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseAvailabilities: Sendable { +public protocol InAppPurchaseAvailabilityRepository: Sendable { /// Returns nil when the IAP has no availability resource yet (404 from ASC) — typical /// for newly-created IAPs. Frontends treat nil as "no availability set; default UI". func getAvailability(iapId: String) async throws -> InAppPurchaseAvailability? diff --git a/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilities.swift b/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilities.swift rename to Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift index 6c1dd7ff..9066676f 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilities.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseAvailabilities: InAppPurchaseAvailabilities, @unchecked Sendable { +public struct SDKInAppPurchaseAvailabilityRepository: InAppPurchaseAvailabilityRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePrices.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceRepository.swift similarity index 94% rename from Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePrices.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceRepository.swift index 0f20d558..22721d3c 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePrices.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchasePriceRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchasePrices: Sendable { +public protocol InAppPurchasePriceRepository: Sendable { /// Cursor-paginated. `cursor` is the opaque value from the previous response's /// `nextCursor`. `limit` defaults to ASC's page size (~50) when nil. func listPricePoints( diff --git a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchases.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseRepository.swift similarity index 91% rename from Sources/ASCKit/Apps/InAppPurchases/InAppPurchases.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseRepository.swift index 2f21de6d..0a7d6e4a 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchases.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchases: Sendable { +public protocol InAppPurchaseRepository: Sendable { func listInAppPurchases(appId: String, limit: Int?) async throws -> PaginatedResponse func createInAppPurchase( appId: String, diff --git a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePrices.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift similarity index 99% rename from Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePrices.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift index 03b06a83..609e4fd4 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePrices.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchasePrices: InAppPurchasePrices, @unchecked Sendable { +public struct SDKInAppPurchasePriceRepository: InAppPurchasePriceRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchases.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchases.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift index 574cb689..f6911df1 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchases.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchases: InAppPurchases, @unchecked Sendable { +public struct SDKInAppPurchaseRepository: InAppPurchaseRepository, @unchecked Sendable { private let client: any APIClient /// Optional enricher that asks iris for `submitWithNextAppStoreVersion` per IAP /// (the public SDK has no path that exposes that bit). Wired by the factory when diff --git a/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizations.swift b/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift similarity index 88% rename from Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizations.swift rename to Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift index 36c62b95..e8b7a1ea 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizations.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Localizations/InAppPurchaseLocalizationRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseLocalizations: Sendable { +public protocol InAppPurchaseLocalizationRepository: Sendable { func listLocalizations(iapId: String) async throws -> [InAppPurchaseLocalization] func createLocalization( iapId: String, diff --git a/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizations.swift b/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizations.swift rename to Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift index 43a226a8..0d472495 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizations.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Localizations/Internal/SDKInAppPurchaseLocalizationRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseLocalizations: InAppPurchaseLocalizations, @unchecked Sendable { +public struct SDKInAppPurchaseLocalizationRepository: InAppPurchaseLocalizationRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodes.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodes.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift index 7b4f0364..607a9e21 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodes.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/InAppPurchaseOfferCodeRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseOfferCodes: Sendable { +public protocol InAppPurchaseOfferCodeRepository: Sendable { func listOfferCodes(iapId: String) async throws -> [InAppPurchaseOfferCode] /// Creates an offer code with full per-territory pricing. /// diff --git a/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodes.swift b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift similarity index 99% rename from Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodes.swift rename to Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift index a4f9d2eb..ee4d06a9 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodes.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepository.swift @@ -1,7 +1,7 @@ import Foundation @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseOfferCodes: InAppPurchaseOfferCodes, @unchecked Sendable { +public struct SDKInAppPurchaseOfferCodeRepository: InAppPurchaseOfferCodeRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewAssets.swift b/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift similarity index 90% rename from Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewAssets.swift rename to Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift index db4ceab2..817d6d02 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewAssets.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Review/InAppPurchaseReviewRepository.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol InAppPurchaseReviewAssets: Sendable { +public protocol InAppPurchaseReviewRepository: Sendable { func getReviewScreenshot(iapId: String) async throws -> InAppPurchaseReviewScreenshot? func uploadReviewScreenshot(iapId: String, fileURL: URL) async throws -> InAppPurchaseReviewScreenshot func deleteReviewScreenshot(screenshotId: String) async throws diff --git a/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssets.swift b/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift similarity index 99% rename from Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssets.swift rename to Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift index 78fc2804..eb5fd9e0 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssets.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKInAppPurchaseReviewAssets: InAppPurchaseReviewAssets, @unchecked Sendable { +public struct SDKInAppPurchaseReviewRepository: InAppPurchaseReviewRepository, @unchecked Sendable { private let client: any APIClient /// Per-attempt sleep when polling for `imageAsset` readiness post-upload. /// Mirrors the iOS SDK's 2s default; tests override to 0 to keep the suite fast. diff --git a/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift b/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift index 4fe0283a..33d7f7dd 100644 --- a/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift +++ b/Sources/ASCKit/Apps/Internal/OpenAPIAppRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKApps: Apps, @unchecked Sendable { +public struct SDKAppRepository: AppRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Performance/Diagnostics.swift b/Sources/ASCKit/Apps/Performance/DiagnosticsRepository.swift similarity index 81% rename from Sources/ASCKit/Apps/Performance/Diagnostics.swift rename to Sources/ASCKit/Apps/Performance/DiagnosticsRepository.swift index 2380eede..e384661c 100644 --- a/Sources/ASCKit/Apps/Performance/Diagnostics.swift +++ b/Sources/ASCKit/Apps/Performance/DiagnosticsRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol Diagnostics: Sendable { +public protocol DiagnosticsRepository: Sendable { func listSignatures(buildId: String, diagnosticType: DiagnosticType?) async throws -> [DiagnosticSignatureInfo] func listLogs(signatureId: String) async throws -> [DiagnosticLogEntry] } diff --git a/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnostics.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/Performance/Internal/SDKDiagnostics.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift index 3d7f8c24..d8a8ffff 100644 --- a/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnostics.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKDiagnosticsRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKDiagnostics: Diagnostics, @unchecked Sendable { +public struct SDKDiagnosticsRepository: DiagnosticsRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetrics.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetrics.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift index c6d3adf6..af0e2eec 100644 --- a/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetrics.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfMetricsRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKPerfMetrics: PerfMetrics, @unchecked Sendable { +public struct SDKPerfMetricsRepository: PerfMetricsRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviews.swift b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviews.swift rename to Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift index 61173516..fcb92c30 100644 --- a/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviews.swift +++ b/Sources/ASCKit/Apps/Performance/Internal/SDKPerfOverviewRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKPerfOverviews: PerfOverviews, @unchecked Sendable { +public struct SDKPerfOverviewRepository: PerfOverviewRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Performance/PerfMetrics.swift b/Sources/ASCKit/Apps/Performance/PerfMetricsRepository.swift similarity index 84% rename from Sources/ASCKit/Apps/Performance/PerfMetrics.swift rename to Sources/ASCKit/Apps/Performance/PerfMetricsRepository.swift index f94eba85..b1c5347a 100644 --- a/Sources/ASCKit/Apps/Performance/PerfMetrics.swift +++ b/Sources/ASCKit/Apps/Performance/PerfMetricsRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol PerfMetrics: Sendable { +public protocol PerfMetricsRepository: Sendable { func listAppMetrics(appId: String, metricType: PerformanceMetricCategory?) async throws -> [PerformanceMetric] func listBuildMetrics(buildId: String, metricType: PerformanceMetricCategory?) async throws -> [PerformanceMetric] } diff --git a/Sources/ASCKit/Apps/Performance/PerfOverviews.swift b/Sources/ASCKit/Apps/Performance/PerfOverviewRepository.swift similarity index 70% rename from Sources/ASCKit/Apps/Performance/PerfOverviews.swift rename to Sources/ASCKit/Apps/Performance/PerfOverviewRepository.swift index c8ed24d8..d1f9e69a 100644 --- a/Sources/ASCKit/Apps/Performance/PerfOverviews.swift +++ b/Sources/ASCKit/Apps/Performance/PerfOverviewRepository.swift @@ -1,6 +1,6 @@ import Mockable @Mockable -public protocol PerfOverviews: Sendable { +public protocol PerfOverviewRepository: Sendable { func getOverview(appId: String, deviceType: String?) async throws -> PerformanceOverview } diff --git a/Sources/ASCKit/Apps/Pricing/Internal/SDKAppPrices.swift b/Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/Pricing/Internal/SDKAppPrices.swift rename to Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift index 35ecc500..42eb497e 100644 --- a/Sources/ASCKit/Apps/Pricing/Internal/SDKAppPrices.swift +++ b/Sources/ASCKit/Apps/Pricing/Internal/SDKPricingRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKAppPrices: AppPrices, @unchecked Sendable { +public struct SDKPricingRepository: PricingRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Pricing/AppPrices.swift b/Sources/ASCKit/Apps/Pricing/PricingRepository.swift similarity index 90% rename from Sources/ASCKit/Apps/Pricing/AppPrices.swift rename to Sources/ASCKit/Apps/Pricing/PricingRepository.swift index a7e41dec..5b93e66f 100644 --- a/Sources/ASCKit/Apps/Pricing/AppPrices.swift +++ b/Sources/ASCKit/Apps/Pricing/PricingRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppPrices: Sendable { +public protocol PricingRepository: Sendable { func hasPricing(appId: String) async throws -> Bool /// The prices the app can be sold at in `territory`. func listPricePoints(appId: String, territory: String) async throws -> [AppPricePoint] diff --git a/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersions.swift b/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersions.swift rename to Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift index 3775e4c6..bf287dce 100644 --- a/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersions.swift +++ b/Sources/ASCKit/Apps/ProductVersions/Internal/SDKProductVersionRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKProductVersions: ProductVersions, @unchecked Sendable { +public struct SDKProductVersionRepository: ProductVersionRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/ProductVersions/ProductVersions.swift b/Sources/ASCKit/Apps/ProductVersions/ProductVersionRepository.swift similarity index 84% rename from Sources/ASCKit/Apps/ProductVersions/ProductVersions.swift rename to Sources/ASCKit/Apps/ProductVersions/ProductVersionRepository.swift index 5760cf46..a749e2b1 100644 --- a/Sources/ASCKit/Apps/ProductVersions/ProductVersions.swift +++ b/Sources/ASCKit/Apps/ProductVersions/ProductVersionRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol ProductVersions: Sendable { +public protocol ProductVersionRepository: Sendable { func listInAppPurchaseVersions(iapId: String) async throws -> [ProductVersion] func listSubscriptionVersions(subscriptionId: String) async throws -> [ProductVersion] func listSubscriptionGroupVersions(groupId: String) async throws -> [ProductVersion] diff --git a/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchases.swift b/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchases.swift rename to Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift index 2b69ee97..fc18c2c2 100644 --- a/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchases.swift +++ b/Sources/ASCKit/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKPromotedPurchases: PromotedPurchases, @unchecked Sendable { +public struct SDKPromotedPurchaseRepository: PromotedPurchaseRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchases.swift b/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchaseRepository.swift similarity index 91% rename from Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchases.swift rename to Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchaseRepository.swift index d77598b6..22aed9db 100644 --- a/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchases.swift +++ b/Sources/ASCKit/Apps/PromotedPurchases/PromotedPurchaseRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol PromotedPurchases: Sendable { +public protocol PromotedPurchaseRepository: Sendable { func listPromotedPurchases(appId: String, limit: Int?) async throws -> PaginatedResponse func createPromotedPurchase( appId: String, diff --git a/Sources/ASCKit/Apps/Reviews/CustomerReviews.swift b/Sources/ASCKit/Apps/Reviews/CustomerReviewRepository.swift similarity index 88% rename from Sources/ASCKit/Apps/Reviews/CustomerReviews.swift rename to Sources/ASCKit/Apps/Reviews/CustomerReviewRepository.swift index f82c9881..6da363e0 100644 --- a/Sources/ASCKit/Apps/Reviews/CustomerReviews.swift +++ b/Sources/ASCKit/Apps/Reviews/CustomerReviewRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol CustomerReviews: Sendable { +public protocol CustomerReviewRepository: Sendable { func listReviews(appId: String) async throws -> [CustomerReview] func getReview(reviewId: String) async throws -> CustomerReview func getResponse(reviewId: String) async throws -> CustomerReviewResponse diff --git a/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviews.swift b/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviews.swift rename to Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift index cf62ca7f..7c6a7e3a 100644 --- a/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviews.swift +++ b/Sources/ASCKit/Apps/Reviews/Internal/SDKCustomerReviewRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKCustomerReviews: CustomerReviews, @unchecked Sendable { +public struct SDKCustomerReviewRepository: CustomerReviewRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilities.swift b/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift similarity index 95% rename from Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilities.swift rename to Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift index ef70e0de..4a33786c 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilities.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionAvailabilities: SubscriptionAvailabilities, @unchecked Sendable { +public struct SDKSubscriptionAvailabilityRepository: SubscriptionAvailabilityRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { @@ -8,7 +8,7 @@ public struct SDKSubscriptionAvailabilities: SubscriptionAvailabilities, @unchec } public func getAvailability(subscriptionId: String) async throws -> ASCKit.SubscriptionAvailability? { - // Two parallel calls — see SDKInAppPurchaseAvailabilities for rationale. + // Two parallel calls — see SDKInAppPurchaseAvailabilityRepository for rationale. // 404 → nil (no availability configured yet on a fresh subscription). do { async let availResponse = client.request( diff --git a/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilities.swift b/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift similarity index 71% rename from Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilities.swift rename to Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift index eaa39d69..3b667003 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilities.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Availability/SubscriptionAvailabilityRepository.swift @@ -1,9 +1,9 @@ import Mockable @Mockable -public protocol SubscriptionAvailabilities: Sendable { +public protocol SubscriptionAvailabilityRepository: Sendable { /// Returns nil when the subscription has no availability resource yet (404 from ASC). - /// Mirrors `InAppPurchaseAvailabilities.getAvailability` 404 tolerance. + /// Mirrors `InAppPurchaseAvailabilityRepository.getAvailability` 404 tolerance. func getAvailability(subscriptionId: String) async throws -> SubscriptionAvailability? func createAvailability(subscriptionId: String, isAvailableInNewTerritories: Bool, territoryIds: [String]) async throws -> SubscriptionAvailability } diff --git a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroups.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift similarity index 95% rename from Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroups.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift index 2d4da141..591b52c4 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroups.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionGroups: SubscriptionGroups, @unchecked Sendable { +public struct SDKSubscriptionGroupRepository: SubscriptionGroupRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPrices.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPrices.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift index e023b61b..055afa0c 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPrices.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionPrices: SubscriptionPrices, @unchecked Sendable { +public struct SDKSubscriptionPriceRepository: SubscriptionPriceRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptions.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptions.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift index feda622c..e12e3c66 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptions.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptions: Subscriptions, @unchecked Sendable { +public struct SDKSubscriptionRepository: SubscriptionRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffers.swift b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffers.swift rename to Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift index 8ef79038..6f28309b 100644 --- a/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffers.swift +++ b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionIntroductoryOffers: SubscriptionIntroductoryOffers, @unchecked Sendable { +public struct SDKSubscriptionIntroductoryOfferRepository: SubscriptionIntroductoryOfferRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffers.swift b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift similarity index 88% rename from Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffers.swift rename to Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift index 255c4bca..4029734a 100644 --- a/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOffers.swift +++ b/Sources/ASCKit/Apps/Subscriptions/IntroductoryOffers/SubscriptionIntroductoryOfferRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionIntroductoryOffers: Sendable { +public protocol SubscriptionIntroductoryOfferRepository: Sendable { func listIntroductoryOffers(subscriptionId: String) async throws -> [SubscriptionIntroductoryOffer] func createIntroductoryOffer( subscriptionId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizations.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift similarity index 95% rename from Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizations.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift index 5ff74eca..d948093d 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizations.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionGroupLocalizationRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionGroupLocalizations: SubscriptionGroupLocalizations, @unchecked Sendable { +public struct SDKSubscriptionGroupLocalizationRepository: SubscriptionGroupLocalizationRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizations.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizations.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift index ea16f2c6..8923fa7a 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizations.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/Internal/SDKSubscriptionLocalizationRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionLocalizations: SubscriptionLocalizations, @unchecked Sendable { +public struct SDKSubscriptionLocalizationRepository: SubscriptionLocalizationRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizations.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift similarity index 88% rename from Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizations.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift index b6833639..065cd91e 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizations.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionGroupLocalizationRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionGroupLocalizations: Sendable { +public protocol SubscriptionGroupLocalizationRepository: Sendable { func listLocalizations(groupId: String) async throws -> [SubscriptionGroupLocalization] func createLocalization( groupId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizations.swift b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift similarity index 89% rename from Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizations.swift rename to Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift index 81611669..33761959 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizations.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Localizations/SubscriptionLocalizationRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionLocalizations: Sendable { +public protocol SubscriptionLocalizationRepository: Sendable { func listLocalizations(subscriptionId: String) async throws -> [SubscriptionLocalization] func createLocalization( subscriptionId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodes.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift similarity index 99% rename from Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodes.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift index 79cd2b7a..fc44ed93 100644 --- a/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodes.swift +++ b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepository.swift @@ -1,7 +1,7 @@ import Foundation @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionOfferCodes: SubscriptionOfferCodes, @unchecked Sendable { +public struct SDKSubscriptionOfferCodeRepository: SubscriptionOfferCodeRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodes.swift b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodes.swift rename to Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift index 1f1e7473..24ce183e 100644 --- a/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodes.swift +++ b/Sources/ASCKit/Apps/Subscriptions/OfferCodes/SubscriptionOfferCodeRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionOfferCodes: Sendable { +public protocol SubscriptionOfferCodeRepository: Sendable { func listOfferCodes(subscriptionId: String) async throws -> [SubscriptionOfferCode] /// Creates a subscription offer code. /// diff --git a/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOffers.swift b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOffers.swift rename to Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift index cf80bf6e..48750260 100644 --- a/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOffers.swift +++ b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/Internal/SDKSubscriptionPromotionalOfferRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionPromotionalOffers: SubscriptionPromotionalOffers, @unchecked Sendable { +public struct SDKSubscriptionPromotionalOfferRepository: SubscriptionPromotionalOfferRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffers.swift b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift similarity index 90% rename from Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffers.swift rename to Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift index 86d0022e..0064cbd3 100644 --- a/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOffers.swift +++ b/Sources/ASCKit/Apps/Subscriptions/PromotionalOffers/SubscriptionPromotionalOfferRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionPromotionalOffers: Sendable { +public protocol SubscriptionPromotionalOfferRepository: Sendable { func listPromotionalOffers(subscriptionId: String) async throws -> [SubscriptionPromotionalOffer] func createPromotionalOffer( subscriptionId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssets.swift b/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift similarity index 99% rename from Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssets.swift rename to Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift index 4621c1b7..d2ac535c 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssets.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKSubscriptionReviewAssets: SubscriptionReviewAssets, @unchecked Sendable { +public struct SDKSubscriptionReviewRepository: SubscriptionReviewRepository, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor /// Per-attempt sleep when polling for `imageAsset` readiness post-upload. diff --git a/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewAssets.swift b/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift similarity index 90% rename from Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewAssets.swift rename to Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift index 0235056e..f850dd49 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewAssets.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Review/SubscriptionReviewRepository.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol SubscriptionReviewAssets: Sendable { +public protocol SubscriptionReviewRepository: Sendable { func getReviewScreenshot(subscriptionId: String) async throws -> SubscriptionReviewScreenshot? func uploadReviewScreenshot(subscriptionId: String, fileURL: URL) async throws -> SubscriptionReviewScreenshot func deleteReviewScreenshot(screenshotId: String) async throws diff --git a/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroups.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroupRepository.swift similarity index 88% rename from Sources/ASCKit/Apps/Subscriptions/SubscriptionGroups.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionGroupRepository.swift index 72e13f16..26dd09f1 100644 --- a/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroups.swift +++ b/Sources/ASCKit/Apps/Subscriptions/SubscriptionGroupRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionGroups: Sendable { +public protocol SubscriptionGroupRepository: Sendable { func listSubscriptionGroups(appId: String, limit: Int?) async throws -> PaginatedResponse func createSubscriptionGroup(appId: String, referenceName: String) async throws -> SubscriptionGroup func updateSubscriptionGroup(groupId: String, referenceName: String) async throws -> SubscriptionGroup diff --git a/Sources/ASCKit/Apps/Subscriptions/SubscriptionPrices.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/Subscriptions/SubscriptionPrices.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceRepository.swift index 18291c25..99393f75 100644 --- a/Sources/ASCKit/Apps/Subscriptions/SubscriptionPrices.swift +++ b/Sources/ASCKit/Apps/Subscriptions/SubscriptionPriceRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionPrices: Sendable { +public protocol SubscriptionPriceRepository: Sendable { /// Cursor-paginated. `cursor` is the opaque value from the previous response's /// `nextCursor`. `limit` defaults to ASC's page size (~50) when nil. func listPricePoints( diff --git a/Sources/ASCKit/Apps/Subscriptions/Subscriptions.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionRepository.swift similarity index 93% rename from Sources/ASCKit/Apps/Subscriptions/Subscriptions.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionRepository.swift index de757acd..534b6c72 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Subscriptions.swift +++ b/Sources/ASCKit/Apps/Subscriptions/SubscriptionRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol Subscriptions: Sendable { +public protocol SubscriptionRepository: Sendable { func listSubscriptions(groupId: String, limit: Int?) async throws -> PaginatedResponse func createSubscription( groupId: String, diff --git a/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOffers.swift b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift similarity index 99% rename from Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOffers.swift rename to Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift index c82c77ee..78b9bc9c 100644 --- a/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOffers.swift +++ b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/Internal/SDKWinBackOfferRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKWinBackOffers: WinBackOffers, @unchecked Sendable { +public struct SDKWinBackOfferRepository: WinBackOfferRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOffers.swift b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOffers.swift rename to Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift index 2287d65c..dfc580fe 100644 --- a/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOffers.swift +++ b/Sources/ASCKit/Apps/Subscriptions/WinBackOffers/WinBackOfferRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol WinBackOffers: Sendable { +public protocol WinBackOfferRepository: Sendable { func listWinBackOffers(subscriptionId: String) async throws -> [WinBackOffer] func createWinBackOffer( subscriptionId: String, diff --git a/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizations.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizationRepository.swift similarity index 91% rename from Sources/ASCKit/Apps/TestFlight/BetaAppLocalizations.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppLocalizationRepository.swift index 0df9fcb5..37a52701 100644 --- a/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizations.swift +++ b/Sources/ASCKit/Apps/TestFlight/BetaAppLocalizationRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BetaAppLocalizations: Sendable { +public protocol BetaAppLocalizationRepository: Sendable { func listBetaAppLocalizations(appId: String) async throws -> [BetaAppLocalization] func getBetaAppLocalization(localizationId: String) async throws -> BetaAppLocalization func createBetaAppLocalization( diff --git a/Sources/ASCKit/Apps/TestFlight/BetaAppReviews.swift b/Sources/ASCKit/Apps/TestFlight/BetaAppReviewRepository.swift similarity index 89% rename from Sources/ASCKit/Apps/TestFlight/BetaAppReviews.swift rename to Sources/ASCKit/Apps/TestFlight/BetaAppReviewRepository.swift index 088bfc46..922a9992 100644 --- a/Sources/ASCKit/Apps/TestFlight/BetaAppReviews.swift +++ b/Sources/ASCKit/Apps/TestFlight/BetaAppReviewRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BetaAppReviews: Sendable { +public protocol BetaAppReviewRepository: Sendable { func listSubmissions(buildId: String) async throws -> [BetaAppReviewSubmission] func createSubmission(buildId: String) async throws -> BetaAppReviewSubmission func getSubmission(id: String) async throws -> BetaAppReviewSubmission diff --git a/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift b/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift index 86276cc6..22c5a182 100644 --- a/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/OpenAPITestFlightRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKTestFlight: TestFlight, @unchecked Sendable { +public struct SDKTestFlightRepository: TestFlightRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizations.swift b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizations.swift rename to Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift index 8f94613a..f7aa86c6 100644 --- a/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizations.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBetaAppLocalizations: BetaAppLocalizations, @unchecked Sendable { +public struct SDKBetaAppLocalizationRepository: BetaAppLocalizationRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviews.swift b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviews.swift rename to Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift index 0fec5f9c..1ee9352f 100644 --- a/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviews.swift +++ b/Sources/ASCKit/Apps/TestFlight/Internal/SDKBetaAppReviewRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBetaAppReviews: BetaAppReviews, @unchecked Sendable { +public struct SDKBetaAppReviewRepository: BetaAppReviewRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/TestFlight/TestFlight.swift b/Sources/ASCKit/Apps/TestFlight/TestFlightRepository.swift similarity index 92% rename from Sources/ASCKit/Apps/TestFlight/TestFlight.swift rename to Sources/ASCKit/Apps/TestFlight/TestFlightRepository.swift index 52ce6f8e..93413dbf 100644 --- a/Sources/ASCKit/Apps/TestFlight/TestFlight.swift +++ b/Sources/ASCKit/Apps/TestFlight/TestFlightRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol TestFlight: Sendable { +public protocol TestFlightRepository: Sendable { func listBetaGroups(appId: String?, limit: Int?) async throws -> PaginatedResponse func createBetaGroup( appId: String, diff --git a/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetails.swift b/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift similarity index 97% rename from Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetails.swift rename to Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift index 22814a3e..b116c6aa 100644 --- a/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetails.swift +++ b/Sources/ASCKit/Apps/Versions/Internal/SDKReviewDetailRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKReviewDetails: ReviewDetails, @unchecked Sendable { +public struct SDKReviewDetailRepository: ReviewDetailRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Versions/Internal/SDKAppStoreVersions.swift b/Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/Versions/Internal/SDKAppStoreVersions.swift rename to Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift index 0aeff44e..c5e31531 100644 --- a/Sources/ASCKit/Apps/Versions/Internal/SDKAppStoreVersions.swift +++ b/Sources/ASCKit/Apps/Versions/Internal/SDKVersionRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAppStoreVersions: AppStoreVersions, @unchecked Sendable { +public struct SDKVersionRepository: VersionRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKVersionLocalizations.swift b/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift similarity index 96% rename from Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKVersionLocalizations.swift rename to Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift index 460e36ee..d77d7ebb 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKVersionLocalizations.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/Internal/SDKLocalizationRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKVersionLocalizations: VersionLocalizations, @unchecked Sendable { +public struct SDKLocalizationRepository: VersionLocalizationRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviews.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift similarity index 98% rename from Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviews.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift index bb7db985..4cc76a48 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviews.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct OpenAPIAppPreviews: AppPreviews, @unchecked Sendable { +public struct OpenAPIPreviewRepository: PreviewRepository, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviews.swift b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift similarity index 89% rename from Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviews.swift rename to Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift index 0efe53ce..468d44a1 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/AppPreviews.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/PreviewSets/PreviewRepository.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol AppPreviews: Sendable { +public protocol PreviewRepository: Sendable { func listPreviewSets(localizationId: String) async throws -> [AppPreviewSet] func createPreviewSet(localizationId: String, previewType: PreviewType) async throws -> AppPreviewSet func listPreviews(setId: String) async throws -> [AppPreview] diff --git a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift index d23e18e2..c3653ca5 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSet.swift @@ -7,14 +7,14 @@ public final class AppScreenshotSet: Identifiable, @unchecked Sendable { public let screenshotDisplayType: ScreenshotDisplayType public let screenshotsCount: Int - private let repo: (any AppScreenshots)? + private let repo: (any ScreenshotRepository)? public init( id: String, localizationId: String, screenshotDisplayType: ScreenshotDisplayType, screenshotsCount: Int = 0, - repo: (any AppScreenshots)? = nil + repo: (any ScreenshotRepository)? = nil ) { self.id = id self.localizationId = localizationId diff --git a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift index 38f6b556..4431e625 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/OpenAPIScreenshotRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAppScreenshots: AppScreenshots, @unchecked Sendable { +public struct SDKScreenshotRepository: ScreenshotRepository, @unchecked Sendable { private let client: any APIClient private let uploader: UploadOperationsExecutor diff --git a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshots.swift b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift similarity index 92% rename from Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshots.swift rename to Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift index ad229e3d..c33fde4d 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/AppScreenshots.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepository.swift @@ -2,7 +2,7 @@ import Foundation import Mockable @Mockable -public protocol AppScreenshots: Sendable { +public protocol ScreenshotRepository: Sendable { /// List screenshot sets for a specific localization. func listScreenshotSets(localizationId: String) async throws -> [AppScreenshotSet] diff --git a/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizations.swift b/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizationRepository.swift similarity index 89% rename from Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizations.swift rename to Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizationRepository.swift index d1b21a27..b93553a6 100644 --- a/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizations.swift +++ b/Sources/ASCKit/Apps/Versions/Localizations/VersionLocalizationRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol VersionLocalizations: Sendable { +public protocol VersionLocalizationRepository: Sendable { func listLocalizations(versionId: String) async throws -> [AppStoreVersionLocalization] func createLocalization(versionId: String, locale: String) async throws -> AppStoreVersionLocalization func updateLocalization( diff --git a/Sources/ASCKit/Apps/Versions/ReviewDetails.swift b/Sources/ASCKit/Apps/Versions/ReviewDetailRepository.swift similarity index 81% rename from Sources/ASCKit/Apps/Versions/ReviewDetails.swift rename to Sources/ASCKit/Apps/Versions/ReviewDetailRepository.swift index dc21e4b9..d274021a 100644 --- a/Sources/ASCKit/Apps/Versions/ReviewDetails.swift +++ b/Sources/ASCKit/Apps/Versions/ReviewDetailRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol ReviewDetails: Sendable { +public protocol ReviewDetailRepository: Sendable { func getReviewDetail(versionId: String) async throws -> AppStoreReviewDetail func upsertReviewDetail(versionId: String, update: ReviewDetailUpdate) async throws -> AppStoreReviewDetail } diff --git a/Sources/ASCKit/Apps/Versions/AppStoreVersions.swift b/Sources/ASCKit/Apps/Versions/VersionRepository.swift similarity index 95% rename from Sources/ASCKit/Apps/Versions/AppStoreVersions.swift rename to Sources/ASCKit/Apps/Versions/VersionRepository.swift index 83d79efe..2614df65 100644 --- a/Sources/ASCKit/Apps/Versions/AppStoreVersions.swift +++ b/Sources/ASCKit/Apps/Versions/VersionRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AppStoreVersions: Sendable { +public protocol VersionRepository: Sendable { func listVersions(appId: String) async throws -> [AppStoreVersion] func getVersion(id: String) async throws -> AppStoreVersion func createVersion(appId: String, versionString: String, platform: AppStorePlatform) async throws -> AppStoreVersion diff --git a/Sources/ASCKit/Auth/Iris/IrisSessions.swift b/Sources/ASCKit/Auth/Iris/IrisSessionRepository.swift similarity index 84% rename from Sources/ASCKit/Auth/Iris/IrisSessions.swift rename to Sources/ASCKit/Auth/Iris/IrisSessionRepository.swift index c7742505..276e5519 100644 --- a/Sources/ASCKit/Auth/Iris/IrisSessions.swift +++ b/Sources/ASCKit/Auth/Iris/IrisSessionRepository.swift @@ -4,10 +4,10 @@ import Mockable /// Persists `IrisAuthSession` for reuse across `asc` invocations. /// /// One session at a time — the protocol is CRUD on a singleton resource. Implementations -/// live in Infrastructure (`KeychainIrisSessionRepository` on macOS, `FileIrisSessions` +/// live in Infrastructure (`KeychainIrisSessionRepository` on macOS, `FileIrisSessionRepository` /// for the disk fallback, `CompositeIrisSessionRepository` to chain them). @Mockable -public protocol IrisSessions: Sendable { +public protocol IrisSessionRepository: Sendable { func save(_ session: IrisAuthSession) throws func current() throws -> IrisAuthSession? func delete() throws diff --git a/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDs.swift b/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDRepository.swift similarity index 86% rename from Sources/ASCKit/CodeSigning/BundleIDs/BundleIDs.swift rename to Sources/ASCKit/CodeSigning/BundleIDs/BundleIDRepository.swift index e009ec7f..f5ffc37d 100644 --- a/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDs.swift +++ b/Sources/ASCKit/CodeSigning/BundleIDs/BundleIDRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol BundleIDs: Sendable { +public protocol BundleIDRepository: Sendable { func listBundleIDs(platform: BundleIDPlatform?, identifier: String?) async throws -> [BundleID] func createBundleID(name: String, identifier: String, platform: BundleIDPlatform) async throws -> BundleID func deleteBundleID(id: String) async throws diff --git a/Sources/ASCKit/CodeSigning/Certificates/Certificates.swift b/Sources/ASCKit/CodeSigning/Certificates/CertificateRepository.swift similarity index 85% rename from Sources/ASCKit/CodeSigning/Certificates/Certificates.swift rename to Sources/ASCKit/CodeSigning/Certificates/CertificateRepository.swift index 5d7ebe26..156126b9 100644 --- a/Sources/ASCKit/CodeSigning/Certificates/Certificates.swift +++ b/Sources/ASCKit/CodeSigning/Certificates/CertificateRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol Certificates: Sendable { +public protocol CertificateRepository: Sendable { func listCertificates(certificateType: CertificateType?, limit: Int?) async throws -> [Certificate] func createCertificate(certificateType: CertificateType, csrContent: String) async throws -> Certificate func revokeCertificate(id: String) async throws diff --git a/Sources/ASCKit/CodeSigning/Devices/Devices.swift b/Sources/ASCKit/CodeSigning/Devices/DeviceRepository.swift similarity index 82% rename from Sources/ASCKit/CodeSigning/Devices/Devices.swift rename to Sources/ASCKit/CodeSigning/Devices/DeviceRepository.swift index 981f75de..98825abe 100644 --- a/Sources/ASCKit/CodeSigning/Devices/Devices.swift +++ b/Sources/ASCKit/CodeSigning/Devices/DeviceRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol Devices: Sendable { +public protocol DeviceRepository: Sendable { func listDevices(platform: BundleIDPlatform?) async throws -> [Device] func registerDevice(name: String, udid: String, platform: BundleIDPlatform) async throws -> Device } diff --git a/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDs.swift b/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift similarity index 96% rename from Sources/ASCKit/CodeSigning/Internal/SDKBundleIDs.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift index 0a791e81..2f666abc 100644 --- a/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDs.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKBundleIDRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKBundleIDs: BundleIDs, @unchecked Sendable { +public struct SDKBundleIDRepository: BundleIDRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/CodeSigning/Internal/SDKCertificates.swift b/Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift similarity index 96% rename from Sources/ASCKit/CodeSigning/Internal/SDKCertificates.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift index bf47abe9..81c685f0 100644 --- a/Sources/ASCKit/CodeSigning/Internal/SDKCertificates.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKCertificateRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKCertificates: Certificates, @unchecked Sendable { +public struct SDKCertificateRepository: CertificateRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/CodeSigning/Internal/SDKDevices.swift b/Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift similarity index 96% rename from Sources/ASCKit/CodeSigning/Internal/SDKDevices.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift index d6d1d149..5af1044a 100644 --- a/Sources/ASCKit/CodeSigning/Internal/SDKDevices.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKDeviceRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKDevices: Devices, @unchecked Sendable { +public struct SDKDeviceRepository: DeviceRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/CodeSigning/Internal/SDKProfiles.swift b/Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift similarity index 98% rename from Sources/ASCKit/CodeSigning/Internal/SDKProfiles.swift rename to Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift index 79b9d2a5..c9783b83 100644 --- a/Sources/ASCKit/CodeSigning/Internal/SDKProfiles.swift +++ b/Sources/ASCKit/CodeSigning/Internal/SDKProfileRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKProfiles: Profiles, @unchecked Sendable { +public struct SDKProfileRepository: ProfileRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/CodeSigning/Profiles/Profiles.swift b/Sources/ASCKit/CodeSigning/Profiles/ProfileRepository.swift similarity index 89% rename from Sources/ASCKit/CodeSigning/Profiles/Profiles.swift rename to Sources/ASCKit/CodeSigning/Profiles/ProfileRepository.swift index eb63da4d..3597acf3 100644 --- a/Sources/ASCKit/CodeSigning/Profiles/Profiles.swift +++ b/Sources/ASCKit/CodeSigning/Profiles/ProfileRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol Profiles: Sendable { +public protocol ProfileRepository: Sendable { func listProfiles(bundleIdId: String?, profileType: ProfileType?) async throws -> [Profile] func createProfile( name: String, diff --git a/Sources/ASCKit/GameCenter/GameCenter.swift b/Sources/ASCKit/GameCenter/GameCenterRepository.swift similarity index 94% rename from Sources/ASCKit/GameCenter/GameCenter.swift rename to Sources/ASCKit/GameCenter/GameCenterRepository.swift index ff934395..bbbf98db 100644 --- a/Sources/ASCKit/GameCenter/GameCenter.swift +++ b/Sources/ASCKit/GameCenter/GameCenterRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol GameCenter: Sendable { +public protocol GameCenterRepository: Sendable { func getDetail(appId: String) async throws -> GameCenterDetail func listAchievements(gameCenterDetailId: String) async throws -> [GameCenterAchievement] diff --git a/Sources/ASCKit/GameCenter/Internal/SDKGameCenter.swift b/Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift similarity index 98% rename from Sources/ASCKit/GameCenter/Internal/SDKGameCenter.swift rename to Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift index a16b560e..de9fa1bb 100644 --- a/Sources/ASCKit/GameCenter/Internal/SDKGameCenter.swift +++ b/Sources/ASCKit/GameCenter/Internal/SDKGameCenterRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKGameCenter: GameCenter, @unchecked Sendable { +public struct SDKGameCenterRepository: GameCenterRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/GameCenter/Moderation/GameCenterModeration.swift b/Sources/ASCKit/GameCenter/Moderation/GameCenterModerationRepository.swift similarity index 90% rename from Sources/ASCKit/GameCenter/Moderation/GameCenterModeration.swift rename to Sources/ASCKit/GameCenter/Moderation/GameCenterModerationRepository.swift index 1e085165..4274cf4c 100644 --- a/Sources/ASCKit/GameCenter/Moderation/GameCenterModeration.swift +++ b/Sources/ASCKit/GameCenter/Moderation/GameCenterModerationRepository.swift @@ -3,7 +3,7 @@ import Mockable /// Moderates what players submit to Game Center: individual leaderboard scores /// and the players themselves. @Mockable -public protocol GameCenterModeration: Sendable { +public protocol GameCenterModerationRepository: Sendable { func listScoreModerations(leaderboardId: String, blockedOnly: Bool) async throws -> [GameCenterScoreModeration] func updateScoreModeration(id: String, isBlocked: Bool) async throws -> GameCenterScoreModeration func listBlockedPlayers(gameCenterDetailId: String) async throws -> [GameCenterPlayer] diff --git a/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModeration.swift b/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift similarity index 97% rename from Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModeration.swift rename to Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift index b9ddcbd7..5621d4a0 100644 --- a/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModeration.swift +++ b/Sources/ASCKit/GameCenter/Moderation/Internal/SDKGameCenterModerationRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKGameCenterModeration: GameCenterModeration, @unchecked Sendable { +public struct SDKGameCenterModerationRepository: GameCenterModerationRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundles.swift b/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift similarity index 94% rename from Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundles.swift rename to Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift index bf85b365..08767896 100644 --- a/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundles.swift +++ b/Sources/ASCKit/Iris/AppBundles/Internal/IrisSDKAppBundleRepository.swift @@ -1,7 +1,7 @@ import Foundation -/// Implements `IrisAppBundles` via the iris private API. -public struct IrisSDKAppBundles: IrisAppBundles, @unchecked Sendable { +/// Implements `IrisAppBundleRepository` via the iris private API. +public struct IrisSDKAppBundleRepository: IrisAppBundleRepository, @unchecked Sendable { private let client: any IrisAPI public init(client: any IrisAPI = IrisClient()) { diff --git a/Sources/ASCKit/Iris/AppBundles/IrisAppBundles.swift b/Sources/ASCKit/Iris/AppBundles/IrisAppBundleRepository.swift similarity index 88% rename from Sources/ASCKit/Iris/AppBundles/IrisAppBundles.swift rename to Sources/ASCKit/Iris/AppBundles/IrisAppBundleRepository.swift index 272982dc..5100b282 100644 --- a/Sources/ASCKit/Iris/AppBundles/IrisAppBundles.swift +++ b/Sources/ASCKit/Iris/AppBundles/IrisAppBundleRepository.swift @@ -2,7 +2,7 @@ import Mockable /// Repository for iris app bundle operations (private API). @Mockable -public protocol IrisAppBundles: Sendable { +public protocol IrisAppBundleRepository: Sendable { func listAppBundles(session: IrisSession) async throws -> [AppBundle] func createApp( session: IrisSession, diff --git a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStates.swift b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift similarity index 91% rename from Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStates.swift rename to Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift index 23788814..efed0da0 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStates.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepository.swift @@ -1,10 +1,10 @@ import Foundation -/// Implements `IrisInAppPurchaseStates` against +/// Implements `IrisInAppPurchaseStateRepository` against /// `GET /iris/v1/apps/:appId/inAppPurchasesV2`. Apple's iris listing exposes /// `submitWithNextAppStoreVersion` as an attribute on each IAP — the public SDK /// does not, which is why this lives behind the iris cookie surface. -public struct IrisSDKInAppPurchaseStates: IrisInAppPurchaseStates, @unchecked Sendable { +public struct IrisSDKInAppPurchaseStateRepository: IrisInAppPurchaseStateRepository, @unchecked Sendable { private let client: any IrisAPI public init(client: any IrisAPI = IrisClient()) { diff --git a/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStates.swift b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift similarity index 85% rename from Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStates.swift rename to Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift index 100f45f1..9794795a 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStates.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseStateRepository.swift @@ -5,12 +5,12 @@ import Mockable /// version. The public ASC SDK has no path that exposes this field, so the iris /// listing endpoint is the source of truth. /// -/// Used by `SDKInAppPurchases.listInAppPurchases` as a best-effort enrichment: +/// Used by `SDKInAppPurchaseRepository.listInAppPurchases` as a best-effort enrichment: /// when iris cookies are available the resulting `InAppPurchase.submitWithNextAppStoreVersion` /// drives the `removeFromNextVersion` affordance; without iris cookies the field /// stays `false` and CI scripts using API-key auth keep their existing JSON output. @Mockable -public protocol IrisInAppPurchaseStates: Sendable { +public protocol IrisInAppPurchaseStateRepository: Sendable { /// Returns a map of `iapId → submitWithNextAppStoreVersion`. Filtered server-side /// to IAPs in `READY_TO_SUBMIT` (the only state where the queue flag is actionable). func fetchSubmitFlags(session: IrisSession, appId: String) async throws -> [String: Bool] diff --git a/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessions.swift b/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift similarity index 91% rename from Sources/ASCKit/Iris/Internal/Auth/FileIrisSessions.swift rename to Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift index c9679b6f..1ba190c0 100644 --- a/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessions.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/FileIrisSessionRepository.swift @@ -3,7 +3,7 @@ import Foundation /// Persists `IrisAuthSession` to `~/.asc/iris/session.json` with `0600` permissions. /// Cross-platform fallback for Linux and a default on macOS until `KeychainIrisSessionRepository` /// lands; the composite repository tries keychain first and falls back here. -public struct FileIrisSessions: IrisSessions, @unchecked Sendable { +public struct FileIrisSessionRepository: IrisSessionRepository, @unchecked Sendable { private let fileURL: URL public static let defaultSessionURL: URL = { @@ -14,7 +14,7 @@ public struct FileIrisSessions: IrisSessions, @unchecked Sendable { .appendingPathComponent("session.json") }() - public init(fileURL: URL = FileIrisSessions.defaultSessionURL) { + public init(fileURL: URL = FileIrisSessionRepository.defaultSessionURL) { self.fileURL = fileURL } diff --git a/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift b/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift index d644de49..897a5957 100644 --- a/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift +++ b/Sources/ASCKit/Iris/Internal/Auth/StoredSRPIrisCookieProvider.swift @@ -8,9 +8,9 @@ import Foundation /// is present or the session has expired. Composition with browser/env cookies is the /// composite's job, not this provider's. public struct StoredSRPIrisCookieProvider: IrisCookieProvider { - private let sessionRepository: any IrisSessions + private let sessionRepository: any IrisSessionRepository - public init(sessionRepository: any IrisSessions = FileIrisSessions()) { + public init(sessionRepository: any IrisSessionRepository = FileIrisSessionRepository()) { self.sessionRepository = sessionRepository } diff --git a/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenter.swift b/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift similarity index 97% rename from Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenter.swift rename to Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift index 631435ec..b146f36d 100644 --- a/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenter.swift +++ b/Sources/ASCKit/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepository.swift @@ -1,6 +1,6 @@ import Foundation -/// Implements `IrisResolutionCenter` via the iris private API. +/// Implements `IrisResolutionCenterRepository` via the iris private API. /// /// The Resolution Center (App Review's rejection message text and guideline /// citations) has no official App Store Connect API surface — Apple's OpenAPI @@ -8,7 +8,7 @@ import Foundation /// UI reads it from these three iris endpoints, composed here into one /// user-visible operation. The endpoint shapes are undocumented; this mapper /// is the absorption layer if Apple shifts a field. -public struct IrisSDKResolutionCenter: IrisResolutionCenter, @unchecked Sendable { +public struct IrisSDKResolutionCenterRepository: IrisResolutionCenterRepository, @unchecked Sendable { private let client: any IrisAPI public init(client: any IrisAPI = IrisClient()) { diff --git a/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenter.swift b/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift similarity index 94% rename from Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenter.swift rename to Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift index 3f00c5c9..892def5f 100644 --- a/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenter.swift +++ b/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift @@ -8,7 +8,7 @@ import Mockable /// dependency, while this path is reachable only when iris cookies are /// available. @Mockable -public protocol IrisResolutionCenter: Sendable { +public protocol IrisResolutionCenterRepository: Sendable { /// One user-visible operation — "read the Resolution Center for this /// submission". The adapter composes the thread → messages → rejections /// iris calls behind it. diff --git a/Sources/ASCKit/Reports/Analytics/AnalyticsReports.swift b/Sources/ASCKit/Reports/Analytics/AnalyticsReportRepository.swift similarity index 91% rename from Sources/ASCKit/Reports/Analytics/AnalyticsReports.swift rename to Sources/ASCKit/Reports/Analytics/AnalyticsReportRepository.swift index e15da455..b81c3f13 100644 --- a/Sources/ASCKit/Reports/Analytics/AnalyticsReports.swift +++ b/Sources/ASCKit/Reports/Analytics/AnalyticsReportRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol AnalyticsReports: Sendable { +public protocol AnalyticsReportRepository: Sendable { func createRequest(appId: String, accessType: AnalyticsAccessType) async throws -> AnalyticsReportRequest func listRequests(appId: String, accessType: AnalyticsAccessType?) async throws -> [AnalyticsReportRequest] func deleteRequest(id: String) async throws diff --git a/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReports.swift b/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift similarity index 98% rename from Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReports.swift rename to Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift index ee10fec3..38e11fb7 100644 --- a/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReports.swift +++ b/Sources/ASCKit/Reports/Analytics/Internal/SDKAnalyticsReportRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKAnalyticsReports: AnalyticsReports, @unchecked Sendable { +public struct SDKAnalyticsReportRepository: AnalyticsReportRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Screenshots/Gallery/GalleryTemplates.swift b/Sources/ASCKit/Screenshots/Gallery/GalleryTemplateRepository.swift similarity index 89% rename from Sources/ASCKit/Screenshots/Gallery/GalleryTemplates.swift rename to Sources/ASCKit/Screenshots/Gallery/GalleryTemplateRepository.swift index 67d57d1a..ac0d84b5 100644 --- a/Sources/ASCKit/Screenshots/Gallery/GalleryTemplates.swift +++ b/Sources/ASCKit/Screenshots/Gallery/GalleryTemplateRepository.swift @@ -10,7 +10,7 @@ public protocol GalleryTemplateProvider: Sendable { /// Repository for querying gallery templates. @Mockable -public protocol GalleryTemplates: Sendable { +public protocol GalleryTemplateRepository: Sendable { func listGalleries() async throws -> [Gallery] func getGallery(templateId: String) async throws -> Gallery? } diff --git a/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplates.swift b/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift similarity index 82% rename from Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplates.swift rename to Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift index cd01e68e..990b93f3 100644 --- a/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplates.swift +++ b/Sources/ASCKit/Screenshots/Internal/AggregateGalleryTemplateRepository.swift @@ -1,8 +1,8 @@ import Foundation /// Aggregates gallery templates from all registered providers. -public final actor AggregateGalleryTemplates: GalleryTemplates { - public static let shared = AggregateGalleryTemplates() +public final actor AggregateGalleryTemplateRepository: GalleryTemplateRepository { + public static let shared = AggregateGalleryTemplateRepository() private var providers: [any GalleryTemplateProvider] = [] diff --git a/Sources/ASCKit/Screenshots/Internal/AggregateTemplates.swift b/Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift similarity index 83% rename from Sources/ASCKit/Screenshots/Internal/AggregateTemplates.swift rename to Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift index 3aa85f27..5f91762d 100644 --- a/Sources/ASCKit/Screenshots/Internal/AggregateTemplates.swift +++ b/Sources/ASCKit/Screenshots/Internal/AggregateTemplateRepository.swift @@ -5,10 +5,10 @@ import Foundation /// The platform ships with no built-in templates. Plugins register /// providers to supply their own templates. /// -/// Use `AggregateTemplates.shared` as the global registry. -public final actor AggregateTemplates: Templates { +/// Use `AggregateTemplateRepository.shared` as the global registry. +public final actor AggregateTemplateRepository: TemplateRepository { /// Global shared instance — plugins register providers here. - public static let shared = AggregateTemplates() + public static let shared = AggregateTemplateRepository() private var providers: [any TemplateProvider] = [] diff --git a/Sources/ASCKit/Screenshots/Templates.swift b/Sources/ASCKit/Screenshots/TemplateRepository.swift similarity index 95% rename from Sources/ASCKit/Screenshots/Templates.swift rename to Sources/ASCKit/Screenshots/TemplateRepository.swift index dd93b770..13ce3930 100644 --- a/Sources/ASCKit/Screenshots/Templates.swift +++ b/Sources/ASCKit/Screenshots/TemplateRepository.swift @@ -19,7 +19,7 @@ public protocol TemplateProvider: Sendable { /// The platform ships with no built-in templates. Plugins register /// `TemplateProvider` implementations to supply templates. @Mockable -public protocol Templates: Sendable { +public protocol TemplateRepository: Sendable { /// List all templates from all providers, optionally filtered by screen size. func listTemplates(size: ScreenSize?) async throws -> [AppShotTemplate] diff --git a/Sources/ASCKit/Shared/Internal/ClientFactory.swift b/Sources/ASCKit/Shared/Internal/ClientFactory.swift index f2566752..249212ac 100644 --- a/Sources/ASCKit/Shared/Internal/ClientFactory.swift +++ b/Sources/ASCKit/Shared/Internal/ClientFactory.swift @@ -5,44 +5,44 @@ public struct ClientFactory: Sendable { public init() {} - public func makeApps(authProvider: any AuthProvider) throws -> any Apps { + public func makeAppRepository(authProvider: any AuthProvider) throws -> any AppRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKApps(client: provider) + return SDKAppRepository(client: provider) } - public func makeAppStoreVersions(authProvider: any AuthProvider) throws -> any AppStoreVersions { + public func makeVersionRepository(authProvider: any AuthProvider) throws -> any VersionRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAppStoreVersions(client: provider) + return SDKVersionRepository(client: provider) } - public func makeBuilds(authProvider: any AuthProvider) throws -> any Builds { + public func makeBuildRepository(authProvider: any AuthProvider) throws -> any BuildRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKBuilds(client: provider) + return SDKBuildRepository(client: provider) } - public func makeTestFlight(authProvider: any AuthProvider) throws -> any TestFlight { + public func makeTestFlightRepository(authProvider: any AuthProvider) throws -> any TestFlightRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKTestFlight(client: provider) + return SDKTestFlightRepository(client: provider) } - public func makeVersionLocalizations(authProvider: any AuthProvider) throws -> any VersionLocalizations { + public func makeVersionLocalizationRepository(authProvider: any AuthProvider) throws -> any VersionLocalizationRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKVersionLocalizations(client: provider) + return SDKLocalizationRepository(client: provider) } - public func makeAppScreenshots(authProvider: any AuthProvider) throws -> any AppScreenshots { + public func makeScreenshotRepository(authProvider: any AuthProvider) throws -> any ScreenshotRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAppScreenshots(client: provider) + return SDKScreenshotRepository(client: provider) } - public func makeAppInfos(authProvider: any AuthProvider) throws -> any AppInfos { + public func makeAppInfoRepository(authProvider: any AuthProvider) throws -> any AppInfoRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAppInfos(client: provider) + return SDKAppInfoRepository(client: provider) } - public func makeAppCategories(authProvider: any AuthProvider) throws -> any AppCategories { + public func makeAppCategoryRepository(authProvider: any AuthProvider) throws -> any AppCategoryRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAppCategories(client: provider) + return SDKAppCategoryRepository(client: provider) } public func makeReviewSubmissions(authProvider: any AuthProvider) throws -> any ReviewSubmissions { @@ -50,89 +50,89 @@ public struct ClientFactory: Sendable { return OpenAPIReviewSubmissions(client: provider) } - public func makeBundleIDs(authProvider: any AuthProvider) throws -> any BundleIDs { + public func makeBundleIDRepository(authProvider: any AuthProvider) throws -> any BundleIDRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKBundleIDs(client: provider) + return SDKBundleIDRepository(client: provider) } - public func makeCertificates(authProvider: any AuthProvider) throws -> any Certificates { + public func makeCertificateRepository(authProvider: any AuthProvider) throws -> any CertificateRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKCertificates(client: provider) + return SDKCertificateRepository(client: provider) } - public func makeDevices(authProvider: any AuthProvider) throws -> any Devices { + public func makeDeviceRepository(authProvider: any AuthProvider) throws -> any DeviceRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKDevices(client: provider) + return SDKDeviceRepository(client: provider) } - public func makeProfiles(authProvider: any AuthProvider) throws -> any Profiles { + public func makeProfileRepository(authProvider: any AuthProvider) throws -> any ProfileRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKProfiles(client: provider) + return SDKProfileRepository(client: provider) } - public func makeBuildUploads(authProvider: any AuthProvider) throws -> any BuildUploads { + public func makeBuildUploadRepository(authProvider: any AuthProvider) throws -> any BuildUploadRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKBuildUploads(client: provider) + return SDKBuildUploadRepository(client: provider) } - public func makeBetaBuildLocalizations(authProvider: any AuthProvider) throws -> any BetaBuildLocalizations { + public func makeBetaBuildLocalizationRepository(authProvider: any AuthProvider) throws -> any BetaBuildLocalizationRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKBetaBuildLocalizations(client: provider) + return SDKBetaBuildLocalizationRepository(client: provider) } - public func makeReviewDetails(authProvider: any AuthProvider) throws -> any ReviewDetails { + public func makeReviewDetailRepository(authProvider: any AuthProvider) throws -> any ReviewDetailRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKReviewDetails(client: provider) + return SDKReviewDetailRepository(client: provider) } - public func makeAppPrices(authProvider: any AuthProvider) throws -> any AppPrices { + public func makePricingRepository(authProvider: any AuthProvider) throws -> any PricingRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAppPrices(client: provider) + return SDKPricingRepository(client: provider) } - public func makeAppPreviews(authProvider: any AuthProvider) throws -> any AppPreviews { + public func makePreviewRepository(authProvider: any AuthProvider) throws -> any PreviewRepository { let provider = try makeProvider(authProvider: authProvider) - return OpenAPIAppPreviews(client: provider) + return OpenAPIPreviewRepository(client: provider) } - public func makeInAppPurchases(authProvider: any AuthProvider) throws -> any InAppPurchases { + public func makeInAppPurchaseRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseRepository { let provider = try makeProvider(authProvider: authProvider) // Best-effort iris enrichment for `submitWithNextAppStoreVersion`. The closure // resolves iris cookies on every list call (so freshly-logged-in sessions are // picked up); any failure — no cookies, network error, malformed response — // returns an empty map and the SDK list still succeeds with the flag = false. let cookieProvider = makeIrisCookieProvider() - let stateRepo = IrisSDKInAppPurchaseStates() + let stateRepo = IrisSDKInAppPurchaseStateRepository() let irisFlagsProvider: @Sendable (String) async -> [String: Bool] = { appId in guard let session = try? cookieProvider.resolveSession() else { return [:] } return (try? await stateRepo.fetchSubmitFlags(session: session, appId: appId)) ?? [:] } - return SDKInAppPurchases(client: provider, irisFlagsProvider: irisFlagsProvider) + return SDKInAppPurchaseRepository(client: provider, irisFlagsProvider: irisFlagsProvider) } - public func makeInAppPurchaseLocalizations(authProvider: any AuthProvider) throws -> any InAppPurchaseLocalizations { + public func makeInAppPurchaseLocalizationRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseLocalizationRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseLocalizations(client: provider) + return SDKInAppPurchaseLocalizationRepository(client: provider) } - public func makeSubscriptionGroups(authProvider: any AuthProvider) throws -> any SubscriptionGroups { + public func makeSubscriptionGroupRepository(authProvider: any AuthProvider) throws -> any SubscriptionGroupRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionGroups(client: provider) + return SDKSubscriptionGroupRepository(client: provider) } - public func makeSubscriptions(authProvider: any AuthProvider) throws -> any Subscriptions { + public func makeSubscriptionRepository(authProvider: any AuthProvider) throws -> any SubscriptionRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptions(client: provider) + return SDKSubscriptionRepository(client: provider) } - public func makeSubscriptionLocalizations(authProvider: any AuthProvider) throws -> any SubscriptionLocalizations { + public func makeSubscriptionLocalizationRepository(authProvider: any AuthProvider) throws -> any SubscriptionLocalizationRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionLocalizations(client: provider) + return SDKSubscriptionLocalizationRepository(client: provider) } - public func makeSubscriptionGroupLocalizations(authProvider: any AuthProvider) throws -> any SubscriptionGroupLocalizations { + public func makeSubscriptionGroupLocalizationRepository(authProvider: any AuthProvider) throws -> any SubscriptionGroupLocalizationRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionGroupLocalizations(client: provider) + return SDKSubscriptionGroupLocalizationRepository(client: provider) } public func makeInAppPurchaseSubmissions(authProvider: any AuthProvider) throws -> any InAppPurchaseSubmissions { @@ -140,19 +140,19 @@ public struct ClientFactory: Sendable { return SDKInAppPurchaseSubmissions(client: provider) } - public func makeProductVersions(authProvider: any AuthProvider) throws -> any ProductVersions { + public func makeProductVersionRepository(authProvider: any AuthProvider) throws -> any ProductVersionRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKProductVersions(client: provider) + return SDKProductVersionRepository(client: provider) } - public func makeInAppPurchasePrices(authProvider: any AuthProvider) throws -> any InAppPurchasePrices { + public func makeInAppPurchasePriceRepository(authProvider: any AuthProvider) throws -> any InAppPurchasePriceRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchasePrices(client: provider) + return SDKInAppPurchasePriceRepository(client: provider) } - public func makeSubscriptionPrices(authProvider: any AuthProvider) throws -> any SubscriptionPrices { + public func makeSubscriptionPriceRepository(authProvider: any AuthProvider) throws -> any SubscriptionPriceRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionPrices(client: provider) + return SDKSubscriptionPriceRepository(client: provider) } public func makeSubscriptionSubmissions(authProvider: any AuthProvider) throws -> any SubscriptionSubmissions { @@ -160,109 +160,109 @@ public struct ClientFactory: Sendable { return SDKSubscriptionSubmissions(client: provider) } - public func makeSubscriptionIntroductoryOffers(authProvider: any AuthProvider) throws -> any SubscriptionIntroductoryOffers { + public func makeSubscriptionIntroductoryOfferRepository(authProvider: any AuthProvider) throws -> any SubscriptionIntroductoryOfferRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionIntroductoryOffers(client: provider) + return SDKSubscriptionIntroductoryOfferRepository(client: provider) } - public func makeSubscriptionPromotionalOffers(authProvider: any AuthProvider) throws -> any SubscriptionPromotionalOffers { + public func makeSubscriptionPromotionalOfferRepository(authProvider: any AuthProvider) throws -> any SubscriptionPromotionalOfferRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionPromotionalOffers(client: provider) + return SDKSubscriptionPromotionalOfferRepository(client: provider) } - public func makeWinBackOffers(authProvider: any AuthProvider) throws -> any WinBackOffers { + public func makeWinBackOfferRepository(authProvider: any AuthProvider) throws -> any WinBackOfferRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKWinBackOffers(client: provider) + return SDKWinBackOfferRepository(client: provider) } - public func makeAssetLibraries(authProvider: any AuthProvider) throws -> any AssetLibraries { + public func makeAssetLibraryRepository(authProvider: any AuthProvider) throws -> any AssetLibraryRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAssetLibraries(client: provider) + return SDKAssetLibraryRepository(client: provider) } - public func makeLibraryImages(authProvider: any AuthProvider) throws -> any LibraryImages { + public func makeLibraryImageRepository(authProvider: any AuthProvider) throws -> any LibraryImageRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKLibraryImages(client: provider) + return SDKLibraryImageRepository(client: provider) } - public func makeLibraryVideos(authProvider: any AuthProvider) throws -> any LibraryVideos { + public func makeLibraryVideoRepository(authProvider: any AuthProvider) throws -> any LibraryVideoRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKLibraryVideos(client: provider) + return SDKLibraryVideoRepository(client: provider) } - public func makeAssetPlacements(authProvider: any AuthProvider) throws -> any AssetPlacements { + public func makeAssetPlacementRepository(authProvider: any AuthProvider) throws -> any AssetPlacementRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAssetPlacements(client: provider) + return SDKAssetPlacementRepository(client: provider) } - public func makeExperiments(authProvider: any AuthProvider) throws -> any Experiments { + public func makeExperimentRepository(authProvider: any AuthProvider) throws -> any ExperimentRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKExperiments(client: provider) + return SDKExperimentRepository(client: provider) } - public func makePromotedPurchases(authProvider: any AuthProvider) throws -> any PromotedPurchases { + public func makePromotedPurchaseRepository(authProvider: any AuthProvider) throws -> any PromotedPurchaseRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKPromotedPurchases(client: provider) + return SDKPromotedPurchaseRepository(client: provider) } - public func makeInAppPurchaseReviewAssets(authProvider: any AuthProvider) throws -> any InAppPurchaseReviewAssets { + public func makeInAppPurchaseReviewRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseReviewRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseReviewAssets(client: provider) + return SDKInAppPurchaseReviewRepository(client: provider) } - public func makeSubscriptionReviewAssets(authProvider: any AuthProvider) throws -> any SubscriptionReviewAssets { + public func makeSubscriptionReviewRepository(authProvider: any AuthProvider) throws -> any SubscriptionReviewRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionReviewAssets(client: provider) + return SDKSubscriptionReviewRepository(client: provider) } - public func makeSubscriptionOfferCodes(authProvider: any AuthProvider) throws -> any SubscriptionOfferCodes { + public func makeSubscriptionOfferCodeRepository(authProvider: any AuthProvider) throws -> any SubscriptionOfferCodeRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionOfferCodes(client: provider) + return SDKSubscriptionOfferCodeRepository(client: provider) } - public func makeInAppPurchaseOfferCodes(authProvider: any AuthProvider) throws -> any InAppPurchaseOfferCodes { + public func makeInAppPurchaseOfferCodeRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseOfferCodeRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseOfferCodes(client: provider) + return SDKInAppPurchaseOfferCodeRepository(client: provider) } - public func makeAgeRatingDeclarations(authProvider: any AuthProvider) throws -> any AgeRatingDeclarations { + public func makeAgeRatingDeclarationRepository(authProvider: any AuthProvider) throws -> any AgeRatingDeclarationRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAgeRatingDeclarations(client: provider) + return SDKAgeRatingDeclarationRepository(client: provider) } - public func makeUsers(authProvider: any AuthProvider) throws -> any Users { + public func makeUserRepository(authProvider: any AuthProvider) throws -> any UserRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKUsers(client: provider) + return SDKUserRepository(client: provider) } - public func makeXcodeCloudProducts(authProvider: any AuthProvider) throws -> any XcodeCloudProducts { + public func makeXcodeCloudProductRepository(authProvider: any AuthProvider) throws -> any XcodeCloudProductRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKXcodeCloudProducts(client: provider) + return SDKXcodeCloudProductRepository(client: provider) } - public func makeXcodeCloudWorkflows(authProvider: any AuthProvider) throws -> any XcodeCloudWorkflows { + public func makeXcodeCloudWorkflowRepository(authProvider: any AuthProvider) throws -> any XcodeCloudWorkflowRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKXcodeCloudWorkflows(client: provider) + return SDKXcodeCloudWorkflowRepository(client: provider) } - public func makeXcodeCloudBuildRuns(authProvider: any AuthProvider) throws -> any XcodeCloudBuildRuns { + public func makeXcodeCloudBuildRunRepository(authProvider: any AuthProvider) throws -> any XcodeCloudBuildRunRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKXcodeCloudBuildRuns(client: provider) + return SDKXcodeCloudBuildRunRepository(client: provider) } - public func makeGameCenter(authProvider: any AuthProvider) throws -> any GameCenter { + public func makeGameCenterRepository(authProvider: any AuthProvider) throws -> any GameCenterRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKGameCenter(client: provider) + return SDKGameCenterRepository(client: provider) } - public func makeGameCenterModeration(authProvider: any AuthProvider) throws -> any GameCenterModeration { + public func makeGameCenterModerationRepository(authProvider: any AuthProvider) throws -> any GameCenterModerationRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKGameCenterModeration(client: provider) + return SDKGameCenterModerationRepository(client: provider) } - public func makeAppClips(authProvider: any AuthProvider) throws -> any AppClips { + public func makeAppClipRepository(authProvider: any AuthProvider) throws -> any AppClipRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAppClips(client: provider) + return SDKAppClipRepository(client: provider) } public func makeReports(authProvider: any AuthProvider) throws -> any Reports { @@ -270,59 +270,59 @@ public struct ClientFactory: Sendable { return SDKReports(client: provider) } - public func makeAnalyticsReports(authProvider: any AuthProvider) throws -> any AnalyticsReports { + public func makeAnalyticsReportRepository(authProvider: any AuthProvider) throws -> any AnalyticsReportRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAnalyticsReports(client: provider) + return SDKAnalyticsReportRepository(client: provider) } - public func makeCustomerReviews(authProvider: any AuthProvider) throws -> any CustomerReviews { + public func makeCustomerReviewRepository(authProvider: any AuthProvider) throws -> any CustomerReviewRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKCustomerReviews(client: provider) + return SDKCustomerReviewRepository(client: provider) } - public func makePerfMetrics(authProvider: any AuthProvider) throws -> any PerfMetrics { + public func makePerfMetricsRepository(authProvider: any AuthProvider) throws -> any PerfMetricsRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKPerfMetrics(client: provider) + return SDKPerfMetricsRepository(client: provider) } - public func makePerfOverviews(authProvider: any AuthProvider) throws -> any PerfOverviews { + public func makePerfOverviewRepository(authProvider: any AuthProvider) throws -> any PerfOverviewRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKPerfOverviews(client: provider) + return SDKPerfOverviewRepository(client: provider) } - public func makeDiagnostics(authProvider: any AuthProvider) throws -> any Diagnostics { + public func makeDiagnosticsRepository(authProvider: any AuthProvider) throws -> any DiagnosticsRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKDiagnostics(client: provider) + return SDKDiagnosticsRepository(client: provider) } - public func makeBetaAppReviews(authProvider: any AuthProvider) throws -> any BetaAppReviews { + public func makeBetaAppReviewRepository(authProvider: any AuthProvider) throws -> any BetaAppReviewRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKBetaAppReviews(client: provider) + return SDKBetaAppReviewRepository(client: provider) } - public func makeBetaAppLocalizations(authProvider: any AuthProvider) throws -> any BetaAppLocalizations { + public func makeBetaAppLocalizationRepository(authProvider: any AuthProvider) throws -> any BetaAppLocalizationRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKBetaAppLocalizations(client: provider) + return SDKBetaAppLocalizationRepository(client: provider) } - public func makeInAppPurchaseAvailabilities(authProvider: any AuthProvider) throws -> any InAppPurchaseAvailabilities { + public func makeInAppPurchaseAvailabilityRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseAvailabilityRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseAvailabilities(client: provider) + return SDKInAppPurchaseAvailabilityRepository(client: provider) } - public func makeSubscriptionAvailabilities(authProvider: any AuthProvider) throws -> any SubscriptionAvailabilities { + public func makeSubscriptionAvailabilityRepository(authProvider: any AuthProvider) throws -> any SubscriptionAvailabilityRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionAvailabilities(client: provider) + return SDKSubscriptionAvailabilityRepository(client: provider) } - public func makeAppAvailabilities(authProvider: any AuthProvider) throws -> any AppAvailabilities { + public func makeAppAvailabilityRepository(authProvider: any AuthProvider) throws -> any AppAvailabilityRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKAppAvailabilities(client: provider) + return SDKAppAvailabilityRepository(client: provider) } - public func makeTerritories(authProvider: any AuthProvider) throws -> any Territories { + public func makeTerritoryRepository(authProvider: any AuthProvider) throws -> any TerritoryRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKTerritories(client: provider) + return SDKTerritoryRepository(client: provider) } // MARK: - Simulators (no ASC auth needed — local xcrun simctl) @@ -353,16 +353,16 @@ public struct ClientFactory: Sendable { // MARK: - Iris (private API, cookie-based auth) - public func makeIrisAppBundles() -> any IrisAppBundles { - IrisSDKAppBundles() + public func makeIrisAppBundleRepository() -> any IrisAppBundleRepository { + IrisSDKAppBundleRepository() } public func makeIrisInAppPurchaseSubmissions() -> any IrisInAppPurchaseSubmissions { IrisSDKInAppPurchaseSubmissions() } - public func makeIrisResolutionCenter() -> any IrisResolutionCenter { - IrisSDKResolutionCenter() + public func makeIrisResolutionCenterRepository() -> any IrisResolutionCenterRepository { + IrisSDKResolutionCenterRepository() } public func makeIrisCookieProvider() -> any IrisCookieProvider { diff --git a/Sources/ASCKit/Submissions/SubmissionPlan.swift b/Sources/ASCKit/Submissions/SubmissionPlan.swift index 406ef58b..e5a81661 100644 --- a/Sources/ASCKit/Submissions/SubmissionPlan.swift +++ b/Sources/ASCKit/Submissions/SubmissionPlan.swift @@ -75,16 +75,16 @@ extension PlannedReviewItem: Presentable { /// subscription that is `READY_TO_SUBMIT` and has a submittable version, plus /// the version of each subscription group one of them belongs to. public struct SubmissionPlanner: Sendable { - let iapRepo: any InAppPurchases - let groupRepo: any SubscriptionGroups - let subscriptionRepo: any Subscriptions - let productVersionRepo: any ProductVersions + let iapRepo: any InAppPurchaseRepository + let groupRepo: any SubscriptionGroupRepository + let subscriptionRepo: any SubscriptionRepository + let productVersionRepo: any ProductVersionRepository public init( - iapRepo: any InAppPurchases, - groupRepo: any SubscriptionGroups, - subscriptionRepo: any Subscriptions, - productVersionRepo: any ProductVersions + iapRepo: any InAppPurchaseRepository, + groupRepo: any SubscriptionGroupRepository, + subscriptionRepo: any SubscriptionRepository, + productVersionRepo: any ProductVersionRepository ) { self.iapRepo = iapRepo self.groupRepo = groupRepo diff --git a/Sources/ASCKit/Territories/Internal/SDKTerritories.swift b/Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift similarity index 87% rename from Sources/ASCKit/Territories/Internal/SDKTerritories.swift rename to Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift index 223c4513..376fb5e9 100644 --- a/Sources/ASCKit/Territories/Internal/SDKTerritories.swift +++ b/Sources/ASCKit/Territories/Internal/SDKTerritoryRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKTerritories: Territories, @unchecked Sendable { +public struct SDKTerritoryRepository: TerritoryRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Territories/Territories.swift b/Sources/ASCKit/Territories/TerritoryRepository.swift similarity index 63% rename from Sources/ASCKit/Territories/Territories.swift rename to Sources/ASCKit/Territories/TerritoryRepository.swift index 329f88f0..31d0e0b1 100644 --- a/Sources/ASCKit/Territories/Territories.swift +++ b/Sources/ASCKit/Territories/TerritoryRepository.swift @@ -1,6 +1,6 @@ import Mockable @Mockable -public protocol Territories: Sendable { +public protocol TerritoryRepository: Sendable { func listTerritories() async throws -> [Territory] } diff --git a/Sources/ASCKit/Users/Internal/SDKUsers.swift b/Sources/ASCKit/Users/Internal/SDKUserRepository.swift similarity index 98% rename from Sources/ASCKit/Users/Internal/SDKUsers.swift rename to Sources/ASCKit/Users/Internal/SDKUserRepository.swift index 43d08a6f..62a7def4 100644 --- a/Sources/ASCKit/Users/Internal/SDKUsers.swift +++ b/Sources/ASCKit/Users/Internal/SDKUserRepository.swift @@ -1,7 +1,7 @@ @preconcurrency import AppStoreConnect_Swift_SDK import Foundation -public struct SDKUsers: Users, @unchecked Sendable { +public struct SDKUserRepository: UserRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Users/Users.swift b/Sources/ASCKit/Users/UserRepository.swift similarity index 92% rename from Sources/ASCKit/Users/Users.swift rename to Sources/ASCKit/Users/UserRepository.swift index 3dc975f1..2529dd46 100644 --- a/Sources/ASCKit/Users/Users.swift +++ b/Sources/ASCKit/Users/UserRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol Users: Sendable { +public protocol UserRepository: Sendable { func listUsers(role: UserRole?) async throws -> [TeamMember] func updateUser(id: String, roles: [UserRole]) async throws -> TeamMember func removeUser(id: String) async throws diff --git a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRuns.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift similarity index 96% rename from Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRuns.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift index 6cd3c05b..7033ec92 100644 --- a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRuns.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKXcodeCloudBuildRuns: XcodeCloudBuildRuns, @unchecked Sendable { +public struct SDKXcodeCloudBuildRunRepository: XcodeCloudBuildRunRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProducts.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift similarity index 91% rename from Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProducts.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift index d7600c09..58448e90 100644 --- a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProducts.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudProductRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKXcodeCloudProducts: XcodeCloudProducts, @unchecked Sendable { +public struct SDKXcodeCloudProductRepository: XcodeCloudProductRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflows.swift b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift similarity index 90% rename from Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflows.swift rename to Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift index 17bff5a4..93fa21dd 100644 --- a/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflows.swift +++ b/Sources/ASCKit/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKXcodeCloudWorkflows: XcodeCloudWorkflows, @unchecked Sendable { +public struct SDKXcodeCloudWorkflowRepository: XcodeCloudWorkflowRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRuns.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRunRepository.swift similarity index 82% rename from Sources/ASCKit/XcodeCloud/XcodeCloudBuildRuns.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudBuildRunRepository.swift index 2030b01c..df3cbd1a 100644 --- a/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRuns.swift +++ b/Sources/ASCKit/XcodeCloud/XcodeCloudBuildRunRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol XcodeCloudBuildRuns: Sendable { +public protocol XcodeCloudBuildRunRepository: Sendable { func listBuildRuns(workflowId: String) async throws -> [XcodeCloudBuildRun] func getBuildRun(id: String) async throws -> XcodeCloudBuildRun func startBuildRun(workflowId: String, clean: Bool) async throws -> XcodeCloudBuildRun diff --git a/Sources/ASCKit/XcodeCloud/XcodeCloudProducts.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudProductRepository.swift similarity index 64% rename from Sources/ASCKit/XcodeCloud/XcodeCloudProducts.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudProductRepository.swift index ec7095da..02c06e07 100644 --- a/Sources/ASCKit/XcodeCloud/XcodeCloudProducts.swift +++ b/Sources/ASCKit/XcodeCloud/XcodeCloudProductRepository.swift @@ -1,6 +1,6 @@ import Mockable @Mockable -public protocol XcodeCloudProducts: Sendable { +public protocol XcodeCloudProductRepository: Sendable { func listProducts(appId: String?) async throws -> [XcodeCloudProduct] } diff --git a/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflows.swift b/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflowRepository.swift similarity index 65% rename from Sources/ASCKit/XcodeCloud/XcodeCloudWorkflows.swift rename to Sources/ASCKit/XcodeCloud/XcodeCloudWorkflowRepository.swift index 9c9719a8..fe58ce6c 100644 --- a/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflows.swift +++ b/Sources/ASCKit/XcodeCloud/XcodeCloudWorkflowRepository.swift @@ -1,6 +1,6 @@ import Mockable @Mockable -public protocol XcodeCloudWorkflows: Sendable { +public protocol XcodeCloudWorkflowRepository: Sendable { func listWorkflows(productId: String) async throws -> [XcodeCloudWorkflow] } diff --git a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift index 1cb8c774..5a0066d1 100644 --- a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift +++ b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingGetTests.swift @@ -7,7 +7,7 @@ import Testing struct AgeRatingGetTests { @Test func `age-rating get returns declaration with id and affordances`() async throws { - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() given(mockRepo).getDeclaration(appInfoId: .any) .willReturn(AgeRatingDeclaration(id: "decl-1", appInfoId: "info-42")) @@ -31,7 +31,7 @@ struct AgeRatingGetTests { } @Test func `age-rating get includes non-nil content fields in output`() async throws { - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() given(mockRepo).getDeclaration(appInfoId: .any) .willReturn(AgeRatingDeclaration( id: "decl-2", diff --git a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift index ce7ff44c..214a6274 100644 --- a/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AgeRating/AgeRatingUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct AgeRatingUpdateTests { @Test func `age-rating update returns updated declaration with exact JSON`() async throws { - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() given(mockRepo).updateDeclaration(id: .any, update: .any) .willReturn(AgeRatingDeclaration( id: "decl-1", @@ -43,7 +43,7 @@ struct AgeRatingUpdateTests { } @Test func `age-rating update passes only specified flags`() async throws { - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() var capturedUpdate: AgeRatingDeclarationUpdate? given(mockRepo).updateDeclaration(id: .any, update: .any) @@ -70,7 +70,7 @@ struct AgeRatingUpdateTests { @Test func `should set a Korea override of twelve plus`() async throws { // Given - App Store Connect applies the override it is sent - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() given(mockRepo).updateDeclaration(id: .any, update: .any) .willProduce { id, update in AgeRatingDeclaration(id: id, appInfoId: "info-42", koreaAgeRatingOverride: update.koreaAgeRatingOverride) @@ -104,7 +104,7 @@ struct AgeRatingUpdateTests { @Test func `should set Korea's GRAC classification number`() async throws { // Given - App Store Connect applies the number it is sent - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() given(mockRepo).updateDeclaration(id: .any, update: .any) .willProduce { id, update in AgeRatingDeclaration(id: id, appInfoId: "info-42", gracRatingClassificationNumber: update.gracRatingClassificationNumber) @@ -137,7 +137,7 @@ struct AgeRatingUpdateTests { } @Test func `should save and show the social media answers`() async throws { - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() given(mockRepo).updateDeclaration(id: .any, update: .any) .willProduce { id, update in AgeRatingDeclaration( diff --git a/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift b/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift index b95be71b..135a1172 100644 --- a/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift +++ b/Tests/ASCCommandTests/Commands/AnalyticsReports/AnalyticsReportsTests.swift @@ -7,7 +7,7 @@ import Testing struct AnalyticsReportsRequestTests { @Test func `creates a one-time snapshot request with affordances`() async throws { - let mockRepo = MockAnalyticsReports() + let mockRepo = MockAnalyticsReportRepository() given(mockRepo).createRequest(appId: .any, accessType: .any).willReturn( AnalyticsReportRequest(id: "req-1", appId: "app-1", accessType: .oneTimeSnapshot, isStoppedDueToInactivity: nil) ) @@ -38,7 +38,7 @@ struct AnalyticsReportsRequestTests { struct AnalyticsReportsListTests { @Test func `lists requests with affordances`() async throws { - let mockRepo = MockAnalyticsReports() + let mockRepo = MockAnalyticsReportRepository() given(mockRepo).listRequests(appId: .any, accessType: .any).willReturn([ AnalyticsReportRequest(id: "req-1", appId: "app-1", accessType: .ongoing, isStoppedDueToInactivity: nil) ]) @@ -74,7 +74,7 @@ struct AnalyticsReportsDeleteTests { } @Test func `deletes request and outputs confirmation`() async throws { - let mockRepo = MockAnalyticsReports() + let mockRepo = MockAnalyticsReportRepository() given(mockRepo).deleteRequest(id: .any).willReturn(()) let cmd = try AnalyticsReportsDelete.parse(["--request-id", "req-1"]) @@ -88,7 +88,7 @@ struct AnalyticsReportsDeleteTests { struct AnalyticsReportsReportsListTests { @Test func `lists reports with affordances`() async throws { - let mockRepo = MockAnalyticsReports() + let mockRepo = MockAnalyticsReportRepository() given(mockRepo).listReports(requestId: .any, category: .any).willReturn([ AnalyticsReport(id: "rpt-1", requestId: "req-1", name: "App Downloads", category: .appStoreEngagement) ]) @@ -119,7 +119,7 @@ struct AnalyticsReportsReportsListTests { struct AnalyticsReportsInstancesListTests { @Test func `lists instances with affordances`() async throws { - let mockRepo = MockAnalyticsReports() + let mockRepo = MockAnalyticsReportRepository() given(mockRepo).listInstances(reportId: .any, granularity: .any).willReturn([ AnalyticsReportInstance(id: "inst-1", reportId: "rpt-1", granularity: .daily, processingDate: "2024-01-15") ]) @@ -150,7 +150,7 @@ struct AnalyticsReportsInstancesListTests { struct AnalyticsReportsSegmentsListTests { @Test func `lists segments with affordances`() async throws { - let mockRepo = MockAnalyticsReports() + let mockRepo = MockAnalyticsReportRepository() given(mockRepo).listSegments(instanceId: .any).willReturn([ AnalyticsReportSegment(id: "seg-1", instanceId: "inst-1", checksum: "abc123", sizeInBytes: 2048, url: "https://example.com/data.tsv") ]) diff --git a/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift b/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift index 823074d4..94a71d5f 100644 --- a/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppCategories/AppCategoriesListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppCategoriesListTests { @Test func `listed categories include id platforms and affordances`() async throws { - let mockRepo = MockAppCategories() + let mockRepo = MockAppCategoryRepository() given(mockRepo).listCategories(platform: .any).willReturn([ AppCategory(id: "6014", platforms: ["IOS"], parentId: nil), ]) @@ -33,7 +33,7 @@ struct AppCategoriesListTests { } @Test func `listed subcategory includes parent id`() async throws { - let mockRepo = MockAppCategories() + let mockRepo = MockAppCategoryRepository() given(mockRepo).listCategories(platform: .any).willReturn([ AppCategory(id: "6014-action", platforms: ["IOS"], parentId: "6014"), ]) diff --git a/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift index 1f1525d3..32594968 100644 --- a/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClipExperienceLocalizations/AppClipExperienceLocalizationsTests.swift @@ -7,7 +7,7 @@ import Testing struct AppClipExperienceLocalizationsListTests { @Test func `listed localizations include experienceId locale subtitle and affordances`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listLocalizations(experienceId: .any).willReturn([ AppClipDefaultExperienceLocalization(id: "loc-1", experienceId: "exp-1", locale: "en-US", subtitle: "Quick access") ]) @@ -34,7 +34,7 @@ struct AppClipExperienceLocalizationsListTests { } @Test func `listed localizations omit nil subtitle from JSON`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listLocalizations(experienceId: .any).willReturn([ AppClipDefaultExperienceLocalization(id: "loc-1", experienceId: "exp-1", locale: "en-US", subtitle: nil) ]) @@ -60,7 +60,7 @@ struct AppClipExperienceLocalizationsListTests { } @Test func `table output includes localization id locale and subtitle`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listLocalizations(experienceId: .any).willReturn([ AppClipDefaultExperienceLocalization(id: "loc-1", experienceId: "exp-1", locale: "en-US", subtitle: "Quick access") ]) @@ -78,7 +78,7 @@ struct AppClipExperienceLocalizationsListTests { struct AppClipExperienceLocalizationsCreateTests { @Test func `create localization returns created localization with affordances`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).createLocalization(experienceId: .any, locale: .any, subtitle: .any).willReturn( AppClipDefaultExperienceLocalization(id: "loc-new", experienceId: "exp-1", locale: "fr-FR", subtitle: "Accès rapide") ) @@ -119,7 +119,7 @@ struct AppClipExperienceLocalizationsDeleteTests { } @Test func `delete localization calls repo with localization id`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).deleteLocalization(id: .any).willReturn(()) let cmd = try AppClipExperienceLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift b/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift index 248ba40a..496ddb74 100644 --- a/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClipExperiences/AppClipExperiencesTests.swift @@ -7,7 +7,7 @@ import Testing struct AppClipExperiencesListTests { @Test func `listed experiences include appClipId action and affordances`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listExperiences(appClipId: .any).willReturn([ AppClipDefaultExperience(id: "exp-1", appClipId: "clip-1", action: .open) ]) @@ -34,7 +34,7 @@ struct AppClipExperiencesListTests { } @Test func `listed experiences omit nil action from JSON`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listExperiences(appClipId: .any).willReturn([ AppClipDefaultExperience(id: "exp-1", appClipId: "clip-1", action: nil) ]) @@ -60,7 +60,7 @@ struct AppClipExperiencesListTests { } @Test func `table output includes experience id and action`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listExperiences(appClipId: .any).willReturn([ AppClipDefaultExperience(id: "exp-1", appClipId: "clip-1", action: .open) ]) @@ -78,7 +78,7 @@ struct AppClipExperiencesListTests { struct AppClipExperiencesCreateTests { @Test func `create experience returns created experience with affordances`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).createExperience(appClipId: .any, action: .any).willReturn( AppClipDefaultExperience(id: "exp-new", appClipId: "clip-1", action: .view) ) @@ -105,7 +105,7 @@ struct AppClipExperiencesCreateTests { } @Test func `create experience without action creates with nil action`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).createExperience(appClipId: .any, action: .any).willReturn( AppClipDefaultExperience(id: "exp-new", appClipId: "clip-1", action: nil) ) @@ -140,7 +140,7 @@ struct AppClipExperiencesDeleteTests { } @Test func `delete experience calls repo with experience id`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).deleteExperience(id: .any).willReturn(()) let cmd = try AppClipExperiencesDelete.parse(["--experience-id", "exp-1"]) diff --git a/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift b/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift index 4f8a3bca..9aa60653 100644 --- a/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppClips/AppClipsListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppClipsListTests { @Test func `listed app clips include appId bundleId and affordances`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listAppClips(appId: .any).willReturn([ AppClip(id: "clip-1", appId: "app-1", bundleId: "com.example.clip") ]) @@ -33,7 +33,7 @@ struct AppClipsListTests { } @Test func `listed app clips omit nil bundleId from JSON`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listAppClips(appId: .any).willReturn([ AppClip(id: "clip-1", appId: "app-1", bundleId: nil) ]) @@ -58,7 +58,7 @@ struct AppClipsListTests { } @Test func `table output includes clip id appId and bundleId`() async throws { - let mockRepo = MockAppClips() + let mockRepo = MockAppClipRepository() given(mockRepo).listAppClips(appId: .any).willReturn([ AppClip(id: "clip-1", appId: "app-1", bundleId: "com.example.clip") ]) diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift index 6b236bc9..95d0a5bb 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfoLocalizationsCreateTests { @Test func `created localization is returned with id and locale`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo) .createLocalization(appInfoId: .any, locale: .any, name: .any) .willReturn(AppInfoLocalization(id: "loc-1", appInfoId: "info-1", locale: "en-US", name: "My App")) @@ -40,7 +40,7 @@ struct AppInfoLocalizationsCreateTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo) .createLocalization(appInfoId: .any, locale: .any, name: .any) .willReturn(AppInfoLocalization(id: "loc-2", appInfoId: "info-1", locale: "zh-Hans", name: "我的应用", subtitle: "副标题")) diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift index 1fc12e36..fb5d31d8 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfoLocalizationsDeleteTests { @Test func `delete calls repository and prints deleted id`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo) .deleteLocalization(id: .any) .willReturn(()) diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift index 0158d7a6..dc5be0b2 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfoLocalizationsListTests { @Test func `listed app info localizations include affordances for navigation`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo).listLocalizations(appInfoId: .any).willReturn([ AppInfoLocalization(id: "loc-1", appInfoId: "info-1", locale: "en-US", name: "My App", subtitle: "Do things"), ]) diff --git a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift index dcfb575c..163c3760 100644 --- a/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfoLocalizations/AppInfoLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfoLocalizationsUpdateTests { @Test func `updated app info localization is returned with affordances`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo) .updateLocalization(id: .any, name: .any, subtitle: .any, privacyPolicyUrl: .any, privacyChoicesUrl: .any, privacyPolicyText: .any) .willReturn(AppInfoLocalization(id: "loc-1", appInfoId: "info-1", locale: "en-US", name: "New Name", subtitle: "New Sub")) @@ -41,7 +41,7 @@ struct AppInfoLocalizationsUpdateTests { } @Test func `update with privacy choices url and privacy policy text passes them through`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() var capturedChoicesUrl: String?? var capturedPolicyText: String?? given(mockRepo) diff --git a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift index 261d132f..58333c84 100644 --- a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfosListTests { @Test func `listed app infos include affordances for navigation`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo).listAppInfos(appId: .any).willReturn([ AppInfo(id: "info-1", appId: "app-1"), ]) diff --git a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift index 8bcd0738..1de87ebe 100644 --- a/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/AppInfos/AppInfosUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct AppInfosUpdateTests { @Test func `updated app info with primary category is returned with affordances`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo) .updateCategories( id: .any, @@ -49,7 +49,7 @@ struct AppInfosUpdateTests { } @Test func `update passes all category flags to repository`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() var capturedPrimary: String?? var capturedSecondary: String?? given(mockRepo) diff --git a/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift b/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift index 8206289c..43677f8e 100644 --- a/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AppPreviewSets/AppPreviewSetsCommandTests.swift @@ -9,7 +9,7 @@ struct AppPreviewSetsCommandTests { // MARK: - list @Test func `listed preview sets include affordances for navigation`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).listPreviewSets(localizationId: .any).willReturn([ AppPreviewSet(id: "set-1", localizationId: "loc-1", previewType: .iphone67, previewsCount: 3), ]) @@ -36,7 +36,7 @@ struct AppPreviewSetsCommandTests { } @Test func `listed preview sets returns empty data array when none exist`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).listPreviewSets(localizationId: .any).willReturn([]) let cmd = try AppPreviewSetsList.parse(["--localization-id", "loc-1", "--pretty"]) @@ -52,7 +52,7 @@ struct AppPreviewSetsCommandTests { } @Test func `table output for preview sets includes all row fields`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).listPreviewSets(localizationId: .any).willReturn([ AppPreviewSet(id: "set-1", localizationId: "loc-1", previewType: .iphone67, previewsCount: 2), ]) @@ -69,7 +69,7 @@ struct AppPreviewSetsCommandTests { // MARK: - create @Test func `created preview set is returned with affordances`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).createPreviewSet(localizationId: .any, previewType: .any).willReturn( AppPreviewSet(id: "set-new", localizationId: "loc-1", previewType: .iphone67, previewsCount: 0) ) @@ -96,7 +96,7 @@ struct AppPreviewSetsCommandTests { } @Test func `unknown preview type throws validation error`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() let cmd = try AppPreviewSetsCreate.parse(["--localization-id", "loc-1", "--preview-type", "INVALID_TYPE"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -104,7 +104,7 @@ struct AppPreviewSetsCommandTests { } @Test func `created Apple TV preview set returns correct preview type`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).createPreviewSet(localizationId: .any, previewType: .any).willReturn( AppPreviewSet(id: "set-1", localizationId: "loc-42", previewType: .appleTV, previewsCount: 0) ) diff --git a/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift b/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift index 21ddb925..870a21fa 100644 --- a/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AppPreviews/AppPreviewsCommandTests.swift @@ -9,7 +9,7 @@ struct AppPreviewsCommandTests { // MARK: - list @Test func `listed previews include file metadata and affordances`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).listPreviews(setId: .any).willReturn([ AppPreview( id: "prev-1", @@ -46,7 +46,7 @@ struct AppPreviewsCommandTests { } @Test func `previews without optional fields omit them from json`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).listPreviews(setId: .any).willReturn([ AppPreview( id: "prev-1", @@ -77,7 +77,7 @@ struct AppPreviewsCommandTests { } @Test func `previews in processing state include video delivery state`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).listPreviews(setId: .any).willReturn([ AppPreview( id: "prev-1", @@ -114,7 +114,7 @@ struct AppPreviewsCommandTests { } @Test func `table output for previews includes all row fields`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).listPreviews(setId: .any).willReturn([ AppPreview( id: "prev-1", @@ -138,7 +138,7 @@ struct AppPreviewsCommandTests { // MARK: - upload @Test func `uploaded preview is returned with file metadata and affordances`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).uploadPreview(setId: .any, fileURL: .any, previewFrameTimeCode: .any).willReturn( AppPreview( id: "prev-new", @@ -175,7 +175,7 @@ struct AppPreviewsCommandTests { } @Test func `upload with preview frame timecode passes timecode to repository`() async throws { - let mockRepo = MockAppPreviews() + let mockRepo = MockPreviewRepository() given(mockRepo).uploadPreview(setId: .any, fileURL: .any, previewFrameTimeCode: .any).willReturn( AppPreview( id: "prev-1", diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift index 4a61419d..a1fc83b2 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsGalleryTemplatesTests.swift @@ -10,7 +10,7 @@ struct AppShotsGalleryTemplatesTests { // MARK: - List @Test func `list gallery templates returns galleries with affordances`() async throws { - let mockRepo = MockGalleryTemplates() + let mockRepo = MockGalleryTemplateRepository() let gallery = Gallery(appName: "TestApp", screenshots: ["s0.png", "s1.png"]) gallery.template = GalleryTemplate(id: "neon-pop", name: "Neon Pop", screens: [ .hero: ScreenLayout(headline: TextSlot(y: 0.07, size: 0.08)), @@ -28,7 +28,7 @@ struct AppShotsGalleryTemplatesTests { } @Test func `list gallery templates table format`() async throws { - let mockRepo = MockGalleryTemplates() + let mockRepo = MockGalleryTemplateRepository() let gallery = Gallery(appName: "TestApp", screenshots: ["s0.png"]) gallery.template = GalleryTemplate(id: "neon", name: "Neon", screens: [:]) gallery.palette = GalleryPalette(id: "p", name: "P", background: "#000") @@ -43,7 +43,7 @@ struct AppShotsGalleryTemplatesTests { // MARK: - Get @Test func `get gallery template returns specific gallery`() async throws { - let mockRepo = MockGalleryTemplates() + let mockRepo = MockGalleryTemplateRepository() let gallery = Gallery(appName: "BezelBlend", screenshots: ["s0.png"]) gallery.template = GalleryTemplate(id: "neon-pop", name: "Neon Pop", screens: [:]) gallery.palette = GalleryPalette(id: "p", name: "P", background: "#000") @@ -56,7 +56,7 @@ struct AppShotsGalleryTemplatesTests { } @Test func `get gallery template returns error when not found`() async throws { - let mockRepo = MockGalleryTemplates() + let mockRepo = MockGalleryTemplateRepository() given(mockRepo).getGallery(templateId: .value("nope")).willReturn(nil) let cmd = try AppShotsGalleryTemplatesGet.parse(["--id", "nope"]) @@ -69,7 +69,7 @@ struct AppShotsGalleryTemplatesTests { } @Test func `get gallery template with preview flag returns HTML`() async throws { - let mockRepo = MockGalleryTemplates() + let mockRepo = MockGalleryTemplateRepository() let gallery = Gallery(appName: "TestApp", screenshots: ["s0.png"]) gallery.template = GalleryTemplate(id: "neon-pop", name: "Neon Pop", screens: [ .hero: ScreenLayout(headline: TextSlot(y: 0.07, size: 0.08)), diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift index 843e2057..4e95dd0c 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsTemplatesTests.swift @@ -10,7 +10,7 @@ struct AppShotsTemplatesTests { // MARK: - List @Test func `list templates shows all templates with affordances`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).listTemplates(size: .value(nil)).willReturn([ makeTemplate(id: "top-hero", name: "Top Hero"), makeTemplate(id: "minimal-light", name: "Minimal Light"), @@ -25,7 +25,7 @@ struct AppShotsTemplatesTests { } @Test func `list templates filters by size`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).listTemplates(size: .value(.landscape)).willReturn([ makeTemplate(id: "triple-fan", name: "Triple Fan"), ]) @@ -38,7 +38,7 @@ struct AppShotsTemplatesTests { // MARK: - Get @Test func `get template by id returns template detail`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -51,7 +51,7 @@ struct AppShotsTemplatesTests { } @Test func `get template returns error when not found`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).getTemplate(id: .value("nope")).willReturn(nil) let cmd = try AppShotsTemplatesGet.parse(["--id", "nope"]) @@ -65,7 +65,7 @@ struct AppShotsTemplatesTests { // MARK: - Apply @Test func `apply template returns screen design with preview`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -84,7 +84,7 @@ struct AppShotsTemplatesTests { } @Test func `apply with preview image renders HTML to PNG and writes file`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -112,7 +112,7 @@ struct AppShotsTemplatesTests { } @Test func `apply with preview html outputs HTML page`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -129,7 +129,7 @@ struct AppShotsTemplatesTests { } @Test func `apply returns error when template not found`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).getTemplate(id: .value("nope")).willReturn(nil) let cmd = try AppShotsTemplatesApply.parse([ diff --git a/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift b/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift index cce2ce49..572fc2fb 100644 --- a/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift +++ b/Tests/ASCCommandTests/Commands/AppShots/AppShotsThemesTests.swift @@ -98,7 +98,7 @@ struct AppShotsThemesTests { given(mockThemeRepo).compose(themeId: .value("space"), html: .any, canvasWidth: .any, canvasHeight: .any) .willReturn("
themed output
") - let mockTemplateRepo = MockTemplates() + let mockTemplateRepo = MockTemplateRepository() given(mockTemplateRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -118,7 +118,7 @@ struct AppShotsThemesTests { given(mockThemeRepo).compose(themeId: .value("space"), html: .any, canvasWidth: .any, canvasHeight: .any) .willReturn("
themed output
") - let mockTemplateRepo = MockTemplates() + let mockTemplateRepo = MockTemplateRepository() given(mockTemplateRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -151,7 +151,7 @@ struct AppShotsThemesTests { given(mockThemeRepo).compose(themeId: .value("space"), html: .any, canvasWidth: .any, canvasHeight: .any) .willReturn("
themed
") - let mockTemplateRepo = MockTemplates() + let mockTemplateRepo = MockTemplateRepository() given(mockTemplateRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -199,7 +199,7 @@ struct AppShotsThemesTests { let data = try JSONEncoder().encode(design) try data.write(to: URL(fileURLWithPath: designPath)) - let mockTemplateRepo = MockTemplates() + let mockTemplateRepo = MockTemplateRepository() given(mockTemplateRepo).getTemplate(id: .value("top-hero")).willReturn( makeTemplate(id: "top-hero", name: "Top Hero") ) @@ -219,7 +219,7 @@ struct AppShotsThemesTests { @Test func `apply fails when template not found`() async throws { let mockThemeRepo = MockThemes() - let mockTemplateRepo = MockTemplates() + let mockTemplateRepo = MockTemplateRepository() given(mockTemplateRepo).getTemplate(id: .value("nope")).willReturn(nil) let cmd = try AppShotsThemesApply.parse([ diff --git a/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift index b179a61f..a6ec193d 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppPricingCommandsTests.swift @@ -7,7 +7,7 @@ import Testing struct AppPricingCommandsTests { @Test func `listed price points show the price and the command to set it`() async throws { - let mockRepo = MockAppPrices() + let mockRepo = MockPricingRepository() given(mockRepo).listPricePoints(appId: .value("app-1"), territory: .value("USA")).willReturn([ AppPricePoint(id: "pp-1", appId: "app-1", territory: "USA", customerPrice: "4.99", proceeds: "4.24"), ]) @@ -35,7 +35,7 @@ struct AppPricingCommandsTests { } @Test func `price points can be listed for another territory`() async throws { - let mockRepo = MockAppPrices() + let mockRepo = MockPricingRepository() given(mockRepo).listPricePoints(appId: .any, territory: .any).willReturn([]) _ = try await AppsPricePointsList.parse(["--app-id", "app-1", "--territory", "JPN"]).execute(repo: mockRepo) @@ -44,7 +44,7 @@ struct AppPricingCommandsTests { } @Test func `setting the price shows the new schedule`() async throws { - let mockRepo = MockAppPrices() + let mockRepo = MockPricingRepository() given(mockRepo).setPriceSchedule(appId: .value("app-1"), baseTerritory: .value("USA"), pricePointId: .value("pp-1")) .willReturn(AppPriceSchedule(id: "sched-1", appId: "app-1", baseTerritory: "USA")) diff --git a/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift index bbef93cc..7ccf36b8 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppsListTests.swift @@ -7,7 +7,7 @@ import Testing struct AppsListTests { @Test func `listed apps include name bundleId and affordances`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ App(id: "app-1", name: "My App", bundleId: "com.example.app", sku: "SKU1"), @@ -43,7 +43,7 @@ struct AppsListTests { } @Test func `sku is omitted from output when not set`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ App(id: "app-1", name: "No SKU App", bundleId: "com.example"), diff --git a/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift index 2de4cc3e..1d8e3bd5 100644 --- a/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/AppsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct AppsUpdateTests { @Test func `updated content rights declaration returns app with declaration set`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).updateContentRights(appId: .any, declaration: .any).willReturn( App(id: "app-9", name: "Bakery", bundleId: "com.example.bakery", contentRightsDeclaration: .doesNotUseThirdPartyContent) ) diff --git a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift index 0ee4dcec..ae5a6edd 100644 --- a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityCreateTests.swift @@ -13,12 +13,12 @@ struct AppAvailabilityCreateTests { ]) @Test func `creating availability for chosen territories shows the result`() async throws { - let repo = MockAppAvailabilities() + let repo = MockAppAvailabilityRepository() given(repo).createAppAvailability(appId: .any, isAvailableInNewTerritories: .any, territoryIds: .any).willReturn(created) let cmd = try AppAvailabilityCreate.parse(["--app-id", "app-1", "--territory", "USA", "--territory", "JPN", "--available-in-new-territories", "--pretty"]) - let output = try await cmd.execute(repo: repo, territoryRepo: MockTerritories()) + let output = try await cmd.execute(repo: repo, territoryRepo: MockTerritoryRepository()) verify(repo).createAppAvailability(appId: .value("app-1"), isAvailableInNewTerritories: .value(true), territoryIds: .value(["USA", "JPN"])).called(1) @@ -51,9 +51,9 @@ struct AppAvailabilityCreateTests { } @Test func `all territories makes the app available everywhere Apple sells`() async throws { - let repo = MockAppAvailabilities() + let repo = MockAppAvailabilityRepository() given(repo).createAppAvailability(appId: .any, isAvailableInNewTerritories: .any, territoryIds: .any).willReturn(created) - let territories = MockTerritories() + let territories = MockTerritoryRepository() given(territories).listTerritories().willReturn([ Territory(id: "USA", currency: "USD"), Territory(id: "JPN", currency: "JPY"), Territory(id: "FRA", currency: "EUR"), ]) @@ -68,11 +68,11 @@ struct AppAvailabilityCreateTests { @Test func `creating availability needs either territories or all territories`() async throws { let neither = try AppAvailabilityCreate.parse(["--app-id", "app-1"]) await #expect(throws: ValidationError.self) { - _ = try await neither.execute(repo: MockAppAvailabilities(), territoryRepo: MockTerritories()) + _ = try await neither.execute(repo: MockAppAvailabilityRepository(), territoryRepo: MockTerritoryRepository()) } let both = try AppAvailabilityCreate.parse(["--app-id", "app-1", "--territory", "USA", "--all-territories"]) await #expect(throws: ValidationError.self) { - _ = try await both.execute(repo: MockAppAvailabilities(), territoryRepo: MockTerritories()) + _ = try await both.execute(repo: MockAppAvailabilityRepository(), territoryRepo: MockTerritoryRepository()) } } } diff --git a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift index e205ea10..0e22be16 100644 --- a/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Apps/Availability/AppAvailabilityGetTests.swift @@ -7,7 +7,7 @@ import Testing struct AppAvailabilityGetTests { @Test func `get app availability shows per-territory status with content reasons`() async throws { - let mockRepo = MockAppAvailabilities() + let mockRepo = MockAppAvailabilityRepository() given(mockRepo).getAppAvailability(appId: .any) .willReturn(AppAvailability( id: "avail-1", @@ -74,7 +74,7 @@ struct AppAvailabilityGetTests { } @Test func `an app with no availability set up shows no data`() async throws { - let mockRepo = MockAppAvailabilities() + let mockRepo = MockAppAvailabilityRepository() given(mockRepo).getAppAvailability(appId: .any).willReturn(nil) let output = try await AppAvailabilityGet.parse(["--app-id", "app-42", "--pretty"]).execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift index 92529cf9..69081862 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetImagesCommandTests.swift @@ -10,7 +10,7 @@ struct AssetImagesCommandTests { // MARK: - list @Test func `should list the library's images with their state and what can be done with each`() async throws { - let mockRepo = MockLibraryImages() + let mockRepo = MockLibraryImageRepository() given(mockRepo).listImages(libraryId: .value("lib-1"), imageId: .value(nil), state: .value(.prepareForSubmission), category: .value(nil)).willReturn([ LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 14619, category: .appScreenshotsAndPreviews, state: .prepareForSubmission, referenceName: "Home", specId: "spec-1", @@ -47,7 +47,7 @@ struct AssetImagesCommandTests { } @Test func `should show just one image when asked for it by id`() async throws { - let mockRepo = MockLibraryImages() + let mockRepo = MockLibraryImageRepository() given(mockRepo).listImages(libraryId: .value("lib-1"), imageId: .value("img-2"), state: .value(nil), category: .value(.creativeAssets)).willReturn([ LibraryImage(id: "img-2", libraryId: "lib-1", fileName: "card.png", fileSize: 10, category: .creativeAssets, state: .uploadComplete), ]) @@ -80,7 +80,7 @@ struct AssetImagesCommandTests { // MARK: - upload @Test func `should show the uploaded image while App Store Connect processes it`() async throws { - let mockRepo = MockLibraryImages() + let mockRepo = MockLibraryImageRepository() given(mockRepo).uploadImage(libraryId: .value("lib-1"), fileURL: .any, category: .value(.appScreenshotsAndPreviews), referenceName: .value("Home")) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 7, category: .appScreenshotsAndPreviews, state: .uploadComplete, referenceName: "Home")) @@ -112,7 +112,7 @@ struct AssetImagesCommandTests { } @Test func `should wait until App Store Connect has processed the image when asked to wait`() async throws { - let mockRepo = MockLibraryImages() + let mockRepo = MockLibraryImageRepository() given(mockRepo).uploadImage(libraryId: .any, fileURL: .any, category: .value(.creativeAssets), referenceName: .value(nil)) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "card.png", fileSize: 7, category: .creativeAssets, state: .uploadComplete)) given(mockRepo).listImages(libraryId: .value("lib-1"), imageId: .value("img-1"), state: .value(nil), category: .value(nil)) @@ -150,7 +150,7 @@ struct AssetImagesCommandTests { } @Test func `should stop waiting and show why when processing fails`() async throws { - let mockRepo = MockLibraryImages() + let mockRepo = MockLibraryImageRepository() given(mockRepo).uploadImage(libraryId: .any, fileURL: .any, category: .any, referenceName: .any) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "bad.png", fileSize: 7, category: .appScreenshotsAndPreviews, state: .uploadComplete)) given(mockRepo).listImages(libraryId: .any, imageId: .any, state: .any, category: .any) @@ -166,7 +166,7 @@ struct AssetImagesCommandTests { // MARK: - update @Test func `should rename the image and show it under its new name`() async throws { - let mockRepo = MockLibraryImages() + let mockRepo = MockLibraryImageRepository() given(mockRepo).updateImage(libraryId: .value("lib-1"), imageId: .value("img-1"), referenceName: .value("Home (Fall)"), isArchived: .value(nil)) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 7, category: .appScreenshotsAndPreviews, state: .approved, referenceName: "Home (Fall)")) @@ -186,7 +186,7 @@ struct AssetImagesCommandTests { // MARK: - delete @Test func `should report App Store Connect's refusal to delete an image that is still placed`() async throws { - let mockRepo = MockLibraryImages() + let mockRepo = MockLibraryImageRepository() given(mockRepo).deleteImage(imageId: .value("img-1")).willThrow(APIError.unknown("STATE_ERROR.ASSET_HAS_PLACEMENTS")) let cmd = try AssetImagesDelete.parse(["--image-id", "img-1"]) diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift index 8a540cca..f4a87166 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetLibraryCommandTests.swift @@ -7,7 +7,7 @@ import Testing struct AssetLibraryCommandTests { @Test func `should show the app's asset library with where to go next`() async throws { - let mockRepo = MockAssetLibraries() + let mockRepo = MockAssetLibraryRepository() given(mockRepo).getAssetLibrary(appId: .value("app-1")).willReturn(AppAssetLibrary(id: "lib-1", appId: "app-1")) let cmd = try AssetLibraryGet.parse(["--app-id", "app-1", "--pretty"]) @@ -32,7 +32,7 @@ struct AssetLibraryCommandTests { } @Test func `should list placement groups of the requested type and feature with how to place into them`() async throws { - let mockRepo = MockAssetLibraries() + let mockRepo = MockAssetLibraryRepository() given(mockRepo).listPlacementGroups(placementType: .value(.appScreenshot), feature: .value("APP_STORE_VERSIONS")).willReturn([ AssetPlacementGroup(id: "IPHONE_DUO_PROFILE", placementType: .appScreenshot, platform: "IPHONE_APP_STORE", displayClass: "IPHONE_DUO", feature: "APP_STORE_VERSIONS", sizes: ["1290x2796"], maxCount: 10), diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift index a59b7ce4..ca6ce0f7 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetPlacementsCommandTests.swift @@ -9,7 +9,7 @@ struct AssetPlacementsCommandTests { // MARK: - list @Test func `should list a localization's placements in display order with what can be done next`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).listPlacements( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), placementType: .value(.appScreenshot), placementGroup: .value("IPHONE_67") @@ -50,7 +50,7 @@ struct AssetPlacementsCommandTests { } @Test func `should list everywhere an image is placed`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).listAssetPlacements(mediaType: .value(.image), assetId: .value("img-1")).willReturn([ AssetPlacement(id: "pl-1", surface: .appStoreVersionLocalization, localizationId: "loc-1", mediaType: .image, assetId: "img-1", placementType: .appScreenshot, placementGroup: "IPHONE_67", state: .parentApproved), @@ -70,7 +70,7 @@ struct AssetPlacementsCommandTests { } @Test func `should list a treatment localization's placements`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).listPlacements( surface: .value(.experimentTreatmentLocalization), localizationId: .value("tl-1"), placementType: .value(nil), placementGroup: .value(nil) ).willReturn([ @@ -85,7 +85,7 @@ struct AssetPlacementsCommandTests { } @Test func `should list everywhere a video is placed`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).listAssetPlacements(mediaType: .value(.video), assetId: .value("vid-1")).willReturn([ AssetPlacement(id: "pl-1", surface: .appStoreVersionLocalization, localizationId: "loc-1", mediaType: .video, assetId: "vid-1", placementType: .appPreview, placementGroup: "IPHONE_67", state: .parentApproved), @@ -100,7 +100,7 @@ struct AssetPlacementsCommandTests { // MARK: - create @Test func `should place the image on the localization and show the new placement`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).createPlacement( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), mediaType: .value(.image), assetId: .value("img-1"), placementType: .value(.appScreenshot), placementGroup: .value("IPHONE_67") @@ -118,7 +118,7 @@ struct AssetPlacementsCommandTests { } @Test func `should place a video on a treatment localization`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).createPlacement( surface: .value(.experimentTreatmentLocalization), localizationId: .value("tl-1"), mediaType: .value(.video), assetId: .value("vid-1"), placementType: .value(.appPreview), placementGroup: .value("IPHONE_67") @@ -136,7 +136,7 @@ struct AssetPlacementsCommandTests { } @Test func `should place a header image on a custom product page localization`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).createPlacement( surface: .value(.customProductPageLocalization), localizationId: .value("cpl-1"), mediaType: .value(.image), assetId: .value("img-1"), placementType: .value(.productPageHeaderAsset), placementGroup: .value("DEFAULT_PROFILE") @@ -155,7 +155,7 @@ struct AssetPlacementsCommandTests { } @Test func `should list a custom product page localization's placements`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).listPlacements( surface: .value(.customProductPageLocalization), localizationId: .value("cpl-1"), placementType: .value(.appStoreSearchResultsAsset), placementGroup: .value(nil) @@ -202,7 +202,7 @@ struct AssetPlacementsCommandTests { // MARK: - reorder @Test func `should reorder a group on a treatment localization`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).reorderPlacements( surface: .value(.experimentTreatmentLocalization), localizationId: .value("tl-1"), placementGroup: .value("IPHONE_67"), placementIds: .value(["pl-1"]) @@ -219,7 +219,7 @@ struct AssetPlacementsCommandTests { @Test func `should show the group in the order it was given`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).reorderPlacements( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), placementGroup: .value("IPHONE_67"), placementIds: .value(["pl-2", "pl-1"]) @@ -241,7 +241,7 @@ struct AssetPlacementsCommandTests { // MARK: - delete @Test func `should report App Store Connect's refusal to delete a placement once the version is in review`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).deletePlacement(placementId: .value("pl-1")).willThrow(APIError.unknown("STATE_ERROR.INVALID_STATE")) let cmd = try AssetPlacementsDelete.parse(["--placement-id", "pl-1"]) diff --git a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift index 03445477..5537ff7e 100644 --- a/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/AssetLibrary/AssetVideosCommandTests.swift @@ -8,7 +8,7 @@ import Testing struct AssetVideosCommandTests { @Test func `should list the library's videos with their preview frame and what can be done with each`() async throws { - let mockRepo = MockLibraryVideos() + let mockRepo = MockLibraryVideoRepository() given(mockRepo).listVideos(libraryId: .value("lib-1"), videoId: .value(nil), state: .value(nil), category: .value(nil)).willReturn([ LibraryVideo(id: "vid-1", libraryId: "lib-1", fileName: "preview.mp4", fileSize: 10, category: .appScreenshotsAndPreviews, state: .prepareForSubmission, @@ -43,7 +43,7 @@ struct AssetVideosCommandTests { } @Test func `should upload the video with its preview frame and wait until App Store Connect has processed it`() async throws { - let mockRepo = MockLibraryVideos() + let mockRepo = MockLibraryVideoRepository() given(mockRepo).uploadVideo(libraryId: .value("lib-1"), fileURL: .any, category: .value(.appScreenshotsAndPreviews), referenceName: .value("Fall"), previewFrameTimeCode: .value("00:00:05:00")) .willReturn(LibraryVideo(id: "vid-1", libraryId: "lib-1", fileName: "p.mp4", fileSize: 9, category: .appScreenshotsAndPreviews, state: .uploadComplete)) @@ -60,7 +60,7 @@ struct AssetVideosCommandTests { } @Test func `should archive an approved video`() async throws { - let mockRepo = MockLibraryVideos() + let mockRepo = MockLibraryVideoRepository() given(mockRepo).updateVideo(libraryId: .value("lib-1"), videoId: .value("vid-1"), referenceName: .value(nil), isArchived: .value(true)) .willReturn(LibraryVideo(id: "vid-1", libraryId: "lib-1", fileName: "p.mp4", fileSize: 9, category: .appScreenshotsAndPreviews, state: .archived)) @@ -77,7 +77,7 @@ struct AssetVideosCommandTests { } @Test func `should report App Store Connect's refusal to delete a video that is still placed`() async throws { - let mockRepo = MockLibraryVideos() + let mockRepo = MockLibraryVideoRepository() given(mockRepo).deleteVideo(videoId: .value("vid-1")).willThrow(APIError.unknown("STATE_ERROR.ASSET_HAS_PLACEMENTS")) let cmd = try AssetVideosDelete.parse(["--video-id", "vid-1"]) diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift index 454f8592..3fce3490 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsCreateTests { @Test func `creates beta app localization with description and feedback email`() async throws { - let mockRepo = MockBetaAppLocalizations() + let mockRepo = MockBetaAppLocalizationRepository() given(mockRepo).createBetaAppLocalization(appId: .any, locale: .any, update: .any) .willReturn(BetaAppLocalization( id: "bal-new", diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift index 3b1c879f..480b3423 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsDeleteTests { @Test func `delete beta app localization calls repo with localization id`() async throws { - let mockRepo = MockBetaAppLocalizations() + let mockRepo = MockBetaAppLocalizationRepository() given(mockRepo).deleteBetaAppLocalization(localizationId: .any).willReturn(()) let cmd = try BetaAppLocalizationsDelete.parse(["--localization-id", "bal-1"]) diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift index 4530b5d0..f814dfd9 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsGetTests { @Test func `get returns single beta app localization with all fields and affordances`() async throws { - let mockRepo = MockBetaAppLocalizations() + let mockRepo = MockBetaAppLocalizationRepository() given(mockRepo).getBetaAppLocalization(localizationId: .any) .willReturn(BetaAppLocalization( id: "bal-1", diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift index 43620eed..4ef0a425 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsListTests { @Test func `listed beta app localizations show appId, locale, description and affordances`() async throws { - let mockRepo = MockBetaAppLocalizations() + let mockRepo = MockBetaAppLocalizationRepository() given(mockRepo).listBetaAppLocalizations(appId: .any) .willReturn([ BetaAppLocalization( diff --git a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift index 0d42c9a8..d1409006 100644 --- a/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaAppLocalizations/BetaAppLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaAppLocalizationsUpdateTests { @Test func `update returns the updated beta app localization with affordances`() async throws { - let mockRepo = MockBetaAppLocalizations() + let mockRepo = MockBetaAppLocalizationRepository() given(mockRepo).updateBetaAppLocalization(localizationId: .any, update: .any) .willReturn(BetaAppLocalization( id: "bal-1", diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift index 09dc4dbe..a92edd95 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailGetTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewDetailGetTests { @Test func `get detail shows contact info and affordances`() async throws { - let mockRepo = MockBetaAppReviews() + let mockRepo = MockBetaAppReviewRepository() given(mockRepo).getDetail(appId: .value("app-1")) .willReturn( BetaAppReviewDetail( @@ -45,7 +45,7 @@ struct BetaReviewDetailGetTests { } @Test func `get detail omits nil optional fields`() async throws { - let mockRepo = MockBetaAppReviews() + let mockRepo = MockBetaAppReviewRepository() given(mockRepo).getDetail(appId: .value("app-1")) .willReturn( BetaAppReviewDetail(id: "d-1", appId: "app-1") diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift index 3d71ecbe..d57f9766 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewDetailUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewDetailUpdateTests { @Test func `update detail shows updated contact info`() async throws { - let mockRepo = MockBetaAppReviews() + let mockRepo = MockBetaAppReviewRepository() given(mockRepo).updateDetail(id: .value("d-1"), update: .any) .willReturn( BetaAppReviewDetail( diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift index 941a8436..75838909 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewSubmissionsCreateTests { @Test func `created submission shows waiting for review state`() async throws { - let mockRepo = MockBetaAppReviews() + let mockRepo = MockBetaAppReviewRepository() given(mockRepo).createSubmission(buildId: .value("build-1")) .willReturn( BetaAppReviewSubmission(id: "sub-new", buildId: "build-1", state: .waitingForReview) diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift index f8dd6b96..9931a98b 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewSubmissionsGetTests { @Test func `get submission shows details with affordances`() async throws { - let mockRepo = MockBetaAppReviews() + let mockRepo = MockBetaAppReviewRepository() given(mockRepo).getSubmission(id: .value("sub-1")) .willReturn( BetaAppReviewSubmission(id: "sub-1", buildId: "build-42", state: .approved) diff --git a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift index 15fa7895..b2095e1b 100644 --- a/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BetaReview/BetaReviewSubmissionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaReviewSubmissionsListTests { @Test func `listed submissions show id, buildId, state, and affordances`() async throws { - let mockRepo = MockBetaAppReviews() + let mockRepo = MockBetaAppReviewRepository() given(mockRepo).listSubmissions(buildId: .value("build-1")) .willReturn([ BetaAppReviewSubmission(id: "sub-1", buildId: "build-1", state: .waitingForReview), @@ -34,7 +34,7 @@ struct BetaReviewSubmissionsListTests { } @Test func `listed submissions show approved state`() async throws { - let mockRepo = MockBetaAppReviews() + let mockRepo = MockBetaAppReviewRepository() given(mockRepo).listSubmissions(buildId: .value("build-1")) .willReturn([ BetaAppReviewSubmission(id: "sub-1", buildId: "build-1", state: .approved), diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift index b0c55252..7c4f6734 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsAddBetaGroupTests.swift @@ -12,7 +12,7 @@ struct BuildsAddBetaGroupTests { } @Test func `execute adds beta group to build`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).addBetaGroups(buildId: .any, betaGroupIds: .any).willReturn() let cmd = try BuildsAddBetaGroup.parse(["--build-id", "build-1", "--beta-group-id", "bg-42"]) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift index 298ada07..ff0f61be 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsArchiveTests.swift @@ -106,7 +106,7 @@ struct BuildsArchiveTests { given(mockRunner).exportArchive(request: .any) .willReturn(ExportResult(ipaPath: "/tmp/export/MyApp.ipa", exportPath: "/tmp/export")) - let mockUploadRepo = MockBuildUploads() + let mockUploadRepo = MockBuildUploadRepository() given(mockUploadRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .any, fileURL: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "1.0.0", buildNumber: "42", platform: .iOS, state: .complete)) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift index 826d1f8d..63d6c040 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsListTests { @Test func `valid build includes TestFlight affordances`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "42", expired: false, processingState: .valid), @@ -37,7 +37,7 @@ struct BuildsListTests { } @Test func `build with platform and buildNumber shows all fields in JSON`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1.2.0", expired: false, processingState: .valid, buildNumber: "42", platform: .iOS), @@ -69,7 +69,7 @@ struct BuildsListTests { } @Test func `table output includes build number and platform columns`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1.0", expired: false, processingState: .valid, buildNumber: "10", platform: .iOS), @@ -87,7 +87,7 @@ struct BuildsListTests { } @Test func `platform and version options are passed to repository`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .any, platform: .value(.iOS), version: .value("1.0"), limit: .any).willReturn( PaginatedResponse(data: [], nextCursor: nil) ) @@ -105,7 +105,7 @@ struct BuildsListTests { } @Test func `expired build has no affordances`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1", expired: true, processingState: .valid), diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift index fefd4a72..61c5e214 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsNextNumberTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsNextNumberTests { @Test func `next number is 4 when highest build is 3`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .value("app-1"), platform: .value(.iOS), version: .value("1.0.1"), limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1.0.1", buildNumber: "3", platform: .iOS), @@ -36,7 +36,7 @@ struct BuildsNextNumberTests { } @Test func `next number is 1 when no builds exist`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .value("app-1"), platform: .value(.iOS), version: .value("2.0"), limit: .any).willReturn( PaginatedResponse(data: [], nextCursor: nil) ) @@ -61,7 +61,7 @@ struct BuildsNextNumberTests { } @Test func `plain output shows just the number`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [ Build(id: "b-1", version: "1.0", buildNumber: "7"), diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift index c710fc0c..0c41dde4 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsRemoveBetaGroupTests.swift @@ -12,7 +12,7 @@ struct BuildsRemoveBetaGroupTests { } @Test func `execute removes beta group from build`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).removeBetaGroups(buildId: .any, betaGroupIds: .any).willReturn() let cmd = try BuildsRemoveBetaGroup.parse(["--build-id", "build-1", "--beta-group-id", "bg-42"]) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift index cf349936..b5048e98 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsSetEncryptionComplianceTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsSetEncryptionComplianceTests { @Test func `set-encryption-compliance returns the updated build with affordances`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).updateBuildEncryptionCompliance(buildId: .any, usesNonExemptEncryption: .any) .willReturn(Build( id: "b-1", version: "1.0", expired: false, @@ -43,7 +43,7 @@ struct BuildsSetEncryptionComplianceTests { } @Test func `set-encryption-compliance accepts true to declare non-exempt encryption`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).updateBuildEncryptionCompliance(buildId: .any, usesNonExemptEncryption: .any) .willReturn(Build( id: "b-1", version: "1.0", buildNumber: "42", diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift index 3c7322f8..502ae79c 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUpdateBetaNotesTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsUpdateBetaNotesTests { @Test func `execute returns localization with notes`() async throws { - let mockRepo = MockBetaBuildLocalizations() + let mockRepo = MockBetaBuildLocalizationRepository() given(mockRepo).upsertBetaBuildLocalization(buildId: .any, locale: .any, whatsNew: .any) .willReturn(BetaBuildLocalization(id: "bbl-1", buildId: "build-1", locale: "en-US", whatsNew: "Bug fixes")) @@ -32,7 +32,7 @@ struct BuildsUpdateBetaNotesTests { } @Test func `table output includes locale and notes fields`() async throws { - let mockRepo = MockBetaBuildLocalizations() + let mockRepo = MockBetaBuildLocalizationRepository() given(mockRepo).upsertBetaBuildLocalization(buildId: .any, locale: .any, whatsNew: .any) .willReturn(BetaBuildLocalization(id: "bbl-1", buildId: "build-1", locale: "en-US", whatsNew: "New feature")) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift index b481ecc1..3a82d6e6 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadTests.swift @@ -9,7 +9,7 @@ struct BuildsUploadCommandTests { // MARK: - Platform resolution @Test func `auto-detects iOS platform from ipa extension`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .value(.iOS), fileURL: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .complete)) @@ -37,7 +37,7 @@ struct BuildsUploadCommandTests { } @Test func `auto-detects macOS platform from pkg extension`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .value(.macOS), fileURL: .any) .willReturn(BuildUpload(id: "up-2", appId: "app-1", version: "1.0", buildNumber: "1", platform: .macOS, state: .complete)) @@ -65,7 +65,7 @@ struct BuildsUploadCommandTests { } @Test func `uses explicit platform when provided`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .value(.tvOS), fileURL: .any) .willReturn(BuildUpload(id: "up-3", appId: "app-1", version: "1.0", buildNumber: "1", platform: .tvOS, state: .complete)) @@ -93,7 +93,7 @@ struct BuildsUploadCommandTests { } @Test func `throws for unknown explicit platform`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() let cmd = try BuildsUpload.parse(["--app-id", "app-1", "--file", "/tmp/App.ipa", "--version", "1.0", "--build-number", "1", "--platform", "watchos"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -103,7 +103,7 @@ struct BuildsUploadCommandTests { // MARK: - Wait flag @Test func `wait returns upload when immediately complete`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() let completed = BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .complete) given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .any, fileURL: .any).willReturn(completed) given(mockRepo).getBuildUpload(id: .any).willReturn(completed) @@ -132,7 +132,7 @@ struct BuildsUploadCommandTests { } @Test func `wait throws when upload fails with no details`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() let failed = BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .failed) given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .any, fileURL: .any).willReturn(failed) given(mockRepo).getBuildUpload(id: .any).willReturn(failed) @@ -144,7 +144,7 @@ struct BuildsUploadCommandTests { } @Test func `wait throws with error details when upload fails`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() let failed = BuildUpload( id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .failed, errors: [BuildUploadStateDetail(code: "INVALID_BINARY", description: "Binary rejected")] @@ -161,7 +161,7 @@ struct BuildsUploadCommandTests { // MARK: - Table output @Test func `table output includes all row fields`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).uploadBuild(appId: .any, version: .any, buildNumber: .any, platform: .any, fileURL: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "2.0", buildNumber: "42", platform: .iOS, state: .complete)) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift index 7fa9a1de..3d4cb535 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsDeleteTests.swift @@ -12,7 +12,7 @@ struct BuildsUploadsDeleteTests { } @Test func `execute deletes upload record`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).deleteBuildUpload(id: .any).willReturn() let cmd = try BuildsUploadsDelete.parse(["--upload-id", "up-42"]) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift index c81b02c5..319be93f 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsUploadsGetTests { @Test func `execute returns upload with affordances`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).getBuildUpload(id: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "2.0", buildNumber: "55", platform: .iOS, state: .complete)) @@ -35,7 +35,7 @@ struct BuildsUploadsGetTests { } @Test func `table output includes id version build and state`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).getBuildUpload(id: .any) .willReturn(BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "10", platform: .macOS, state: .processing)) diff --git a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift index ef3f811e..027aa14e 100644 --- a/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Builds/BuildsUploadsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BuildsUploadsListTests { @Test func `execute returns list of uploads`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).listBuildUploads(appId: .any).willReturn([ BuildUpload(id: "up-1", appId: "app-1", version: "1.0", buildNumber: "1", platform: .iOS, state: .complete), BuildUpload(id: "up-2", appId: "app-1", version: "1.1", buildNumber: "2", platform: .iOS, state: .processing), @@ -23,7 +23,7 @@ struct BuildsUploadsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockBuildUploads() + let mockRepo = MockBuildUploadRepository() given(mockRepo).listBuildUploads(appId: .any).willReturn([ BuildUpload(id: "up-1", appId: "app-1", version: "2.0", buildNumber: "99", platform: .iOS, state: .failed), ]) diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift index e890acac..3619f308 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct BundleIDsCreateTests { @Test func `execute creates bundle id and returns it`() async throws { - let mockRepo = MockBundleIDs() + let mockRepo = MockBundleIDRepository() given(mockRepo).createBundleID(name: .any, identifier: .any, platform: .any) .willReturn(BundleID(id: "bid-new", name: "My App", identifier: "com.example.app", platform: .iOS)) @@ -33,7 +33,7 @@ struct BundleIDsCreateTests { } @Test func `execute throws for invalid platform`() async throws { - let mockRepo = MockBundleIDs() + let mockRepo = MockBundleIDRepository() let cmd = try BundleIDsCreate.parse(["--name", "My App", "--identifier", "com.example.app", "--platform", "unknown"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -41,7 +41,7 @@ struct BundleIDsCreateTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockBundleIDs() + let mockRepo = MockBundleIDRepository() given(mockRepo).createBundleID(name: .any, identifier: .any, platform: .any) .willReturn(BundleID(id: "bid-1", name: "Test App", identifier: "com.test.app", platform: .macOS)) diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift index dfcf97d2..3ff0e1f2 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct BundleIDsDeleteTests { @Test func `execute deletes bundle id`() async throws { - let mockRepo = MockBundleIDs() + let mockRepo = MockBundleIDRepository() given(mockRepo).deleteBundleID(id: .any).willReturn() let cmd = try BundleIDsDelete.parse(["--bundle-id-id", "bid-42"]) diff --git a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift index ffa72d0b..f6a25afe 100644 --- a/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift +++ b/Tests/ASCCommandTests/Commands/BundleIDs/BundleIDsListTests.swift @@ -7,7 +7,7 @@ import Testing struct BundleIDsListTests { @Test func `listed bundle ids include identifier platform and affordances`() async throws { - let mockRepo = MockBundleIDs() + let mockRepo = MockBundleIDRepository() given(mockRepo).listBundleIDs(platform: .any, identifier: .any).willReturn([ BundleID(id: "bid-1", name: "My App", identifier: "com.example.app", platform: .iOS), ]) @@ -34,7 +34,7 @@ struct BundleIDsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockBundleIDs() + let mockRepo = MockBundleIDRepository() given(mockRepo).listBundleIDs(platform: .any, identifier: .any).willReturn([ BundleID(id: "bid-1", name: "My App", identifier: "com.example.app", platform: .iOS), ]) @@ -48,7 +48,7 @@ struct BundleIDsListTests { } @Test func `seed id is omitted from output when not set`() async throws { - let mockRepo = MockBundleIDs() + let mockRepo = MockBundleIDRepository() given(mockRepo).listBundleIDs(platform: .any, identifier: .any).willReturn([ BundleID(id: "bid-1", name: "My App", identifier: "com.example.app", platform: .macOS), ]) diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift index f791f390..34749c12 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesCreateTests.swift @@ -13,8 +13,8 @@ struct CertificatesCreateTests { -----END CERTIFICATE REQUEST----- """ - private func makeMock(id: String = "cert-1") -> MockCertificates { - let mock = MockCertificates() + private func makeMock(id: String = "cert-1") -> MockCertificateRepository { + let mock = MockCertificateRepository() given(mock).createCertificate(certificateType: .any, csrContent: .any).willReturn( Certificate(id: id, name: "Mac App Distribution", certificateType: .macAppDistribution) ) @@ -86,7 +86,7 @@ struct CertificatesCreateTests { @Test func `create with neither flag throws validation error`() async throws { let cmd = try CertificatesCreate.parse(["--type", "IOS_DISTRIBUTION"]) await #expect(throws: (any Error).self) { - _ = try await cmd.execute(repo: MockCertificates()) + _ = try await cmd.execute(repo: MockCertificateRepository()) } } @@ -101,7 +101,7 @@ struct CertificatesCreateTests { "--csr-path", tmpFile.path, ]) await #expect(throws: (any Error).self) { - _ = try await cmd.execute(repo: MockCertificates()) + _ = try await cmd.execute(repo: MockCertificateRepository()) } } } diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift index cdccb3e0..be75c3b2 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesListTests.swift @@ -8,7 +8,7 @@ import Testing struct CertificatesListTests { @Test func `listed certificates include type and affordances`() async throws { - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-1", name: "iOS Distribution", certificateType: .iosDistribution), ]) @@ -33,7 +33,7 @@ struct CertificatesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-1", name: "iOS Dist", certificateType: .iosDistribution), ]) @@ -49,7 +49,7 @@ struct CertificatesListTests { @Test func `expired-only flag filters out unexpired certificates`() async throws { let past = Date(timeIntervalSince1970: 1_000_000_000) // year 2001 — expired let future = Date(timeIntervalSinceNow: 31_536_000) // one year from now - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-expired", name: "Old", certificateType: .iosDistribution, expirationDate: past), Certificate(id: "cert-fresh", name: "Fresh", certificateType: .iosDistribution, expirationDate: future), @@ -66,7 +66,7 @@ struct CertificatesListTests { let cutoff = Date(timeIntervalSince1970: 1_700_000_000) let earlier = Date(timeIntervalSince1970: 1_600_000_000) let later = Date(timeIntervalSince1970: 1_800_000_000) - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-early", name: "Early", certificateType: .iosDistribution, expirationDate: earlier), Certificate(id: "cert-late", name: "Late", certificateType: .iosDistribution, expirationDate: later), @@ -83,7 +83,7 @@ struct CertificatesListTests { @Test func `before flag accepts date-only YYYY-MM-DD`() async throws { let earlier = Date(timeIntervalSince1970: 1_600_000_000) // 2020-09 let later = Date(timeIntervalSince1970: 2_000_000_000) // 2033-05 - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate(id: "cert-early", name: "Early", certificateType: .iosDistribution, expirationDate: earlier), Certificate(id: "cert-late", name: "Late", certificateType: .iosDistribution, expirationDate: later), @@ -97,7 +97,7 @@ struct CertificatesListTests { } @Test func `limit flag is forwarded to repository`() async throws { - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).listCertificates(certificateType: .any, limit: .value(200)).willReturn([]) let cmd = try CertificatesList.parse(["--limit", "200", "--pretty"]) @@ -113,7 +113,7 @@ struct CertificatesListTests { } @Test func `optional certificate fields are omitted when nil`() async throws { - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).listCertificates(certificateType: .any, limit: .any).willReturn([ Certificate( id: "cert-1", diff --git a/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift b/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift index a6c4ab70..f52c49f1 100644 --- a/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift +++ b/Tests/ASCCommandTests/Commands/Certificates/CertificatesRevokeTests.swift @@ -7,7 +7,7 @@ import Testing struct CertificatesRevokeTests { @Test func `execute revokes certificate`() async throws { - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).revokeCertificate(id: .any).willReturn() let cmd = try CertificatesRevoke.parse(["--certificate-id", "cert-42"]) diff --git a/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift b/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift index ffed19ee..6dffd7d1 100644 --- a/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Devices/DevicesListTests.swift @@ -7,7 +7,7 @@ import Testing struct DevicesListTests { @Test func `table output includes all row fields`() async throws { - let mockRepo = MockDevices() + let mockRepo = MockDeviceRepository() given(mockRepo).listDevices(platform: .any).willReturn([ Device(id: "dev-1", name: "iPhone 15", udid: "ABC-001", deviceClass: .iPhone, platform: .iOS, status: .enabled), ]) @@ -22,7 +22,7 @@ struct DevicesListTests { } @Test func `listed devices include udid class status and affordances`() async throws { - let mockRepo = MockDevices() + let mockRepo = MockDeviceRepository() given(mockRepo).listDevices(platform: .any).willReturn([ Device( id: "dev-1", diff --git a/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift b/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift index 4638c00f..9645faec 100644 --- a/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift +++ b/Tests/ASCCommandTests/Commands/Devices/DevicesRegisterTests.swift @@ -7,7 +7,7 @@ import Testing struct DevicesRegisterTests { @Test func `execute registers device and returns it`() async throws { - let mockRepo = MockDevices() + let mockRepo = MockDeviceRepository() given(mockRepo).registerDevice(name: .any, udid: .any, platform: .any) .willReturn(Device(id: "dev-new", name: "My iPhone", udid: "UDID-001", deviceClass: .iPhone, platform: .iOS, status: .enabled)) @@ -20,7 +20,7 @@ struct DevicesRegisterTests { } @Test func `execute throws for invalid platform`() async throws { - let mockRepo = MockDevices() + let mockRepo = MockDeviceRepository() let cmd = try DevicesRegister.parse(["--name", "My Device", "--udid", "UDID-001", "--platform", "tvos"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -28,7 +28,7 @@ struct DevicesRegisterTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockDevices() + let mockRepo = MockDeviceRepository() given(mockRepo).registerDevice(name: .any, udid: .any, platform: .any) .willReturn(Device(id: "dev-1", name: "iPad Pro", udid: "UDID-002", deviceClass: .iPad, platform: .iOS, status: .enabled)) diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift index 57908ae5..d556f95b 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentLocalizationsTests.swift @@ -7,7 +7,7 @@ import Testing struct ExperimentTreatmentLocalizationsTests { @Test func `listed localizations show locale and delete affordance`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listTreatmentLocalizations(treatmentId: .any, limit: .any).willReturn([ ExperimentTreatmentLocalization(id: "loc-1", treatmentId: "trt-1", locale: "en-US"), ]) @@ -34,7 +34,7 @@ struct ExperimentTreatmentLocalizationsTests { } @Test func `create passes locale and shows the new localization`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).createTreatmentLocalization(treatmentId: .any, locale: .any) .willReturn(ExperimentTreatmentLocalization(id: "loc-2", treatmentId: "trt-1", locale: "de-DE")) @@ -47,7 +47,7 @@ struct ExperimentTreatmentLocalizationsTests { } @Test func `delete calls the repository with the localization id`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).deleteTreatmentLocalization(localizationId: .any).willReturn(()) let cmd = try ExperimentTreatmentLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift index 26c3d427..f8d83609 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentTreatmentsTests.swift @@ -11,7 +11,7 @@ private func makeTreatment(id: String = "trt-1", experimentId: String = "exp-1", struct ExperimentTreatmentsListTests { @Test func `listed treatments show icon name and localization affordances`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listTreatments(experimentId: .any, limit: .any) .willReturn(PaginatedResponse(data: [makeTreatment()], nextCursor: nil)) @@ -45,7 +45,7 @@ struct ExperimentTreatmentsListTests { struct ExperimentTreatmentsCreateTests { @Test func `create passes name and icon and shows the new treatment`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).createTreatment(experimentId: .any, name: .any, appIconName: .any).willReturn(makeTreatment()) let cmd = try ExperimentTreatmentsCreate.parse([ @@ -65,7 +65,7 @@ struct ExperimentTreatmentsCreateTests { struct ExperimentTreatmentsUpdateTests { @Test func `update forwards only the provided fields`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).updateTreatment(treatmentId: .any, name: .any, appIconName: .any).willReturn(makeTreatment()) let cmd = try ExperimentTreatmentsUpdate.parse(["--treatment-id", "trt-1", "--name", "Red icon"]) @@ -75,7 +75,7 @@ struct ExperimentTreatmentsUpdateTests { } @Test func `update requires at least one field`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() let cmd = try ExperimentTreatmentsUpdate.parse(["--treatment-id", "trt-1"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -87,7 +87,7 @@ struct ExperimentTreatmentsUpdateTests { struct ExperimentTreatmentsDeleteTests { @Test func `delete calls the repository with the treatment id`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).deleteTreatment(treatmentId: .any).willReturn(()) let cmd = try ExperimentTreatmentsDelete.parse(["--treatment-id", "trt-1"]) diff --git a/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift b/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift index 0548dcd1..36b7af0c 100644 --- a/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift +++ b/Tests/ASCCommandTests/Commands/Experiments/ExperimentsTests.swift @@ -19,7 +19,7 @@ private func makeExperiment( struct ExperimentsListTests { @Test func `listed editable experiment shows fields and treatment, update, delete affordances`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any) .willReturn(PaginatedResponse(data: [makeExperiment()], nextCursor: nil)) @@ -53,7 +53,7 @@ struct ExperimentsListTests { } @Test func `listed running experiment shows stop affordance and startDate`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any) .willReturn(PaginatedResponse(data: [makeExperiment(state: .approved, startDate: "2026-09-01T00:00:00Z")], nextCursor: nil)) @@ -86,7 +86,7 @@ struct ExperimentsListTests { } @Test func `state flag is forwarded to the repository as a typed filter`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any) .willReturn(PaginatedResponse(data: [], nextCursor: nil)) @@ -98,7 +98,7 @@ struct ExperimentsListTests { } @Test func `unknown state flag is rejected`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() let cmd = try ExperimentsList.parse(["--app-id", "app-1", "--state", "BOGUS"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -106,7 +106,7 @@ struct ExperimentsListTests { } @Test func `table output lists name, platform, traffic and state`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any) .willReturn(PaginatedResponse(data: [makeExperiment()], nextCursor: nil)) @@ -123,7 +123,7 @@ struct ExperimentsListTests { struct ExperimentsGetTests { @Test func `get shows a single approved experiment with start affordance`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).getExperiment(experimentId: .any).willReturn(makeExperiment(state: .approved)) let cmd = try ExperimentsGet.parse(["--experiment-id", "exp-1", "--pretty"]) @@ -159,7 +159,7 @@ struct ExperimentsGetTests { struct ExperimentsCreateTests { @Test func `create passes name, platform and traffic proportion and shows the new test`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).createExperiment(appId: .any, name: .any, platform: .any, trafficProportion: .any) .willReturn(makeExperiment()) @@ -176,7 +176,7 @@ struct ExperimentsCreateTests { } @Test func `create rejects traffic proportion outside 1-100`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() let cmd = try ExperimentsCreate.parse(["--app-id", "app-1", "--name", "X", "--traffic-proportion", "0"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -188,7 +188,7 @@ struct ExperimentsCreateTests { } @Test func `create rejects unknown platform`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() let cmd = try ExperimentsCreate.parse(["--app-id", "app-1", "--name", "X", "--platform", "android", "--traffic-proportion", "30"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -200,7 +200,7 @@ struct ExperimentsCreateTests { struct ExperimentsUpdateTests { @Test func `update forwards only the provided fields and never touches started`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).updateExperiment(experimentId: .any, name: .any, trafficProportion: .any, isStarted: .any) .willReturn(makeExperiment()) @@ -214,7 +214,7 @@ struct ExperimentsUpdateTests { } @Test func `update requires at least one field`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() let cmd = try ExperimentsUpdate.parse(["--experiment-id", "exp-1"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -226,7 +226,7 @@ struct ExperimentsUpdateTests { struct ExperimentsStartStopTests { @Test func `start sets started to true and shows the running test`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).updateExperiment(experimentId: .any, name: .any, trafficProportion: .any, isStarted: .any) .willReturn(makeExperiment(state: .approved, startDate: "2026-09-01T00:00:00Z")) @@ -240,7 +240,7 @@ struct ExperimentsStartStopTests { } @Test func `stop sets started to false`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).updateExperiment(experimentId: .any, name: .any, trafficProportion: .any, isStarted: .any) .willReturn(makeExperiment(state: .stopped, startDate: "2026-09-01T00:00:00Z")) @@ -258,7 +258,7 @@ struct ExperimentsStartStopTests { struct ExperimentsDeleteTests { @Test func `delete calls the repository with the experiment id`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).deleteExperiment(experimentId: .any).willReturn(()) let cmd = try ExperimentsDelete.parse(["--experiment-id", "exp-1"]) diff --git a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift index 586c4365..b8f61eec 100644 --- a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterCommandTests.swift @@ -7,7 +7,7 @@ import Testing struct GameCenterDetailGetTests { @Test func `detail get table output includes id appId and arcade enabled status`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).getDetail(appId: .any) .willReturn(GameCenterDetail(id: "gc-1", appId: "app-1", isArcadeEnabled: false)) @@ -20,7 +20,7 @@ struct GameCenterDetailGetTests { } @Test func `detail get returns id, appId, isArcadeEnabled and affordances`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).getDetail(appId: .any) .willReturn(GameCenterDetail(id: "gc-1", appId: "app-1", isArcadeEnabled: true)) @@ -51,7 +51,7 @@ struct GameCenterDetailGetTests { struct GameCenterAchievementsListTests { @Test func `achievements list returns id, detailId, and affordances`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).listAchievements(gameCenterDetailId: .any) .willReturn([ GameCenterAchievement( @@ -92,7 +92,7 @@ struct GameCenterAchievementsListTests { } @Test func `table output includes achievement fields`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).listAchievements(gameCenterDetailId: .any) .willReturn([ GameCenterAchievement( @@ -120,7 +120,7 @@ struct GameCenterAchievementsListTests { struct GameCenterAchievementsCreateTests { @Test func `achievement create returns created achievement with affordances`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).createAchievement( gameCenterDetailId: .any, referenceName: .any, @@ -176,7 +176,7 @@ struct GameCenterAchievementsCreateTests { struct GameCenterAchievementsDeleteTests { @Test func `achievement delete calls repo`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).deleteAchievement(id: .any).willReturn(()) let cmd = try GameCenterAchievementsDelete.parse(["--achievement-id", "ach-1"]) @@ -190,7 +190,7 @@ struct GameCenterAchievementsDeleteTests { struct GameCenterLeaderboardsListTests { @Test func `table output includes leaderboard fields`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).listLeaderboards(gameCenterDetailId: .any) .willReturn([ GameCenterLeaderboard( @@ -214,7 +214,7 @@ struct GameCenterLeaderboardsListTests { } @Test func `leaderboards list returns id, detailId, and affordances`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).listLeaderboards(gameCenterDetailId: .any) .willReturn([ GameCenterLeaderboard( @@ -258,7 +258,7 @@ struct GameCenterLeaderboardsListTests { struct GameCenterLeaderboardsCreateTests { @Test func `leaderboard create returns created leaderboard with affordances`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).createLeaderboard( gameCenterDetailId: .any, referenceName: .any, @@ -312,7 +312,7 @@ struct GameCenterLeaderboardsCreateTests { struct GameCenterLeaderboardsCreateValidationTests { @Test func `invalid score sort type throws validation error`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() let cmd = try GameCenterLeaderboardsCreate.parse([ "--detail-id", "gc-1", @@ -329,7 +329,7 @@ struct GameCenterLeaderboardsCreateValidationTests { } @Test func `invalid submission type throws validation error`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() let cmd = try GameCenterLeaderboardsCreate.parse([ "--detail-id", "gc-1", @@ -351,7 +351,7 @@ struct GameCenterLeaderboardsCreateValidationTests { struct GameCenterLeaderboardsDeleteTests { @Test func `leaderboard delete calls repo`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).deleteLeaderboard(id: .any).willReturn(()) let cmd = try GameCenterLeaderboardsDelete.parse(["--leaderboard-id", "lb-1"]) diff --git a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift index fccfd69b..43547749 100644 --- a/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/GameCenter/GameCenterModerationCommandTests.swift @@ -31,7 +31,7 @@ private func makeScore( struct GameCenterScoreModerationsListTests { @Test func `should list the leaderboard's scores with their player and next moderation steps`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).listScoreModerations(leaderboardId: .any, blockedOnly: .any).willReturn([makeScore()]) let cmd = try GameCenterScoreModerationsList.parse(["--leaderboard-id", "lb-1", "--pretty"]) @@ -66,7 +66,7 @@ struct GameCenterScoreModerationsListTests { } @Test func `should show only blocked scores when asked for blocked only`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).listScoreModerations(leaderboardId: .value("lb-1"), blockedOnly: .value(true)) .willReturn([makeScore(id: "mod-2", isBlocked: true)]) given(mockRepo).listScoreModerations(leaderboardId: .value("lb-1"), blockedOnly: .value(false)) @@ -87,7 +87,7 @@ struct GameCenterScoreModerationsListTests { struct GameCenterScoreModerationsBlockTests { @Test func `should show the score as blocked and offer unblock`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).updateScoreModeration(id: .value("mod-1"), isBlocked: .value(true)) .willReturn(makeScore(leaderboardId: nil, isBlocked: true, playerNickname: nil, isPlayerBlocked: nil)) @@ -122,7 +122,7 @@ struct GameCenterScoreModerationsBlockTests { struct GameCenterScoreModerationsUnblockTests { @Test func `should show the score as visible again and offer block`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).updateScoreModeration(id: .value("mod-1"), isBlocked: .value(false)) .willReturn(makeScore(leaderboardId: nil, isBlocked: false, playerNickname: nil, isPlayerBlocked: nil)) @@ -157,7 +157,7 @@ struct GameCenterScoreModerationsUnblockTests { struct GameCenterBlockedPlayersListTests { @Test func `should list the game's blocked players and offer to unblock each`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).listBlockedPlayers(gameCenterDetailId: .any).willReturn([ GameCenterPlayer(id: "player-1", gameCenterDetailId: "gc-1", nickname: "Player One", bundleId: "com.example.game", isBlocked: true), @@ -190,7 +190,7 @@ struct GameCenterBlockedPlayersListTests { struct GameCenterPlayersBlockTests { @Test func `should show the player as blocked and offer unblock`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).updatePlayer(id: .value("player-1"), isBlocked: .value(true)).willReturn( GameCenterPlayer(id: "player-1", gameCenterDetailId: nil, nickname: "Player One", bundleId: nil, isBlocked: true) @@ -220,7 +220,7 @@ struct GameCenterPlayersBlockTests { struct GameCenterPlayersUnblockTests { @Test func `should show the player as unblocked and offer block`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).updatePlayer(id: .value("player-1"), isBlocked: .value(false)).willReturn( GameCenterPlayer(id: "player-1", gameCenterDetailId: nil, nickname: "Player One", bundleId: nil, isBlocked: false) diff --git a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift index f86d52f4..3b2ba4bd 100644 --- a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPAvailabilityCreateTests { @Test func `create availability shows created record with territories and currency`() async throws { - let mockRepo = MockInAppPurchaseAvailabilities() + let mockRepo = MockInAppPurchaseAvailabilityRepository() given(mockRepo).createAvailability(iapId: .any, isAvailableInNewTerritories: .any, territoryIds: .any) .willReturn(InAppPurchaseAvailability( id: "avail-new", diff --git a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift index 6b28af67..2efff7e9 100644 --- a/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/Availability/IAPAvailabilityGetTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPAvailabilityGetTests { @Test func `get availability shows iapId, territories with currency and affordances`() async throws { - let mockRepo = MockInAppPurchaseAvailabilities() + let mockRepo = MockInAppPurchaseAvailabilityRepository() given(mockRepo).getAvailability(iapId: .any) .willReturn(InAppPurchaseAvailability( id: "avail-1", diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift index 3c9c0c13..269b0f41 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPCreateTests { @Test func `creates iap and returns it with affordances`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() given(mockRepo).createInAppPurchase(appId: .any, referenceName: .any, productId: .any, type: .any) .willReturn(InAppPurchase( id: "iap-new", @@ -61,7 +61,7 @@ struct IAPCreateTests { } @Test func `throws for invalid iap type`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() let cmd = try IAPCreate.parse([ "--app-id", "app-1", "--reference-name", "Upgrade", diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift index 7db75a6c..8c8ba91e 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPDeleteTests { @Test func `delete iap calls repo with iap id`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() given(mockRepo).deleteInAppPurchase(iapId: .any).willReturn(()) let cmd = try IAPDelete.parse(["--iap-id", "iap-1"]) diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift index 5fa63d3e..f25c2e9c 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPListTests { @Test func `listed iaps include appId, productId, type, state and affordances`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() given(mockRepo).listInAppPurchases(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ InAppPurchase( @@ -57,7 +57,7 @@ struct IAPListTests { } @Test func `listed iap with reviewNote surfaces it in JSON output`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() given(mockRepo).listInAppPurchases(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ InAppPurchase( @@ -78,7 +78,7 @@ struct IAPListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() given(mockRepo).listInAppPurchases(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ InAppPurchase( diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift index ed331589..4845da4a 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPPricePointsListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPPricePointsListTests { @Test func `listed price points include iapId, territory, price and affordances`() async throws { - let mockRepo = MockInAppPurchasePrices() + let mockRepo = MockInAppPurchasePriceRepository() given(mockRepo).listPricePoints(iapId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [InAppPurchasePricePoint( id: "pp-1", iapId: "iap-1", territory: "USA", @@ -37,7 +37,7 @@ struct IAPPricePointsListTests { } @Test func `price point without territory omits setPrice affordance and nil fields`() async throws { - let mockRepo = MockInAppPurchasePrices() + let mockRepo = MockInAppPurchasePriceRepository() given(mockRepo).listPricePoints(iapId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [InAppPurchasePricePoint( id: "pp-2", iapId: "iap-1", diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift index 9c62ae16..7e157f99 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPPricesSetTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPPricesSetTests { @Test func `set price returns schedule id, iapId and affordances`() async throws { - let mockRepo = MockInAppPurchasePrices() + let mockRepo = MockInAppPurchasePriceRepository() given(mockRepo).setPriceSchedule(iapId: .any, baseTerritory: .any, pricePointId: .any) .willReturn(InAppPurchasePriceSchedule(id: "sched-1", iapId: "iap-1")) diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift index 2c450a99..331bcfee 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPUpdateTests { @Test func `updates iap reference name and review note and returns updated record`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() given(mockRepo).updateInAppPurchase( iapId: .any, referenceName: .any, reviewNote: .any, isFamilySharable: .any ).willReturn(InAppPurchase( @@ -35,7 +35,7 @@ struct IAPUpdateTests { } @Test func `family-sharable flag passes true to repo`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() given(mockRepo).updateInAppPurchase( iapId: .any, referenceName: .any, reviewNote: .any, isFamilySharable: .any ).willReturn(InAppPurchase( @@ -53,7 +53,7 @@ struct IAPUpdateTests { } @Test func `not-family-sharable flag passes false to repo`() async throws { - let mockRepo = MockInAppPurchases() + let mockRepo = MockInAppPurchaseRepository() given(mockRepo).updateInAppPurchase( iapId: .any, referenceName: .any, reviewNote: .any, isFamilySharable: .any ).willReturn(InAppPurchase( diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift index bfcca5e5..404eed9c 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPVersionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPVersionsListTests { @Test func `listed IAP versions show state and the command to add them to a submission`() async throws { - let mockRepo = MockProductVersions() + let mockRepo = MockProductVersionRepository() given(mockRepo).listInAppPurchaseVersions(iapId: .value("iap-1")).willReturn([ ProductVersion(id: "iv-1", productId: "iap-1", kind: .inAppPurchase, version: 1, state: .prepareForSubmission), ]) diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift index 780185da..78cf2184 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPLocalizationsCreateTests { @Test func `creates iap localization with name and description and returns it with affordances`() async throws { - let mockRepo = MockInAppPurchaseLocalizations() + let mockRepo = MockInAppPurchaseLocalizationRepository() given(mockRepo).createLocalization(iapId: .any, locale: .any, name: .any, description: .any) .willReturn(InAppPurchaseLocalization( id: "loc-new", @@ -47,7 +47,7 @@ struct IAPLocalizationsCreateTests { } @Test func `creates iap localization without description omits description from json`() async throws { - let mockRepo = MockInAppPurchaseLocalizations() + let mockRepo = MockInAppPurchaseLocalizationRepository() given(mockRepo).createLocalization(iapId: .any, locale: .any, name: .any, description: .any) .willReturn(InAppPurchaseLocalization( id: "loc-new", diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift index 1aec3b4a..2ddac85d 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPLocalizationsDeleteTests { @Test func `delete localization calls repo with localization id`() async throws { - let mockRepo = MockInAppPurchaseLocalizations() + let mockRepo = MockInAppPurchaseLocalizationRepository() given(mockRepo).deleteLocalization(localizationId: .any).willReturn(()) let cmd = try IAPLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift index 15bd8d96..11996b31 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPLocalizationsListTests { @Test func `listed iap localizations include iapId, locale, name and affordances`() async throws { - let mockRepo = MockInAppPurchaseLocalizations() + let mockRepo = MockInAppPurchaseLocalizationRepository() given(mockRepo).listLocalizations(iapId: .any) .willReturn([ InAppPurchaseLocalization( @@ -42,7 +42,7 @@ struct IAPLocalizationsListTests { } @Test func `description is included when present`() async throws { - let mockRepo = MockInAppPurchaseLocalizations() + let mockRepo = MockInAppPurchaseLocalizationRepository() given(mockRepo).listLocalizations(iapId: .any) .willReturn([ InAppPurchaseLocalization( diff --git a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift index 8d1dea08..b274b043 100644 --- a/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPLocalizations/IAPLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPLocalizationsUpdateTests { @Test func `updates iap localization name and description and returns updated record with affordances`() async throws { - let mockRepo = MockInAppPurchaseLocalizations() + let mockRepo = MockInAppPurchaseLocalizationRepository() given(mockRepo).updateLocalization(localizationId: .any, name: .any, description: .any) .willReturn(InAppPurchaseLocalization( id: "loc-1", @@ -51,7 +51,7 @@ struct IAPLocalizationsUpdateTests { } @Test func `updates with only name passes nil description to repo`() async throws { - let mockRepo = MockInAppPurchaseLocalizations() + let mockRepo = MockInAppPurchaseLocalizationRepository() given(mockRepo).updateLocalization(localizationId: .any, name: .any, description: .any) .willReturn(InAppPurchaseLocalization(id: "loc-1", iapId: "", locale: "en-US", name: "Just Name")) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift index c5156507..5c640a2c 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeCustomCodesCreateTests { @Test func `creates IAP custom code and returns result with affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).createCustomCode( offerCodeId: .any, customCode: .any, numberOfCodes: .any, expirationDate: .any diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift index f2cd9323..42c3cf96 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeCustomCodesListTests { @Test func `listed custom codes include customCode numberOfCodes and affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listCustomCodes(offerCodeId: .any) .willReturn([ InAppPurchaseOfferCodeCustomCode( @@ -31,7 +31,7 @@ struct IAPOfferCodeCustomCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listCustomCodes(offerCodeId: .any) .willReturn([ InAppPurchaseOfferCodeCustomCode( diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift index 48502432..366bcfb1 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeCustomCodes/IAPOfferCodeCustomCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeCustomCodesUpdateTests { @Test func `deactivates IAP custom code and returns updated result`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).updateCustomCode(customCodeId: .any, isActive: .any) .willReturn(InAppPurchaseOfferCodeCustomCode( id: "icc-1", @@ -25,7 +25,7 @@ struct IAPOfferCodeCustomCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() let cmd = try IAPOfferCodeCustomCodesUpdate.parse(["--custom-code-id", "icc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift index 151fa676..08b63954 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeOneTimeCodesCreateTests { @Test func `creates IAP one-time codes and returns result with affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(InAppPurchaseOfferCodeOneTimeUseCode( @@ -32,7 +32,7 @@ struct IAPOfferCodeOneTimeCodesCreateTests { } @Test func `defaults environment to production when flag omitted`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(InAppPurchaseOfferCodeOneTimeUseCode( @@ -59,7 +59,7 @@ struct IAPOfferCodeOneTimeCodesCreateTests { } @Test func `forwards sandbox environment to repository`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(InAppPurchaseOfferCodeOneTimeUseCode( diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift index 2e3ad9a9..336c6377 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeOneTimeCodesListTests { @Test func `listed one-time codes include numberOfCodes active and affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any) .willReturn([ InAppPurchaseOfferCodeOneTimeUseCode( @@ -29,7 +29,7 @@ struct IAPOfferCodeOneTimeCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any) .willReturn([ InAppPurchaseOfferCodeOneTimeUseCode( diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift index 1e127f0c..ea3b1aef 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeOneTimeCodesUpdateTests { @Test func `deactivates IAP one-time code and returns updated result`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).updateOneTimeUseCode(oneTimeCodeId: .any, isActive: .any) .willReturn(InAppPurchaseOfferCodeOneTimeUseCode( id: "iotc-1", @@ -24,7 +24,7 @@ struct IAPOfferCodeOneTimeCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() let cmd = try IAPOfferCodeOneTimeCodesUpdate.parse(["--one-time-code-id", "iotc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift index 6b674249..ab26cae1 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodeOneTimeCodes/IAPOfferCodeOneTimeCodesValuesTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodeOneTimeCodesValuesTests { @Test func `returns CSV redemption values from repo`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).fetchOneTimeUseCodeValues(oneTimeCodeId: .any).willReturn("CODE1\nCODE2\nCODE3\n") let cmd = try IAPOfferCodeOneTimeCodesValues.parse(["--one-time-code-id", "otc-1"]) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift index 2dafbd3f..0d6dd60c 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodesCreateTests { @Test func `creates IAP offer code and returns it with affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).createOfferCode( iapId: .any, name: .any, customerEligibilities: .any, prices: .any ).willReturn(InAppPurchaseOfferCode( @@ -32,7 +32,7 @@ struct IAPOfferCodesCreateTests { } @Test func `throws for invalid eligibility`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() let cmd = try IAPOfferCodesCreate.parse([ "--iap-id", "iap-1", "--name", "TEST", @@ -44,7 +44,7 @@ struct IAPOfferCodesCreateTests { } @Test func `forwards paid and free per-territory prices to repository`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).createOfferCode( iapId: .any, name: .any, customerEligibilities: .any, prices: .any ).willReturn(InAppPurchaseOfferCode( @@ -73,7 +73,7 @@ struct IAPOfferCodesCreateTests { } @Test func `defaults to empty prices array when no flags provided`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).createOfferCode( iapId: .any, name: .any, customerEligibilities: .any, prices: .any ).willReturn(InAppPurchaseOfferCode( @@ -95,7 +95,7 @@ struct IAPOfferCodesCreateTests { } @Test func `rejects malformed --price flag`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() let cmd = try IAPOfferCodesCreate.parse([ "--iap-id", "iap-1", "--name", "TEST", diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift index 2a1c114e..477af90c 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodesListTests { @Test func `listed offer codes include name eligibilities active and affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listOfferCodes(iapId: .any) .willReturn([ InAppPurchaseOfferCode( @@ -31,7 +31,7 @@ struct IAPOfferCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listOfferCodes(iapId: .any) .willReturn([ InAppPurchaseOfferCode( diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift index 9e5ba2f2..3fbc9502 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesPricesListTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodesPricesListTests { @Test func `lists prices and returns them with affordances`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listPrices(offerCodeId: .any).willReturn([ InAppPurchaseOfferCodePrice(id: "p-1", offerCodeId: "oc-1", territory: "USA", pricePointId: "pp-9") ]) diff --git a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift index 174d63fe..47662ac7 100644 --- a/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPOfferCodes/IAPOfferCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPOfferCodesUpdateTests { @Test func `deactivates IAP offer code and returns updated result`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).updateOfferCode(offerCodeId: .any, isActive: .any) .willReturn(InAppPurchaseOfferCode( id: "ioc-1", @@ -25,7 +25,7 @@ struct IAPOfferCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() let cmd = try IAPOfferCodesUpdate.parse(["--offer-code-id", "ioc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift b/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift index 80ebe4de..5f29bd32 100644 --- a/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift +++ b/Tests/ASCCommandTests/Commands/IAPReviewScreenshot/IAPReviewScreenshotTests.swift @@ -8,7 +8,7 @@ import Testing struct IAPReviewScreenshotGetTests { @Test func `returns the screenshot when present`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).getReviewScreenshot(iapId: .any).willReturn( InAppPurchaseReviewScreenshot(id: "rs-1", iapId: "iap-1", fileName: "review.png", fileSize: 1234) ) @@ -21,7 +21,7 @@ struct IAPReviewScreenshotGetTests { } @Test func `returns empty data array when no screenshot`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).getReviewScreenshot(iapId: .any).willReturn(nil) let cmd = try IAPReviewScreenshotGet.parse(["--iap-id", "iap-1", "--pretty"]) @@ -41,7 +41,7 @@ struct IAPReviewScreenshotGetTests { struct IAPReviewScreenshotDeleteTests { @Test func `delete calls repo with screenshot id`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).deleteReviewScreenshot(screenshotId: .any).willReturn(()) let cmd = try IAPReviewScreenshotDelete.parse(["--screenshot-id", "rs-1"]) @@ -55,7 +55,7 @@ struct IAPReviewScreenshotDeleteTests { struct IAPImagesListTests { @Test func `lists promotional images with affordances`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).listImages(iapId: .any).willReturn([ InAppPurchasePromotionalImage(id: "img-1", iapId: "iap-1", fileName: "promo.png", fileSize: 9999) ]) @@ -73,7 +73,7 @@ struct IAPImagesListTests { struct IAPImagesDeleteTests { @Test func `delete image calls repo with image id`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).deleteImage(imageId: .any).willReturn(()) let cmd = try IAPImagesDelete.parse(["--image-id", "img-1"]) diff --git a/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift b/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift index 5db6ce6b..849a2751 100644 --- a/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/Init/InitCommandTests.swift @@ -9,7 +9,7 @@ struct InitCommandTests { // MARK: - --app-id mode @Test func `app-id resolves app by ID and saves config`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let mockStorage = MockProjectConfigStorage() given(mockRepo).getApp(id: .any).willReturn( App(id: "app-123", name: "My App", bundleId: "com.example.app") @@ -42,7 +42,7 @@ struct InitCommandTests { // MARK: - --name mode @Test func `name finds matching app case-insensitively and saves config`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let mockStorage = MockProjectConfigStorage() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ @@ -59,7 +59,7 @@ struct InitCommandTests { } @Test func `name throws when no matching app found`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let mockStorage = MockProjectConfigStorage() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ @@ -76,7 +76,7 @@ struct InitCommandTests { // MARK: - Auto-detect mode @Test func `auto-detect matches app by bundle ID from xcodeproj`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let mockStorage = MockProjectConfigStorage() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ @@ -96,7 +96,7 @@ struct InitCommandTests { } @Test func `auto-detect throws when scanner finds no bundle IDs`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let mockStorage = MockProjectConfigStorage() var cmd = try InitCommand.parse([]) @@ -112,7 +112,7 @@ struct InitCommandTests { // MARK: - Review contact flags @Test func `init with contact flags saves review contact in config`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let mockStorage = MockProjectConfigStorage() given(mockRepo).getApp(id: .any).willReturn( App(id: "app-123", name: "My App", bundleId: "com.example.app") @@ -154,7 +154,7 @@ struct InitCommandTests { } @Test func `init without contact flags omits contact from config`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let mockStorage = MockProjectConfigStorage() given(mockRepo).getApp(id: .any).willReturn( App(id: "app-123", name: "My App", bundleId: "com.example.app") @@ -173,7 +173,7 @@ struct InitCommandTests { // MARK: - Auto-detect error cases @Test func `auto-detect throws when no ASC app matches bundle ID`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let mockStorage = MockProjectConfigStorage() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ diff --git a/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift b/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift index 903fbd3a..19fe6279 100644 --- a/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/IrisAppsCreateTests.swift @@ -12,7 +12,7 @@ struct IrisAppsCreateTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisAppBundles() + let mockRepo = MockIrisAppBundleRepository() given(mockRepo).createApp( session: .any, name: .any, diff --git a/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift b/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift index 3f5bfdb1..ec62f445 100644 --- a/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/IrisAppsListTests.swift @@ -12,7 +12,7 @@ struct IrisAppsListTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisAppBundles() + let mockRepo = MockIrisAppBundleRepository() given(mockRepo).listAppBundles(session: .any).willReturn([ AppBundle( id: "app-1", diff --git a/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift b/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift index a55713bf..145e81a2 100644 --- a/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/ResolutionCenter/IrisResolutionCenterGetTests.swift @@ -35,7 +35,7 @@ struct IrisResolutionCenterGetTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisResolutionCenter() + let mockRepo = MockIrisResolutionCenterRepository() given(mockRepo).getResolution(session: .any, submissionId: .value("sub-1")).willReturn( makeDetail(body: "Guideline 2.1 - Performance") ) @@ -84,7 +84,7 @@ struct IrisResolutionCenterGetTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisResolutionCenter() + let mockRepo = MockIrisResolutionCenterRepository() given(mockRepo).getResolution(session: .any, submissionId: .value("sub-1")).willReturn( ResolutionCenterDetail( id: "thread-1", @@ -117,7 +117,7 @@ struct IrisResolutionCenterGetTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisResolutionCenter() + let mockRepo = MockIrisResolutionCenterRepository() given(mockRepo).getResolution(session: .any, submissionId: .value("sub-1")).willReturn( makeDetail(body: "

Guideline 2.1 & 2.3
We were unable to review.

") ) diff --git a/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift index 58ce627a..b6daa6cf 100644 --- a/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/DiagnosticLogsListTests.swift @@ -7,7 +7,7 @@ import Mockable struct DiagnosticLogsListTests { @Test func `listed diagnostic logs show metadata and affordances`() async throws { - let mockRepo = MockDiagnostics() + let mockRepo = MockDiagnosticsRepository() given(mockRepo).listLogs(signatureId: .any).willReturn([ DiagnosticLogEntry( id: "sig-1-0-0", diff --git a/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift index dd6cf5ff..8848daba 100644 --- a/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/DiagnosticsListTests.swift @@ -7,7 +7,7 @@ import Mockable struct DiagnosticsListTests { @Test func `diagnostic type filter is parsed from CLI argument`() async throws { - let mockRepo = MockDiagnostics() + let mockRepo = MockDiagnosticsRepository() given(mockRepo).listSignatures(buildId: .any, diagnosticType: .any).willReturn([]) let cmd = try DiagnosticsList.parse(["--build-id", "build-1", "--diagnostic-type", "DISK_WRITES"]) let output = try await cmd.execute(repo: mockRepo) @@ -15,7 +15,7 @@ struct DiagnosticsListTests { } @Test func `listed diagnostic signatures show type, weight, and affordances`() async throws { - let mockRepo = MockDiagnostics() + let mockRepo = MockDiagnosticsRepository() given(mockRepo).listSignatures(buildId: .any, diagnosticType: .any).willReturn([ DiagnosticSignatureInfo( id: "sig-1", diff --git a/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift b/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift index 612a8d79..7dbae9c2 100644 --- a/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/PerfMetricsListTests.swift @@ -7,7 +7,7 @@ import Mockable struct PerfMetricsListTests { @Test func `listed app metrics show category, value, and affordances`() async throws { - let mockRepo = MockPerfMetrics() + let mockRepo = MockPerfMetricsRepository() given(mockRepo).listAppMetrics(appId: .any, metricType: .any).willReturn([ PerformanceMetric( id: "app-1-LAUNCH-launchTime", @@ -48,7 +48,7 @@ struct PerfMetricsListTests { } @Test func `metric type filter is parsed from CLI argument`() async throws { - let mockRepo = MockPerfMetrics() + let mockRepo = MockPerfMetricsRepository() given(mockRepo).listAppMetrics(appId: .any, metricType: .any).willReturn([]) let cmd = try PerfMetricsList.parse(["--app-id", "app-1", "--metric-type", "DISK"]) let output = try await cmd.execute(repo: mockRepo) @@ -56,7 +56,7 @@ struct PerfMetricsListTests { } @Test func `listed build metrics use build parent type`() async throws { - let mockRepo = MockPerfMetrics() + let mockRepo = MockPerfMetricsRepository() given(mockRepo).listBuildMetrics(buildId: .any, metricType: .any).willReturn([ PerformanceMetric( id: "build-1-HANG-hangRate", diff --git a/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift b/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift index 98c4dc0d..cf37d73b 100644 --- a/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Performance/PerfOverviewGetTests.swift @@ -7,7 +7,7 @@ import Testing struct PerfOverviewGetTests { @Test func `should show what regressed, each metric against its goal and the top hotspots for the device type asked for`() async throws { - let mockRepo = MockPerfOverviews() + let mockRepo = MockPerfOverviewRepository() given(mockRepo).getOverview(appId: .value("1234567890"), deviceType: .value("iPhone")).willReturn( PerformanceOverview( appId: "1234567890", @@ -94,7 +94,7 @@ struct PerfOverviewGetTests { } @Test func `should show nothing regressed when App Store Connect has no performance data for the app`() async throws { - let mockRepo = MockPerfOverviews() + let mockRepo = MockPerfOverviewRepository() given(mockRepo).getOverview(appId: .value("1234567890"), deviceType: .value(nil)).willReturn( PerformanceOverview(appId: "1234567890", platform: "iOS", bundleId: "com.example.app") ) diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift index c20ee7dd..da4df370 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct ProfilesCreateTests { @Test func `execute creates profile and returns it`() async throws { - let mockRepo = MockProfiles() + let mockRepo = MockProfileRepository() given(mockRepo).createProfile(name: .any, profileType: .any, bundleIdId: .any, certificateIds: .any, deviceIds: .any) .willReturn(Profile(id: "prof-new", name: "My Profile", profileType: .iosAppStore, profileState: .active, bundleIdId: "bid-1")) @@ -40,7 +40,7 @@ struct ProfilesCreateTests { } @Test func `execute throws for invalid profile type`() async throws { - let mockRepo = MockProfiles() + let mockRepo = MockProfileRepository() let cmd = try ProfilesCreate.parse([ "--name", "My Profile", "--type", "INVALID_TYPE", @@ -53,7 +53,7 @@ struct ProfilesCreateTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockProfiles() + let mockRepo = MockProfileRepository() given(mockRepo).createProfile(name: .any, profileType: .any, bundleIdId: .any, certificateIds: .any, deviceIds: .any) .willReturn(Profile(id: "prof-1", name: "Mac Store", profileType: .macAppStore, profileState: .active, bundleIdId: "bid-2")) diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift index fc59f550..fe868107 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct ProfilesDeleteTests { @Test func `execute deletes profile`() async throws { - let mockRepo = MockProfiles() + let mockRepo = MockProfileRepository() given(mockRepo).deleteProfile(id: .any).willReturn() let cmd = try ProfilesDelete.parse(["--profile-id", "prof-42"]) diff --git a/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift b/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift index a31d903e..5869d84b 100644 --- a/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Profiles/ProfilesListTests.swift @@ -7,7 +7,7 @@ import Testing struct ProfilesListTests { @Test func `listed profiles include bundleIdId type state and affordances`() async throws { - let mockRepo = MockProfiles() + let mockRepo = MockProfileRepository() given(mockRepo).listProfiles(bundleIdId: .any, profileType: .any).willReturn([ Profile( id: "prof-1", @@ -41,7 +41,7 @@ struct ProfilesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockProfiles() + let mockRepo = MockProfileRepository() given(mockRepo).listProfiles(bundleIdId: .any, profileType: .any).willReturn([ Profile(id: "prof-1", name: "My Profile", profileType: .iosAppStore, profileState: .active, bundleIdId: "bid-1"), ]) @@ -55,7 +55,7 @@ struct ProfilesListTests { } @Test func `invalid profile state renders in output`() async throws { - let mockRepo = MockProfiles() + let mockRepo = MockProfileRepository() given(mockRepo).listProfiles(bundleIdId: .any, profileType: .any).willReturn([ Profile( id: "prof-2", diff --git a/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift b/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift index a32d2c8d..31875536 100644 --- a/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift +++ b/Tests/ASCCommandTests/Commands/PromotedPurchases/PromotedPurchasesTests.swift @@ -12,7 +12,7 @@ private func makePromoted(id: String = "pp-1", appId: String = "app-1") -> Promo struct PromotedPurchasesListTests { @Test func `list returns promoted purchases with affordances`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() given(mockRepo).listPromotedPurchases(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [makePromoted()], nextCursor: nil)) @@ -30,7 +30,7 @@ struct PromotedPurchasesListTests { struct PromotedPurchasesCreateTests { @Test func `requires either iap-id or subscription-id`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() let cmd = try PromotedPurchasesCreate.parse(["--app-id", "app-1"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -38,7 +38,7 @@ struct PromotedPurchasesCreateTests { } @Test func `iap-id and subscription-id are mutually exclusive`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() let cmd = try PromotedPurchasesCreate.parse([ "--app-id", "app-1", "--iap-id", "iap-1", @@ -50,7 +50,7 @@ struct PromotedPurchasesCreateTests { } @Test func `passes iap-id to repo`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() given(mockRepo).createPromotedPurchase( appId: .any, isVisibleForAllUsers: .any, isEnabled: .any, inAppPurchaseId: .any, subscriptionId: .any @@ -73,7 +73,7 @@ struct PromotedPurchasesCreateTests { } @Test func `hidden flag passes false visibility`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() given(mockRepo).createPromotedPurchase( appId: .any, isVisibleForAllUsers: .any, isEnabled: .any, inAppPurchaseId: .any, subscriptionId: .any @@ -101,7 +101,7 @@ struct PromotedPurchasesCreateTests { struct PromotedPurchasesUpdateTests { @Test func `update passes visibility and enabled flags`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() given(mockRepo).updatePromotedPurchase( promotedId: .any, isVisibleForAllUsers: .any, isEnabled: .any ).willReturn(makePromoted()) @@ -125,7 +125,7 @@ struct PromotedPurchasesUpdateTests { struct PromotedPurchasesDeleteTests { @Test func `delete calls repo with promoted-id`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() given(mockRepo).deletePromotedPurchase(promotedId: .any).willReturn(()) let cmd = try PromotedPurchasesDelete.parse(["--promoted-id", "pp-1"]) diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift index f65a566e..5a7741a3 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewResponsesCreateTests { @Test func `create response returns new response with pending state`() async throws { - let mockRepo = MockCustomerReviews() + let mockRepo = MockCustomerReviewRepository() given(mockRepo).createResponse(reviewId: .any, responseBody: .any).willReturn( CustomerReviewResponse( id: "resp-new", diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift index 3499cbcd..ec282997 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesDeleteTests.swift @@ -12,7 +12,7 @@ struct ReviewResponsesDeleteTests { } @Test func `delete response calls repository`() async throws { - let mockRepo = MockCustomerReviews() + let mockRepo = MockCustomerReviewRepository() given(mockRepo).deleteResponse(responseId: .any).willReturn(()) let cmd = try ReviewResponsesDelete.parse(["--response-id", "resp-1"]) diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift index 5564f0c9..c56b27e6 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewResponsesGetTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewResponsesGetTests { @Test func `get response shows response body state and affordances`() async throws { - let mockRepo = MockCustomerReviews() + let mockRepo = MockCustomerReviewRepository() given(mockRepo).getResponse(reviewId: .any).willReturn( CustomerReviewResponse( id: "resp-1", diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift index 22dd2598..33aa6c0d 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewsGetTests { @Test func `get review shows full review details with affordances`() async throws { - let mockRepo = MockCustomerReviews() + let mockRepo = MockCustomerReviewRepository() given(mockRepo).getReview(reviewId: .any).willReturn( CustomerReview( id: "rev-1", diff --git a/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift b/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift index a0b6b11f..9d51393e 100644 --- a/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Reviews/ReviewsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewsListTests { @Test func `listed reviews include rating territory and affordances`() async throws { - let mockRepo = MockCustomerReviews() + let mockRepo = MockCustomerReviewRepository() given(mockRepo).listReviews(appId: .any).willReturn([ CustomerReview( id: "rev-1", diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift index e6e71b47..8a47b3cd 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotSetsCreateTests { @Test func `created screenshot set is returned with affordances`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).createScreenshotSet(localizationId: .any, displayType: .any).willReturn( AppScreenshotSet(id: "set-new", localizationId: "loc-1", screenshotDisplayType: .iphone67, screenshotsCount: 0) ) @@ -35,7 +35,7 @@ struct ScreenshotSetsCreateTests { } @Test func `unknown display type throws validation error`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() let cmd = try ScreenshotSetsCreate.parse(["--localization-id", "loc-1", "--display-type", "INVALID_TYPE"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) @@ -43,7 +43,7 @@ struct ScreenshotSetsCreateTests { } @Test func `created iPad Pro 3gen11 set returns correct display type`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).createScreenshotSet(localizationId: .any, displayType: .any).willReturn( AppScreenshotSet(id: "set-1", localizationId: "loc-42", screenshotDisplayType: .ipadPro3gen11) ) diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift index b621cf3f..d4cd73da 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotSetsDeleteTests { @Test func `should delete the screenshot set it was given`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).deleteScreenshotSet(setId: .value("set-1")).willReturn() let cmd = try ScreenshotSetsDelete.parse(["--set-id", "set-1"]) @@ -18,7 +18,7 @@ struct ScreenshotSetsDeleteTests { } @Test func `should report the App Store Connect error when the set cannot be deleted`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).deleteScreenshotSet(setId: .any).willThrow(APIError.notFound("set-404")) let cmd = try ScreenshotSetsDelete.parse(["--set-id", "set-404"]) diff --git a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift index ce01398a..43011dd4 100644 --- a/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ScreenshotSets/ScreenshotSetsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotSetsListTests { @Test func `listed screenshot sets include affordances for navigation`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).listScreenshotSets(localizationId: .any).willReturn([ AppScreenshotSet(id: "set-1", localizationId: "loc-1", screenshotDisplayType: .iphone67, screenshotsCount: 3), ]) diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift index 03205bfd..740287fe 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotsDeleteTests { @Test func `should delete the screenshot it was given`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).deleteScreenshot(screenshotId: .value("shot-1")).willReturn() let cmd = try ScreenshotsDelete.parse(["--screenshot-id", "shot-1"]) @@ -18,7 +18,7 @@ struct ScreenshotsDeleteTests { } @Test func `should report the App Store Connect error when the screenshot cannot be deleted`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).deleteScreenshot(screenshotId: .any).willThrow(APIError.notFound("shot-404")) let cmd = try ScreenshotsDelete.parse(["--screenshot-id", "shot-404"]) diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift index 861a4e8c..a4b1b384 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportTests.swift @@ -35,8 +35,8 @@ struct ScreenshotsImportTests { // MARK: - Output format @Test func `import uploads screenshots and returns results`() async throws { - let mockLocRepo = MockVersionLocalizations() - let mockSsRepo = MockAppScreenshots() + let mockLocRepo = MockVersionLocalizationRepository() + let mockSsRepo = MockScreenshotRepository() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v1", locale: "en-US"), ]) @@ -76,8 +76,8 @@ struct ScreenshotsImportTests { // MARK: - Find-or-create localization @Test func `import reuses existing localization when locale matches`() async throws { - let mockLocRepo = MockVersionLocalizations() - let mockSsRepo = MockAppScreenshots() + let mockLocRepo = MockVersionLocalizationRepository() + let mockSsRepo = MockScreenshotRepository() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-existing", versionId: "v1", locale: "en-US"), ]) @@ -101,8 +101,8 @@ struct ScreenshotsImportTests { } @Test func `import creates localization when locale is not found`() async throws { - let mockLocRepo = MockVersionLocalizations() - let mockSsRepo = MockAppScreenshots() + let mockLocRepo = MockVersionLocalizationRepository() + let mockSsRepo = MockScreenshotRepository() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([]) given(mockLocRepo).createLocalization(versionId: .any, locale: .any) .willReturn(AppStoreVersionLocalization(id: "loc-new", versionId: "v1", locale: "ja")) @@ -128,8 +128,8 @@ struct ScreenshotsImportTests { // MARK: - Find-or-create screenshot set @Test func `import reuses existing screenshot set when display type matches`() async throws { - let mockLocRepo = MockVersionLocalizations() - let mockSsRepo = MockAppScreenshots() + let mockLocRepo = MockVersionLocalizationRepository() + let mockSsRepo = MockScreenshotRepository() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v1", locale: "en-US"), ]) @@ -153,8 +153,8 @@ struct ScreenshotsImportTests { } @Test func `table output includes all row fields`() async throws { - let mockLocRepo = MockVersionLocalizations() - let mockSsRepo = MockAppScreenshots() + let mockLocRepo = MockVersionLocalizationRepository() + let mockSsRepo = MockScreenshotRepository() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v1", locale: "en-US"), ]) @@ -179,8 +179,8 @@ struct ScreenshotsImportTests { } @Test func `import creates screenshot set when display type is not found`() async throws { - let mockLocRepo = MockVersionLocalizations() - let mockSsRepo = MockAppScreenshots() + let mockLocRepo = MockVersionLocalizationRepository() + let mockSsRepo = MockScreenshotRepository() given(mockLocRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v1", locale: "en-US"), ]) diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift index af995e64..7091ff23 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsImportToLibraryTests.swift @@ -11,11 +11,11 @@ struct ScreenshotsImportToLibraryTests { // MARK: - App Store Connect, stubbed to apply what it's sent private struct AppStoreConnect { - let versionRepo = MockAppStoreVersions() - let localizationRepo = MockVersionLocalizations() - let libraryRepo = MockAssetLibraries() - let imageRepo = MockLibraryImages() - let placementRepo = MockAssetPlacements() + let versionRepo = MockVersionRepository() + let localizationRepo = MockVersionLocalizationRepository() + let libraryRepo = MockAssetLibraryRepository() + let imageRepo = MockLibraryImageRepository() + let placementRepo = MockAssetPlacementRepository() init( versionState: AppStoreVersionState = .prepareForSubmission, diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift index 1733fbbb..2541a799 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotsListTests { @Test func `listed screenshots include file metadata`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).listScreenshots(setId: .any).willReturn([ AppScreenshot(id: "img-1", setId: "set-1", fileName: "hero.png", fileSize: 2_048_000, assetState: .complete, imageWidth: 1290, imageHeight: 2796), ]) @@ -37,7 +37,7 @@ struct ScreenshotsListTests { } @Test func `screenshots without dimensions omit size fields`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).listScreenshots(setId: .any).willReturn([ AppScreenshot(id: "img-1", setId: "set-1", fileName: "screen.png", fileSize: 100, assetState: nil, imageWidth: nil, imageHeight: nil), ]) @@ -64,7 +64,7 @@ struct ScreenshotsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).listScreenshots(setId: .any).willReturn([ AppScreenshot(id: "img-1", setId: "set-1", fileName: "hero.png", fileSize: 2_048_000, assetState: .complete, imageWidth: 1290, imageHeight: 2796), ]) diff --git a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift index 9985ee38..24242c7c 100644 --- a/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift +++ b/Tests/ASCCommandTests/Commands/Screenshots/ScreenshotsUploadTests.swift @@ -7,7 +7,7 @@ import Testing struct ScreenshotsUploadTests { @Test func `uploaded screenshot is returned with file metadata`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).uploadScreenshot(setId: .any, fileURL: .any).willReturn( AppScreenshot(id: "img-new", setId: "set-1", fileName: "hero.png", fileSize: 2_048_000, assetState: .complete, imageWidth: 1290, imageHeight: 2796) ) @@ -37,7 +37,7 @@ struct ScreenshotsUploadTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).uploadScreenshot(setId: .any, fileURL: .any).willReturn( AppScreenshot(id: "img-1", setId: "set-1", fileName: "screen.png", fileSize: 1_048_576, assetState: .complete, imageWidth: 390, imageHeight: 844) ) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift index d84a41a4..4e1f6ab1 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroupLocalizations/SubscriptionGroupLocalizationsTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupLocalizationsListTests { @Test func `lists localizations and returns them with affordances`() async throws { - let mockRepo = MockSubscriptionGroupLocalizations() + let mockRepo = MockSubscriptionGroupLocalizationRepository() given(mockRepo).listLocalizations(groupId: .any).willReturn([ SubscriptionGroupLocalization(id: "loc-1", groupId: "grp-1", locale: "en-US", name: "Premium") ]) @@ -39,7 +39,7 @@ struct SubscriptionGroupLocalizationsListTests { struct SubscriptionGroupLocalizationsCreateTests { @Test func `create posts groupId, locale, name and customAppName`() async throws { - let mockRepo = MockSubscriptionGroupLocalizations() + let mockRepo = MockSubscriptionGroupLocalizationRepository() given(mockRepo).createLocalization(groupId: .any, locale: .any, name: .any, customAppName: .any) .willReturn(SubscriptionGroupLocalization( id: "loc-new", groupId: "grp-1", locale: "en-US", @@ -67,7 +67,7 @@ struct SubscriptionGroupLocalizationsCreateTests { struct SubscriptionGroupLocalizationsUpdateTests { @Test func `update passes localizationId, name and customAppName`() async throws { - let mockRepo = MockSubscriptionGroupLocalizations() + let mockRepo = MockSubscriptionGroupLocalizationRepository() given(mockRepo).updateLocalization(localizationId: .any, name: .any, customAppName: .any) .willReturn(SubscriptionGroupLocalization(id: "loc-1", groupId: "", locale: "en-US", name: "Renamed")) @@ -89,7 +89,7 @@ struct SubscriptionGroupLocalizationsUpdateTests { struct SubscriptionGroupLocalizationsDeleteTests { @Test func `delete calls repo with localization id`() async throws { - let mockRepo = MockSubscriptionGroupLocalizations() + let mockRepo = MockSubscriptionGroupLocalizationRepository() given(mockRepo).deleteLocalization(localizationId: .any).willReturn(()) let cmd = try SubscriptionGroupLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift index f2c64e28..f4d7e419 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupVersionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupVersionsListTests { @Test func `listed subscription group versions show the command to add them to a submission`() async throws { - let mockRepo = MockProductVersions() + let mockRepo = MockProductVersionRepository() given(mockRepo).listSubscriptionGroupVersions(groupId: .value("grp-1")).willReturn([ ProductVersion(id: "gv-1", productId: "grp-1", kind: .subscriptionGroup, version: 1, state: .prepareForSubmission), ]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift index dda5f201..e46cc6aa 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupsCreateTests { @Test func `creates subscription group and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionGroups() + let mockRepo = MockSubscriptionGroupRepository() given(mockRepo).createSubscriptionGroup(appId: .any, referenceName: .any) .willReturn(SubscriptionGroup( id: "grp-new", diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift index b25ed191..1bc668a7 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupsDeleteTests { @Test func `delete subscription group calls repo with group id`() async throws { - let mockRepo = MockSubscriptionGroups() + let mockRepo = MockSubscriptionGroupRepository() given(mockRepo).deleteSubscriptionGroup(groupId: .any).willReturn(()) let cmd = try SubscriptionGroupsDelete.parse(["--group-id", "grp-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift index 88b44919..d40fbae2 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupsListTests { @Test func `listed subscription groups include appId, referenceName and affordances`() async throws { - let mockRepo = MockSubscriptionGroups() + let mockRepo = MockSubscriptionGroupRepository() given(mockRepo).listSubscriptionGroups(appId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ SubscriptionGroup(id: "grp-1", appId: "app-1", referenceName: "Premium Plans") diff --git a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift index 6cb328bb..91dc3de4 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionGroups/SubscriptionGroupsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionGroupsUpdateTests { @Test func `updates subscription group reference name and returns updated record`() async throws { - let mockRepo = MockSubscriptionGroups() + let mockRepo = MockSubscriptionGroupRepository() given(mockRepo).updateSubscriptionGroup(groupId: .any, referenceName: .any) .willReturn(SubscriptionGroup(id: "grp-1", appId: "", referenceName: "Renamed Plans")) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift index 109f7a51..8254467a 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionLocalizationsCreateTests { @Test func `creates subscription localization with name and description and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionLocalizations() + let mockRepo = MockSubscriptionLocalizationRepository() given(mockRepo).createLocalization(subscriptionId: .any, locale: .any, name: .any, description: .any) .willReturn(SubscriptionLocalization( id: "loc-new", @@ -47,7 +47,7 @@ struct SubscriptionLocalizationsCreateTests { } @Test func `creates subscription localization without description omits description from json`() async throws { - let mockRepo = MockSubscriptionLocalizations() + let mockRepo = MockSubscriptionLocalizationRepository() given(mockRepo).createLocalization(subscriptionId: .any, locale: .any, name: .any, description: .any) .willReturn(SubscriptionLocalization( id: "loc-new", diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift index 88fe9290..34bd2216 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionLocalizationsDeleteTests { @Test func `delete localization calls repo with localization id`() async throws { - let mockRepo = MockSubscriptionLocalizations() + let mockRepo = MockSubscriptionLocalizationRepository() given(mockRepo).deleteLocalization(localizationId: .any).willReturn(()) let cmd = try SubscriptionLocalizationsDelete.parse(["--localization-id", "loc-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift index 20700a69..dc583b09 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionLocalizationsListTests { @Test func `listed subscription localizations include subscriptionId, locale, name and affordances`() async throws { - let mockRepo = MockSubscriptionLocalizations() + let mockRepo = MockSubscriptionLocalizationRepository() given(mockRepo).listLocalizations(subscriptionId: .any) .willReturn([ SubscriptionLocalization( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift index 445fbacf..764694fc 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionLocalizations/SubscriptionLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionLocalizationsUpdateTests { @Test func `updates subscription localization name and description and returns updated record with affordances`() async throws { - let mockRepo = MockSubscriptionLocalizations() + let mockRepo = MockSubscriptionLocalizationRepository() given(mockRepo).updateLocalization(localizationId: .any, name: .any, description: .any) .willReturn(SubscriptionLocalization( id: "loc-1", diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift index 97197c40..cd10dc09 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeCustomCodesCreateTests { @Test func `creates custom code and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createCustomCode( offerCodeId: .any, customCode: .any, numberOfCodes: .any, expirationDate: .any diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift index 1835b8d0..f5c08f5a 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeCustomCodesListTests { @Test func `listed custom codes include customCode numberOfCodes and affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listCustomCodes(offerCodeId: .any) .willReturn([ SubscriptionOfferCodeCustomCode( @@ -31,7 +31,7 @@ struct SubscriptionOfferCodeCustomCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listCustomCodes(offerCodeId: .any) .willReturn([ SubscriptionOfferCodeCustomCode( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift index 3d4ca48c..07bd864e 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeCustomCodes/SubscriptionOfferCodeCustomCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeCustomCodesUpdateTests { @Test func `deactivates custom code and returns updated result`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).updateCustomCode(customCodeId: .any, isActive: .any) .willReturn(SubscriptionOfferCodeCustomCode( id: "cc-1", @@ -25,7 +25,7 @@ struct SubscriptionOfferCodeCustomCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() let cmd = try SubscriptionOfferCodeCustomCodesUpdate.parse(["--custom-code-id", "cc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift index d8570cb9..81be6fe6 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeOneTimeCodesCreateTests { @Test func `creates one-time codes and returns result with affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(SubscriptionOfferCodeOneTimeUseCode( @@ -32,7 +32,7 @@ struct SubscriptionOfferCodeOneTimeCodesCreateTests { } @Test func `defaults environment to production when flag omitted`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(SubscriptionOfferCodeOneTimeUseCode( @@ -59,7 +59,7 @@ struct SubscriptionOfferCodeOneTimeCodesCreateTests { } @Test func `forwards sandbox environment to repository`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn(SubscriptionOfferCodeOneTimeUseCode( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift index b65687f8..d1fdcf3b 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeOneTimeCodesListTests { @Test func `listed one-time codes include numberOfCodes active and affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any) .willReturn([ SubscriptionOfferCodeOneTimeUseCode( @@ -29,7 +29,7 @@ struct SubscriptionOfferCodeOneTimeCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any) .willReturn([ SubscriptionOfferCodeOneTimeUseCode( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift index 8388366b..16c636f4 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeOneTimeCodesUpdateTests { @Test func `deactivates one-time code and returns updated result`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).updateOneTimeUseCode(oneTimeCodeId: .any, isActive: .any) .willReturn(SubscriptionOfferCodeOneTimeUseCode( id: "otc-1", @@ -24,7 +24,7 @@ struct SubscriptionOfferCodeOneTimeCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() let cmd = try SubscriptionOfferCodeOneTimeCodesUpdate.parse(["--one-time-code-id", "otc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift index 57d91d57..7875201b 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodeOneTimeCodes/SubscriptionOfferCodeOneTimeCodesValuesTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodeOneTimeCodesValuesTests { @Test func `returns CSV redemption values from repo`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).fetchOneTimeUseCodeValues(oneTimeCodeId: .any).willReturn("CODE1\nCODE2\n") let cmd = try SubscriptionOfferCodeOneTimeCodesValues.parse(["--one-time-code-id", "otc-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift index 3fc74547..910f1691 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodesCreateTests { @Test func `creates offer code and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createOfferCode( subscriptionId: .any, name: .any, customerEligibilities: .any, offerEligibility: .any, duration: .any, offerMode: .any, @@ -44,7 +44,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `forwards paid prices and isAutoRenewEnabled true by default`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createOfferCode( subscriptionId: .any, name: .any, customerEligibilities: .any, offerEligibility: .any, duration: .any, offerMode: .any, @@ -81,7 +81,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `forwards isAutoRenewEnabled false when flag set`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createOfferCode( subscriptionId: .any, name: .any, customerEligibilities: .any, offerEligibility: .any, duration: .any, offerMode: .any, @@ -114,7 +114,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `throws for invalid duration`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() let cmd = try SubscriptionOfferCodesCreate.parse([ "--subscription-id", "sub-1", "--name", "TEST", @@ -130,7 +130,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `throws for invalid mode`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() let cmd = try SubscriptionOfferCodesCreate.parse([ "--subscription-id", "sub-1", "--name", "TEST", @@ -146,7 +146,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `throws for invalid eligibility`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() let cmd = try SubscriptionOfferCodesCreate.parse([ "--subscription-id", "sub-1", "--name", "TEST", @@ -162,7 +162,7 @@ struct SubscriptionOfferCodesCreateTests { } @Test func `throws for invalid offer eligibility`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() let cmd = try SubscriptionOfferCodesCreate.parse([ "--subscription-id", "sub-1", "--name", "TEST", diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift index 787cf0e7..ff6b2661 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodesListTests { @Test func `listed offer codes include name duration mode active and affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listOfferCodes(subscriptionId: .any) .willReturn([ SubscriptionOfferCode( @@ -55,7 +55,7 @@ struct SubscriptionOfferCodesListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listOfferCodes(subscriptionId: .any) .willReturn([ SubscriptionOfferCode( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift index 7c89b659..7a37bbb1 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesPricesListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodesPricesListTests { @Test func `lists subscription offer code prices with affordances`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listPrices(offerCodeId: .any).willReturn([ SubscriptionOfferCodePrice(id: "p-1", offerCodeId: "oc-1", territory: "USA", subscriptionPricePointId: "spp-7") ]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift index f5a08305..afb739ac 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOfferCodes/SubscriptionOfferCodesUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOfferCodesUpdateTests { @Test func `deactivates offer code and returns updated result`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).updateOfferCode(offerCodeId: .any, isActive: .any) .willReturn(SubscriptionOfferCode( id: "oc-1", @@ -29,7 +29,7 @@ struct SubscriptionOfferCodesUpdateTests { } @Test func `throws for invalid active value`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() let cmd = try SubscriptionOfferCodesUpdate.parse(["--offer-code-id", "oc-1", "--active", "maybe"]) await #expect(throws: (any Error).self) { try await cmd.execute(repo: mockRepo) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift index 964fbd7c..93779d7c 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOffersCreateTests { @Test func `creates free trial offer and returns it with affordances`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() given(mockRepo).createIntroductoryOffer( subscriptionId: .any, duration: .any, offerMode: .any, numberOfPeriods: .any, startDate: .any, endDate: .any, @@ -49,7 +49,7 @@ struct SubscriptionOffersCreateTests { } @Test func `throws for invalid duration`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() let cmd = try SubscriptionOffersCreate.parse([ "--subscription-id", "sub-1", "--duration", "DAILY", @@ -62,7 +62,7 @@ struct SubscriptionOffersCreateTests { } @Test func `throws for invalid mode`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() let cmd = try SubscriptionOffersCreate.parse([ "--subscription-id", "sub-1", "--duration", "ONE_MONTH", @@ -75,7 +75,7 @@ struct SubscriptionOffersCreateTests { } @Test func `throws when PAY_AS_YOU_GO missing price point id`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() let cmd = try SubscriptionOffersCreate.parse([ "--subscription-id", "sub-1", "--duration", "ONE_MONTH", @@ -88,7 +88,7 @@ struct SubscriptionOffersCreateTests { } @Test func `throws when PAY_UP_FRONT missing price point id`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() let cmd = try SubscriptionOffersCreate.parse([ "--subscription-id", "sub-1", "--duration", "ONE_MONTH", @@ -101,7 +101,7 @@ struct SubscriptionOffersCreateTests { } @Test func `succeeds when PAY_AS_YOU_GO with price point id`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() given(mockRepo).createIntroductoryOffer( subscriptionId: .any, duration: .any, offerMode: .any, numberOfPeriods: .any, startDate: .any, endDate: .any, diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift index 85a28632..5477e489 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOffersDeleteTests { @Test func `delete introductory offer calls repo with offer id`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() given(mockRepo).deleteIntroductoryOffer(offerId: .any).willReturn(()) let cmd = try SubscriptionOffersDelete.parse(["--offer-id", "offer-1"]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift index 21828c8d..4a4b6bbc 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionOffers/SubscriptionOffersListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionOffersListTests { @Test func `listed offers include subscriptionId duration mode and affordances`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() given(mockRepo).listIntroductoryOffers(subscriptionId: .any) .willReturn([ SubscriptionIntroductoryOffer( @@ -42,7 +42,7 @@ struct SubscriptionOffersListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() given(mockRepo).listIntroductoryOffers(subscriptionId: .any) .willReturn([ SubscriptionIntroductoryOffer( diff --git a/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift index 0139f92c..adeeb93a 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionPromotionalOffers/SubscriptionPromotionalOffersTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionPromotionalOffersListTests { @Test func `lists promotional offers with affordances`() async throws { - let mockRepo = MockSubscriptionPromotionalOffers() + let mockRepo = MockSubscriptionPromotionalOfferRepository() given(mockRepo).listPromotionalOffers(subscriptionId: .any).willReturn([ SubscriptionPromotionalOffer( id: "po-1", subscriptionId: "sub-1", name: "Winback", @@ -45,7 +45,7 @@ struct SubscriptionPromotionalOffersListTests { struct SubscriptionPromotionalOffersCreateTests { @Test func `parses --price specs into territory and pricePointId`() async throws { - let mockRepo = MockSubscriptionPromotionalOffers() + let mockRepo = MockSubscriptionPromotionalOfferRepository() given(mockRepo).createPromotionalOffer( subscriptionId: .any, name: .any, offerCode: .any, duration: .any, offerMode: .any, numberOfPeriods: .any, prices: .any @@ -83,7 +83,7 @@ struct SubscriptionPromotionalOffersCreateTests { } @Test func `throws when --price spec is malformed`() async throws { - let mockRepo = MockSubscriptionPromotionalOffers() + let mockRepo = MockSubscriptionPromotionalOfferRepository() let cmd = try SubscriptionPromotionalOffersCreate.parse([ "--subscription-id", "sub-1", "--name", "Winback", @@ -103,7 +103,7 @@ struct SubscriptionPromotionalOffersCreateTests { struct SubscriptionPromotionalOffersDeleteTests { @Test func `delete calls repo with offer id`() async throws { - let mockRepo = MockSubscriptionPromotionalOffers() + let mockRepo = MockSubscriptionPromotionalOfferRepository() given(mockRepo).deletePromotionalOffer(offerId: .any).willReturn(()) let cmd = try SubscriptionPromotionalOffersDelete.parse(["--offer-id", "po-1"]) @@ -117,7 +117,7 @@ struct SubscriptionPromotionalOffersDeleteTests { struct SubscriptionPromotionalOffersPricesListTests { @Test func `lists prices with affordances`() async throws { - let mockRepo = MockSubscriptionPromotionalOffers() + let mockRepo = MockSubscriptionPromotionalOfferRepository() given(mockRepo).listPrices(offerId: .any).willReturn([ SubscriptionPromotionalOfferPrice(id: "p-1", offerId: "po-1", territory: "USA", subscriptionPricePointId: "spp-1") ]) diff --git a/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift b/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift index bb6832a1..016472cb 100644 --- a/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift +++ b/Tests/ASCCommandTests/Commands/SubscriptionReviewScreenshot/SubscriptionReviewScreenshotTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionReviewScreenshotGetTests { @Test func `returns the screenshot when present`() async throws { - let mockRepo = MockSubscriptionReviewAssets() + let mockRepo = MockSubscriptionReviewRepository() given(mockRepo).getReviewScreenshot(subscriptionId: .any).willReturn( SubscriptionReviewScreenshot(id: "rs-1", subscriptionId: "sub-1", fileName: "review.png", fileSize: 1234) ) @@ -24,7 +24,7 @@ struct SubscriptionReviewScreenshotGetTests { struct SubscriptionReviewScreenshotDeleteTests { @Test func `delete calls repo with screenshot id`() async throws { - let mockRepo = MockSubscriptionReviewAssets() + let mockRepo = MockSubscriptionReviewRepository() given(mockRepo).deleteReviewScreenshot(screenshotId: .any).willReturn(()) let cmd = try SubscriptionReviewScreenshotDelete.parse(["--screenshot-id", "rs-1"]) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift index 14a8fa81..3a460f40 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionAvailabilityCreateTests { @Test func `create availability shows created record with territories and currency`() async throws { - let mockRepo = MockSubscriptionAvailabilities() + let mockRepo = MockSubscriptionAvailabilityRepository() given(mockRepo).createAvailability(subscriptionId: .any, isAvailableInNewTerritories: .any, territoryIds: .any) .willReturn(SubscriptionAvailability( id: "avail-new", diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift index 91c2ddc9..c27f2eaa 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/Availability/SubscriptionAvailabilityGetTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionAvailabilityGetTests { @Test func `get availability shows subscriptionId, territories with currency and affordances`() async throws { - let mockRepo = MockSubscriptionAvailabilities() + let mockRepo = MockSubscriptionAvailabilityRepository() given(mockRepo).getAvailability(subscriptionId: .any) .willReturn(SubscriptionAvailability( id: "avail-1", diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift index fbd50d8c..8a2370fe 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricePointsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionPricePointsListTests { @Test func `listed price points include subscriptionId, territory, prices and affordances`() async throws { - let mockRepo = MockSubscriptionPrices() + let mockRepo = MockSubscriptionPriceRepository() given(mockRepo).listPricePoints(subscriptionId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [ SubscriptionPricePoint( @@ -54,7 +54,7 @@ struct SubscriptionPricePointsListTests { } @Test func `passes nil territory when flag omitted`() async throws { - let mockRepo = MockSubscriptionPrices() + let mockRepo = MockSubscriptionPriceRepository() given(mockRepo).listPricePoints(subscriptionId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [], nextCursor: nil)) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift index 63034481..e368b8e3 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionPricesSetTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionPricesSetTests { @Test func `set price posts subscriptionId, territory and pricePointId`() async throws { - let mockRepo = MockSubscriptionPrices() + let mockRepo = MockSubscriptionPriceRepository() given(mockRepo).setPrice( subscriptionId: .any, territory: .any, pricePointId: .any, startDate: .any, preserveCurrentPrice: .any @@ -30,7 +30,7 @@ struct SubscriptionPricesSetTests { } @Test func `start-date and preserve-current-price flag pass through`() async throws { - let mockRepo = MockSubscriptionPrices() + let mockRepo = MockSubscriptionPriceRepository() given(mockRepo).setPrice( subscriptionId: .any, territory: .any, pricePointId: .any, startDate: .any, preserveCurrentPrice: .any diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift index 4540abd0..d0e8102d 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionVersionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionVersionsListTests { @Test func `listed subscription versions in review do not offer adding them to a submission`() async throws { - let mockRepo = MockProductVersions() + let mockRepo = MockProductVersionRepository() given(mockRepo).listSubscriptionVersions(subscriptionId: .value("sub-1")).willReturn([ ProductVersion(id: "sv-1", productId: "sub-1", kind: .subscription, version: 2, state: .waitingForReview), ]) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift index 7fd136b2..d0fb0578 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsCreateTests { @Test func `creates subscription and returns it with affordances`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).createSubscription(groupId: .any, name: .any, productId: .any, period: .any, isFamilySharable: .any, groupLevel: .any) .willReturn(Subscription( id: "sub-new", @@ -68,7 +68,7 @@ struct SubscriptionsCreateTests { } @Test func `throws for invalid subscription period`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() let cmd = try SubscriptionsCreate.parse([ "--group-id", "grp-1", "--name", "Monthly", diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift index a2bab913..1616c709 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsDeleteTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsDeleteTests { @Test func `delete subscription calls repo with subscription id`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).deleteSubscription(subscriptionId: .any).willReturn(()) let cmd = try SubscriptionsDelete.parse(["--subscription-id", "sub-1"]) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift index a505812f..3127ea7d 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsListTests { @Test func `listed subscriptions include groupId, period, state and affordances`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).listSubscriptions(groupId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ Subscription( @@ -64,7 +64,7 @@ struct SubscriptionsListTests { } @Test func `listed subscription with reviewNote surfaces it in JSON output`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).listSubscriptions(groupId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ Subscription( @@ -86,7 +86,7 @@ struct SubscriptionsListTests { } @Test func `table output includes all row fields`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).listSubscriptions(groupId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ Subscription( @@ -108,7 +108,7 @@ struct SubscriptionsListTests { } @Test func `should show multi-seat status and markets when App Store Connect sends them`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).listSubscriptions(groupId: .any, limit: .any) .willReturn(PaginatedResponse(data: [ Subscription( diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift index 2279fda3..c3de583d 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsUpdateTests { @Test func `updates subscription name and review note and returns updated record`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any @@ -37,7 +37,7 @@ struct SubscriptionsUpdateTests { } @Test func `family-sharable flag passes true to repo`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any @@ -58,7 +58,7 @@ struct SubscriptionsUpdateTests { } @Test func `group-level passes through to repo`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any @@ -79,7 +79,7 @@ struct SubscriptionsUpdateTests { } @Test func `period passes through to repo`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any @@ -100,7 +100,7 @@ struct SubscriptionsUpdateTests { } @Test func `should show the multi-seat status and markets App Store Connect saved when updating`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any diff --git a/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift b/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift index dc6a0e28..34a15bc4 100644 --- a/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift +++ b/Tests/ASCCommandTests/Commands/Territories/TerritoriesListTests.swift @@ -7,7 +7,7 @@ import Testing struct TerritoriesListTests { @Test func `listed territories show id, currency and affordances`() async throws { - let mockRepo = MockTerritories() + let mockRepo = MockTerritoryRepository() given(mockRepo).listTerritories() .willReturn([ Territory(id: "USA", currency: "USD"), diff --git a/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift b/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift index 19b32834..466030f9 100644 --- a/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/TestFlight/TestFlightCommandTests.swift @@ -7,7 +7,7 @@ import Testing struct BetaGroupsListTests { @Test func `groups list includes affordances and appId in json output`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).listBetaGroups(appId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaGroup(id: "g-1", appId: "app-1", name: "External Testers", isInternalGroup: false), @@ -55,7 +55,7 @@ struct BetaGroupsListTests { struct BetaGroupsCreateTests { @Test func `groups create external returns group with affordances`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo) .createBetaGroup(appId: .any, name: .any, isInternalGroup: .any, publicLinkEnabled: .any, feedbackEnabled: .any) .willReturn(BetaGroup(id: "g-new", appId: "app-1", name: "External Beta", isInternalGroup: false, publicLinkEnabled: true)) @@ -89,7 +89,7 @@ struct BetaGroupsCreateTests { } @Test func `groups create internal flag marks group as internal`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo) .createBetaGroup(appId: .any, name: .any, isInternalGroup: .any, publicLinkEnabled: .any, feedbackEnabled: .any) .willReturn(BetaGroup(id: "g-int", appId: "app-1", name: "Company Team", isInternalGroup: true)) @@ -127,7 +127,7 @@ struct BetaGroupsCreateTests { struct BetaTestersListTests { @Test func `testers list includes affordances and groupId in json output`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).listBetaTesters(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaTester(id: "t-1", groupId: "g-1", firstName: "Jane", lastName: "Doe", email: "jane@example.com", inviteType: .email), @@ -158,7 +158,7 @@ struct BetaTestersListTests { } @Test func `testers list omits nil optional fields from json output`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).listBetaTesters(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaTester(id: "t-1", groupId: "g-1", firstName: "Unknown", lastName: nil, email: nil, inviteType: nil), @@ -190,7 +190,7 @@ struct BetaTestersListTests { struct BetaTestersAddTests { @Test func `testers add returns created tester with affordances`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).addBetaTester(groupId: .any, email: .any, firstName: .any, lastName: .any).willReturn( BetaTester(id: "t-new", groupId: "g-1", firstName: "New", lastName: nil, email: "new@example.com", inviteType: .email) ) @@ -222,7 +222,7 @@ struct BetaTestersAddTests { struct BetaTestersRemoveTests { @Test func `testers remove returns confirmation message`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).removeBetaTester(groupId: .any, testerId: .any).willReturn() let cmd = try BetaTestersRemove.parse(["--beta-group-id", "g-1", "--tester-id", "t-1"]) @@ -236,7 +236,7 @@ struct BetaTestersRemoveTests { struct BetaTestersImportTests { @Test func `testers import parses csv and adds each tester`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).addBetaTester(groupId: .any, email: .any, firstName: .any, lastName: .any) .willReturn(BetaTester(id: "t-1", groupId: "g-1", firstName: "Jane", lastName: "Doe", email: "jane@example.com")) given(mockRepo).addBetaTester(groupId: .any, email: .any, firstName: .any, lastName: .any) @@ -281,7 +281,7 @@ struct BetaTestersImportTests { } @Test func `testers import skips header row and empty lines`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).addBetaTester(groupId: .any, email: .any, firstName: .any, lastName: .any) .willReturn(BetaTester(id: "t-1", groupId: "g-1", email: "single@example.com")) @@ -316,7 +316,7 @@ struct BetaTestersImportTests { struct BetaTestersExportTests { @Test func `testers export formats testers as csv`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).listBetaTesters(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaTester(id: "t-1", groupId: "g-1", firstName: "Jane", lastName: "Doe", email: "jane@example.com"), @@ -335,7 +335,7 @@ struct BetaTestersExportTests { } @Test func `testers export handles nil name fields as empty strings in csv`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).listBetaTesters(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ BetaTester(id: "t-1", groupId: "g-1", firstName: nil, lastName: nil, email: "anon@example.com"), diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift index 1ef2ce8a..11bc2d2c 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsCancelTests.swift @@ -7,7 +7,7 @@ import Testing struct UserInvitationsCancelTests { @Test func `cancel calls repository with invitation id`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).cancelUserInvitation(id: .value("inv-1")).willReturn() let cmd = try UserInvitationsCancel.parse(["--invitation-id", "inv-1"]) diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift index 0da0cbe8..bf1ae4ce 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsInviteTests.swift @@ -7,7 +7,7 @@ import Testing struct UserInvitationsInviteTests { @Test func `invite returns invitation record with affordances`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).inviteUser( email: .any, firstName: .any, @@ -41,7 +41,7 @@ struct UserInvitationsInviteTests { } @Test func `invite rejects invalid role`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() let cmd = try UserInvitationsInvite.parse([ "--email", "x@example.com", @@ -55,7 +55,7 @@ struct UserInvitationsInviteTests { } @Test func `invite with all-apps-visible passes flag to repository`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).inviteUser( email: .any, firstName: .any, @@ -89,7 +89,7 @@ struct UserInvitationsInviteTests { } @Test func `invite role filter applied to invitations list`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).listUserInvitations(role: .value(.developer)).willReturn([ UserInvitationRecord( id: "inv-3", diff --git a/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift b/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift index daa8c8bc..c7760b94 100644 --- a/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UserInvitationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct UserInvitationsListTests { @Test func `listed invitations include email roles and cancel affordance`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).listUserInvitations(role: .any).willReturn([ UserInvitationRecord( id: "inv-1", diff --git a/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift index 73f1e7b7..e7e0cab5 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersListTests.swift @@ -7,7 +7,7 @@ import Testing struct UsersListTests { @Test func `listed users include roles and affordances`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).listUsers(role: .any).willReturn([ TeamMember( id: "u-1", @@ -32,7 +32,7 @@ struct UsersListTests { } @Test func `table output includes username and roles`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).listUsers(role: .any).willReturn([ TeamMember( id: "u-1", @@ -54,7 +54,7 @@ struct UsersListTests { } @Test func `role filter is passed to repository`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).listUsers(role: .value(.developer)).willReturn([ TeamMember( id: "u-2", diff --git a/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift index 3cd9f630..75205cda 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersRemoveTests.swift @@ -7,7 +7,7 @@ import Testing struct UsersRemoveTests { @Test func `remove calls repository with user id`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).removeUser(id: .value("u-1")).willReturn() let cmd = try UsersRemove.parse(["--user-id", "u-1"]) diff --git a/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift b/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift index 7c553e13..8cb5b3b6 100644 --- a/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Users/UsersUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct UsersUpdateTests { @Test func `update returns team member with new roles`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).updateUser(id: .any, roles: .any).willReturn( TeamMember( id: "u-1", @@ -28,7 +28,7 @@ struct UsersUpdateTests { } @Test func `update rejects invalid role`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() let cmd = try UsersUpdate.parse(["--user-id", "u-1", "--role", "INVALID"]) await #expect(throws: (any Error).self) { @@ -37,7 +37,7 @@ struct UsersUpdateTests { } @Test func `update passes multiple roles to repository`() async throws { - let mockRepo = MockUsers() + let mockRepo = MockUserRepository() given(mockRepo).updateUser(id: .any, roles: .any).willReturn( TeamMember( id: "u-1", diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift index b1a6697c..03fa82ba 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionLocalizationsCreateTests { @Test func `created localization is returned with affordances`() async throws { - let mockRepo = MockVersionLocalizations() + let mockRepo = MockVersionLocalizationRepository() given(mockRepo).createLocalization(versionId: .any, locale: .any).willReturn( AppStoreVersionLocalization(id: "loc-new", versionId: "v-1", locale: "en-US") ) @@ -35,7 +35,7 @@ struct VersionLocalizationsCreateTests { } @Test func `created zh-Hans localization returns correct locale`() async throws { - let mockRepo = MockVersionLocalizations() + let mockRepo = MockVersionLocalizationRepository() given(mockRepo).createLocalization(versionId: .any, locale: .any).willReturn( AppStoreVersionLocalization(id: "loc-new", versionId: "v-99", locale: "zh-Hans") ) diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift index b2843570..7aa63d3b 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsListTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionLocalizationsListTests { @Test func `listed localizations include affordances for navigation`() async throws { - let mockRepo = MockVersionLocalizations() + let mockRepo = MockVersionLocalizationRepository() given(mockRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v-1", locale: "en-US"), AppStoreVersionLocalization(id: "loc-2", versionId: "v-1", locale: "zh-Hans"), diff --git a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift index 2f94f5e3..568f6ffa 100644 --- a/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionLocalizations/VersionLocalizationsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionLocalizationsUpdateTests { @Test func `updated localization is returned with whatsNew text`() async throws { - let mockRepo = MockVersionLocalizations() + let mockRepo = MockVersionLocalizationRepository() given(mockRepo).updateLocalization( localizationId: .any, whatsNew: .any, @@ -53,7 +53,7 @@ struct VersionLocalizationsUpdateTests { } @Test func `update with all optional fields returns full content`() async throws { - let mockRepo = MockVersionLocalizations() + let mockRepo = MockVersionLocalizationRepository() given(mockRepo).updateLocalization( localizationId: .any, whatsNew: .any, diff --git a/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift b/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift index c924cc61..539cfc2c 100644 --- a/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift +++ b/Tests/ASCCommandTests/Commands/VersionReviewDetail/VersionReviewDetailTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionReviewDetailGetTests { @Test func `get review detail returns affordances and all fields`() async throws { - let mockRepo = MockReviewDetails() + let mockRepo = MockReviewDetailRepository() given(mockRepo).getReviewDetail(versionId: .any).willReturn( AppStoreReviewDetail( id: "rd-1", @@ -45,7 +45,7 @@ struct VersionReviewDetailGetTests { } @Test func `get review detail omits nil optional fields from JSON`() async throws { - let mockRepo = MockReviewDetails() + let mockRepo = MockReviewDetailRepository() given(mockRepo).getReviewDetail(versionId: .any).willReturn( AppStoreReviewDetail(id: "rd-empty", versionId: "v-2", demoAccountRequired: false) ) @@ -75,7 +75,7 @@ struct VersionReviewDetailGetTests { struct VersionReviewDetailUpdateTests { @Test func `update review detail returns updated record with affordances`() async throws { - let mockRepo = MockReviewDetails() + let mockRepo = MockReviewDetailRepository() given(mockRepo).upsertReviewDetail(versionId: .any, update: .any).willReturn( AppStoreReviewDetail( id: "rd-2", diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift index c2f153d7..4a233b77 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsCheckReadinessTests.swift @@ -76,9 +76,9 @@ struct VersionsCheckReadinessTests { ) } - private func makeAnsweredAgeRating() -> (MockAppInfos, MockAgeRatingDeclarations) { - let appInfoRepo = MockAppInfos() - let ageRatingRepo = MockAgeRatingDeclarations() + private func makeAnsweredAgeRating() -> (MockAppInfoRepository, MockAgeRatingDeclarationRepository) { + let appInfoRepo = MockAppInfoRepository() + let ageRatingRepo = MockAgeRatingDeclarationRepository() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([makeAppInfo()]) given(ageRatingRepo).getDeclaration(appInfoId: .value("info-1")).willReturn(makeDeclaration()) return (appInfoRepo, ageRatingRepo) @@ -86,16 +86,16 @@ struct VersionsCheckReadinessTests { /// Runs the check on an otherwise ready version, with the given age rating setup. private func checkReadyVersion( - appInfoRepo: MockAppInfos, - ageRatingRepo: MockAgeRatingDeclarations + appInfoRepo: MockAppInfoRepository, + ageRatingRepo: MockAgeRatingDeclarationRepository ) async throws -> String { - let mockVersionRepo = MockAppStoreVersions() - let mockAppRepo = MockApps() - let mockBuildRepo = MockBuilds() - let mockReviewDetailRepo = MockReviewDetails() - let mockLocalizationRepo = MockVersionLocalizations() - let mockScreenshotRepo = MockAppScreenshots() - let mockPricingRepo = MockAppPrices() + let mockVersionRepo = MockVersionRepository() + let mockAppRepo = MockAppRepository() + let mockBuildRepo = MockBuildRepository() + let mockReviewDetailRepo = MockReviewDetailRepository() + let mockLocalizationRepo = MockVersionLocalizationRepository() + let mockScreenshotRepo = MockScreenshotRepository() + let mockPricingRepo = MockPricingRepository() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) given(mockVersionRepo).getVersion(id: .value("v-123")).willReturn(makeEditable()) given(mockBuildRepo).getBuild(id: .value("build-55")).willReturn(makeBuild()) @@ -120,8 +120,8 @@ struct VersionsCheckReadinessTests { // MARK: - Tests @Test func `should not be ready and should name social media when it is unanswered`() async throws { - let appInfoRepo = MockAppInfos() - let ageRatingRepo = MockAgeRatingDeclarations() + let appInfoRepo = MockAppInfoRepository() + let ageRatingRepo = MockAgeRatingDeclarationRepository() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([makeAppInfo()]) given(ageRatingRepo).getDeclaration(appInfoId: .value("info-1")).willReturn(makeDeclaration(isSocialMedia: nil)) @@ -138,8 +138,8 @@ struct VersionsCheckReadinessTests { } @Test func `should read the age rating of the app info being prepared, not the live one`() async throws { - let appInfoRepo = MockAppInfos() - let ageRatingRepo = MockAgeRatingDeclarations() + let appInfoRepo = MockAppInfoRepository() + let ageRatingRepo = MockAgeRatingDeclarationRepository() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([ makeAppInfo(id: "info-live", state: "READY_FOR_DISTRIBUTION"), makeAppInfo(id: "info-1", state: "PREPARE_FOR_SUBMISSION"), @@ -153,8 +153,8 @@ struct VersionsCheckReadinessTests { } @Test func `should read the age rating of a rejected app info rather than the live one`() async throws { - let appInfoRepo = MockAppInfos() - let ageRatingRepo = MockAgeRatingDeclarations() + let appInfoRepo = MockAppInfoRepository() + let ageRatingRepo = MockAgeRatingDeclarationRepository() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([ makeAppInfo(id: "info-live", state: "READY_FOR_DISTRIBUTION"), makeAppInfo(id: "info-1", state: "REJECTED"), @@ -168,23 +168,23 @@ struct VersionsCheckReadinessTests { } @Test func `should not be ready when the app has no app info to read an age rating from`() async throws { - let appInfoRepo = MockAppInfos() + let appInfoRepo = MockAppInfoRepository() given(appInfoRepo).listAppInfos(appId: .value("app-456")).willReturn([]) - let output = try await checkReadyVersion(appInfoRepo: appInfoRepo, ageRatingRepo: MockAgeRatingDeclarations()) + let output = try await checkReadyVersion(appInfoRepo: appInfoRepo, ageRatingRepo: MockAgeRatingDeclarationRepository()) #expect(output.contains(#""isReadyToSubmit" : false"#)) #expect(output.contains(#""message" : "No app info found to read the age rating from""#)) } @Test func `version with valid build and pricing is ready to submit`() async throws { - let mockVersionRepo = MockAppStoreVersions() - let mockAppRepo = MockApps() - let mockBuildRepo = MockBuilds() - let mockReviewDetailRepo = MockReviewDetails() - let mockLocalizationRepo = MockVersionLocalizations() - let mockScreenshotRepo = MockAppScreenshots() - let mockPricingRepo = MockAppPrices() + let mockVersionRepo = MockVersionRepository() + let mockAppRepo = MockAppRepository() + let mockBuildRepo = MockBuildRepository() + let mockReviewDetailRepo = MockReviewDetailRepository() + let mockLocalizationRepo = MockVersionLocalizationRepository() + let mockScreenshotRepo = MockScreenshotRepository() + let mockPricingRepo = MockPricingRepository() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) @@ -263,13 +263,13 @@ struct VersionsCheckReadinessTests { } @Test func `version without linked build is not ready to submit`() async throws { - let mockVersionRepo = MockAppStoreVersions() - let mockAppRepo = MockApps() - let mockBuildRepo = MockBuilds() - let mockReviewDetailRepo = MockReviewDetails() - let mockLocalizationRepo = MockVersionLocalizations() - let mockScreenshotRepo = MockAppScreenshots() - let mockPricingRepo = MockAppPrices() + let mockVersionRepo = MockVersionRepository() + let mockAppRepo = MockAppRepository() + let mockBuildRepo = MockBuildRepository() + let mockReviewDetailRepo = MockReviewDetailRepository() + let mockLocalizationRepo = MockVersionLocalizationRepository() + let mockScreenshotRepo = MockScreenshotRepository() + let mockPricingRepo = MockPricingRepository() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) @@ -335,13 +335,13 @@ struct VersionsCheckReadinessTests { } @Test func `live version is not editable so cannot submit`() async throws { - let mockVersionRepo = MockAppStoreVersions() - let mockAppRepo = MockApps() - let mockBuildRepo = MockBuilds() - let mockReviewDetailRepo = MockReviewDetails() - let mockLocalizationRepo = MockVersionLocalizations() - let mockScreenshotRepo = MockAppScreenshots() - let mockPricingRepo = MockAppPrices() + let mockVersionRepo = MockVersionRepository() + let mockAppRepo = MockAppRepository() + let mockBuildRepo = MockBuildRepository() + let mockReviewDetailRepo = MockReviewDetailRepository() + let mockLocalizationRepo = MockVersionLocalizationRepository() + let mockScreenshotRepo = MockScreenshotRepository() + let mockPricingRepo = MockPricingRepository() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) @@ -418,13 +418,13 @@ struct VersionsCheckReadinessTests { } @Test func `secondary locale without screenshots does not block submission`() async throws { - let mockVersionRepo = MockAppStoreVersions() - let mockAppRepo = MockApps() - let mockBuildRepo = MockBuilds() - let mockReviewDetailRepo = MockReviewDetails() - let mockLocalizationRepo = MockVersionLocalizations() - let mockScreenshotRepo = MockAppScreenshots() - let mockPricingRepo = MockAppPrices() + let mockVersionRepo = MockVersionRepository() + let mockAppRepo = MockAppRepository() + let mockBuildRepo = MockBuildRepository() + let mockReviewDetailRepo = MockReviewDetailRepository() + let mockLocalizationRepo = MockVersionLocalizationRepository() + let mockScreenshotRepo = MockScreenshotRepository() + let mockPricingRepo = MockPricingRepository() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) @@ -518,13 +518,13 @@ struct VersionsCheckReadinessTests { } @Test func `missing review contact does not block submission`() async throws { - let mockVersionRepo = MockAppStoreVersions() - let mockAppRepo = MockApps() - let mockBuildRepo = MockBuilds() - let mockReviewDetailRepo = MockReviewDetails() - let mockLocalizationRepo = MockVersionLocalizations() - let mockScreenshotRepo = MockAppScreenshots() - let mockPricingRepo = MockAppPrices() + let mockVersionRepo = MockVersionRepository() + let mockAppRepo = MockAppRepository() + let mockBuildRepo = MockBuildRepository() + let mockReviewDetailRepo = MockReviewDetailRepository() + let mockLocalizationRepo = MockVersionLocalizationRepository() + let mockScreenshotRepo = MockScreenshotRepository() + let mockPricingRepo = MockPricingRepository() let (mockAppInfoRepo, mockAgeRatingRepo) = makeAnsweredAgeRating() given(mockAppRepo).getApp(id: .value("app-456")).willReturn(makeApp()) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift index c92d0328..8157c33b 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsCreateTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionsCreateTests { @Test func `created iOS version is returned in prepare for submission state`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).createVersion(appId: .any, versionString: .any, platform: .any).willReturn( AppStoreVersion(id: "v-new", appId: "app-1", versionString: "2.0.0", platform: .iOS, state: .prepareForSubmission) ) @@ -39,7 +39,7 @@ struct VersionsCreateTests { } @Test func `created macOS version returns version with macOS platform`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).createVersion(appId: .any, versionString: .any, platform: .any).willReturn( AppStoreVersion(id: "v-1", appId: "app-42", versionString: "3.1.0", platform: .macOS, state: .prepareForSubmission) ) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift index 7f52f202..9cad6ee8 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionsListTests { @Test func `live version includes navigation affordances`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).listVersions(appId: .any).willReturn([ AppStoreVersion(id: "v-1", appId: "app-1", versionString: "2.3.0", platform: .iOS, state: .readyForSale), ]) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift index c359d648..3cdef952 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsSetBuildTests.swift @@ -12,7 +12,7 @@ struct VersionsSetBuildTests { } @Test func `execute links build to version`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).setBuild(versionId: .any, buildId: .any).willReturn() let cmd = try VersionsSetBuild.parse(["--version-id", "v-1", "--build-id", "build-42"]) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift index f369fc1d..3dd2eb6b 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift @@ -41,28 +41,28 @@ struct VersionsSubmitTests { // MARK: - --with-products - private func planner(iapRepo: MockInAppPurchases, versionRepo: MockProductVersions) -> SubmissionPlanner { - let groups = MockSubscriptionGroups() + private func planner(iapRepo: MockInAppPurchaseRepository, versionRepo: MockProductVersionRepository) -> SubmissionPlanner { + let groups = MockSubscriptionGroupRepository() given(groups).listSubscriptionGroups(appId: .any, limit: .any).willReturn(PaginatedResponse(data: [])) return SubmissionPlanner(iapRepo: iapRepo, groupRepo: groups, - subscriptionRepo: MockSubscriptions(), productVersionRepo: versionRepo) + subscriptionRepo: MockSubscriptionRepository(), productVersionRepo: versionRepo) } - private func readyLifetimeIAP() -> (MockInAppPurchases, MockProductVersions) { - let iaps = MockInAppPurchases() + private func readyLifetimeIAP() -> (MockInAppPurchaseRepository, MockProductVersionRepository) { + let iaps = MockInAppPurchaseRepository() given(iaps).listInAppPurchases(appId: .any, limit: .any).willReturn(PaginatedResponse(data: [ InAppPurchase(id: "iap-1", appId: "app-1", referenceName: "Lifetime", productId: "com.app.lifetime", type: .nonConsumable, state: .readyToSubmit), ])) - let versions = MockProductVersions() + let versions = MockProductVersionRepository() given(versions).listInAppPurchaseVersions(iapId: .any).willReturn([ ProductVersion(id: "iv-1", productId: "iap-1", kind: .inAppPurchase, version: 1, state: .prepareForSubmission), ]) return (iaps, versions) } - private func appVersionRepo() -> MockAppStoreVersions { - let repo = MockAppStoreVersions() + private func appVersionRepo() -> MockVersionRepository { + let repo = MockVersionRepository() given(repo).getVersion(id: .value("v-1")).willReturn( AppStoreVersion(id: "v-1", appId: "app-1", versionString: "1.0", platform: .iOS, state: .prepareForSubmission) ) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift index 4bee6d12..7c68e20d 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsUpdateTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionsUpdateTests { @Test func `updated version returns new version string with editable affordances`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).updateVersion( id: .any, versionString: .any, @@ -45,7 +45,7 @@ struct VersionsUpdateTests { } @Test func `copyright flag is forwarded to repo update`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).updateVersion( id: .any, versionString: .any, copyright: .any, releaseType: .any, earliestReleaseDate: .any ).willReturn( @@ -72,7 +72,7 @@ struct VersionsUpdateTests { } @Test func `release type and earliest release date flags are forwarded to repo update`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).updateVersion( id: .any, versionString: .any, copyright: .any, releaseType: .any, earliestReleaseDate: .any ).willReturn( @@ -101,7 +101,7 @@ struct VersionsUpdateTests { } @Test func `version flag stays optional when omitted`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).updateVersion( id: .any, versionString: .any, copyright: .any, releaseType: .any, earliestReleaseDate: .any ).willReturn( diff --git a/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift index 9dedd30a..d5712331 100644 --- a/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AppShotsControllerTests.swift @@ -10,7 +10,7 @@ struct AppShotsControllerTests { // MARK: - Templates list @Test func `templates list returns data with _links`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).listTemplates(size: .any).willReturn([ makeTemplate(id: "hero", name: "Hero"), ]) diff --git a/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift index cd5210f3..c05dfca8 100644 --- a/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AppsControllerTests.swift @@ -8,7 +8,7 @@ import Mockable struct AppsControllerTests { @Test func `apps list with include icon attaches iconAsset per app`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() let asset = ImageAsset( templateUrl: "https://cdn.example.com/a/{w}x{h}bb.{f}", width: 512, @@ -33,7 +33,7 @@ struct AppsControllerTests { } @Test func `app infos list returns JSON with _links and data wrapper`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo).listAppInfos(appId: .any).willReturn([ AppInfo(id: "ai-1", appId: "42", primaryCategoryId: "6014"), ]) @@ -49,7 +49,7 @@ struct AppsControllerTests { } @Test func `app info localizations list returns JSON with _links and fields`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo).listLocalizations(appInfoId: .any).willReturn([ AppInfoLocalization( id: "loc-1", @@ -75,7 +75,7 @@ struct AppsControllerTests { } @Test func `age rating get returns JSON with _links and data wrapper`() async throws { - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() given(mockRepo).getDeclaration(appInfoId: .any).willReturn( AgeRatingDeclaration(id: "rating-1", appInfoId: "ai-1", isGambling: false) ) @@ -93,7 +93,7 @@ struct AppsControllerTests { } @Test func `app info update returns updated record with category ids`() async throws { - let mockRepo = MockAppInfos() + let mockRepo = MockAppInfoRepository() given(mockRepo) .updateCategories( id: .any, @@ -131,7 +131,7 @@ struct AppsControllerTests { } @Test func `apps list without include icon omits iconAsset`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [ App(id: "42", name: "MyApp", bundleId: "com.test"), diff --git a/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift index fb558388..50fcab03 100644 --- a/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/AssetLibraryControllerTests.swift @@ -7,7 +7,7 @@ import Testing struct AssetLibraryControllerTests { @Test func `should place the image sent over REST on the localization`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).createPlacement( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), mediaType: .value(.image), assetId: .value("img-1"), placementType: .value(.appScreenshot), placementGroup: .value("IPHONE_67") @@ -23,7 +23,7 @@ struct AssetLibraryControllerTests { } @Test func `should place a video sent over REST on a treatment localization`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).createPlacement( surface: .value(.experimentTreatmentLocalization), localizationId: .value("tl-1"), mediaType: .value(.video), assetId: .value("vid-1"), placementType: .value(.appPreview), placementGroup: .value("IPHONE_67") @@ -39,7 +39,7 @@ struct AssetLibraryControllerTests { } @Test func `should rename and archive an image over REST with the same fields as the CLI`() async throws { - let mockRepo = MockLibraryImages() + let mockRepo = MockLibraryImageRepository() given(mockRepo).updateImage(libraryId: .value("lib-1"), imageId: .value("img-1"), referenceName: .value("Home"), isArchived: .value(true)) .willReturn(LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 1, category: .appScreenshotsAndPreviews, state: .archived, referenceName: "Home")) @@ -53,12 +53,12 @@ struct AssetLibraryControllerTests { @Test func `should refuse a REST image update that changes nothing`() async throws { await #expect(throws: AssetLibraryController.BadRequest("Provide referenceName or archived")) { - _ = try await AssetLibraryController.updateImage(imageId: "img-1", json: ["libraryId": "lib-1"], repo: MockLibraryImages()) + _ = try await AssetLibraryController.updateImage(imageId: "img-1", json: ["libraryId": "lib-1"], repo: MockLibraryImageRepository()) } } @Test func `should refuse a REST placement that names no asset or an unknown placement type`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() await #expect(throws: AssetLibraryController.BadRequest("Provide imageId or videoId, placementType and placementGroup")) { _ = try await AssetLibraryController.createPlacement( @@ -69,7 +69,7 @@ struct AssetLibraryControllerTests { } @Test func `should reorder the group in the order sent over REST`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() given(mockRepo).reorderPlacements( surface: .value(.appStoreVersionLocalization), localizationId: .value("loc-1"), placementGroup: .value("IPHONE_67"), placementIds: .value(["pl-2", "pl-1"]) @@ -84,7 +84,7 @@ struct AssetLibraryControllerTests { } @Test func `should refuse a REST reorder without a group or placements`() async throws { - let mockRepo = MockAssetPlacements() + let mockRepo = MockAssetPlacementRepository() await #expect(throws: AssetLibraryController.BadRequest("Provide placementGroup and placementIds")) { _ = try await AssetLibraryController.reorderPlacements( diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift index 615572a2..2df17a33 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/AgeRatingRoutesTests.swift @@ -12,7 +12,7 @@ import Testing struct AgeRatingRoutesTests { @Test func `should save the social media answers over REST`() async throws { - let repo = MockAgeRatingDeclarations() + let repo = MockAgeRatingDeclarationRepository() given(repo).updateDeclaration(id: .value("decl-1"), update: .any).willProduce { id, update in AgeRatingDeclaration( id: id, diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift index 6234793b..94b296d8 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/CustomProductPagePlacementRoutesTests.swift @@ -11,7 +11,7 @@ import Testing struct CustomProductPagePlacementRoutesTests { @Test func `should place a header image on a custom product page localization over REST`() async throws { - let placementRepo = MockAssetPlacements() + let placementRepo = MockAssetPlacementRepository() given(placementRepo).createPlacement( surface: .value(.customProductPageLocalization), localizationId: .value("cpl-1"), mediaType: .value(.image), assetId: .value("img-1"), placementType: .value(.productPageHeaderAsset), placementGroup: .value("DEFAULT_PROFILE") @@ -33,7 +33,7 @@ struct CustomProductPagePlacementRoutesTests { } @Test func `should list a custom product page localization's placements over REST`() async throws { - let placementRepo = MockAssetPlacements() + let placementRepo = MockAssetPlacementRepository() given(placementRepo).listPlacements( surface: .value(.customProductPageLocalization), localizationId: .value("cpl-1"), placementType: .value(.appStoreSearchResultsAsset), placementGroup: .value(nil) @@ -58,12 +58,12 @@ struct CustomProductPagePlacementRoutesTests { _ method: HTTPRequest.Method, _ uri: String, body: String? = nil, - placementRepo: MockAssetPlacements + placementRepo: MockAssetPlacementRepository ) async throws -> (HTTPResponse.Status, String) { let router = Router(context: BasicWebSocketRequestContext.self) AssetLibraryController( - libraryRepo: MockAssetLibraries(), imageRepo: MockLibraryImages(), - videoRepo: MockLibraryVideos(), placementRepo: placementRepo + libraryRepo: MockAssetLibraryRepository(), imageRepo: MockLibraryImageRepository(), + videoRepo: MockLibraryVideoRepository(), placementRepo: placementRepo ).addRoutes(to: router.group("/api/v1")) return try await Application(router: router).test(.router) { client in try await client.execute( diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift index 1fdae25d..8077d8da 100644 --- a/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/ScreenshotDeleteRoutesTests.swift @@ -10,7 +10,7 @@ import Testing struct ScreenshotDeleteRoutesTests { @Test func `should confirm the screenshot was deleted over REST`() async throws { - let repo = MockAppScreenshots() + let repo = MockScreenshotRepository() given(repo).deleteScreenshot(screenshotId: .value("shot-1")).willReturn() let (status, body) = try await Self.delete("/api/v1/screenshots/shot-1") { @@ -22,7 +22,7 @@ struct ScreenshotDeleteRoutesTests { } @Test func `should confirm the screenshot set was deleted over REST`() async throws { - let repo = MockAppScreenshots() + let repo = MockScreenshotRepository() given(repo).deleteScreenshotSet(setId: .value("set-1")).willReturn() let (status, body) = try await Self.delete("/api/v1/screenshot-sets/set-1") { diff --git a/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift index 727cfde4..bd8d5f42 100644 --- a/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/GameCenterControllerTests.swift @@ -7,8 +7,8 @@ import Testing struct GameCenterControllerTests { /// Stubs App Store Connect so the created achievement echoes what it was sent. - private func achievementEchoingRepo() -> MockGameCenter { - let mockRepo = MockGameCenter() + private func achievementEchoingRepo() -> MockGameCenterRepository { + let mockRepo = MockGameCenterRepository() given(mockRepo).createAchievement( gameCenterDetailId: .any, referenceName: .any, vendorIdentifier: .any, points: .any, isShowBeforeEarned: .any, isRepeatable: .any @@ -23,8 +23,8 @@ struct GameCenterControllerTests { } /// Stubs App Store Connect so the created leaderboard echoes what it was sent. - private func leaderboardEchoingRepo() -> MockGameCenter { - let mockRepo = MockGameCenter() + private func leaderboardEchoingRepo() -> MockGameCenterRepository { + let mockRepo = MockGameCenterRepository() given(mockRepo).createLeaderboard( gameCenterDetailId: .any, referenceName: .any, vendorIdentifier: .any, scoreSortType: .any, submissionType: .any @@ -76,7 +76,7 @@ struct GameCenterControllerTests { _ = try await GameCenterController.createAchievement( detailId: "gc-1", json: ["referenceName": "First Win", "vendorIdentifier": "com.example.first-win"], - repo: MockGameCenter() + repo: MockGameCenterRepository() ) } } @@ -119,7 +119,7 @@ struct GameCenterControllerTests { _ = try await GameCenterController.createLeaderboard( detailId: "gc-1", json: ["referenceName": "All Time High", "vendorIdentifier": "com.example.high-score", "scoreSortType": "SIDEWAYS"], - repo: MockGameCenter() + repo: MockGameCenterRepository() ) } } @@ -132,7 +132,7 @@ struct GameCenterControllerTests { "referenceName": "All Time High", "vendorIdentifier": "com.example.high-score", "scoreSortType": "DESC", "submissionType": "AVERAGE_SCORE", ], - repo: MockGameCenter() + repo: MockGameCenterRepository() ) } } diff --git a/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift index d0ff9a1e..5a0bbcb0 100644 --- a/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift @@ -12,7 +12,7 @@ struct RESTRoutesTests { // MARK: - Apps @Test func `apps list returns JSON with _links`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [App(id: "42", name: "MyApp", bundleId: "com.test")]) ) @@ -24,7 +24,7 @@ struct RESTRoutesTests { } @Test func `apps list returns data wrapper`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [App(id: "1", name: "Test", bundleId: "com.test")]) ) @@ -35,7 +35,7 @@ struct RESTRoutesTests { // MARK: - Versions @Test func `versions list returns JSON with _links`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).listVersions(appId: .any).willReturn([ AppStoreVersion(id: "v-1", appId: "42", versionString: "1.0", platform: .iOS, state: .prepareForSubmission), ]) @@ -121,7 +121,7 @@ struct RESTRoutesTests { } @Test func `age-rating update returns JSON with _links`() async throws { - let mockRepo = MockAgeRatingDeclarations() + let mockRepo = MockAgeRatingDeclarationRepository() given(mockRepo).updateDeclaration(id: .any, update: .any).willReturn( AgeRatingDeclaration(id: "decl-1", appInfoId: "info-42", isAdvertising: false) ) @@ -135,7 +135,7 @@ struct RESTRoutesTests { } @Test func `apps update returns JSON with _links and contentRightsDeclaration`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).updateContentRights(appId: .any, declaration: .any).willReturn( App(id: "42", name: "Bakery", bundleId: "com.example", contentRightsDeclaration: .doesNotUseThirdPartyContent) ) @@ -150,7 +150,7 @@ struct RESTRoutesTests { } @Test func `versions update returns JSON with _links`() async throws { - let mockRepo = MockAppStoreVersions() + let mockRepo = MockVersionRepository() given(mockRepo).updateVersion( id: .any, versionString: .any, @@ -172,7 +172,7 @@ struct RESTRoutesTests { // MARK: - Version Localizations @Test func `version localizations list returns JSON with _links`() async throws { - let mockRepo = MockVersionLocalizations() + let mockRepo = MockVersionLocalizationRepository() given(mockRepo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v-1", locale: "en-US", description: "A great app"), ]) @@ -213,7 +213,7 @@ struct RESTRoutesTests { // MARK: - Builds @Test func `builds list returns JSON with _links`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).listBuilds(appId: .any, platform: .any, version: .any, limit: .any).willReturn( PaginatedResponse(data: [Build(id: "b-1", version: "1.0", expired: false, processingState: .valid)]) ) @@ -224,7 +224,7 @@ struct RESTRoutesTests { } @Test func `builds set-encryption-compliance REST output contains updated build`() async throws { - let mockRepo = MockBuilds() + let mockRepo = MockBuildRepository() given(mockRepo).updateBuildEncryptionCompliance(buildId: .any, usesNonExemptEncryption: .any) .willReturn(Build(id: "b-1", version: "1.0", expired: false, processingState: .valid, usesNonExemptEncryption: false)) let output = try await BuildsSetEncryptionCompliance.parse([ @@ -240,7 +240,7 @@ struct RESTRoutesTests { // MARK: - TestFlight @Test func `testflight groups list returns JSON with _links`() async throws { - let mockRepo = MockTestFlight() + let mockRepo = MockTestFlightRepository() given(mockRepo).listBetaGroups(appId: .any, limit: .any).willReturn( PaginatedResponse(data: [BetaGroup(id: "g-1", appId: "42", name: "External Testers", isInternalGroup: false)]) ) @@ -253,7 +253,7 @@ struct RESTRoutesTests { // MARK: - Beta App Localizations @Test func `beta app localizations list returns JSON with _links to parent app`() async throws { - let mockRepo = MockBetaAppLocalizations() + let mockRepo = MockBetaAppLocalizationRepository() given(mockRepo).listBetaAppLocalizations(appId: .any).willReturn([ BetaAppLocalization(id: "bal-1", appId: "42", locale: "en-US", description: "Welcome", feedbackEmail: "beta@example.com"), ]) @@ -266,7 +266,7 @@ struct RESTRoutesTests { } @Test func `beta app localizations get returns _links for actions on this localization`() async throws { - let mockRepo = MockBetaAppLocalizations() + let mockRepo = MockBetaAppLocalizationRepository() given(mockRepo).getBetaAppLocalization(localizationId: .any).willReturn( BetaAppLocalization(id: "bal-7", appId: "99", locale: "ja", description: "ベータ") ) @@ -280,7 +280,7 @@ struct RESTRoutesTests { // MARK: - App Shots @Test func `templates list returns data wrapper`() async throws { - let mockRepo = MockTemplates() + let mockRepo = MockTemplateRepository() given(mockRepo).listTemplates(size: .any).willReturn([]) let output = try await AppShotsTemplatesList.parse(["--pretty"]).execute(repo: mockRepo, affordanceMode: .rest) #expect(output.contains("\"data\"")) @@ -344,7 +344,7 @@ struct RESTRoutesTests { // MARK: - Certificates REST filters @Test func `certificates list accepts limit via rest mode`() async throws { - let mockRepo = MockCertificates() + let mockRepo = MockCertificateRepository() given(mockRepo).listCertificates(certificateType: .any, limit: .value(200)).willReturn([ Certificate(id: "cert-1", name: "Dist", certificateType: .iosDistribution), ]) @@ -365,7 +365,7 @@ struct RESTRoutesTests { // MARK: - Promoted Purchases @Test func `promoted purchases list returns JSON with _links pointing at REST paths`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() given(mockRepo).listPromotedPurchases(appId: .any, limit: .any).willReturn( PaginatedResponse(data: [ PromotedPurchase( @@ -389,7 +389,7 @@ struct RESTRoutesTests { // MARK: - Subscription Group Localizations @Test func `subscription group localizations REST exposes nested path under group`() async throws { - let mockRepo = MockSubscriptionGroupLocalizations() + let mockRepo = MockSubscriptionGroupLocalizationRepository() given(mockRepo).listLocalizations(groupId: .any).willReturn([ SubscriptionGroupLocalization(id: "loc-1", groupId: "grp-7", locale: "en-US", name: "Premium") ]) @@ -404,7 +404,7 @@ struct RESTRoutesTests { } @Test func `subscription group localization create returns JSON with _links`() async throws { - let mockRepo = MockSubscriptionGroupLocalizations() + let mockRepo = MockSubscriptionGroupLocalizationRepository() given(mockRepo).createLocalization(groupId: .any, locale: .any, name: .any, customAppName: .any) .willReturn(SubscriptionGroupLocalization( id: "loc-1", groupId: "grp-7", locale: "en-US", name: "Premium" @@ -423,7 +423,7 @@ struct RESTRoutesTests { // MARK: - Review uploads (IAP + Subscription) @Test func `iap review screenshot upload returns JSON with _links pointing at iap-review-screenshot`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).uploadReviewScreenshot(iapId: .any, fileURL: .any).willReturn( InAppPurchaseReviewScreenshot(id: "rs-1", iapId: "iap-7", fileName: "shot.png", fileSize: 1024, assetState: .complete) ) @@ -438,7 +438,7 @@ struct RESTRoutesTests { } @Test func `iap image upload returns JSON with _links pointing at iap-images`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).uploadImage(iapId: .any, fileURL: .any).willReturn( InAppPurchasePromotionalImage(id: "img-1", iapId: "iap-7", fileName: "promo.jpg", fileSize: 2048, state: .uploadComplete) ) @@ -453,7 +453,7 @@ struct RESTRoutesTests { } @Test func `subscription review screenshot upload returns JSON with _links pointing at subscription-review-screenshot`() async throws { - let mockRepo = MockSubscriptionReviewAssets() + let mockRepo = MockSubscriptionReviewRepository() given(mockRepo).uploadReviewScreenshot(subscriptionId: .any, fileURL: .any).willReturn( SubscriptionReviewScreenshot(id: "srs-1", subscriptionId: "sub-7", fileName: "shot.png", fileSize: 1024, assetState: .complete) ) @@ -468,7 +468,7 @@ struct RESTRoutesTests { } @Test func `subscription image upload returns JSON with _links pointing at subscription-images`() async throws { - let mockRepo = MockSubscriptionReviewAssets() + let mockRepo = MockSubscriptionReviewRepository() given(mockRepo).uploadImage(subscriptionId: .any, fileURL: .any).willReturn( SubscriptionPromotionalImage(id: "simg-1", subscriptionId: "sub-7", fileName: "promo.jpg", fileSize: 2048, state: .uploadComplete) ) @@ -483,7 +483,7 @@ struct RESTRoutesTests { } @Test func `subscription group localization update returns JSON with _links`() async throws { - let mockRepo = MockSubscriptionGroupLocalizations() + let mockRepo = MockSubscriptionGroupLocalizationRepository() given(mockRepo).updateLocalization(localizationId: .any, name: .any, customAppName: .any) .willReturn(SubscriptionGroupLocalization( id: "loc-1", groupId: "grp-7", locale: "en-US", name: "Renamed" @@ -502,7 +502,7 @@ struct RESTRoutesTests { // MARK: - Subscription Pricing @Test func `subscription price-points REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionPrices() + let mockRepo = MockSubscriptionPriceRepository() given(mockRepo).listPricePoints(subscriptionId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [ SubscriptionPricePoint(id: "spp-1", subscriptionId: "sub-7", territory: "USA", @@ -520,7 +520,7 @@ struct RESTRoutesTests { // MARK: - Subscription Promotional Offers @Test func `subscription promotional offers REST exposes nested paths`() async throws { - let mockRepo = MockSubscriptionPromotionalOffers() + let mockRepo = MockSubscriptionPromotionalOfferRepository() given(mockRepo).listPromotionalOffers(subscriptionId: .any).willReturn([ SubscriptionPromotionalOffer( id: "po-1", subscriptionId: "sub-7", name: "Winback", @@ -541,7 +541,7 @@ struct RESTRoutesTests { // MARK: - Win-Back Offers @Test func `win-back offers REST exposes nested paths under subscription`() async throws { - let mockRepo = MockWinBackOffers() + let mockRepo = MockWinBackOfferRepository() given(mockRepo).listWinBackOffers(subscriptionId: .any).willReturn([ WinBackOffer( id: "wb-1", subscriptionId: "sub-7", @@ -567,7 +567,7 @@ struct RESTRoutesTests { // MARK: - Offer Code Prices @Test func `iap offer code prices REST exposes nested path under offer code`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listPrices(offerCodeId: .any).willReturn([ InAppPurchaseOfferCodePrice(id: "p-1", offerCodeId: "oc-7", territory: "USA", pricePointId: "pp-1") ]) @@ -581,7 +581,7 @@ struct RESTRoutesTests { } @Test func `subscription offer code prices REST exposes nested path under offer code`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listPrices(offerCodeId: .any).willReturn([ SubscriptionOfferCodePrice(id: "p-1", offerCodeId: "oc-7", territory: "USA", subscriptionPricePointId: "spp-1") ]) @@ -597,7 +597,7 @@ struct RESTRoutesTests { // MARK: - One-Time Use Codes (IAP + Subscription) @Test func `IAP one-time codes list REST resolves to nested path under offer code`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any).willReturn([ InAppPurchaseOfferCodeOneTimeUseCode( id: "otc-1", offerCodeId: "oc-7", numberOfCodes: 100, @@ -615,7 +615,7 @@ struct RESTRoutesTests { } @Test func `IAP one-time codes update REST resolves to PATCH on the code id`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).updateOneTimeUseCode(oneTimeCodeId: .any, isActive: .any).willReturn( InAppPurchaseOfferCodeOneTimeUseCode( id: "otc-1", offerCodeId: "oc-7", numberOfCodes: 100, @@ -634,7 +634,7 @@ struct RESTRoutesTests { } @Test func `subscription one-time codes list REST resolves to nested path under offer code`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listOneTimeUseCodes(offerCodeId: .any).willReturn([ SubscriptionOfferCodeOneTimeUseCode( id: "otc-1", offerCodeId: "oc-7", numberOfCodes: 100, @@ -652,7 +652,7 @@ struct RESTRoutesTests { } @Test func `IAP offer codes create REST emits _links pointing back at parent IAP path`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).createOfferCode( iapId: .any, name: .any, customerEligibilities: .any, prices: .any ).willReturn(InAppPurchaseOfferCode( @@ -673,7 +673,7 @@ struct RESTRoutesTests { } @Test func `subscription offer codes create REST emits _links`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createOfferCode( subscriptionId: .any, name: .any, customerEligibilities: .any, offerEligibility: .any, duration: .any, offerMode: .any, numberOfPeriods: .any, @@ -701,7 +701,7 @@ struct RESTRoutesTests { } @Test func `subscription one-time codes create REST forwards environment to repo and emits _links`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).createOneTimeUseCode( offerCodeId: .any, numberOfCodes: .any, expirationDate: .any, environment: .any ).willReturn( @@ -731,7 +731,7 @@ struct RESTRoutesTests { // MARK: - IAP Review Assets @Test func `IAP review screenshot REST returns nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).getReviewScreenshot(iapId: .any).willReturn( InAppPurchaseReviewScreenshot(id: "rs-1", iapId: "iap-7", fileName: "review.png", fileSize: 1234, assetState: .complete) @@ -749,7 +749,7 @@ struct RESTRoutesTests { } @Test func `IAP images REST returns nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseReviewAssets() + let mockRepo = MockInAppPurchaseReviewRepository() given(mockRepo).listImages(iapId: .any).willReturn([ InAppPurchasePromotionalImage(id: "img-1", iapId: "iap-7", fileName: "promo.png", fileSize: 9999, state: .approved) @@ -766,7 +766,7 @@ struct RESTRoutesTests { // MARK: - Subscription Review Asset @Test func `subscription review screenshot REST returns nested path under subscription`() async throws { - let mockRepo = MockSubscriptionReviewAssets() + let mockRepo = MockSubscriptionReviewRepository() given(mockRepo).getReviewScreenshot(subscriptionId: .any).willReturn( SubscriptionReviewScreenshot(id: "rs-1", subscriptionId: "sub-7", fileName: "review.png", fileSize: 1234, assetState: .complete) @@ -784,7 +784,7 @@ struct RESTRoutesTests { } @Test func `promoted purchases REST suppresses update and delete links while in review`() async throws { - let mockRepo = MockPromotedPurchases() + let mockRepo = MockPromotedPurchaseRepository() given(mockRepo).listPromotedPurchases(appId: .any, limit: .any).willReturn( PaginatedResponse(data: [ PromotedPurchase( @@ -809,7 +809,7 @@ struct RESTRoutesTests { // MARK: - IAP detail listings (Localizations, Availability, OfferCodes, PricePoints) @Test func `IAP localizations list REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseLocalizations() + let mockRepo = MockInAppPurchaseLocalizationRepository() given(mockRepo).listLocalizations(iapId: .any).willReturn([ InAppPurchaseLocalization(id: "loc-1", iapId: "iap-7", locale: "en-US", name: "Lifetime", description: "Lifetime pass", state: .approved) ]) @@ -823,7 +823,7 @@ struct RESTRoutesTests { } @Test func `IAP availability get REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseAvailabilities() + let mockRepo = MockInAppPurchaseAvailabilityRepository() given(mockRepo).getAvailability(iapId: .any).willReturn( InAppPurchaseAvailability(id: "avail-1", iapId: "iap-7", isAvailableInNewTerritories: true, @@ -839,7 +839,7 @@ struct RESTRoutesTests { } @Test func `IAP availability create REST emits _links pointing back at parent IAP path`() async throws { - let mockRepo = MockInAppPurchaseAvailabilities() + let mockRepo = MockInAppPurchaseAvailabilityRepository() given(mockRepo).createAvailability(iapId: .any, isAvailableInNewTerritories: .any, territoryIds: .any) .willReturn(InAppPurchaseAvailability( id: "iap-7", iapId: "iap-7", @@ -862,7 +862,7 @@ struct RESTRoutesTests { } @Test func `IAP offer codes list REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchaseOfferCodes() + let mockRepo = MockInAppPurchaseOfferCodeRepository() given(mockRepo).listOfferCodes(iapId: .any).willReturn([ InAppPurchaseOfferCode(id: "oc-1", iapId: "iap-7", name: "Promo", customerEligibilities: [.nonSpender], isActive: true) ]) @@ -876,7 +876,7 @@ struct RESTRoutesTests { } @Test func `IAP equalizations list REST exposes nested path under price point`() async throws { - let mockRepo = MockInAppPurchasePrices() + let mockRepo = MockInAppPurchasePriceRepository() given(mockRepo).listEqualizations(pricePointId: .any, limit: .any).willReturn([ InAppPurchasePricePoint(id: "pp-USA", iapId: "", territory: "USA", customerPrice: "9.99", proceeds: "6.99"), InAppPurchasePricePoint(id: "pp-JPN", iapId: "", territory: "JPN", customerPrice: "1500", proceeds: "1050"), @@ -892,7 +892,7 @@ struct RESTRoutesTests { } @Test func `IAP price-schedule get REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchasePrices() + let mockRepo = MockInAppPurchasePriceRepository() given(mockRepo).getPriceSchedule(iapId: .any).willReturn( InAppPurchasePriceSchedule(id: "iap-7", iapId: "iap-7") ) @@ -906,7 +906,7 @@ struct RESTRoutesTests { } @Test func `IAP price-schedule get REST returns empty data when no schedule`() async throws { - let mockRepo = MockInAppPurchasePrices() + let mockRepo = MockInAppPurchasePriceRepository() given(mockRepo).getPriceSchedule(iapId: .any).willReturn(nil) let output = try await IAPPriceScheduleGet.parse(["--iap-id", "iap-7", "--pretty"]) @@ -917,7 +917,7 @@ struct RESTRoutesTests { } @Test func `IAP price-points list REST exposes nested path under iap`() async throws { - let mockRepo = MockInAppPurchasePrices() + let mockRepo = MockInAppPurchasePriceRepository() given(mockRepo).listPricePoints(iapId: .any, territory: .any, limit: .any, cursor: .any) .willReturn(PaginatedResponse(data: [ InAppPurchasePricePoint(id: "pp-1", iapId: "iap-7", territory: "USA", customerPrice: "9.99", proceeds: "6.99") @@ -934,7 +934,7 @@ struct RESTRoutesTests { // MARK: - Subscription detail listings (Localizations, Availability, OfferCodes, IntroOffers) @Test func `subscriptions list REST exposes nested path under subscription group`() async throws { - let mockRepo = MockSubscriptions() + let mockRepo = MockSubscriptionRepository() given(mockRepo).listSubscriptions(groupId: .any, limit: .any).willReturn( PaginatedResponse(data: [ Subscription( @@ -957,7 +957,7 @@ struct RESTRoutesTests { } @Test func `subscription localizations list REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionLocalizations() + let mockRepo = MockSubscriptionLocalizationRepository() given(mockRepo).listLocalizations(subscriptionId: .any).willReturn([ SubscriptionLocalization(id: "loc-1", subscriptionId: "sub-7", locale: "en-US", name: "Premium", description: "Premium plan", state: .approved) ]) @@ -971,7 +971,7 @@ struct RESTRoutesTests { } @Test func `subscription availability get REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionAvailabilities() + let mockRepo = MockSubscriptionAvailabilityRepository() given(mockRepo).getAvailability(subscriptionId: .any).willReturn( SubscriptionAvailability(id: "avail-1", subscriptionId: "sub-7", isAvailableInNewTerritories: true, @@ -987,7 +987,7 @@ struct RESTRoutesTests { } @Test func `subscription offer codes list REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionOfferCodes() + let mockRepo = MockSubscriptionOfferCodeRepository() given(mockRepo).listOfferCodes(subscriptionId: .any).willReturn([ SubscriptionOfferCode(id: "oc-1", subscriptionId: "sub-7", name: "Promo", customerEligibilities: [.new], offerEligibility: .introductory, @@ -1027,7 +1027,7 @@ struct RESTRoutesTests { } @Test func `subscription introductory offers list REST exposes nested path under subscription`() async throws { - let mockRepo = MockSubscriptionIntroductoryOffers() + let mockRepo = MockSubscriptionIntroductoryOfferRepository() given(mockRepo).listIntroductoryOffers(subscriptionId: .any).willReturn([ SubscriptionIntroductoryOffer(id: "io-1", subscriptionId: "sub-7", duration: .oneMonth, offerMode: .freeTrial, numberOfPeriods: 1) ]) @@ -1046,7 +1046,7 @@ struct RESTRoutesTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisResolutionCenter() + let mockRepo = MockIrisResolutionCenterRepository() given(mockRepo).getResolution(session: .any, submissionId: .value("sub-1")).willReturn( ResolutionCenterDetail(id: "thread-1", submissionId: "sub-1", threadState: "OPEN") ) @@ -1076,7 +1076,7 @@ struct RESTRoutesTests { // MARK: - Experiments (Product Page Optimization) @Test func `experiments list returns JSON with _links pointing at REST paths`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listExperiments(appId: .any, state: .any, limit: .any).willReturn( PaginatedResponse(data: [ AppStoreVersionExperiment(id: "exp-1", appId: "app-42", name: "Icon test", platform: .iOS, @@ -1096,7 +1096,7 @@ struct RESTRoutesTests { } @Test func `experiments REST exposes start link for approved unstarted test`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).getExperiment(experimentId: .any).willReturn( AppStoreVersionExperiment(id: "exp-1", appId: "app-42", name: "Icon test", platform: .iOS, trafficProportion: 30, state: .approved) @@ -1111,7 +1111,7 @@ struct RESTRoutesTests { } @Test func `experiment treatments REST exposes nested path under experiment`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listTreatments(experimentId: .any, limit: .any).willReturn( PaginatedResponse(data: [ExperimentTreatment(id: "trt-1", experimentId: "exp-7", name: "Blue icon")], nextCursor: nil) ) @@ -1127,7 +1127,7 @@ struct RESTRoutesTests { } @Test func `experiment treatment localizations REST exposes nested path under treatment`() async throws { - let mockRepo = MockExperiments() + let mockRepo = MockExperimentRepository() given(mockRepo).listTreatmentLocalizations(treatmentId: .any, limit: .any).willReturn([ ExperimentTreatmentLocalization(id: "loc-1", treatmentId: "trt-7", locale: "en-US") ]) @@ -1142,7 +1142,7 @@ struct RESTRoutesTests { } @Test func `app REST links include experiments`() async throws { - let mockRepo = MockApps() + let mockRepo = MockAppRepository() given(mockRepo).listApps(limit: .any).willReturn( PaginatedResponse(data: [App(id: "42", name: "MyApp", bundleId: "com.test")]) ) @@ -1155,7 +1155,7 @@ struct RESTRoutesTests { // MARK: - Product versions @Test func `product version lists return REST links to siblings and to add to a submission`() async throws { - let mockRepo = MockProductVersions() + let mockRepo = MockProductVersionRepository() given(mockRepo).listInAppPurchaseVersions(iapId: .any).willReturn([ ProductVersion(id: "iv-1", productId: "iap-1", kind: .inAppPurchase, version: 1, state: .prepareForSubmission), ]) @@ -1203,23 +1203,23 @@ struct RESTRoutesTests { } @Test func `a dry run over REST links each planned product to its versions`() async throws { - let versionRepo = MockAppStoreVersions() + let versionRepo = MockVersionRepository() given(versionRepo).getVersion(id: .any).willReturn( AppStoreVersion(id: "v-1", appId: "app-1", versionString: "1.0", platform: .iOS, state: .prepareForSubmission) ) - let iaps = MockInAppPurchases() + let iaps = MockInAppPurchaseRepository() given(iaps).listInAppPurchases(appId: .any, limit: .any).willReturn(PaginatedResponse(data: [ InAppPurchase(id: "iap-1", appId: "app-1", referenceName: "Lifetime", productId: "com.app.lifetime", type: .nonConsumable, state: .readyToSubmit), ])) - let groups = MockSubscriptionGroups() + let groups = MockSubscriptionGroupRepository() given(groups).listSubscriptionGroups(appId: .any, limit: .any).willReturn(PaginatedResponse(data: [])) - let productVersions = MockProductVersions() + let productVersions = MockProductVersionRepository() given(productVersions).listInAppPurchaseVersions(iapId: .any).willReturn([ ProductVersion(id: "iv-1", productId: "iap-1", kind: .inAppPurchase, version: 1, state: .prepareForSubmission), ]) let planner = SubmissionPlanner(iapRepo: iaps, groupRepo: groups, - subscriptionRepo: MockSubscriptions(), productVersionRepo: productVersions) + subscriptionRepo: MockSubscriptionRepository(), productVersionRepo: productVersions) let output = try await VersionsSubmit.parse(["--version-id", "v-1", "--dry-run"]).executeWithProducts( submissionRepo: MockReviewSubmissions(), versionRepo: versionRepo, planner: planner, affordanceMode: .rest @@ -1233,7 +1233,7 @@ struct RESTRoutesTests { // MARK: - App pricing @Test func `app price points link to setting the app's price over REST`() async throws { - let mockRepo = MockAppPrices() + let mockRepo = MockPricingRepository() given(mockRepo).listPricePoints(appId: .any, territory: .any).willReturn([ AppPricePoint(id: "pp-1", appId: "app-1", territory: "USA", customerPrice: "0.0", proceeds: "0.0"), ]) @@ -1249,7 +1249,7 @@ struct RESTRoutesTests { // MARK: - App availability @Test func `app availability links to itself over REST`() async throws { - let repo = MockAppAvailabilities() + let repo = MockAppAvailabilityRepository() given(repo).getAppAvailability(appId: .any).willReturn( AppAvailability(id: "avail-1", appId: "app-42", isAvailableInNewTerritories: true, territories: []) ) @@ -1264,7 +1264,7 @@ struct RESTRoutesTests { // MARK: - Performance overview @Test func `should link the performance overview to itself, app metrics and builds over REST`() async throws { - let repo = MockPerfOverviews() + let repo = MockPerfOverviewRepository() given(repo).getOverview(appId: .any, deviceType: .any).willReturn( PerformanceOverview(appId: "1234567890") ) @@ -1281,7 +1281,7 @@ struct RESTRoutesTests { // MARK: - Performance metrics & diagnostics @Test func `should link an app's metrics to the app's perf-metrics over REST`() async throws { - let repo = MockPerfMetrics() + let repo = MockPerfMetricsRepository() given(repo).listAppMetrics(appId: .any, metricType: .any).willReturn([ PerformanceMetric( id: "app-1-LAUNCH-launchTime", parentId: "app-1", parentType: .app, @@ -1314,7 +1314,7 @@ struct RESTRoutesTests { } @Test func `should link a build's metrics to the build's perf-metrics over REST`() async throws { - let repo = MockPerfMetrics() + let repo = MockPerfMetricsRepository() given(repo).listBuildMetrics(buildId: .any, metricType: .any).willReturn([ PerformanceMetric( id: "build-1-HANG-hangRate", parentId: "build-1", parentType: .build, @@ -1347,7 +1347,7 @@ struct RESTRoutesTests { } @Test func `should link a diagnostic signature to its logs and its build's diagnostics over REST`() async throws { - let repo = MockDiagnostics() + let repo = MockDiagnosticsRepository() given(repo).listSignatures(buildId: .any, diagnosticType: .any).willReturn([ DiagnosticSignatureInfo( id: "sig-1", buildId: "build-1", diagnosticType: .hangs, @@ -1384,7 +1384,7 @@ struct RESTRoutesTests { } @Test func `should link a diagnostic log back to its signature's logs over REST`() async throws { - let repo = MockDiagnostics() + let repo = MockDiagnosticsRepository() given(repo).listLogs(signatureId: .any).willReturn([ DiagnosticLogEntry(id: "sig-1-0-0", signatureId: "sig-1", event: "hang"), ]) @@ -1414,7 +1414,7 @@ struct RESTRoutesTests { // MARK: - Game Center @Test func `should link a game's detail, achievements, leaderboards and blocked players over REST`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).getDetail(appId: .any) .willReturn(GameCenterDetail(id: "gc-1", appId: "app-1", isArcadeEnabled: false)) @@ -1453,7 +1453,7 @@ struct RESTRoutesTests { } @Test func `should link a leaderboard's siblings, delete and score moderation over REST`() async throws { - let mockRepo = MockGameCenter() + let mockRepo = MockGameCenterRepository() given(mockRepo).listLeaderboards(gameCenterDetailId: .any).willReturn([ GameCenterLeaderboard(id: "lb-1", gameCenterDetailId: "gc-1", referenceName: "All Time High", vendorIdentifier: "all_time_high", scoreSortType: .desc, @@ -1495,7 +1495,7 @@ struct RESTRoutesTests { } @Test func `should link block, block player and the score list for a visible score over REST`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).listScoreModerations(leaderboardId: .any, blockedOnly: .any).willReturn([ GameCenterScoreModeration(id: "mod-1", leaderboardId: "lb-1", rank: "1", score: "9999", submittedDate: nil, isBlocked: false, isPreReleased: false, context: nil, @@ -1542,7 +1542,7 @@ struct RESTRoutesTests { } @Test func `should link unblock for a blocked score over REST`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).updateScoreModeration(id: .any, isBlocked: .any).willReturn( GameCenterScoreModeration(id: "mod-1", leaderboardId: nil, rank: nil, score: nil, submittedDate: nil, isBlocked: true, isPreReleased: false, context: nil, @@ -1576,7 +1576,7 @@ struct RESTRoutesTests { } @Test func `should link unblock and the blocked list for a blocked player over REST`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).listBlockedPlayers(gameCenterDetailId: .any).willReturn([ GameCenterPlayer(id: "player-1", gameCenterDetailId: "gc-1", nickname: nil, bundleId: nil, isBlocked: true), ]) @@ -1608,7 +1608,7 @@ struct RESTRoutesTests { } @Test func `should link block for an unblocked player over REST`() async throws { - let mockRepo = MockGameCenterModeration() + let mockRepo = MockGameCenterModerationRepository() given(mockRepo).updatePlayer(id: .any, isBlocked: .any).willReturn( GameCenterPlayer(id: "player-1", gameCenterDetailId: nil, nickname: nil, bundleId: nil, isBlocked: false) ) @@ -1637,7 +1637,7 @@ struct RESTRoutesTests { // MARK: - App Asset Library @Test func `should link the asset library to its images, videos, upload and placement groups over REST`() async throws { - let repo = MockAssetLibraries() + let repo = MockAssetLibraryRepository() given(repo).getAssetLibrary(appId: .any).willReturn(AppAssetLibrary(id: "lib-1", appId: "app-1")) let output = try await AssetLibraryGet.parse(["--app-id", "app-1"]) @@ -1647,7 +1647,7 @@ struct RESTRoutesTests { } @Test func `should link a library image to its placements and deletion over REST`() async throws { - let repo = MockLibraryImages() + let repo = MockLibraryImageRepository() given(repo).listImages(libraryId: .any, imageId: .any, state: .any, category: .any).willReturn([ LibraryImage(id: "img-1", libraryId: "lib-1", fileName: "home.png", fileSize: 1, category: .appScreenshotsAndPreviews, state: .inReview), ]) @@ -1659,7 +1659,7 @@ struct RESTRoutesTests { } @Test func `should link a placement to deletion and reordering its group over REST`() async throws { - let repo = MockAssetPlacements() + let repo = MockAssetPlacementRepository() given(repo).listPlacements(surface: .any, localizationId: .any, placementType: .any, placementGroup: .any).willReturn([ AssetPlacement(id: "pl-1", surface: .appStoreVersionLocalization, localizationId: "loc-1", mediaType: .image, assetId: "img-1", placementType: .appScreenshot, placementGroup: "IPHONE_67", position: 1, state: .parentPrepareForSubmission), @@ -1672,7 +1672,7 @@ struct RESTRoutesTests { } @Test func `should link a version localization to its asset placements over REST`() async throws { - let repo = MockVersionLocalizations() + let repo = MockVersionLocalizationRepository() given(repo).listLocalizations(versionId: .any).willReturn([ AppStoreVersionLocalization(id: "loc-1", versionId: "v-1", locale: "en-US"), ]) @@ -1684,7 +1684,7 @@ struct RESTRoutesTests { } @Test func `should link a library video to its placements, archiving and deletion over REST`() async throws { - let repo = MockLibraryVideos() + let repo = MockLibraryVideoRepository() given(repo).listVideos(libraryId: .any, videoId: .any, state: .any, category: .any).willReturn([ LibraryVideo(id: "vid-1", libraryId: "lib-1", fileName: "p.mp4", fileSize: 1, category: .appScreenshotsAndPreviews, state: .approved), ]) @@ -1696,7 +1696,7 @@ struct RESTRoutesTests { } @Test func `should link a treatment localization's placements to reordering under the treatment localization over REST`() async throws { - let repo = MockAssetPlacements() + let repo = MockAssetPlacementRepository() given(repo).listPlacements(surface: .any, localizationId: .any, placementType: .any, placementGroup: .any).willReturn([ AssetPlacement(id: "pl-1", surface: .experimentTreatmentLocalization, localizationId: "tl-1", mediaType: .image, assetId: "img-1", placementType: .appScreenshot, placementGroup: "IPHONE_67", position: 1, state: .parentPrepareForSubmission), diff --git a/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift b/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift index 087831b0..1481b692 100644 --- a/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/SubscriptionsControllerTests.swift @@ -7,8 +7,8 @@ import Testing struct SubscriptionsControllerTests { /// Stubs App Store Connect so the saved subscription echoes the attributes it was sent. - private func echoingRepo() -> MockSubscriptions { - let mockRepo = MockSubscriptions() + private func echoingRepo() -> MockSubscriptionRepository { + let mockRepo = MockSubscriptionRepository() given(mockRepo).updateSubscription( subscriptionId: .any, name: .any, isFamilySharable: .any, groupLevel: .any, subscriptionPeriod: .any, reviewNote: .any, multiSeatStatus: .any, marketSettings: .any diff --git a/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift b/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift index 9fe71a4f..0058c866 100644 --- a/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift +++ b/Tests/ASCCommandTests/Commands/WinBackOffers/WinBackOffersTests.swift @@ -18,7 +18,7 @@ private func makeOffer(id: String = "wb-1", subscriptionId: String = "sub-1") -> struct WinBackOffersListTests { @Test func `lists win-back offers with affordances`() async throws { - let mockRepo = MockWinBackOffers() + let mockRepo = MockWinBackOfferRepository() given(mockRepo).listWinBackOffers(subscriptionId: .any).willReturn([makeOffer()]) let cmd = try WinBackOffersList.parse(["--subscription-id", "sub-1", "--pretty"]) @@ -33,7 +33,7 @@ struct WinBackOffersListTests { struct WinBackOffersCreateTests { @Test func `create passes through eligibility, dates and prices`() async throws { - let mockRepo = MockWinBackOffers() + let mockRepo = MockWinBackOfferRepository() given(mockRepo).createWinBackOffer( subscriptionId: .any, referenceName: .any, offerId: .any, duration: .any, offerMode: .any, periodCount: .any, @@ -84,7 +84,7 @@ struct WinBackOffersCreateTests { } @Test func `throws when priority invalid`() async throws { - let mockRepo = MockWinBackOffers() + let mockRepo = MockWinBackOfferRepository() let cmd = try WinBackOffersCreate.parse([ "--subscription-id", "sub-1", "--reference-name", "X", @@ -108,7 +108,7 @@ struct WinBackOffersCreateTests { struct WinBackOffersUpdateTests { @Test func `update passes through optional fields`() async throws { - let mockRepo = MockWinBackOffers() + let mockRepo = MockWinBackOfferRepository() given(mockRepo).updateWinBackOffer( offerId: .any, startDate: .any, endDate: .any, priority: .any, promotionIntent: .any, @@ -143,7 +143,7 @@ struct WinBackOffersUpdateTests { struct WinBackOffersDeleteTests { @Test func `delete calls repo with offer id`() async throws { - let mockRepo = MockWinBackOffers() + let mockRepo = MockWinBackOfferRepository() given(mockRepo).deleteWinBackOffer(offerId: .any).willReturn(()) let cmd = try WinBackOffersDelete.parse(["--offer-id", "wb-1"]) @@ -157,7 +157,7 @@ struct WinBackOffersDeleteTests { struct WinBackOffersPricesListTests { @Test func `lists prices with affordances`() async throws { - let mockRepo = MockWinBackOffers() + let mockRepo = MockWinBackOfferRepository() given(mockRepo).listPrices(offerId: .any).willReturn([ WinBackOfferPrice(id: "p-1", offerId: "wb-1", territory: "USA", subscriptionPricePointId: "spp-1") ]) diff --git a/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift b/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift index 9b1ecd8c..b3721ac9 100644 --- a/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift +++ b/Tests/ASCCommandTests/Commands/XcodeCloud/XcodeCloudCommandTests.swift @@ -7,7 +7,7 @@ import Testing struct XcodeCloudProductsListTests { @Test func `listed products include app id and affordances`() async throws { - let mockRepo = MockXcodeCloudProducts() + let mockRepo = MockXcodeCloudProductRepository() given(mockRepo).listProducts(appId: .any).willReturn([ XcodeCloudProduct(id: "prod-1", appId: "app-42", name: "My App CI", productType: .app), ]) @@ -38,7 +38,7 @@ struct XcodeCloudProductsListTests { struct XcodeCloudWorkflowsListTests { @Test func `listed workflows include product id and affordances`() async throws { - let mockRepo = MockXcodeCloudWorkflows() + let mockRepo = MockXcodeCloudWorkflowRepository() given(mockRepo).listWorkflows(productId: .value("prod-1")).willReturn([ XcodeCloudWorkflow(id: "wf-1", productId: "prod-1", name: "CI Build", isEnabled: true, isLockedForEditing: false), ]) @@ -67,7 +67,7 @@ struct XcodeCloudWorkflowsListTests { } @Test func `disabled workflow omits startBuild affordance`() async throws { - let mockRepo = MockXcodeCloudWorkflows() + let mockRepo = MockXcodeCloudWorkflowRepository() given(mockRepo).listWorkflows(productId: .value("prod-1")).willReturn([ XcodeCloudWorkflow(id: "wf-2", productId: "prod-1", name: "Disabled CI", isEnabled: false, isLockedForEditing: false), ]) @@ -99,7 +99,7 @@ struct XcodeCloudWorkflowsListTests { struct XcodeCloudBuildsListTests { @Test func `listed build runs include workflow id and affordances`() async throws { - let mockRepo = MockXcodeCloudBuildRuns() + let mockRepo = MockXcodeCloudBuildRunRepository() given(mockRepo).listBuildRuns(workflowId: .value("wf-1")).willReturn([ XcodeCloudBuildRun( id: "run-1", workflowId: "wf-1", number: 5, @@ -137,7 +137,7 @@ struct XcodeCloudBuildsListTests { struct XcodeCloudBuildsGetTests { @Test func `get build run returns single build run with affordances`() async throws { - let mockRepo = MockXcodeCloudBuildRuns() + let mockRepo = MockXcodeCloudBuildRunRepository() given(mockRepo).getBuildRun(id: .value("run-99")).willReturn( XcodeCloudBuildRun( id: "run-99", workflowId: "wf-1", number: 12, @@ -174,7 +174,7 @@ struct XcodeCloudBuildsGetTests { struct XcodeCloudBuildsStartTests { @Test func `start build returns new build run with affordances`() async throws { - let mockRepo = MockXcodeCloudBuildRuns() + let mockRepo = MockXcodeCloudBuildRunRepository() given(mockRepo).startBuildRun(workflowId: .value("wf-1"), clean: .value(false)).willReturn( XcodeCloudBuildRun( id: "run-100", workflowId: "wf-1", number: nil, @@ -206,7 +206,7 @@ struct XcodeCloudBuildsStartTests { } @Test func `start build with clean flag calls repo with clean true`() async throws { - let mockRepo = MockXcodeCloudBuildRuns() + let mockRepo = MockXcodeCloudBuildRunRepository() given(mockRepo).startBuildRun(workflowId: .value("wf-1"), clean: .value(true)).willReturn( XcodeCloudBuildRun(id: "run-101", workflowId: "wf-1", executionProgress: .pending) ) diff --git a/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipsTests.swift b/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipsTests.swift rename to Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift index 830849e2..65905689 100644 --- a/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipsTests.swift +++ b/Tests/ASCKitTests/Apps/AppClips/Internal/SDKAppClipRepositoryTests.swift @@ -15,7 +15,7 @@ struct SDKAppClipRepositoryListAppClipsTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.listAppClips(appId: "app-99") #expect(result.count == 2) @@ -31,7 +31,7 @@ struct SDKAppClipRepositoryListAppClipsTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.listAppClips(appId: "app-1") #expect(result[0].bundleId == "com.example.clip") @@ -44,7 +44,7 @@ struct SDKAppClipRepositoryListAppClipsTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.listAppClips(appId: "app-1") #expect(result[0].bundleId == nil) @@ -64,7 +64,7 @@ struct SDKAppClipRepositoryListExperiencesTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.listExperiences(appClipId: "clip-42") #expect(result.count == 2) @@ -80,7 +80,7 @@ struct SDKAppClipRepositoryListExperiencesTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.listExperiences(appClipId: "clip-1") #expect(result[0].action == .open) @@ -97,7 +97,7 @@ struct SDKAppClipRepositoryCreateExperienceTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.createExperience(appClipId: "clip-42", action: .view) #expect(result.id == "exp-new") @@ -119,7 +119,7 @@ struct SDKAppClipRepositoryListLocalizationsTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.listLocalizations(experienceId: "exp-42") #expect(result.count == 2) @@ -139,7 +139,7 @@ struct SDKAppClipRepositoryListLocalizationsTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.listLocalizations(experienceId: "exp-1") #expect(result[0].locale == "fr-FR") @@ -161,7 +161,7 @@ struct SDKAppClipRepositoryCreateLocalizationTests { links: .init(this: "") )) - let repo = SDKAppClips(client: stub) + let repo = SDKAppClipRepository(client: stub) let result = try await repo.createLocalization(experienceId: "exp-42", locale: "en-US", subtitle: "Quick access") #expect(result.id == "loc-new") diff --git a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationsTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationsTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift index 569debe0..2d230ccc 100644 --- a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationsTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAgeRatingDeclarationRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAgeRatingDeclarationsTests { +struct SDKAgeRatingDeclarationRepositoryTests { // MARK: - getDeclaration @@ -15,7 +15,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-42") #expect(result.id == "decl-1") @@ -33,7 +33,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.isAdvertising == true) @@ -55,7 +55,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.violenceRealistic == .frequentOrIntense) @@ -73,7 +73,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.kidsAgeBand == .nineToEleven) @@ -90,7 +90,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.ageRatingOverride == .thirteenPlus) @@ -107,7 +107,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.koreaAgeRatingOverride == .twelvePlus) @@ -124,7 +124,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.koreaAgeRatingOverride == .all) @@ -141,7 +141,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.getDeclaration(appInfoId: "info-1") #expect(result.gracRatingClassificationNumber == "CC-OL-000000-000") @@ -164,7 +164,7 @@ struct SDKAgeRatingDeclarationsTests { update.isAdvertising = false update.violenceRealistic = .frequentOrIntense - let repo = SDKAgeRatingDeclarations(client: stub) + let repo = SDKAgeRatingDeclarationRepository(client: stub) let result = try await repo.updateDeclaration(id: "decl-1", update: update) #expect(result.id == "decl-1") @@ -189,7 +189,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let result = try await SDKAgeRatingDeclarations(client: stub).getDeclaration(appInfoId: "info-1") + let result = try await SDKAgeRatingDeclarationRepository(client: stub).getDeclaration(appInfoId: "info-1") #expect(result.isSocialMedia == false) #expect(result.isSocialMediaAgeRestricted == true) @@ -203,7 +203,7 @@ struct SDKAgeRatingDeclarationsTests { links: .init(this: "") )) - let result = try await SDKAgeRatingDeclarations(client: stub).getDeclaration(appInfoId: "info-1") + let result = try await SDKAgeRatingDeclarationRepository(client: stub).getDeclaration(appInfoId: "info-1") #expect(result.isSocialMedia == nil) #expect(result.isSocialMediaAgeRestricted == nil) @@ -221,7 +221,7 @@ struct SDKAgeRatingDeclarationsTests { update.isSocialMediaAgeRestricted = true update.developerAgeRatingInfoUrl = "https://example.com/age" - _ = try await SDKAgeRatingDeclarations(client: stub).updateDeclaration(id: "decl-1", update: update) + _ = try await SDKAgeRatingDeclarationRepository(client: stub).updateDeclaration(id: "decl-1", update: update) let body = try #require(stub.requests.first?.body) let json = try #require(try JSONSerialization.jsonObject(with: Data(body.utf8)) as? [String: Any]) diff --git a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoriesTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoriesTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift index 1ad8f7d9..2cab012b 100644 --- a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoriesTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppCategoryRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppCategoriesTests { +struct SDKAppCategoryRepositoryTests { @Test func `listCategories returns top level and subcategories as flat list`() async throws { let stub = StubAPIClient() @@ -15,7 +15,7 @@ struct SDKAppCategoriesTests { links: .init(this: "") )) - let repo = SDKAppCategories(client: stub) + let repo = SDKAppCategoryRepository(client: stub) let result = try await repo.listCategories(platform: nil) #expect(result.count == 2) @@ -32,7 +32,7 @@ struct SDKAppCategoriesTests { links: .init(this: "") )) - let repo = SDKAppCategories(client: stub) + let repo = SDKAppCategoryRepository(client: stub) let result = try await repo.listCategories(platform: nil) #expect(result[0].platforms.contains("IOS")) @@ -53,7 +53,7 @@ struct SDKAppCategoriesTests { links: .init(this: "") )) - let repo = SDKAppCategories(client: stub) + let repo = SDKAppCategoryRepository(client: stub) let result = try await repo.listCategories(platform: nil) #expect(result[0].parentId == "6014") @@ -71,7 +71,7 @@ struct SDKAppCategoriesTests { links: .init(this: "") )) - let repo = SDKAppCategories(client: stub) + let repo = SDKAppCategoryRepository(client: stub) let result = try await repo.getCategory(id: "6014-action") #expect(result.id == "6014-action") @@ -89,7 +89,7 @@ struct SDKAppCategoriesTests { links: .init(this: "") )) - let repo = SDKAppCategories(client: stub) + let repo = SDKAppCategoryRepository(client: stub) let result = try await repo.listCategories(platform: nil) #expect(result[0].parentId == nil) diff --git a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfosTests.swift b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfosTests.swift rename to Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift index 69fc37d1..865b82f5 100644 --- a/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfosTests.swift +++ b/Tests/ASCKitTests/Apps/AppInfos/Internal/SDKAppInfoRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppInfosTests { +struct SDKAppInfoRepositoryTests { // MARK: - listAppInfos @@ -17,7 +17,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listAppInfos(appId: "app-99") #expect(result.count == 2) @@ -37,7 +37,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].appStoreAgeRating == "FOUR_PLUS") @@ -56,7 +56,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].appStoreState == "READY_FOR_SALE") @@ -83,7 +83,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].primaryCategoryId == "6014") @@ -101,7 +101,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].id == "info-abc") @@ -119,7 +119,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listLocalizations(appInfoId: "info-42") #expect(result.count == 2) @@ -139,7 +139,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listLocalizations(appInfoId: "info-1") #expect(result[0].locale == "fr-FR") @@ -160,7 +160,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.createLocalization(appInfoId: "info-42", locale: "en-US", name: "My App") #expect(result.id == "loc-new") @@ -183,7 +183,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.updateLocalization( id: "loc-1", name: "Updated App", subtitle: "New subtitle", privacyPolicyUrl: nil, privacyChoicesUrl: nil, privacyPolicyText: nil ) @@ -205,7 +205,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.updateLocalization(id: "loc-2", name: "Meine App", subtitle: nil, privacyPolicyUrl: nil, privacyChoicesUrl: nil, privacyPolicyText: nil) #expect(result.appInfoId == "") @@ -224,7 +224,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listAppInfos(appId: "app-1") #expect(result[0].primaryCategoryId == "6014") @@ -247,7 +247,7 @@ struct SDKAppInfosTests { links: .init(this: "") )) - let repo = SDKAppInfos(client: stub) + let repo = SDKAppInfoRepository(client: stub) let result = try await repo.listLocalizations(appInfoId: "info-1") #expect(result[0].privacyChoicesUrl == "https://example.com/choices") diff --git a/Tests/ASCKitTests/Apps/AppsTests.swift b/Tests/ASCKitTests/Apps/AppRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/AppsTests.swift rename to Tests/ASCKitTests/Apps/AppRepositoryTests.swift index 97d233b7..de043659 100644 --- a/Tests/ASCKitTests/Apps/AppsTests.swift +++ b/Tests/ASCKitTests/Apps/AppRepositoryTests.swift @@ -3,11 +3,11 @@ import Testing @testable import ASCKit @Suite -struct AppsTests { +struct AppRepositoryTests { @Test func `list apps returns paginated response`() async throws { - let mock = MockApps() + let mock = MockAppRepository() let apps = [ MockRepositoryFactory.makeApp(id: "1", name: "App One"), MockRepositoryFactory.makeApp(id: "2", name: "App Two"), @@ -24,7 +24,7 @@ struct AppsTests { @Test func `get app returns single app`() async throws { - let mock = MockApps() + let mock = MockAppRepository() let app = MockRepositoryFactory.makeApp(id: "42", name: "My App") given(mock).getApp(id: .value("42")).willReturn(app) @@ -36,7 +36,7 @@ struct AppsTests { @Test func `fetch app icon returns image asset when build has icon`() async throws { - let mock = MockApps() + let mock = MockAppRepository() let asset = MockRepositoryFactory.makeImageAsset(width: 1024, height: 1024) given(mock).fetchAppIcon(appId: .value("42")).willReturn(asset) @@ -48,7 +48,7 @@ struct AppsTests { @Test func `fetch app icon returns nil when no build has icon`() async throws { - let mock = MockApps() + let mock = MockAppRepository() given(mock).fetchAppIcon(appId: .any).willReturn(nil) let result = try await mock.fetchAppIcon(appId: "no-builds") @@ -57,7 +57,7 @@ struct AppsTests { @Test func `list apps with pagination cursor`() async throws { - let mock = MockApps() + let mock = MockAppRepository() let response = PaginatedResponse( data: [MockRepositoryFactory.makeApp()], nextCursor: "next-page-token", diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImagesTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift similarity index 97% rename from Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImagesTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift index 19a4acae..d5f0a446 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImagesTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Images/Internal/SDKLibraryImageRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKLibraryImagesTests { +struct SDKLibraryImageRepositoryTests { // MARK: - listImages @@ -142,8 +142,8 @@ struct SDKLibraryImagesTests { // MARK: - Fixtures - static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKLibraryImages { - SDKLibraryImages(client: stub, uploader: UploadOperationsExecutor(http: http)) + static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKLibraryImageRepository { + SDKLibraryImageRepository(client: stub, uploader: UploadOperationsExecutor(http: http)) } static func images(_ json: String) throws -> LibraryAssetsDocument { diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift index 649f4875..fdb7bfc1 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Import/ScreenshotImportExecuteTests.swift @@ -177,7 +177,7 @@ private struct Refused: LocalizedError { /// An asset library that keeps what it's sent. Images are processed after `readsUntilProcessed` /// reads; files named in `failing` fail processing with that reason. -private final class FakeLibrary: LibraryImages, @unchecked Sendable { +private final class FakeLibrary: LibraryImageRepository, @unchecked Sendable { private let lock = NSLock() private var stored: [LibraryImage] = [] private var reads: [String: Int] = [:] @@ -224,7 +224,7 @@ private final class FakeLibrary: LibraryImages, @unchecked Sendable { } /// Placements that apply what they're sent: create appends, delete removes, reorder reorders. -private final class FakePlacements: AssetPlacements, @unchecked Sendable { +private final class FakePlacements: AssetPlacementRepository, @unchecked Sendable { private let lock = NSLock() private var stored: [AssetPlacement] private var created = 0 diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibrariesTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibrariesTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift index 60268e66..2d8e4fcc 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibrariesTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Internal/SDKAssetLibraryRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAssetLibrariesTests { +struct SDKAssetLibraryRepositoryTests { // MARK: - getAssetLibrary @@ -15,7 +15,7 @@ struct SDKAssetLibrariesTests { links: .init(this: "") )) - let library = try await SDKAssetLibraries(client: stub).getAssetLibrary(appId: "app-42") + let library = try await SDKAssetLibraryRepository(client: stub).getAssetLibrary(appId: "app-42") #expect(library == ASCKit.AppAssetLibrary(id: "lib-1", appId: "app-42")) #expect(stub.lastPath == "/v1/apps/app-42/assetLibrary") @@ -27,7 +27,7 @@ struct SDKAssetLibrariesTests { let stub = StubAPIClient() stub.willReturn(try Self.refData(Self.catalog)) - let groups = try await SDKAssetLibraries(client: stub).listPlacementGroups(placementType: nil, feature: nil) + let groups = try await SDKAssetLibraryRepository(client: stub).listPlacementGroups(placementType: nil, feature: nil) #expect(groups == [ AssetPlacementGroup(id: "IPHONE_DYNAMIC_ISLAND_LARGE_PROFILE", placementType: .appScreenshot, @@ -49,7 +49,7 @@ struct SDKAssetLibrariesTests { let stub = StubAPIClient() stub.willReturn(try Self.refData(Self.catalog)) - let groups = try await SDKAssetLibraries(client: stub) + let groups = try await SDKAssetLibraryRepository(client: stub) .listPlacementGroups(placementType: .appScreenshot, feature: "CUSTOM_PRODUCT_PAGES") #expect(groups == [ @@ -63,7 +63,7 @@ struct SDKAssetLibrariesTests { let stub = StubAPIClient() stub.willReturn(try Self.refData(Self.catalog)) - _ = try await SDKAssetLibraries(client: stub) + _ = try await SDKAssetLibraryRepository(client: stub) .listPlacementGroups(placementType: .appScreenshot, feature: "APP_STORE_VERSIONS") #expect(stub.lastPath == "/v1/appAssetLibraryRefData") @@ -81,7 +81,7 @@ struct SDKAssetLibrariesTests { }}],"links":{"self":""}} """)) - let groups = try await SDKAssetLibraries(client: stub).listPlacementGroups(placementType: nil, feature: nil) + let groups = try await SDKAssetLibraryRepository(client: stub).listPlacementGroups(placementType: nil, feature: nil) #expect(groups == []) } diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementsTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementsTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift index e3dbc51c..e2211512 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementsTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Placements/Internal/SDKAssetPlacementRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAssetPlacementsTests { +struct SDKAssetPlacementRepositoryTests { // MARK: - listPlacements @@ -21,7 +21,7 @@ struct SDKAssetPlacementsTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacements(client: stub).listPlacements( + let placements = try await SDKAssetPlacementRepository(client: stub).listPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementType: nil, placementGroup: nil ) @@ -45,7 +45,7 @@ struct SDKAssetPlacementsTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacements(client: stub).listPlacements( + let placements = try await SDKAssetPlacementRepository(client: stub).listPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementType: nil, placementGroup: nil ) @@ -58,7 +58,7 @@ struct SDKAssetPlacementsTests { let stub = StubAPIClient() stub.willReturn(try Self.placements(#"{"data":[],"links":{"self":""}}"#)) - _ = try await SDKAssetPlacements(client: stub).listPlacements( + _ = try await SDKAssetPlacementRepository(client: stub).listPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementType: .appScreenshot, placementGroup: "IPHONE_DYNAMIC_ISLAND_LARGE_PROFILE" ) @@ -80,7 +80,7 @@ struct SDKAssetPlacementsTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacements(client: stub).listPlacements( + let placements = try await SDKAssetPlacementRepository(client: stub).listPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementType: nil, placementGroup: nil ) @@ -91,7 +91,7 @@ struct SDKAssetPlacementsTests { let stub = StubAPIClient() stub.willReturn(try Self.placements(#"{"data":[\#(Self.screenshot(id: "pl-1", group: "IPHONE_67", image: "img-1"))],"links":{"self":""}}"#)) - let placements = try await SDKAssetPlacements(client: stub).listPlacements( + let placements = try await SDKAssetPlacementRepository(client: stub).listPlacements( surface: .experimentTreatmentLocalization, localizationId: "tl-1", placementType: nil, placementGroup: nil ) @@ -110,7 +110,7 @@ struct SDKAssetPlacementsTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacements(client: stub).listAssetPlacements(mediaType: .video, assetId: "vid-1") + let placements = try await SDKAssetPlacementRepository(client: stub).listAssetPlacements(mediaType: .video, assetId: "vid-1") #expect(stub.lastPath == "/v1/appAssetLibraryVideos/vid-1/placements") #expect(placements == [ @@ -133,7 +133,7 @@ struct SDKAssetPlacementsTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacements(client: stub).listAssetPlacements(mediaType: .image, assetId: "img-7") + let placements = try await SDKAssetPlacementRepository(client: stub).listAssetPlacements(mediaType: .image, assetId: "img-7") #expect(placements == [ AssetPlacement(id: "pl-1", surface: .appStoreVersionLocalization, localizationId: "loc-1", mediaType: .image, @@ -161,7 +161,7 @@ struct SDKAssetPlacementsTests { """)) // When - let placements = try await SDKAssetPlacements(client: stub).listAssetPlacements(mediaType: .image, assetId: "img-7") + let placements = try await SDKAssetPlacementRepository(client: stub).listAssetPlacements(mediaType: .image, assetId: "img-7") // Then #expect(placements == [ @@ -180,7 +180,7 @@ struct SDKAssetPlacementsTests { "links":{"self":""}} """)) - let placement = try await SDKAssetPlacements(client: stub).createPlacement( + let placement = try await SDKAssetPlacementRepository(client: stub).createPlacement( surface: .appStoreVersionLocalization, localizationId: "loc-9", mediaType: .image, assetId: "img-1", placementType: .appScreenshot, placementGroup: "IPHONE_DYNAMIC_ISLAND_LARGE_PROFILE" ) @@ -202,7 +202,7 @@ struct SDKAssetPlacementsTests { "links":{"self":""}} """)) - _ = try await SDKAssetPlacements(client: stub).createPlacement( + _ = try await SDKAssetPlacementRepository(client: stub).createPlacement( surface: .experimentTreatmentLocalization, localizationId: "tl-1", mediaType: .video, assetId: "vid-1", placementType: .appPreview, placementGroup: "IPHONE_67" ) @@ -222,7 +222,7 @@ struct SDKAssetPlacementsTests { ],"links":{"self":""}} """)) - let placements = try await SDKAssetPlacements(client: stub).reorderPlacements( + let placements = try await SDKAssetPlacementRepository(client: stub).reorderPlacements( surface: .appStoreVersionLocalization, localizationId: "loc-9", placementGroup: "IPHONE_67", placementIds: ["pl-2", "pl-1"] ) @@ -237,7 +237,7 @@ struct SDKAssetPlacementsTests { @Test func `should delete the placement`() async throws { let stub = StubAPIClient() - try await SDKAssetPlacements(client: stub).deletePlacement(placementId: "pl-1") + try await SDKAssetPlacementRepository(client: stub).deletePlacement(placementId: "pl-1") #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["DELETE /v1/appAssetLibraryPlacements/pl-1"]) } diff --git a/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideosTests.swift b/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift similarity index 96% rename from Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideosTests.swift rename to Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift index 726fbbea..545c2da3 100644 --- a/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideosTests.swift +++ b/Tests/ASCKitTests/Apps/AssetLibrary/Videos/Internal/SDKLibraryVideoRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKLibraryVideosTests { +struct SDKLibraryVideoRepositoryTests { @Test func `should tie each video to the library it was listed under with its preview frame and processed video`() async throws { let stub = StubAPIClient() @@ -88,8 +88,8 @@ struct SDKLibraryVideosTests { // MARK: - Fixtures - static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKLibraryVideos { - SDKLibraryVideos(client: stub, uploader: UploadOperationsExecutor(http: http)) + static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKLibraryVideoRepository { + SDKLibraryVideoRepository(client: stub, uploader: UploadOperationsExecutor(http: http)) } static func videos(_ json: String) throws -> LibraryAssetsDocument { diff --git a/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilitiesTests.swift b/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift similarity index 94% rename from Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilitiesTests.swift rename to Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift index a4b7ac5b..a4ceeab2 100644 --- a/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilitiesTests.swift +++ b/Tests/ASCKitTests/Apps/Availability/Internal/SDKAppAvailabilityRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppAvailabilitiesTests { +struct SDKAppAvailabilityRepositoryTests { @Test func `getAppAvailability injects appId and maps territory statuses from dedicated relationship`() async throws { let stub = StubAPIClient() @@ -43,7 +43,7 @@ struct SDKAppAvailabilitiesTests { links: .init(this: "") )) - let repo = SDKAppAvailabilities(client: stub) + let repo = SDKAppAvailabilityRepository(client: stub) let result = try await repo.getAppAvailability(appId: "app-99") #expect(result?.id == "avail-1") @@ -86,7 +86,7 @@ struct SDKAppAvailabilitiesTests { links: .init(this: "") )) - let repo = SDKAppAvailabilities(client: stub) + let repo = SDKAppAvailabilityRepository(client: stub) let result = try await repo.getAppAvailability(appId: "app-1") #expect(result?.territories[0].releaseDate == "2026-04-01") @@ -105,7 +105,7 @@ struct SDKAppAvailabilitiesTests { )) stub.willReturn(TerritoryAvailabilitiesResponse(data: [], links: .init(this: ""))) - let repo = SDKAppAvailabilities(client: stub) + let repo = SDKAppAvailabilityRepository(client: stub) let result = try await repo.getAppAvailability(appId: "app-1") #expect(result?.territories.isEmpty == true) @@ -131,7 +131,7 @@ struct SDKAppAvailabilitiesTests { )) stub.willReturn(TerritoryAvailabilitiesResponse(data: many, links: .init(this: ""))) - let repo = SDKAppAvailabilities(client: stub) + let repo = SDKAppAvailabilityRepository(client: stub) let result = try await repo.getAppAvailability(appId: "app-many") #expect(result?.territories.count == 175) @@ -146,7 +146,7 @@ struct SDKAppAvailabilitiesTests { detail: "There is no resource of type 'appAvailabilities' with id 'app-1'"), ]), nil) - let repo = SDKAppAvailabilities(client: stub) + let repo = SDKAppAvailabilityRepository(client: stub) let result = try await repo.getAppAvailability(appId: "app-1") #expect(result == nil) @@ -166,7 +166,7 @@ struct SDKAppAvailabilitiesTests { links: .init(this: "") )) - let repo = SDKAppAvailabilities(client: stub) + let repo = SDKAppAvailabilityRepository(client: stub) let result = try await repo.createAppAvailability( appId: "app-1", isAvailableInNewTerritories: true, territoryIds: ["USA", "JPN"] ) diff --git a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationsTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationsTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift index 9cab0cff..7cd1ff9e 100644 --- a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationsTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBetaBuildLocalizationRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBetaBuildLocalizationsTests { +struct SDKBetaBuildLocalizationRepositoryTests { @Test func `listBetaBuildLocalizations injects buildId into each localization`() async throws { let stub = StubAPIClient() @@ -12,7 +12,7 @@ struct SDKBetaBuildLocalizationsTests { links: .init(this: "") )) - let repo = SDKBetaBuildLocalizations(client: stub) + let repo = SDKBetaBuildLocalizationRepository(client: stub) let locs = try await repo.listBetaBuildLocalizations(buildId: "build-42") #expect(locs.count == 1) @@ -36,7 +36,7 @@ struct SDKBetaBuildLocalizationsTests { links: .init(this: "") )) - let repo = SDKBetaBuildLocalizations(client: stub) + let repo = SDKBetaBuildLocalizationRepository(client: stub) let result = try await repo.upsertBetaBuildLocalization(buildId: "build-42", locale: "en-US", whatsNew: "New notes") #expect(result.id == "bbl-1") @@ -58,7 +58,7 @@ struct SDKBetaBuildLocalizationsTests { links: .init(this: "") )) - let repo = SDKBetaBuildLocalizations(client: stub) + let repo = SDKBetaBuildLocalizationRepository(client: stub) let result = try await repo.upsertBetaBuildLocalization(buildId: "build-42", locale: "fr-FR", whatsNew: "Nouvelles fonctionnalités") #expect(result.id == "bbl-new") diff --git a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildsTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildsTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift index 70e5dd09..94668e72 100644 --- a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildsTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBuildsTests { +struct SDKBuildRepositoryTests { @Test func `listBuilds maps version and processingState`() async throws { let stub = StubAPIClient() @@ -18,7 +18,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) #expect(result.data[0].id == "build-1") @@ -47,7 +47,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) #expect(result.data[0].version == "1.2.0") @@ -68,7 +68,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) #expect(result.data[0].version == "42") @@ -93,7 +93,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.listBuilds(appId: nil, platform: nil, version: nil, limit: nil) #expect(result.data[0].processingState == domainState) @@ -112,7 +112,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.listBuilds(appId: "app-42", platform: nil, version: nil, limit: nil) #expect(result.data.count == 1) @@ -131,7 +131,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.getBuild(id: "build-99") #expect(result.id == "build-99") @@ -143,14 +143,14 @@ struct SDKBuildsTests { @Test func `addBetaGroups succeeds without error`() async throws { let stub = StubAPIClient() - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) try await repo.addBetaGroups(buildId: "build-1", betaGroupIds: ["bg-1", "bg-2"]) #expect(stub.voidRequestCalled) } @Test func `removeBetaGroups succeeds without error`() async throws { let stub = StubAPIClient() - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) try await repo.removeBetaGroups(buildId: "build-1", betaGroupIds: ["bg-1"]) #expect(stub.voidRequestCalled) } @@ -167,7 +167,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.getBuild(id: "build-1") #expect(result.usesNonExemptEncryption == false) @@ -183,7 +183,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.getBuild(id: "build-1") #expect(result.usesNonExemptEncryption == nil) @@ -200,7 +200,7 @@ struct SDKBuildsTests { links: .init(this: "") )) - let repo = SDKBuilds(client: stub) + let repo = SDKBuildRepository(client: stub) let result = try await repo.updateBuildEncryptionCompliance(buildId: "build-1", usesNonExemptEncryption: false) #expect(result.id == "build-1") diff --git a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadsTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadsTests.swift rename to Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift index e4c14778..610c343a 100644 --- a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadsTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBuildUploadsTests { +struct SDKBuildUploadRepositoryTests { @Test func `listBuildUploads injects appId into each upload`() async throws { let stub = StubAPIClient() @@ -14,7 +14,7 @@ struct SDKBuildUploadsTests { links: .init(this: "") )) - let repo = SDKBuildUploads(client: stub) + let repo = SDKBuildUploadRepository(client: stub) let uploads = try await repo.listBuildUploads(appId: "app-42") #expect(uploads.count == 1) @@ -29,7 +29,7 @@ struct SDKBuildUploadsTests { links: .init(this: "") )) - let repo = SDKBuildUploads(client: stub) + let repo = SDKBuildUploadRepository(client: stub) let uploads = try await repo.listBuildUploads(appId: "app-1") #expect(uploads[0].state == .complete) @@ -43,7 +43,7 @@ struct SDKBuildUploadsTests { links: .init(this: "") )) - let repo = SDKBuildUploads(client: stub) + let repo = SDKBuildUploadRepository(client: stub) let upload = try await repo.getBuildUpload(id: "up-99") #expect(upload.id == "up-99") @@ -54,7 +54,7 @@ struct SDKBuildUploadsTests { @Test func `deleteBuildUpload calls void request`() async throws { let stub = StubAPIClient() - let repo = SDKBuildUploads(client: stub) + let repo = SDKBuildUploadRepository(client: stub) try await repo.deleteBuildUpload(id: "up-1") @@ -73,7 +73,7 @@ struct SDKBuildUploadsTests { links: .init(this: "") )) - let repo = SDKBuildUploads(client: stub) + let repo = SDKBuildUploadRepository(client: stub) let upload = try await repo.getBuildUpload(id: "up-1") #expect(upload.state == .failed) @@ -92,7 +92,7 @@ struct SDKBuildUploadsTests { links: .init(this: "") )) - let repo = SDKBuildUploads(client: stub) + let repo = SDKBuildUploadRepository(client: stub) let upload = try await repo.getBuildUpload(id: "up-1") #expect(upload.errors.isEmpty) @@ -137,7 +137,7 @@ struct SDKBuildUploadsTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKBuildUploads(client: stub) + let repo = SDKBuildUploadRepository(client: stub) let result = try await repo.listBuildUploads(appId: "app-1") #expect(result.count == 75) diff --git a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift index 8a221d5b..587e9a71 100644 --- a/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Builds/Internal/SDKBuildUploadRepositoryUploadTests.swift @@ -18,7 +18,7 @@ struct SDKBuildUploadRepositoryUploadTests { try Self.file(#"{"data":{"type":"buildUploadFiles","id":"file-1","attributes":{"fileName":"MyApp.ipa","fileSize":7}},"links":{"self":""}}"#), ]) - let upload = try await SDKBuildUploads(client: stub).uploadBuild( + let upload = try await SDKBuildUploadRepository(client: stub).uploadBuild( appId: "app-1", version: "1.2.0", buildNumber: "42", platform: .iOS, fileURL: file ) @@ -40,7 +40,7 @@ struct SDKBuildUploadRepositoryUploadTests { http.enqueue(json: "", statusCode: 500) await #expect(throws: (any Error).self) { - try await SDKBuildUploads(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadBuild( + try await SDKBuildUploadRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadBuild( appId: "app-1", version: "1.2.0", buildNumber: "42", platform: .iOS, fileURL: file ) } @@ -56,7 +56,7 @@ struct SDKBuildUploadRepositoryUploadTests { http.enqueue(json: "", statusCode: 200) await #expect(throws: (any Error).self) { - _ = try await SDKBuildUploads(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadBuild( + _ = try await SDKBuildUploadRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadBuild( appId: "app-1", version: "1.2.0", buildNumber: "42", platform: .iOS, fileURL: file ) } diff --git a/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentsTests.swift b/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentsTests.swift rename to Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift index 873cdf6b..ec4638fa 100644 --- a/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentsTests.swift +++ b/Tests/ASCKitTests/Apps/Experiments/Internal/SDKExperimentRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKExperimentsTests { +struct SDKExperimentRepositoryTests { private func sdkExperiment( id: String = "exp-1", @@ -28,7 +28,7 @@ struct SDKExperimentsTests { links: .init(this: "") )) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let result = try await repo.listExperiments(appId: "app-99", state: nil, limit: nil) #expect(result.data.count == 2) @@ -46,7 +46,7 @@ struct SDKExperimentsTests { let stub = StubAPIClient() stub.willReturn(AppStoreVersionExperimentsV2Response(data: [], links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) _ = try await repo.listExperiments(appId: "app-1", state: .approved, limit: 5) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) @@ -61,7 +61,7 @@ struct SDKExperimentsTests { links: .init(this: "") )) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let result = try await repo.listExperiments(appId: "app-1", state: nil, limit: nil) #expect(result.data[0].startDate == "2025-09-01T00:00:00Z") @@ -74,7 +74,7 @@ struct SDKExperimentsTests { sdk.relationships?.app = .init(data: .init(type: .apps, id: "app-3")) stub.willReturn(AppStoreVersionExperimentV2Response(data: sdk, links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let exp = try await repo.getExperiment(experimentId: "exp-7") #expect(exp.id == "exp-7") @@ -86,7 +86,7 @@ struct SDKExperimentsTests { let stub = StubAPIClient() stub.willReturn(AppStoreVersionExperimentV2Response(data: sdkExperiment(id: "exp-new"), links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let exp = try await repo.createExperiment(appId: "app-1", name: "Icon test", platform: .iOS, trafficProportion: 30) #expect(exp.id == "exp-new") @@ -100,7 +100,7 @@ struct SDKExperimentsTests { sdk.relationships?.app = .init(data: .init(type: .apps, id: "app-1")) stub.willReturn(AppStoreVersionExperimentV2Response(data: sdk, links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let exp = try await repo.updateExperiment(experimentId: "exp-1", name: nil, trafficProportion: nil, isStarted: true) #expect(exp.appId == "app-1") @@ -114,7 +114,7 @@ struct SDKExperimentsTests { sdk.relationships?.app = .init(data: .init(type: .apps, id: "app-3")) stub.willReturn(AppStoreVersionExperimentV2Response(data: sdk, links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) _ = try await repo.getExperiment(experimentId: "exp-7") // Apple omits `relationships.app` from GET unless `include=app` is requested. @@ -128,7 +128,7 @@ struct SDKExperimentsTests { sdk.relationships?.app = .init(data: .init(type: .apps, id: "app-1")) stub.willReturn(AppStoreVersionExperimentV2Response(data: sdk, links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let exp = try await repo.updateExperiment(experimentId: "exp-1", name: "Renamed", trafficProportion: nil, isStarted: nil) // PATCH responses carry no relationships; the adapter follows up with GET ?include=app. @@ -139,7 +139,7 @@ struct SDKExperimentsTests { @Test func `deleteExperiment issues a void request`() async throws { let stub = StubAPIClient() - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) try await repo.deleteExperiment(experimentId: "exp-1") #expect(stub.voidRequestCalled == true) } @@ -160,7 +160,7 @@ struct SDKExperimentsTests { links: .init(this: "") )) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let result = try await repo.listTreatments(experimentId: "exp-5", limit: nil) #expect(result.data.count == 2) @@ -175,7 +175,7 @@ struct SDKExperimentsTests { let stub = StubAPIClient() stub.willReturn(AppStoreVersionExperimentTreatmentResponse(data: sdkTreatment(id: "trt-new"), links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let t = try await repo.createTreatment(experimentId: "exp-1", name: "Blue icon", appIconName: "AppIcon-Blue") #expect(t.id == "trt-new") @@ -189,7 +189,7 @@ struct SDKExperimentsTests { sdk.relationships = .init(appStoreVersionExperimentV2: .init(data: .init(type: .appStoreVersionExperiments, id: "exp-4"))) stub.willReturn(AppStoreVersionExperimentTreatmentResponse(data: sdk, links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let t = try await repo.updateTreatment(treatmentId: "trt-1", name: "Red icon", appIconName: nil) #expect(t.experimentId == "exp-4") @@ -202,7 +202,7 @@ struct SDKExperimentsTests { sdk.relationships = .init(appStoreVersionExperimentV2: .init(data: .init(type: .appStoreVersionExperiments, id: "exp-4"))) stub.willReturn(AppStoreVersionExperimentTreatmentResponse(data: sdk, links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let t = try await repo.updateTreatment(treatmentId: "trt-1", name: "Red icon", appIconName: nil) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) @@ -212,7 +212,7 @@ struct SDKExperimentsTests { @Test func `deleteTreatment issues a void request`() async throws { let stub = StubAPIClient() - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) try await repo.deleteTreatment(treatmentId: "trt-1") #expect(stub.voidRequestCalled == true) } @@ -233,7 +233,7 @@ struct SDKExperimentsTests { links: .init(this: "") )) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let locs = try await repo.listTreatmentLocalizations(treatmentId: "trt-3", limit: nil) #expect(locs.count == 2) @@ -246,7 +246,7 @@ struct SDKExperimentsTests { let stub = StubAPIClient() stub.willReturn(AppStoreVersionExperimentTreatmentLocalizationResponse(data: sdkLocalization(id: "loc-new", locale: "fr-FR"), links: .init(this: ""))) - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) let loc = try await repo.createTreatmentLocalization(treatmentId: "trt-1", locale: "fr-FR") #expect(loc.id == "loc-new") @@ -257,7 +257,7 @@ struct SDKExperimentsTests { @Test func `deleteTreatmentLocalization issues a void request`() async throws { let stub = StubAPIClient() - let repo = SDKExperiments(client: stub) + let repo = SDKExperimentRepository(client: stub) try await repo.deleteTreatmentLocalization(localizationId: "loc-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilitiesTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilitiesTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift index c3e40ec1..653ecfd7 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilitiesTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Availability/Internal/SDKInAppPurchaseAvailabilityRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseAvailabilitiesTests { +struct SDKInAppPurchaseAvailabilityRepositoryTests { @Test func `getAvailability composes attributes call with availableTerritories relationship call`() async throws { let stub = StubAPIClient() @@ -25,7 +25,7 @@ struct SDKInAppPurchaseAvailabilitiesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseAvailabilities(client: stub) + let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) let result = try await repo.getAvailability(iapId: "iap-99") #expect(result?.id == "avail-1") @@ -56,7 +56,7 @@ struct SDKInAppPurchaseAvailabilitiesTests { } stub.willReturn(TerritoriesResponse(data: manyTerritories, links: .init(this: ""))) - let repo = SDKInAppPurchaseAvailabilities(client: stub) + let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) let result = try await repo.getAvailability(iapId: "iap-big") #expect(result?.territories.count == 175) @@ -74,7 +74,7 @@ struct SDKInAppPurchaseAvailabilitiesTests { )) stub.willReturn(TerritoriesResponse(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchaseAvailabilities(client: stub) + let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) let result = try await repo.getAvailability(iapId: "iap-1") #expect(result?.territories.isEmpty == true) @@ -87,7 +87,7 @@ struct SDKInAppPurchaseAvailabilitiesTests { // treat nil as "no availability set yet" and seed sensible defaults. let stub = StubAPIClient() // No `willReturn(_:)` for InAppPurchaseAvailabilityResponse → request throws → nil. - let repo = SDKInAppPurchaseAvailabilities(client: stub) + let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) let result = try? await repo.getAvailability(iapId: "iap-fresh") #expect(result == nil) } @@ -109,7 +109,7 @@ struct SDKInAppPurchaseAvailabilitiesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseAvailabilities(client: stub) + let repo = SDKInAppPurchaseAvailabilityRepository(client: stub) let result = try await repo.createAvailability( iapId: "iap-42", isAvailableInNewTerritories: true, diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationsTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationsTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift index caad57e6..355b0a79 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationsTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseLocalizationRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseLocalizationsTests { +struct SDKInAppPurchaseLocalizationRepositoryTests { // MARK: - listLocalizations @@ -17,7 +17,7 @@ struct SDKInAppPurchaseLocalizationsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizations(client: stub) + let repo = SDKInAppPurchaseLocalizationRepository(client: stub) let result = try await repo.listLocalizations(iapId: "iap-42") #expect(result.count == 2) @@ -37,7 +37,7 @@ struct SDKInAppPurchaseLocalizationsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizations(client: stub) + let repo = SDKInAppPurchaseLocalizationRepository(client: stub) let result = try await repo.listLocalizations(iapId: "iap-1") #expect(result[0].locale == "fr-FR") @@ -54,7 +54,7 @@ struct SDKInAppPurchaseLocalizationsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizations(client: stub) + let repo = SDKInAppPurchaseLocalizationRepository(client: stub) let result = try await repo.listLocalizations(iapId: "iap-1") #expect(result[0].id == "loc-xyz") @@ -73,7 +73,7 @@ struct SDKInAppPurchaseLocalizationsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizations(client: stub) + let repo = SDKInAppPurchaseLocalizationRepository(client: stub) let result = try await repo.createLocalization( iapId: "iap-42", locale: "en-US", @@ -99,7 +99,7 @@ struct SDKInAppPurchaseLocalizationsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizations(client: stub) + let repo = SDKInAppPurchaseLocalizationRepository(client: stub) let result = try await repo.createLocalization( iapId: "iap-1", locale: "zh-Hans", @@ -123,7 +123,7 @@ struct SDKInAppPurchaseLocalizationsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseLocalizations(client: stub) + let repo = SDKInAppPurchaseLocalizationRepository(client: stub) let result = try await repo.updateLocalization( localizationId: "loc-1", name: "Renamed", description: "New desc" ) @@ -138,7 +138,7 @@ struct SDKInAppPurchaseLocalizationsTests { @Test func `deleteLocalization performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseLocalizations(client: stub) + let repo = SDKInAppPurchaseLocalizationRepository(client: stub) try await repo.deleteLocalization(localizationId: "loc-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePricesTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift similarity index 94% rename from Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePricesTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift index 92bf6ee1..26fe82ab 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePricesTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasePriceRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchasePricesTests { +struct SDKInAppPurchasePriceRepositoryTests { // MARK: - listPricePoints @@ -17,7 +17,7 @@ struct SDKInAppPurchasePricesTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.listPricePoints(iapId: "iap-99", territory: nil, limit: nil, cursor: nil) #expect(result.data.count == 2) @@ -37,7 +37,7 @@ struct SDKInAppPurchasePricesTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.listPricePoints(iapId: "iap-1", territory: nil, limit: nil, cursor: nil) #expect(result.data[0].territory == "USA") @@ -56,7 +56,7 @@ struct SDKInAppPurchasePricesTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.listPricePoints(iapId: "iap-1", territory: nil, limit: nil, cursor: nil) #expect(result.data[0].customerPrice == "0.99") @@ -71,7 +71,7 @@ struct SDKInAppPurchasePricesTests { meta: PagingInformation(paging: .init(total: 100, limit: 50, nextCursor: "next-page-token")) )) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.listPricePoints(iapId: "iap-1", territory: nil, limit: 50, cursor: nil) #expect(result.nextCursor == "next-page-token") @@ -87,7 +87,7 @@ struct SDKInAppPurchasePricesTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.setPriceSchedule(iapId: "iap-abc", baseTerritory: "USA", pricePointId: "pp-1") #expect(result.id == "sched-1") @@ -99,7 +99,7 @@ struct SDKInAppPurchasePricesTests { // back-reference so the server knows which IAP the price belongs to. Omitting either // produces a 4xx that surfaces as a 500 to web clients. @Test func `price schedule request mirrors iOS app shape`() throws { - let request = SDKInAppPurchasePrices.makePriceScheduleCreateRequest( + let request = SDKInAppPurchasePriceRepository.makePriceScheduleCreateRequest( iapId: "iap-abc", baseTerritory: "CHN", pricePointId: "pp-1" @@ -150,7 +150,7 @@ struct SDKInAppPurchasePricesTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.listEqualizations(pricePointId: "pp-USA", limit: nil) #expect(result.count == 2) @@ -169,7 +169,7 @@ struct SDKInAppPurchasePricesTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.listEqualizations(pricePointId: "pp-USA", limit: nil) // The equalizations endpoint is keyed by price point, not by IAP, so iapId is empty. @@ -200,7 +200,7 @@ struct SDKInAppPurchasePricesTests { // Step 3: equalizations empty. stub.willReturn(InAppPurchasePricePointsResponse(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.getPriceSchedule(iapId: "iap-7") #expect(result?.baseTerritory?.id == "USA") @@ -269,7 +269,7 @@ struct SDKInAppPurchasePricesTests { links: .init(this: "") )) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.getPriceSchedule(iapId: "iap-7") // territoryPrices contains USA (manual + equalized) deduped + JPN (equalized). @@ -317,7 +317,7 @@ struct SDKInAppPurchasePricesTests { ]) stub.willReturn(InAppPurchasePricePointsResponse(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchasePrices(client: stub) + let repo = SDKInAppPurchasePriceRepository(client: stub) let result = try await repo.getPriceSchedule(iapId: "iap-7") let prices = result?.territoryPrices ?? [] diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasesTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasesTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift index 20dca02f..bd30a09f 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchasesTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchasesTests { +struct SDKInAppPurchaseRepositoryTests { // MARK: - listInAppPurchases @@ -17,7 +17,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-99", limit: nil) #expect(result.data.count == 2) @@ -33,7 +33,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].id == "iap-abc") @@ -48,7 +48,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].type == .consumable) @@ -61,7 +61,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].type == .nonConsumable) @@ -74,7 +74,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].reviewNote == "Use code TEST") @@ -87,7 +87,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].reviewNote == nil) @@ -100,7 +100,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].state == .missingMetadata) @@ -121,7 +121,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data.allSatisfy { $0.isFirstTimeSubmission == true }) @@ -139,7 +139,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data.allSatisfy { $0.isFirstTimeSubmission == false }) @@ -157,7 +157,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) let newIAP = try #require(result.data.first { $0.id == "iap-new" }) @@ -169,7 +169,7 @@ struct SDKInAppPurchasesTests { let stub = StubAPIClient() stub.willReturn(InAppPurchasesV2Response(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data.isEmpty) @@ -194,7 +194,7 @@ struct SDKInAppPurchasesTests { ["iap-1": true, "iap-2": false] } - let repo = SDKInAppPurchases(client: stub, irisFlagsProvider: enricher) + let repo = SDKInAppPurchaseRepository(client: stub, irisFlagsProvider: enricher) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) let iap1 = try #require(result.data.first { $0.id == "iap-1" }) @@ -212,7 +212,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.listInAppPurchases(appId: "app-1", limit: nil) #expect(result.data[0].submitWithNextAppStoreVersion == false) @@ -231,7 +231,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.createInAppPurchase( appId: "app-42", referenceName: "Gold Coins", @@ -255,7 +255,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.createInAppPurchase( appId: "app-1", referenceName: "Subscription", @@ -268,7 +268,7 @@ struct SDKInAppPurchasesTests { @Test func `createInAppPurchase throws for freeSubscription type`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) await #expect(throws: (any Error).self) { try await repo.createInAppPurchase( appId: "app-1", @@ -291,7 +291,7 @@ struct SDKInAppPurchasesTests { links: .init(this: "") )) - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) let result = try await repo.updateInAppPurchase( iapId: "iap-1", referenceName: "Renamed", reviewNote: "Note", isFamilySharable: true ) @@ -305,7 +305,7 @@ struct SDKInAppPurchasesTests { @Test func `deleteInAppPurchase performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchases(client: stub) + let repo = SDKInAppPurchaseRepository(client: stub) try await repo.deleteInAppPurchase(iapId: "iap-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodesTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodesTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift index a266b5a9..c736d59a 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodesTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/OfferCodes/Internal/SDKInAppPurchaseOfferCodeRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseOfferCodesTests { +struct SDKInAppPurchaseOfferCodeRepositoryTests { // MARK: - listOfferCodes @@ -33,7 +33,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.listOfferCodes(iapId: "iap-99") #expect(result.count == 2) @@ -57,7 +57,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.listOfferCodes(iapId: "iap-1") #expect(result[0].id == "iap-oc-1") @@ -85,7 +85,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.listOfferCodes(iapId: "iap-1") #expect(result[0].productionCodeCount == 8_500) @@ -109,7 +109,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.createOfferCode( iapId: "iap-42", name: "LAUNCH", @@ -142,7 +142,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.updateOfferCode(offerCodeId: "iap-oc-1", isActive: false) #expect(result.id == "iap-oc-1") @@ -170,7 +170,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.listCustomCodes(offerCodeId: "iap-oc-10") #expect(result.count == 1) @@ -198,7 +198,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.createCustomCode( offerCodeId: "iap-oc-5", customCode: "WELCOME", @@ -228,7 +228,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.updateCustomCode(customCodeId: "iap-cc-1", isActive: false) #expect(result.id == "iap-cc-1") @@ -255,7 +255,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.listOneTimeUseCodes(offerCodeId: "iap-oc-20") #expect(result.count == 1) @@ -281,7 +281,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.createOneTimeUseCode( offerCodeId: "iap-oc-7", numberOfCodes: 750, @@ -310,7 +310,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.createOneTimeUseCode( offerCodeId: "iap-oc-7", numberOfCodes: 10, @@ -337,7 +337,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.updateOneTimeUseCode(oneTimeCodeId: "iap-otc-1", isActive: false) #expect(result.id == "iap-otc-1") @@ -360,7 +360,7 @@ struct SDKInAppPurchaseOfferCodesTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.listPrices(offerCodeId: "oc-77") #expect(result[0].offerCodeId == "oc-77") @@ -371,7 +371,7 @@ struct SDKInAppPurchaseOfferCodesTests { @Test func `fetchOneTimeUseCodeValues returns CSV string from SDK`() async throws { let stub = StubAPIClient() stub.willReturn("CODE1\nCODE2\nCODE3\n") - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.fetchOneTimeUseCodeValues(oneTimeCodeId: "otc-1") #expect(result == "CODE1\nCODE2\nCODE3\n") } @@ -395,7 +395,7 @@ struct SDKInAppPurchaseOfferCodesTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<100, nextCursor: "page-2"), page(100..<175, nextCursor: nil)]) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) let result = try await repo.listPrices(offerCodeId: "oc-1") #expect(result.count == 175) @@ -408,7 +408,7 @@ struct SDKInAppPurchaseOfferCodesTests { let stub = StubAPIClient() stub.willReturn(InAppPurchaseOfferPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKInAppPurchaseOfferCodes(client: stub) + let repo = SDKInAppPurchaseOfferCodeRepository(client: stub) _ = try await repo.listPrices(offerCodeId: "oc-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssetsTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssetsTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift index a885de52..4ceb6ace 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewAssetsTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Review/Internal/SDKInAppPurchaseReviewRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseReviewAssetsTests { +struct SDKInAppPurchaseReviewRepositoryTests { // MARK: - listImages @@ -23,7 +23,7 @@ struct SDKInAppPurchaseReviewAssetsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewAssets(client: stub) + let repo = SDKInAppPurchaseReviewRepository(client: stub) let result = try await repo.listImages(iapId: "iap-77") #expect(result.count == 2) @@ -42,7 +42,7 @@ struct SDKInAppPurchaseReviewAssetsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewAssets(client: stub) + let repo = SDKInAppPurchaseReviewRepository(client: stub) let result = try await repo.listImages(iapId: "iap-1") #expect(result[0].fileName == "promo.png") @@ -68,7 +68,7 @@ struct SDKInAppPurchaseReviewAssetsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewAssets(client: stub) + let repo = SDKInAppPurchaseReviewRepository(client: stub) let result = try await repo.listImages(iapId: "iap-1") #expect(result[0].imageAsset == nil) @@ -92,7 +92,7 @@ struct SDKInAppPurchaseReviewAssetsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewAssets(client: stub) + let repo = SDKInAppPurchaseReviewRepository(client: stub) let result = try await repo.listImages(iapId: "iap-1") #expect(result[0].imageAsset == nil) @@ -116,7 +116,7 @@ struct SDKInAppPurchaseReviewAssetsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseReviewAssets(client: stub) + let repo = SDKInAppPurchaseReviewRepository(client: stub) let result = try await repo.listImages(iapId: "iap-1") #expect(result[0].imageAsset?.templateUrl == "https://cdn/{w}x{h}bb.{f}") @@ -128,14 +128,14 @@ struct SDKInAppPurchaseReviewAssetsTests { @Test func `deleteReviewScreenshot performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseReviewAssets(client: stub) + let repo = SDKInAppPurchaseReviewRepository(client: stub) try await repo.deleteReviewScreenshot(screenshotId: "rs-1") #expect(stub.voidRequestCalled == true) } @Test func `deleteImage performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseReviewAssets(client: stub) + let repo = SDKInAppPurchaseReviewRepository(client: stub) try await repo.deleteImage(imageId: "img-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Internal/SDKAppsTests.swift b/Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/Internal/SDKAppsTests.swift rename to Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift index 44fbb307..8022e9bc 100644 --- a/Tests/ASCKitTests/Apps/Internal/SDKAppsTests.swift +++ b/Tests/ASCKitTests/Apps/Internal/SDKAppRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppsTests { +struct SDKAppRepositoryTests { @Test func `getApp maps single app from SDK response`() async throws { let stub = StubAPIClient() @@ -16,7 +16,7 @@ struct SDKAppsTests { links: .init(this: "") )) - let repo = SDKApps(client: stub) + let repo = SDKAppRepository(client: stub) let result = try await repo.getApp(id: "app-99") #expect(result.id == "app-99") @@ -53,7 +53,7 @@ struct SDKAppsTests { links: .init(this: "") )) - let repo = SDKApps(client: stub) + let repo = SDKAppRepository(client: stub) let icon = try await repo.fetchAppIcon(appId: "app-1") #expect(icon?.templateUrl == "https://cdn.example.com/a/{w}x{h}bb.{f}") @@ -76,7 +76,7 @@ struct SDKAppsTests { links: .init(this: "") )) - let repo = SDKApps(client: stub) + let repo = SDKAppRepository(client: stub) let icon = try await repo.fetchAppIcon(appId: "app-1") #expect(icon == nil) @@ -95,7 +95,7 @@ struct SDKAppsTests { links: .init(this: "") )) - let repo = SDKApps(client: stub) + let repo = SDKAppRepository(client: stub) let result = try await repo.listApps(limit: nil) #expect(result.data[0].id == "app-1") diff --git a/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift index 63c56e74..e4d3e03b 100644 --- a/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKDiagnosticsRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKDiagnosticsTests { +struct SDKDiagnosticsRepositoryTests { private func makeSDKSignature( id: String = "sig-1", @@ -31,7 +31,7 @@ struct SDKDiagnosticsTests { links: .init(this: "") )) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result.count == 1) @@ -53,7 +53,7 @@ struct SDKDiagnosticsTests { links: .init(this: "") )) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-99", diagnosticType: nil) #expect(result.allSatisfy { $0.buildId == "build-99" }) @@ -66,7 +66,7 @@ struct SDKDiagnosticsTests { links: .init(this: "") )) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result[0].insightDirection == nil) @@ -79,7 +79,7 @@ struct SDKDiagnosticsTests { links: .init(this: "") )) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: .diskWrites) #expect(result[0].diagnosticType == .diskWrites) @@ -92,7 +92,7 @@ struct SDKDiagnosticsTests { links: .init(this: "") )) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: .launches) #expect(result[0].diagnosticType == .launches) @@ -105,7 +105,7 @@ struct SDKDiagnosticsTests { links: .init(this: "") )) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result[0].insightDirection == "DOWN") @@ -118,7 +118,7 @@ struct SDKDiagnosticsTests { links: .init(this: "") )) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result[0].insightDirection == "UNDEFINED") @@ -133,7 +133,7 @@ struct SDKDiagnosticsTests { ) stub.willReturn(DiagnosticSignaturesResponse(data: [sig], links: .init(this: ""))) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result[0].diagnosticType == .hangs) @@ -177,7 +177,7 @@ struct SDKDiagnosticsTests { ) stub.willReturn(logs) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listLogs(signatureId: "sig-1") #expect(result[0].callStackSummary == "main > UIApplicationMain > layoutSubviews") @@ -199,7 +199,7 @@ struct SDKDiagnosticsTests { ) stub.willReturn(logs) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listLogs(signatureId: "sig-1") #expect(result[0].callStackSummary == nil) @@ -234,7 +234,7 @@ struct SDKDiagnosticsTests { ) stub.willReturn(logs) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listLogs(signatureId: "sig-1") #expect(result.count == 1) @@ -251,7 +251,7 @@ struct SDKDiagnosticsTests { let stub = StubAPIClient() stub.willReturn(DiagnosticLogs(productData: nil, version: "1.0")) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listLogs(signatureId: "sig-1") #expect(result.isEmpty) @@ -268,7 +268,7 @@ struct SDKDiagnosticsTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKDiagnostics(client: stub) + let repo = SDKDiagnosticsRepository(client: stub) let result = try await repo.listSignatures(buildId: "build-1", diagnosticType: nil) #expect(result.count == 75) diff --git a/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift index 591d5656..a1c544d0 100644 --- a/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfMetricsRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKPerfMetricsTests { +struct SDKPerfMetricsRepositoryTests { private func makeXcodeMetrics( platform: String = "IOS", @@ -49,7 +49,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics()) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.count == 1) @@ -68,7 +68,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics()) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-42", metricType: nil) #expect(result.allSatisfy { $0.parentId == "app-42" }) @@ -79,7 +79,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics()) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listBuildMetrics(buildId: "build-7", metricType: nil) #expect(result.allSatisfy { $0.parentId == "build-7" }) @@ -93,7 +93,7 @@ struct SDKPerfMetricsTests { metricIdentifier: "peakMemory" )) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result[0].id == "app-1-MEMORY-peakMemory") @@ -103,7 +103,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .hang, metricIdentifier: "hangRate")) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: .hang) #expect(result.count == 1) @@ -114,7 +114,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .disk, metricIdentifier: "diskWrites")) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listBuildMetrics(buildId: "build-1", metricType: .disk) #expect(result.count == 1) @@ -131,7 +131,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: sdkCategory, metricIdentifier: "test")) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result[0].category == domainCategory) @@ -160,7 +160,7 @@ struct SDKPerfMetricsTests { ) stub.willReturn(metrics) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.count == 1) @@ -183,7 +183,7 @@ struct SDKPerfMetricsTests { ) stub.willReturn(metrics) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.isEmpty) @@ -207,7 +207,7 @@ struct SDKPerfMetricsTests { ) stub.willReturn(metrics) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.count == 1) @@ -220,7 +220,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(XcodeMetrics(version: "1.0", insights: nil, productData: nil)) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.isEmpty) @@ -230,7 +230,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .storage, metricIdentifier: "storageUsed")) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) let result = try await repo.listAppMetrics(appId: "app-1", metricType: nil) #expect(result.map(\.category) == [.storage]) @@ -240,7 +240,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .storage, metricIdentifier: "storageUsed")) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) _ = try await repo.listAppMetrics(appId: "app-1", metricType: .storage) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) @@ -251,7 +251,7 @@ struct SDKPerfMetricsTests { let stub = StubAPIClient() stub.willReturn(makeXcodeMetrics(categoryIdentifier: .storage, metricIdentifier: "storageUsed")) - let repo = SDKPerfMetrics(client: stub) + let repo = SDKPerfMetricsRepository(client: stub) _ = try await repo.listBuildMetrics(buildId: "build-1", metricType: .storage) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewsTests.swift b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift similarity index 97% rename from Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewsTests.swift rename to Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift index 0ed8d6cf..42a96011 100644 --- a/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewsTests.swift +++ b/Tests/ASCKitTests/Apps/Performance/Internal/SDKPerfOverviewRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKPerfOverviewsTests { +struct SDKPerfOverviewRepositoryTests { /// A real `GET /v1/apps/{id}/performanceOverviews` body for an app without data (redacted). private let emptyOverviewJSON = """ @@ -60,10 +60,10 @@ struct SDKPerfOverviewsTests { } """ - private func makeRepo(json: String) -> SDKPerfOverviews { + private func makeRepo(json: String) -> SDKPerfOverviewRepository { let stub = StubAPIClient() stub.willReturn(Data(json.utf8)) - return SDKPerfOverviews(client: stub) + return SDKPerfOverviewRepository(client: stub) } @Test func `should show an empty overview when App Store Connect has no performance data for the app`() async throws { diff --git a/Tests/ASCKitTests/Apps/Pricing/Internal/SDKAppPricesTests.swift b/Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/Pricing/Internal/SDKAppPricesTests.swift rename to Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift index 611c813b..3437e746 100644 --- a/Tests/ASCKitTests/Apps/Pricing/Internal/SDKAppPricesTests.swift +++ b/Tests/ASCKitTests/Apps/Pricing/Internal/SDKPricingRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppPricesTests { +struct SDKPricingRepositoryTests { @Test func `hasPricing returns true when price schedule exists`() async throws { let stub = StubAPIClient() @@ -16,7 +16,7 @@ struct SDKAppPricesTests { links: .init(this: "") )) - let repo = SDKAppPrices(client: stub) + let repo = SDKPricingRepository(client: stub) let result = try await repo.hasPricing(appId: "app-1") #expect(result == true) } @@ -24,7 +24,7 @@ struct SDKAppPricesTests { @Test func `hasPricing returns false when request throws`() async throws { let stub = ThrowingStubAPIClient() - let repo = SDKAppPrices(client: stub) + let repo = SDKPricingRepository(client: stub) let result = try await repo.hasPricing(appId: "app-no-pricing") #expect(result == false) } @@ -53,7 +53,7 @@ private final class ThrowingStubAPIClient: APIClient, @unchecked Sendable { let stub = StubAPIClient() stub.willReturnPages([page(0..<200, nextCursor: "page-2"), page(200..<250, nextCursor: nil)]) - let repo = SDKAppPrices(client: stub) + let repo = SDKPricingRepository(client: stub) let points = try await repo.listPricePoints(appId: "app-1", territory: "USA") #expect(points.count == 250) @@ -70,7 +70,7 @@ private final class ThrowingStubAPIClient: APIClient, @unchecked Sendable { data: .init(type: .appPriceSchedules, id: "sched-1"), links: .init(this: "") )) - let repo = SDKAppPrices(client: stub) + let repo = SDKPricingRepository(client: stub) let schedule = try await repo.setPriceSchedule(appId: "app-1", baseTerritory: "USA", pricePointId: "pp-9") #expect(schedule == ASCKit.AppPriceSchedule(id: "sched-1", appId: "app-1", baseTerritory: "USA")) diff --git a/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionsTests.swift b/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionsTests.swift rename to Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift index 6a5f8f27..2862958f 100644 --- a/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionsTests.swift +++ b/Tests/ASCKitTests/Apps/ProductVersions/Internal/SDKProductVersionRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKProductVersionsTests { +struct SDKProductVersionRepositoryTests { @Test func `in-app purchase versions carry their IAP id, version number and state`() async throws { let stub = StubAPIClient() @@ -15,7 +15,7 @@ struct SDKProductVersionsTests { links: .init(this: "") )) - let repo = SDKProductVersions(client: stub) + let repo = SDKProductVersionRepository(client: stub) let versions = try await repo.listInAppPurchaseVersions(iapId: "iap-7") #expect(versions == [ @@ -34,7 +34,7 @@ struct SDKProductVersionsTests { links: .init(this: "") )) - let repo = SDKProductVersions(client: stub) + let repo = SDKProductVersionRepository(client: stub) let versions = try await repo.listSubscriptionVersions(subscriptionId: "sub-7") #expect(versions == [ @@ -53,7 +53,7 @@ struct SDKProductVersionsTests { links: .init(this: "") )) - let repo = SDKProductVersions(client: stub) + let repo = SDKProductVersionRepository(client: stub) let versions = try await repo.listSubscriptionGroupVersions(groupId: "grp-7") #expect(versions == [ @@ -74,7 +74,7 @@ struct SDKProductVersionsTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKProductVersions(client: stub) + let repo = SDKProductVersionRepository(client: stub) let versions = try await repo.listSubscriptionVersions(subscriptionId: "sub-7") #expect(versions.count == 75) diff --git a/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchasesTests.swift b/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchasesTests.swift rename to Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift index 5bbf70ac..ad3204c3 100644 --- a/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchasesTests.swift +++ b/Tests/ASCKitTests/Apps/PromotedPurchases/Internal/SDKPromotedPurchaseRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKPromotedPurchasesTests { +struct SDKPromotedPurchaseRepositoryTests { @Test func `listPromotedPurchases injects appId into each item`() async throws { let stub = StubAPIClient() @@ -21,7 +21,7 @@ struct SDKPromotedPurchasesTests { links: .init(this: "") )) - let repo = SDKPromotedPurchases(client: stub) + let repo = SDKPromotedPurchaseRepository(client: stub) let result = try await repo.listPromotedPurchases(appId: "app-99", limit: nil) #expect(result.data.count == 2) @@ -40,7 +40,7 @@ struct SDKPromotedPurchasesTests { links: .init(this: "") )) - let repo = SDKPromotedPurchases(client: stub) + let repo = SDKPromotedPurchaseRepository(client: stub) let result = try await repo.listPromotedPurchases(appId: "app-1", limit: nil) #expect(result.data[0].state == .approved) @@ -63,7 +63,7 @@ struct SDKPromotedPurchasesTests { links: .init(this: "") )) - let repo = SDKPromotedPurchases(client: stub) + let repo = SDKPromotedPurchaseRepository(client: stub) let result = try await repo.listPromotedPurchases(appId: "app-1", limit: nil) #expect(result.data[0].inAppPurchaseId == "iap-1") @@ -81,7 +81,7 @@ struct SDKPromotedPurchasesTests { links: .init(this: "") )) - let repo = SDKPromotedPurchases(client: stub) + let repo = SDKPromotedPurchaseRepository(client: stub) let result = try await repo.createPromotedPurchase( appId: "app-42", isVisibleForAllUsers: true, isEnabled: true, inAppPurchaseId: "iap-1", subscriptionId: nil @@ -102,7 +102,7 @@ struct SDKPromotedPurchasesTests { links: .init(this: "") )) - let repo = SDKPromotedPurchases(client: stub) + let repo = SDKPromotedPurchaseRepository(client: stub) let result = try await repo.updatePromotedPurchase( promotedId: "pp-1", isVisibleForAllUsers: false, isEnabled: false ) @@ -113,7 +113,7 @@ struct SDKPromotedPurchasesTests { @Test func `deletePromotedPurchase performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKPromotedPurchases(client: stub) + let repo = SDKPromotedPurchaseRepository(client: stub) try await repo.deletePromotedPurchase(promotedId: "pp-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewsTests.swift b/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewsTests.swift rename to Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift index c001e6f6..a51f5060 100644 --- a/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewsTests.swift +++ b/Tests/ASCKitTests/Apps/Reviews/Internal/SDKCustomerReviewRepositoryTests.swift @@ -15,7 +15,7 @@ struct SDKCustomerReviewRepositoryListReviewsTests { links: .init(this: "") )) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.listReviews(appId: "app-99") #expect(result.count == 2) @@ -40,7 +40,7 @@ struct SDKCustomerReviewRepositoryListReviewsTests { links: .init(this: "") )) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.listReviews(appId: "app-1") #expect(result[0].rating == 5) @@ -62,7 +62,7 @@ struct SDKCustomerReviewRepositoryListReviewsTests { links: .init(this: "") )) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.listReviews(appId: "app-1") #expect(result[0].territory == "USA") @@ -77,7 +77,7 @@ struct SDKCustomerReviewRepositoryListReviewsTests { links: .init(this: "") )) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.listReviews(appId: "app-1") #expect(result[0].territory == nil) @@ -98,7 +98,7 @@ struct SDKCustomerReviewRepositoryGetReviewTests { links: .init(this: "") )) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.getReview(reviewId: "rev-42") #expect(result.id == "rev-42") @@ -122,7 +122,7 @@ struct SDKCustomerReviewRepositoryGetResponseTests { links: .init(this: "") )) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.getResponse(reviewId: "rev-42") #expect(result.id == "resp-1") @@ -142,7 +142,7 @@ struct SDKCustomerReviewRepositoryGetResponseTests { links: .init(this: "") )) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.getResponse(reviewId: "rev-1") #expect(result.state == .pendingPublish) @@ -163,7 +163,7 @@ struct SDKCustomerReviewRepositoryCreateResponseTests { links: .init(this: "") )) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.createResponse(reviewId: "rev-42", responseBody: "Thank you!") #expect(result.id == "resp-new") @@ -179,7 +179,7 @@ struct SDKCustomerReviewRepositoryDeleteResponseTests { @Test func `deleteResponse calls void request`() async throws { let stub = StubAPIClient() - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) try await repo.deleteResponse(responseId: "resp-1") #expect(stub.voidRequestCalled) @@ -196,7 +196,7 @@ struct SDKCustomerReviewRepositoryDeleteResponseTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKCustomerReviews(client: stub) + let repo = SDKCustomerReviewRepository(client: stub) let result = try await repo.listReviews(appId: "app-1") #expect(result.count == 75) diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilitiesTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilitiesTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift index 2529fe56..a5b21311 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilitiesTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Availability/Internal/SDKSubscriptionAvailabilityRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionAvailabilitiesTests { +struct SDKSubscriptionAvailabilityRepositoryTests { @Test func `getAvailability composes attributes call with availableTerritories relationship call`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKSubscriptionAvailabilitiesTests { links: .init(this: "") )) - let repo = SDKSubscriptionAvailabilities(client: stub) + let repo = SDKSubscriptionAvailabilityRepository(client: stub) let result = try await repo.getAvailability(subscriptionId: "sub-99") #expect(result?.id == "avail-1") @@ -50,7 +50,7 @@ struct SDKSubscriptionAvailabilitiesTests { } stub.willReturn(TerritoriesResponse(data: many, links: .init(this: ""))) - let repo = SDKSubscriptionAvailabilities(client: stub) + let repo = SDKSubscriptionAvailabilityRepository(client: stub) let result = try await repo.getAvailability(subscriptionId: "sub-big") #expect(result?.territories.count == 175) @@ -68,7 +68,7 @@ struct SDKSubscriptionAvailabilitiesTests { )) stub.willReturn(TerritoriesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionAvailabilities(client: stub) + let repo = SDKSubscriptionAvailabilityRepository(client: stub) let result = try await repo.getAvailability(subscriptionId: "sub-1") #expect(result?.territories.isEmpty == true) @@ -76,7 +76,7 @@ struct SDKSubscriptionAvailabilitiesTests { @Test func `getAvailability returns nil when subscription has no availability resource yet`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionAvailabilities(client: stub) + let repo = SDKSubscriptionAvailabilityRepository(client: stub) let result = try? await repo.getAvailability(subscriptionId: "sub-fresh") #expect(result == nil) } @@ -98,7 +98,7 @@ struct SDKSubscriptionAvailabilitiesTests { links: .init(this: "") )) - let repo = SDKSubscriptionAvailabilities(client: stub) + let repo = SDKSubscriptionAvailabilityRepository(client: stub) let result = try await repo.createAvailability( subscriptionId: "sub-42", isAvailableInNewTerritories: false, diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationsTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationsTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift index b61f3901..b3bb5fee 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationsTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupLocalizationRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionGroupLocalizationsTests { +struct SDKSubscriptionGroupLocalizationRepositoryTests { @Test func `listLocalizations injects groupId into each item`() async throws { let stub = StubAPIClient() @@ -21,7 +21,7 @@ struct SDKSubscriptionGroupLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupLocalizations(client: stub) + let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) let result = try await repo.listLocalizations(groupId: "grp-77") #expect(result.count == 2) @@ -40,7 +40,7 @@ struct SDKSubscriptionGroupLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupLocalizations(client: stub) + let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) let result = try await repo.listLocalizations(groupId: "grp-1") #expect(result[0].locale == "en-US") @@ -58,7 +58,7 @@ struct SDKSubscriptionGroupLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupLocalizations(client: stub) + let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) let result = try await repo.createLocalization( groupId: "grp-42", locale: "en-US", name: "Premium", customAppName: nil ) @@ -78,7 +78,7 @@ struct SDKSubscriptionGroupLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroupLocalizations(client: stub) + let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) let result = try await repo.updateLocalization(localizationId: "loc-1", name: "Renamed", customAppName: nil) #expect(result.id == "loc-1") @@ -89,7 +89,7 @@ struct SDKSubscriptionGroupLocalizationsTests { @Test func `deleteLocalization performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionGroupLocalizations(client: stub) + let repo = SDKSubscriptionGroupLocalizationRepository(client: stub) try await repo.deleteLocalization(localizationId: "loc-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupsTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupsTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift index a0cb6916..ee273830 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupsTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionGroupRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionGroupsTests { +struct SDKSubscriptionGroupRepositoryTests { // MARK: - listSubscriptionGroups @@ -17,7 +17,7 @@ struct SDKSubscriptionGroupsTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroups(client: stub) + let repo = SDKSubscriptionGroupRepository(client: stub) let result = try await repo.listSubscriptionGroups(appId: "app-99", limit: nil) #expect(result.data.count == 2) @@ -33,7 +33,7 @@ struct SDKSubscriptionGroupsTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroups(client: stub) + let repo = SDKSubscriptionGroupRepository(client: stub) let result = try await repo.listSubscriptionGroups(appId: "app-1", limit: nil) #expect(result.data[0].id == "grp-abc") @@ -53,7 +53,7 @@ struct SDKSubscriptionGroupsTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroups(client: stub) + let repo = SDKSubscriptionGroupRepository(client: stub) let result = try await repo.createSubscriptionGroup(appId: "app-42", referenceName: "Premium Plans") #expect(result.id == "grp-new") @@ -71,7 +71,7 @@ struct SDKSubscriptionGroupsTests { links: .init(this: "") )) - let repo = SDKSubscriptionGroups(client: stub) + let repo = SDKSubscriptionGroupRepository(client: stub) let result = try await repo.updateSubscriptionGroup(groupId: "grp-1", referenceName: "Renamed Plans") #expect(result.id == "grp-1") @@ -81,7 +81,7 @@ struct SDKSubscriptionGroupsTests { @Test func `deleteSubscriptionGroup performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionGroups(client: stub) + let repo = SDKSubscriptionGroupRepository(client: stub) try await repo.deleteSubscriptionGroup(groupId: "grp-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationsTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationsTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift index 389374a5..d8aed37a 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationsTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionLocalizationRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionLocalizationsTests { +struct SDKSubscriptionLocalizationRepositoryTests { // MARK: - listLocalizations @@ -17,7 +17,7 @@ struct SDKSubscriptionLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizations(client: stub) + let repo = SDKSubscriptionLocalizationRepository(client: stub) let result = try await repo.listLocalizations(subscriptionId: "sub-42") #expect(result.count == 2) @@ -37,7 +37,7 @@ struct SDKSubscriptionLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizations(client: stub) + let repo = SDKSubscriptionLocalizationRepository(client: stub) let result = try await repo.listLocalizations(subscriptionId: "sub-1") #expect(result[0].locale == "de-DE") @@ -54,7 +54,7 @@ struct SDKSubscriptionLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizations(client: stub) + let repo = SDKSubscriptionLocalizationRepository(client: stub) let result = try await repo.listLocalizations(subscriptionId: "sub-1") #expect(result[0].id == "loc-xyz") @@ -73,7 +73,7 @@ struct SDKSubscriptionLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizations(client: stub) + let repo = SDKSubscriptionLocalizationRepository(client: stub) let result = try await repo.createLocalization( subscriptionId: "sub-42", locale: "en-US", @@ -99,7 +99,7 @@ struct SDKSubscriptionLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizations(client: stub) + let repo = SDKSubscriptionLocalizationRepository(client: stub) let result = try await repo.createLocalization( subscriptionId: "sub-1", locale: "zh-Hans", @@ -121,7 +121,7 @@ struct SDKSubscriptionLocalizationsTests { links: .init(this: "") )) - let repo = SDKSubscriptionLocalizations(client: stub) + let repo = SDKSubscriptionLocalizationRepository(client: stub) let result = try await repo.updateLocalization(localizationId: "loc-1", name: "Renamed", description: "New") #expect(result.id == "loc-1") @@ -131,7 +131,7 @@ struct SDKSubscriptionLocalizationsTests { @Test func `deleteLocalization performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionLocalizations(client: stub) + let repo = SDKSubscriptionLocalizationRepository(client: stub) try await repo.deleteLocalization(localizationId: "loc-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPricesTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift similarity index 94% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPricesTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift index b14e9a03..e4937871 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPricesTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPriceRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionPricesTests { +struct SDKSubscriptionPriceRepositoryTests { @Test func `listPricePoints injects subscriptionId into each price point`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKSubscriptionPricesTests { links: .init(this: "") )) - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) let result = try await repo.listPricePoints(subscriptionId: "sub-77", territory: nil, limit: nil, cursor: nil) #expect(result.data.count == 2) @@ -43,7 +43,7 @@ struct SDKSubscriptionPricesTests { links: .init(this: "") )) - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) let result = try await repo.listPricePoints(subscriptionId: "sub-1", territory: "USA", limit: nil, cursor: nil) #expect(result.data[0].customerPrice == "9.99") @@ -61,7 +61,7 @@ struct SDKSubscriptionPricesTests { links: .init(this: "") )) - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) let result = try await repo.setPrice( subscriptionId: "sub-42", territory: "USA", pricePointId: "spp-1", startDate: nil, preserveCurrentPrice: nil @@ -81,7 +81,7 @@ struct SDKSubscriptionPricesTests { stub.willReturn(SubscriptionPricesResponse(data: [], links: .init(this: ""))) let inputs = (0..<175).map { SubscriptionPriceInput(territory: "T\($0)", pricePointId: "spp-\($0)") } - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) _ = try await repo.setPrices(subscriptionId: "sub-1", prices: inputs) let writes = stub.requests.filter { $0.method != "GET" } @@ -96,7 +96,7 @@ struct SDKSubscriptionPricesTests { )) stub.willReturn(SubscriptionPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) _ = try await repo.setPrices(subscriptionId: "sub-1", prices: [ SubscriptionPriceInput(territory: "USA", pricePointId: "spp-USA", startDate: "2026-10-01", preserveCurrentPrice: true), SubscriptionPriceInput(territory: "JPN", pricePointId: "spp-JPN"), @@ -126,7 +126,7 @@ struct SDKSubscriptionPricesTests { links: .init(this: "") )) - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) let result = try await repo.listEqualizations(pricePointId: "spp-USA", limit: nil) #expect(result.count == 2) @@ -142,7 +142,7 @@ struct SDKSubscriptionPricesTests { let stub = StubAPIClient() stub.willReturn(SubscriptionPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) let result = try await repo.getPriceSchedule(subscriptionId: "sub-7") #expect(result == nil) @@ -193,7 +193,7 @@ struct SDKSubscriptionPricesTests { links: .init(this: "") )) - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) let result = try await repo.getPriceSchedule(subscriptionId: "sub-7") let prices: [ASCKit.TerritoryPrice] = result?.territoryPrices ?? [] @@ -237,7 +237,7 @@ struct SDKSubscriptionPricesTests { ]) // No equalizations stubbed — every territory must come from the manual prices. - let repo = SDKSubscriptionPrices(client: stub) + let repo = SDKSubscriptionPriceRepository(client: stub) let result = try await repo.getPriceSchedule(subscriptionId: "sub-7") let prices = result?.territoryPrices ?? [] diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOffersTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOffersTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift index 012df6cc..bb36a0b4 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOffersTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionPromotionalOfferRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionPromotionalOffersTests { +struct SDKSubscriptionPromotionalOfferRepositoryTests { @Test func `listPromotionalOffers injects subscriptionId into each offer`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKSubscriptionPromotionalOffersTests { links: .init(this: "") )) - let repo = SDKSubscriptionPromotionalOffers(client: stub) + let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) let result = try await repo.listPromotionalOffers(subscriptionId: "sub-77") #expect(result.count == 2) @@ -43,7 +43,7 @@ struct SDKSubscriptionPromotionalOffersTests { links: .init(this: "") )) - let repo = SDKSubscriptionPromotionalOffers(client: stub) + let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) let result = try await repo.listPromotionalOffers(subscriptionId: "sub-1") #expect(result[0].duration == .threeMonths) @@ -63,7 +63,7 @@ struct SDKSubscriptionPromotionalOffersTests { links: .init(this: "") )) - let repo = SDKSubscriptionPromotionalOffers(client: stub) + let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) let result = try await repo.createPromotionalOffer( subscriptionId: "sub-42", name: "Winback", offerCode: "wb25", @@ -77,7 +77,7 @@ struct SDKSubscriptionPromotionalOffersTests { @Test func `deletePromotionalOffer performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionPromotionalOffers(client: stub) + let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) try await repo.deletePromotionalOffer(offerId: "po-1") #expect(stub.voidRequestCalled == true) } @@ -97,7 +97,7 @@ struct SDKSubscriptionPromotionalOffersTests { links: .init(this: "") )) - let repo = SDKSubscriptionPromotionalOffers(client: stub) + let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) let result = try await repo.listPrices(offerId: "po-77") #expect(result.count == 1) @@ -125,7 +125,7 @@ struct SDKSubscriptionPromotionalOffersTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<100, nextCursor: "page-2"), page(100..<175, nextCursor: nil)]) - let repo = SDKSubscriptionPromotionalOffers(client: stub) + let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) let result = try await repo.listPrices(offerId: "po-1") #expect(result.count == 175) @@ -138,7 +138,7 @@ struct SDKSubscriptionPromotionalOffersTests { let stub = StubAPIClient() stub.willReturn(SubscriptionPromotionalOfferPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionPromotionalOffers(client: stub) + let repo = SDKSubscriptionPromotionalOfferRepository(client: stub) _ = try await repo.listPrices(offerId: "po-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionsTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionsTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift index e08a9eae..45691cbe 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionsTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionsTests { +struct SDKSubscriptionRepositoryTests { // MARK: - listSubscriptions @@ -17,7 +17,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-99", limit: nil) #expect(result.data.count == 2) @@ -33,7 +33,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].id == "sub-1") @@ -50,7 +50,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].subscriptionPeriod == .oneMonth) @@ -65,7 +65,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].reviewNote == "Use code TEST") @@ -80,7 +80,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].reviewNote == nil) @@ -95,7 +95,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].isFamilySharable == true) @@ -113,7 +113,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].multiSeatStatus == .enabled) @@ -129,7 +129,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.listSubscriptions(groupId: "grp-1", limit: nil) #expect(result.data[0].multiSeatStatus == nil) @@ -149,7 +149,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.createSubscription( groupId: "grp-42", name: "Monthly Premium", @@ -175,7 +175,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.createSubscription( groupId: "grp-1", name: "Annual", @@ -206,7 +206,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.updateSubscription( subscriptionId: "sub-1", name: "Renamed", isFamilySharable: true, groupLevel: 3, @@ -228,7 +228,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) _ = try await repo.updateSubscription( subscriptionId: "sub-1", name: nil, isFamilySharable: nil, groupLevel: nil, @@ -249,7 +249,7 @@ struct SDKSubscriptionsTests { links: .init(this: "") )) - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) let result = try await repo.updateSubscription( subscriptionId: "sub-1", name: nil, isFamilySharable: nil, groupLevel: nil, @@ -265,7 +265,7 @@ struct SDKSubscriptionsTests { @Test func `deleteSubscription performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptions(client: stub) + let repo = SDKSubscriptionRepository(client: stub) try await repo.deleteSubscription(subscriptionId: "sub-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOffersTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift similarity index 94% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOffersTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift index 6412b505..c90a8e84 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOffersTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKWinBackOfferRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKWinBackOffersTests { +struct SDKWinBackOfferRepositoryTests { @Test func `listWinBackOffers injects subscriptionId into each offer`() async throws { let stub = StubAPIClient() @@ -24,7 +24,7 @@ struct SDKWinBackOffersTests { links: .init(this: "") )) - let repo = SDKWinBackOffers(client: stub) + let repo = SDKWinBackOfferRepository(client: stub) let result = try await repo.listWinBackOffers(subscriptionId: "sub-77") #expect(result.count == 1) @@ -54,7 +54,7 @@ struct SDKWinBackOffersTests { links: .init(this: "") )) - let repo = SDKWinBackOffers(client: stub) + let repo = SDKWinBackOfferRepository(client: stub) let result = try await repo.listWinBackOffers(subscriptionId: "sub-1") #expect(result[0].customerEligibilityTimeSinceLastSubscribedMin == 2) @@ -82,7 +82,7 @@ struct SDKWinBackOffersTests { links: .init(this: "") )) - let repo = SDKWinBackOffers(client: stub) + let repo = SDKWinBackOfferRepository(client: stub) let result = try await repo.updateWinBackOffer( offerId: "wb-1", startDate: nil, endDate: nil, @@ -114,7 +114,7 @@ struct SDKWinBackOffersTests { links: .init(this: "") )) - let repo = SDKWinBackOffers(client: stub) + let repo = SDKWinBackOfferRepository(client: stub) let result = try await repo.createWinBackOffer( subscriptionId: "sub-42", referenceName: "Lapsed", offerId: "lapsed25", @@ -137,7 +137,7 @@ struct SDKWinBackOffersTests { @Test func `deleteWinBackOffer performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKWinBackOffers(client: stub) + let repo = SDKWinBackOfferRepository(client: stub) try await repo.deleteWinBackOffer(offerId: "wb-1") #expect(stub.voidRequestCalled == true) } @@ -157,7 +157,7 @@ struct SDKWinBackOffersTests { links: .init(this: "") )) - let repo = SDKWinBackOffers(client: stub) + let repo = SDKWinBackOfferRepository(client: stub) let result = try await repo.listPrices(offerId: "wb-77") #expect(result[0].offerId == "wb-77") @@ -184,7 +184,7 @@ struct SDKWinBackOffersTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<100, nextCursor: "page-2"), page(100..<175, nextCursor: nil)]) - let repo = SDKWinBackOffers(client: stub) + let repo = SDKWinBackOfferRepository(client: stub) let result = try await repo.listPrices(offerId: "wb-1") #expect(result.count == 175) @@ -197,7 +197,7 @@ struct SDKWinBackOffersTests { let stub = StubAPIClient() stub.willReturn(WinBackOfferPricesResponse(data: [], links: .init(this: ""))) - let repo = SDKWinBackOffers(client: stub) + let repo = SDKWinBackOfferRepository(client: stub) _ = try await repo.listPrices(offerId: "wb-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffersTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffersTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift index 2b726c1d..902d91fd 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOffersTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/IntroductoryOffers/Internal/SDKSubscriptionIntroductoryOfferRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionIntroductoryOffersTests { +struct SDKSubscriptionIntroductoryOfferRepositoryTests { // MARK: - listIntroductoryOffers @@ -25,7 +25,7 @@ struct SDKSubscriptionIntroductoryOffersTests { links: .init(this: "") )) - let repo = SDKSubscriptionIntroductoryOffers(client: stub) + let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) let result = try await repo.listIntroductoryOffers(subscriptionId: "sub-99") #expect(result.count == 2) @@ -45,7 +45,7 @@ struct SDKSubscriptionIntroductoryOffersTests { links: .init(this: "") )) - let repo = SDKSubscriptionIntroductoryOffers(client: stub) + let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) let result = try await repo.listIntroductoryOffers(subscriptionId: "sub-1") #expect(result[0].duration == .sixMonths) @@ -67,7 +67,7 @@ struct SDKSubscriptionIntroductoryOffersTests { links: .init(this: "") )) - let repo = SDKSubscriptionIntroductoryOffers(client: stub) + let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) let result = try await repo.listIntroductoryOffers(subscriptionId: "sub-1") #expect(result[0].territory == "USA") @@ -86,7 +86,7 @@ struct SDKSubscriptionIntroductoryOffersTests { links: .init(this: "") )) - let repo = SDKSubscriptionIntroductoryOffers(client: stub) + let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) let result = try await repo.createIntroductoryOffer( subscriptionId: "sub-42", duration: .oneMonth, @@ -106,7 +106,7 @@ struct SDKSubscriptionIntroductoryOffersTests { @Test func `deleteIntroductoryOffer performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionIntroductoryOffers(client: stub) + let repo = SDKSubscriptionIntroductoryOfferRepository(client: stub) try await repo.deleteIntroductoryOffer(offerId: "offer-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodesTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodesTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift index 541c0303..8f578b35 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodesTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/OfferCodes/Internal/SDKSubscriptionOfferCodeRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionOfferCodesTests { +struct SDKSubscriptionOfferCodeRepositoryTests { // MARK: - listOfferCodes @@ -42,7 +42,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.listOfferCodes(subscriptionId: "sub-99") #expect(result.count == 2) @@ -71,7 +71,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.listOfferCodes(subscriptionId: "sub-1") #expect(result[0].id == "oc-1") @@ -107,7 +107,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.listOfferCodes(subscriptionId: "sub-1") #expect(result[0].productionCodeCount == 480) @@ -135,7 +135,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.createOfferCode( subscriptionId: "sub-42", name: "LAUNCH", @@ -176,7 +176,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.updateOfferCode(offerCodeId: "oc-1", isActive: false) #expect(result.id == "oc-1") @@ -205,7 +205,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.listCustomCodes(offerCodeId: "oc-10") #expect(result.count == 1) @@ -233,7 +233,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.createCustomCode( offerCodeId: "oc-5", customCode: "HOLIDAY", @@ -263,7 +263,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.updateCustomCode(customCodeId: "cc-1", isActive: false) #expect(result.id == "cc-1") @@ -290,7 +290,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.listOneTimeUseCodes(offerCodeId: "oc-20") #expect(result.count == 1) @@ -316,7 +316,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.createOneTimeUseCode( offerCodeId: "oc-7", numberOfCodes: 500, @@ -345,7 +345,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.createOneTimeUseCode( offerCodeId: "oc-7", numberOfCodes: 10, @@ -372,7 +372,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.updateOneTimeUseCode(oneTimeCodeId: "otc-1", isActive: false) #expect(result.id == "otc-1") @@ -395,7 +395,7 @@ struct SDKSubscriptionOfferCodesTests { links: .init(this: "") )) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.listPrices(offerCodeId: "oc-77") #expect(result[0].offerCodeId == "oc-77") @@ -406,7 +406,7 @@ struct SDKSubscriptionOfferCodesTests { @Test func `fetchOneTimeUseCodeValues returns CSV string from SDK`() async throws { let stub = StubAPIClient() stub.willReturn("ABC\nDEF\n") - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.fetchOneTimeUseCodeValues(oneTimeCodeId: "otc-1") #expect(result == "ABC\nDEF\n") } @@ -430,7 +430,7 @@ struct SDKSubscriptionOfferCodesTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<100, nextCursor: "page-2"), page(100..<175, nextCursor: nil)]) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) let result = try await repo.listPrices(offerCodeId: "oc-1") #expect(result.count == 175) @@ -443,7 +443,7 @@ struct SDKSubscriptionOfferCodesTests { let stub = StubAPIClient() stub.willReturn(SubscriptionOfferCodePricesResponse(data: [], links: .init(this: ""))) - let repo = SDKSubscriptionOfferCodes(client: stub) + let repo = SDKSubscriptionOfferCodeRepository(client: stub) _ = try await repo.listPrices(offerCodeId: "oc-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssetsTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssetsTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift index 82811133..2073bdf4 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewAssetsTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryTests.swift @@ -3,11 +3,11 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionReviewAssetsTests { +struct SDKSubscriptionReviewRepositoryTests { @Test func `deleteReviewScreenshot performs void request`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionReviewAssets(client: stub) + let repo = SDKSubscriptionReviewRepository(client: stub) try await repo.deleteReviewScreenshot(screenshotId: "rs-1") #expect(stub.voidRequestCalled == true) } @@ -30,7 +30,7 @@ struct SDKSubscriptionReviewAssetsTests { links: .init(this: "") )) - let repo = SDKSubscriptionReviewAssets(client: stub) + let repo = SDKSubscriptionReviewRepository(client: stub) let result = try await repo.listImages(subscriptionId: "sub-1") #expect(result[0].imageAsset == nil) @@ -54,7 +54,7 @@ struct SDKSubscriptionReviewAssetsTests { links: .init(this: "") )) - let repo = SDKSubscriptionReviewAssets(client: stub) + let repo = SDKSubscriptionReviewRepository(client: stub) let result = try await repo.listImages(subscriptionId: "sub-1") #expect(result[0].imageAsset == nil) @@ -78,7 +78,7 @@ struct SDKSubscriptionReviewAssetsTests { links: .init(this: "") )) - let repo = SDKSubscriptionReviewAssets(client: stub) + let repo = SDKSubscriptionReviewRepository(client: stub) let result = try await repo.listImages(subscriptionId: "sub-1") #expect(result[0].imageAsset?.templateUrl == "https://cdn/{w}x{h}bb.{f}") diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift index 1d0d6757..2f4c2ecf 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Review/Internal/SDKSubscriptionReviewRepositoryUploadTests.swift @@ -72,8 +72,8 @@ struct SDKSubscriptionReviewRepositoryUploadTests { #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/subscriptionImages"]) } - static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKSubscriptionReviewAssets { - SDKSubscriptionReviewAssets(client: stub, uploader: UploadOperationsExecutor(http: http), pollDelayNanos: 0, pollMaxAttempts: 1) + static func repo(_ stub: StubAPIClient, http: any HTTPPerforming = SequencedStubHTTPClient()) -> SDKSubscriptionReviewRepository { + SDKSubscriptionReviewRepository(client: stub, uploader: UploadOperationsExecutor(http: http), pollDelayNanos: 0, pollMaxAttempts: 1) } static func screenshot(_ json: String) throws -> SubscriptionAppStoreReviewScreenshotResponse { diff --git a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationsTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationsTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift index 96f0840a..7c811c32 100644 --- a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationsTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppLocalizationRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBetaAppLocalizationsTests { +struct SDKBetaAppLocalizationRepositoryTests { @Test func `listBetaAppLocalizations injects appId into each localization`() async throws { let stub = StubAPIClient() @@ -15,7 +15,7 @@ struct SDKBetaAppLocalizationsTests { links: .init(this: "") )) - let repo = SDKBetaAppLocalizations(client: stub) + let repo = SDKBetaAppLocalizationRepository(client: stub) let locs = try await repo.listBetaAppLocalizations(appId: "app-42") #expect(locs.count == 2) @@ -41,7 +41,7 @@ struct SDKBetaAppLocalizationsTests { links: .init(this: "") )) - let repo = SDKBetaAppLocalizations(client: stub) + let repo = SDKBetaAppLocalizationRepository(client: stub) let loc = try await repo.getBetaAppLocalization(localizationId: "bal-7") #expect(loc.id == "bal-7") @@ -63,7 +63,7 @@ struct SDKBetaAppLocalizationsTests { links: .init(this: "") )) - let repo = SDKBetaAppLocalizations(client: stub) + let repo = SDKBetaAppLocalizationRepository(client: stub) let loc = try await repo.createBetaAppLocalization( appId: "app-1", locale: "de-DE", @@ -92,7 +92,7 @@ struct SDKBetaAppLocalizationsTests { links: .init(this: "") )) - let repo = SDKBetaAppLocalizations(client: stub) + let repo = SDKBetaAppLocalizationRepository(client: stub) let loc = try await repo.updateBetaAppLocalization( localizationId: "bal-1", update: BetaAppLocalizationUpdate(description: "Updated description") @@ -105,7 +105,7 @@ struct SDKBetaAppLocalizationsTests { @Test func `deleteBetaAppLocalization completes without throwing`() async throws { let stub = StubAPIClient() - let repo = SDKBetaAppLocalizations(client: stub) + let repo = SDKBetaAppLocalizationRepository(client: stub) try await repo.deleteBetaAppLocalization(localizationId: "bal-1") #expect(stub.voidRequestCalled) } diff --git a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewsTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewsTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift index 07d87b36..7a84e8de 100644 --- a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewsTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKBetaAppReviewRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBetaAppReviewsTests { +struct SDKBetaAppReviewRepositoryTests { // MARK: - Submissions @@ -20,7 +20,7 @@ struct SDKBetaAppReviewsTests { links: .init(this: "") )) - let repo = SDKBetaAppReviews(client: stub) + let repo = SDKBetaAppReviewRepository(client: stub) let result = try await repo.listSubmissions(buildId: "build-42") #expect(result.count == 1) @@ -40,7 +40,7 @@ struct SDKBetaAppReviewsTests { links: .init(this: "") )) - let repo = SDKBetaAppReviews(client: stub) + let repo = SDKBetaAppReviewRepository(client: stub) let result = try await repo.listSubmissions(buildId: "b-1") #expect(result[0].state == .approved) @@ -59,7 +59,7 @@ struct SDKBetaAppReviewsTests { links: .init(this: "") )) - let repo = SDKBetaAppReviews(client: stub) + let repo = SDKBetaAppReviewRepository(client: stub) let result = try await repo.createSubmission(buildId: "build-99") #expect(result.id == "sub-new") @@ -79,7 +79,7 @@ struct SDKBetaAppReviewsTests { links: .init(this: "") )) - let repo = SDKBetaAppReviews(client: stub) + let repo = SDKBetaAppReviewRepository(client: stub) let result = try await repo.getSubmission(id: "sub-1") #expect(result.id == "sub-1") @@ -109,7 +109,7 @@ struct SDKBetaAppReviewsTests { links: .init(this: "") )) - let repo = SDKBetaAppReviews(client: stub) + let repo = SDKBetaAppReviewRepository(client: stub) let result = try await repo.getDetail(appId: "app-42") #expect(result.id == "detail-1") @@ -139,7 +139,7 @@ struct SDKBetaAppReviewsTests { links: .init(this: "") )) - let repo = SDKBetaAppReviews(client: stub) + let repo = SDKBetaAppReviewRepository(client: stub) let result = try await repo.updateDetail( id: "detail-1", update: BetaAppReviewDetailUpdate(contactFirstName: "Jane", contactEmail: "jane@example.com", notes: "Updated") diff --git a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightTests.swift b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightTests.swift rename to Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift index b3e5fca4..49561f10 100644 --- a/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightTests.swift +++ b/Tests/ASCKitTests/Apps/TestFlight/Internal/SDKTestFlightRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKTestFlightTests { +struct SDKTestFlightRepositoryTests { @Test func `listBetaGroups maps name and isInternalGroup`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKTestFlightTests { links: .init(this: "") )) - let repo = SDKTestFlight(client: stub) + let repo = SDKTestFlightRepository(client: stub) let result = try await repo.listBetaGroups(appId: nil, limit: nil) #expect(result.data.count == 2) @@ -41,7 +41,7 @@ struct SDKTestFlightTests { links: .init(this: "") )) - let repo = SDKTestFlight(client: stub) + let repo = SDKTestFlightRepository(client: stub) let result = try await repo.listBetaGroups(appId: "app-42", limit: nil) #expect(result.data[0].appId == "app-42") @@ -60,7 +60,7 @@ struct SDKTestFlightTests { links: .init(this: "") )) - let repo = SDKTestFlight(client: stub) + let repo = SDKTestFlightRepository(client: stub) let result = try await repo.listBetaTesters(groupId: "group-99", limit: nil) #expect(result.data[0].firstName == "Jane") @@ -88,7 +88,7 @@ struct SDKTestFlightTests { links: .init(this: "") )) - let repo = SDKTestFlight(client: stub) + let repo = SDKTestFlightRepository(client: stub) let result = try await repo.listBetaTesters(groupId: "g-1", limit: nil) #expect(result.data[0].inviteType == domainType) @@ -106,7 +106,7 @@ struct SDKTestFlightTests { links: .init(this: "") )) - let repo = SDKTestFlight(client: stub) + let repo = SDKTestFlightRepository(client: stub) let tester = try await repo.addBetaTester(groupId: "g-1", email: "new@example.com", firstName: "New", lastName: nil) #expect(tester.id == "t-new") @@ -126,7 +126,7 @@ struct SDKTestFlightTests { links: .init(this: "") )) - let repo = SDKTestFlight(client: stub) + let repo = SDKTestFlightRepository(client: stub) let group = try await repo.createBetaGroup( appId: "app-1", name: "External Beta", @@ -153,7 +153,7 @@ struct SDKTestFlightTests { links: .init(this: "") )) - let repo = SDKTestFlight(client: stub) + let repo = SDKTestFlightRepository(client: stub) let group = try await repo.createBetaGroup( appId: "app-7", name: "Company Team", @@ -170,7 +170,7 @@ struct SDKTestFlightTests { @Test func `removeBetaTester calls void delete endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKTestFlight(client: stub) + let repo = SDKTestFlightRepository(client: stub) try await repo.removeBetaTester(groupId: "g-1", testerId: "t-1") #expect(stub.voidRequestCalled == true) diff --git a/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailsTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift similarity index 95% rename from Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailsTests.swift rename to Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift index 780c80e0..c0bdd9c5 100644 --- a/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailsTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKReviewDetailRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKReviewDetailsTests { +struct SDKReviewDetailRepositoryTests { @Test func `getReviewDetail injects versionId and maps contact fields`() async throws { let stub = StubAPIClient() @@ -26,7 +26,7 @@ struct SDKReviewDetailsTests { links: .init(this: "") )) - let repo = SDKReviewDetails(client: stub) + let repo = SDKReviewDetailRepository(client: stub) let result = try await repo.getReviewDetail(versionId: "v-42") #expect(result.id == "rd-1") @@ -58,7 +58,7 @@ struct SDKReviewDetailsTests { links: .init(this: "") )) - let repo = SDKReviewDetails(client: stub) + let repo = SDKReviewDetailRepository(client: stub) let result = try await repo.getReviewDetail(versionId: "v-99") #expect(result.demoAccountRequired == true) @@ -68,7 +68,7 @@ struct SDKReviewDetailsTests { } @Test func `getReviewDetail returns empty detail when API throws`() async throws { - let repo = SDKReviewDetails(client: ReviewDetailThrowingStub()) + let repo = SDKReviewDetailRepository(client: ReviewDetailThrowingStub()) let result = try await repo.getReviewDetail(versionId: "v-empty") #expect(result.id == "") @@ -101,7 +101,7 @@ struct SDKReviewDetailsTests { ), links: .init(this: "") ) - let repo = SDKReviewDetails(client: stub) + let repo = SDKReviewDetailRepository(client: stub) let update = ASCKit.ReviewDetailUpdate( contactFirstName: "Jane", contactLastName: "Smith", @@ -154,7 +154,7 @@ struct SDKReviewDetailsTests { ), links: .init(this: "") )) - let repo = SDKReviewDetails(client: stub) + let repo = SDKReviewDetailRepository(client: stub) let update = ASCKit.ReviewDetailUpdate( contactFirstName: "New", contactPhone: "+1-555-9999", diff --git a/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift index 9c9caa87..c2d11d84 100644 --- a/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryCreateTests.swift @@ -16,7 +16,7 @@ struct SDKVersionRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) let result = try await repo.createVersion(appId: "app-42", versionString: "2.0.0", platform: .iOS) #expect(result.id == "v-new") @@ -37,14 +37,14 @@ struct SDKVersionRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) let result = try await repo.createVersion(appId: "app-1", versionString: "1.0.0", platform: .macOS) #expect(result.platform == .macOS) } @Test func `createVersion throws for unsupported platform`() async throws { - let repo = SDKAppStoreVersions(client: StubAPIClient()) + let repo = SDKVersionRepository(client: StubAPIClient()) await #expect(throws: (any Error).self) { try await repo.createVersion(appId: "app-1", versionString: "1.0.0", platform: .watchOS) } @@ -61,7 +61,7 @@ struct SDKVersionRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) await #expect(throws: (any Error).self) { try await repo.createVersion(appId: "app-1", versionString: "1.0.0", platform: .iOS) } diff --git a/Tests/ASCKitTests/Apps/Versions/Internal/SDKAppStoreVersionsTests.swift b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Versions/Internal/SDKAppStoreVersionsTests.swift rename to Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift index 1551401e..b51fb16d 100644 --- a/Tests/ASCKitTests/Apps/Versions/Internal/SDKAppStoreVersionsTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Internal/SDKVersionRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKAppStoreVersionsTests { +struct SDKVersionRepositoryTests { @Test func `listVersions injects appId into each version`() async throws { let stub = StubAPIClient() @@ -23,7 +23,7 @@ struct SDKAppStoreVersionsTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) let result = try await repo.listVersions(appId: "app-42") #expect(result.count == 2) @@ -43,7 +43,7 @@ struct SDKAppStoreVersionsTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) let result = try await repo.listVersions(appId: "app-1") #expect(result[0].versionString == "2.3.0") @@ -67,7 +67,7 @@ struct SDKAppStoreVersionsTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) let result = try await repo.getVersion(id: "v-1") #expect(result.id == "v-1") @@ -87,7 +87,7 @@ struct SDKAppStoreVersionsTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) let result = try await repo.getVersion(id: "v-2") #expect(result.appId == "") @@ -105,7 +105,7 @@ struct SDKAppStoreVersionsTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) await #expect(throws: (any Error).self) { try await repo.getVersion(id: "v-bad") } @@ -124,7 +124,7 @@ struct SDKAppStoreVersionsTests { links: .init(this: "") )) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) try await repo.setBuild(versionId: "v-1", buildId: "build-42") // No error thrown = success } @@ -140,7 +140,7 @@ struct SDKAppStoreVersionsTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKAppStoreVersions(client: stub) + let repo = SDKVersionRepository(client: stub) let result = try await repo.listVersions(appId: "app-1") #expect(result.count == 75) diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKVersionLocalizationsTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift similarity index 93% rename from Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKVersionLocalizationsTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift index 966a6b14..a2902b3a 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKVersionLocalizationsTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/Internal/SDKLocalizationRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKVersionLocalizationsTests { +struct SDKLocalizationRepositoryTests { // MARK: - listLocalizations @@ -26,7 +26,7 @@ struct SDKVersionLocalizationsTests { links: .init(this: "") )) - let repo = SDKVersionLocalizations(client: stub) + let repo = SDKLocalizationRepository(client: stub) let result = try await repo.listLocalizations(versionId: "v-42") #expect(result.count == 2) @@ -46,7 +46,7 @@ struct SDKVersionLocalizationsTests { links: .init(this: "") )) - let repo = SDKVersionLocalizations(client: stub) + let repo = SDKLocalizationRepository(client: stub) let result = try await repo.listLocalizations(versionId: "v-1") #expect(result[0].id == "loc-1") @@ -66,7 +66,7 @@ struct SDKVersionLocalizationsTests { links: .init(this: "") )) - let repo = SDKVersionLocalizations(client: stub) + let repo = SDKLocalizationRepository(client: stub) let result = try await repo.createLocalization(versionId: "v-42", locale: "en-US") #expect(result.id == "loc-new") @@ -87,7 +87,7 @@ struct SDKVersionLocalizationsTests { links: .init(this: "") )) - let repo = SDKVersionLocalizations(client: stub) + let repo = SDKLocalizationRepository(client: stub) let result = try await repo.updateLocalization( localizationId: "loc-42", whatsNew: "Bug fixes and performance improvements", @@ -121,7 +121,7 @@ struct SDKVersionLocalizationsTests { links: .init(this: "") )) - let repo = SDKVersionLocalizations(client: stub) + let repo = SDKLocalizationRepository(client: stub) let result = try await repo.updateLocalization( localizationId: "loc-1", whatsNew: "新功能", diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviewsTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviewsTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift index 37cdffa8..9e108932 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIAppPreviewsTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct OpenAPIAppPreviewsTests { +struct OpenAPIPreviewRepositoryTests { // MARK: - listPreviewSets @@ -25,7 +25,7 @@ struct OpenAPIAppPreviewsTests { links: .init(this: "") )) - let repo = OpenAPIAppPreviews(client: stub) + let repo = OpenAPIPreviewRepository(client: stub) let result = try await repo.listPreviewSets(localizationId: "loc-99") #expect(result.count == 2) @@ -45,7 +45,7 @@ struct OpenAPIAppPreviewsTests { links: .init(this: "") )) - let repo = OpenAPIAppPreviews(client: stub) + let repo = OpenAPIPreviewRepository(client: stub) let result = try await repo.listPreviewSets(localizationId: "loc-1") #expect(result[0].previewType == .iphone67) @@ -72,7 +72,7 @@ struct OpenAPIAppPreviewsTests { links: .init(this: "") )) - let repo = OpenAPIAppPreviews(client: stub) + let repo = OpenAPIPreviewRepository(client: stub) let result = try await repo.listPreviewSets(localizationId: "loc-1") #expect(result[0].previewsCount == 2) @@ -98,7 +98,7 @@ struct OpenAPIAppPreviewsTests { links: .init(this: "") )) - let repo = OpenAPIAppPreviews(client: stub) + let repo = OpenAPIPreviewRepository(client: stub) let result = try await repo.listPreviews(setId: "set-42") #expect(result.count == 2) @@ -122,7 +122,7 @@ struct OpenAPIAppPreviewsTests { links: .init(this: "") )) - let repo = OpenAPIAppPreviews(client: stub) + let repo = OpenAPIPreviewRepository(client: stub) let result = try await repo.listPreviews(setId: "set-1") #expect(result[0].videoDeliveryState == .complete) @@ -145,7 +145,7 @@ struct OpenAPIAppPreviewsTests { links: .init(this: "") )) - let repo = OpenAPIAppPreviews(client: stub) + let repo = OpenAPIPreviewRepository(client: stub) let result = try await repo.listPreviews(setId: "set-1") #expect(result[0].videoDeliveryState == .processing) @@ -165,7 +165,7 @@ struct OpenAPIAppPreviewsTests { links: .init(this: "") )) - let repo = OpenAPIAppPreviews(client: stub) + let repo = OpenAPIPreviewRepository(client: stub) let result = try await repo.createPreviewSet(localizationId: "loc-77", previewType: .iphone67) #expect(result.id == "new-set") diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift index 99ed81ab..afc88c2b 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/PreviewSets/Internal/OpenAPIPreviewRepositoryUploadTests.swift @@ -14,7 +14,7 @@ struct OpenAPIPreviewRepositoryUploadTests { try Self.preview(#"{"data":{"type":"appPreviews","id":"prev-1","attributes":{"fileName":"demo.mov","fileSize":7,"mimeType":"video/quicktime","previewFrameTimeCode":"00:00:05:00","videoDeliveryState":{"state":"UPLOAD_COMPLETE"}}},"links":{"self":""}}"#), ]) - let preview = try await OpenAPIAppPreviews(client: stub).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: "00:00:05:00") + let preview = try await OpenAPIPreviewRepository(client: stub).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: "00:00:05:00") #expect(preview == AppPreview(id: "prev-1", setId: "pset-1", fileName: "demo.mov", fileSize: 7, mimeType: "video/quicktime", videoDeliveryState: .uploadComplete, previewFrameTimeCode: "00:00:05:00")) @@ -32,7 +32,7 @@ struct OpenAPIPreviewRepositoryUploadTests { http.enqueue(json: "", statusCode: 500) await #expect(throws: (any Error).self) { - try await OpenAPIAppPreviews(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: nil) + try await OpenAPIPreviewRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: nil) } #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/appPreviews"]) } @@ -45,7 +45,7 @@ struct OpenAPIPreviewRepositoryUploadTests { http.enqueue(json: "", statusCode: 200) await #expect(throws: (any Error).self) { - _ = try await OpenAPIAppPreviews(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: nil) + _ = try await OpenAPIPreviewRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadPreview(setId: "pset-1", fileURL: file, previewFrameTimeCode: nil) } #expect(http.capturedRequests.isEmpty) #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/appPreviews"]) diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift index 9f2b8c15..c1311fa4 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotSetTests.swift @@ -46,14 +46,14 @@ struct AppScreenshotSetTests { @Test func `set is equatable regardless of injected repo`() { - let a = MockRepositoryFactory.makeScreenshotSet(id: "1", repo: MockAppScreenshots()) - let b = MockRepositoryFactory.makeScreenshotSet(id: "1", repo: MockAppScreenshots()) + let a = MockRepositoryFactory.makeScreenshotSet(id: "1", repo: MockScreenshotRepository()) + let b = MockRepositoryFactory.makeScreenshotSet(id: "1", repo: MockScreenshotRepository()) #expect(a == b) } @Test func `importScreenshots uses own id as setId`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).uploadScreenshot(setId: .value("set-42"), fileURL: .any) .willReturn(MockRepositoryFactory.makeScreenshot(setId: "set-42")) @@ -68,7 +68,7 @@ struct AppScreenshotSetTests { @Test func `importScreenshots uploads entries sorted by order`() async throws { - let mockRepo = MockAppScreenshots() + let mockRepo = MockScreenshotRepository() given(mockRepo).uploadScreenshot(setId: .any, fileURL: .any) .willReturn(MockRepositoryFactory.makeScreenshot(id: "img-1")) @@ -88,7 +88,7 @@ struct AppScreenshotSetTests { @Test func `importScreenshots skips entries with no matching imageURL`() async throws { - let set = MockRepositoryFactory.makeScreenshotSet(id: "set-1", repo: MockAppScreenshots()) + let set = MockRepositoryFactory.makeScreenshotSet(id: "set-1", repo: MockScreenshotRepository()) let results = try await set.importScreenshots( entries: [ScreenshotManifest.ScreenshotEntry(order: 1, file: "missing.png")], imageURLs: [:] diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift index 129827ab..ee38ffab 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryCreateTests.swift @@ -18,7 +18,7 @@ struct SDKScreenshotRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKAppScreenshots(client: stub) + let repo = SDKScreenshotRepository(client: stub) let result = try await repo.createScreenshotSet(localizationId: "loc-42", displayType: .iphone67) #expect(result.id == "set-new") @@ -37,7 +37,7 @@ struct SDKScreenshotRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKAppScreenshots(client: stub) + let repo = SDKScreenshotRepository(client: stub) let result = try await repo.createScreenshotSet(localizationId: "loc-1", displayType: .iphone67) // A set with repo injected does not throw "requires a repository" @@ -56,7 +56,7 @@ struct SDKScreenshotRepositoryCreateTests { links: .init(this: "") )) - let repo = SDKAppScreenshots(client: stub) + let repo = SDKScreenshotRepository(client: stub) let result = try await repo.createScreenshotSet(localizationId: "loc-1", displayType: .ipadPro3gen11) #expect(result.screenshotDisplayType == .ipadPro3gen11) diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKAppScreenshotsTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKAppScreenshotsTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift index 608807a2..aa3a05ed 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKAppScreenshotsTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryTests.swift @@ -3,14 +3,14 @@ import Testing @testable import ASCKit @Suite -struct SDKAppScreenshotsTests { +struct SDKScreenshotRepositoryTests { // MARK: - deleteScreenshot @Test func `should delete the screenshot from App Store Connect`() async throws { let stub = StubAPIClient() - try await SDKAppScreenshots(client: stub).deleteScreenshot(screenshotId: "shot-1") + try await SDKScreenshotRepository(client: stub).deleteScreenshot(screenshotId: "shot-1") #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["DELETE /v1/appScreenshots/shot-1"]) } @@ -18,7 +18,7 @@ struct SDKAppScreenshotsTests { @Test func `should delete the screenshot set from App Store Connect`() async throws { let stub = StubAPIClient() - try await SDKAppScreenshots(client: stub).deleteScreenshotSet(setId: "set-1") + try await SDKScreenshotRepository(client: stub).deleteScreenshotSet(setId: "set-1") #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["DELETE /v1/appScreenshotSets/set-1"]) } @@ -43,7 +43,7 @@ struct SDKAppScreenshotsTests { links: .init(this: "") )) - let repo = SDKAppScreenshots(client: stub) + let repo = SDKScreenshotRepository(client: stub) let result = try await repo.listScreenshotSets(localizationId: "loc-99") #expect(result.count == 2) @@ -63,7 +63,7 @@ struct SDKAppScreenshotsTests { links: .init(this: "") )) - let repo = SDKAppScreenshots(client: stub) + let repo = SDKScreenshotRepository(client: stub) let result = try await repo.listScreenshotSets(localizationId: "loc-1") // A set with repo injected does not throw "requires a repository" @@ -84,7 +84,7 @@ struct SDKAppScreenshotsTests { links: .init(this: "") )) - let repo = SDKAppScreenshots(client: stub) + let repo = SDKScreenshotRepository(client: stub) let result = try await repo.listScreenshotSets(localizationId: "loc-1") #expect(result[0].screenshotDisplayType == .iphone67) @@ -110,7 +110,7 @@ struct SDKAppScreenshotsTests { links: .init(this: "") )) - let repo = SDKAppScreenshots(client: stub) + let repo = SDKScreenshotRepository(client: stub) let result = try await repo.listScreenshots(setId: "set-77") #expect(result.count == 2) @@ -130,7 +130,7 @@ struct SDKAppScreenshotsTests { links: .init(this: "") )) - let repo = SDKAppScreenshots(client: stub) + let repo = SDKScreenshotRepository(client: stub) let result = try await repo.listScreenshots(setId: "set-1") #expect(result[0].id == "img-1") diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift index fb0c371f..319eb08b 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/Internal/SDKScreenshotRepositoryUploadTests.swift @@ -14,7 +14,7 @@ struct SDKScreenshotRepositoryUploadTests { try Self.screenshot(#"{"data":{"type":"appScreenshots","id":"shot-1","attributes":{"fileName":"home.png","fileSize":7,"assetDeliveryState":{"state":"UPLOAD_COMPLETE"}}},"links":{"self":""}}"#), ]) - let screenshot = try await SDKAppScreenshots(client: stub).uploadScreenshot(setId: "set-1", fileURL: file) + let screenshot = try await SDKScreenshotRepository(client: stub).uploadScreenshot(setId: "set-1", fileURL: file) #expect(screenshot == AppScreenshot(id: "shot-1", setId: "set-1", fileName: "home.png", fileSize: 7, assetState: .uploadComplete)) #expect(stub.requests.map { "\($0.method) \($0.path) \($0.body ?? "")" } == [ @@ -31,7 +31,7 @@ struct SDKScreenshotRepositoryUploadTests { http.enqueue(json: "", statusCode: 500) await #expect(throws: (any Error).self) { - try await SDKAppScreenshots(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadScreenshot(setId: "set-1", fileURL: file) + try await SDKScreenshotRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadScreenshot(setId: "set-1", fileURL: file) } #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/appScreenshots"]) } @@ -44,7 +44,7 @@ struct SDKScreenshotRepositoryUploadTests { http.enqueue(json: "", statusCode: 200) await #expect(throws: (any Error).self) { - _ = try await SDKAppScreenshots(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadScreenshot(setId: "set-1", fileURL: file) + _ = try await SDKScreenshotRepository(client: stub, uploader: UploadOperationsExecutor(http: http)).uploadScreenshot(setId: "set-1", fileURL: file) } #expect(http.capturedRequests.isEmpty) #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["POST /v1/appScreenshots"]) diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotsTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotsTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift index d2e0d312..4dd1d93c 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/AppScreenshotsTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/ScreenshotSets/ScreenshotRepositoryTests.swift @@ -3,10 +3,10 @@ import Testing @testable import ASCKit @Suite -struct AppScreenshotsTests { +struct ScreenshotRepositoryTests { @Test func `list screenshot sets returns sets for localization`() async throws { - let mock = MockAppScreenshots() + let mock = MockScreenshotRepository() let sets = [ MockRepositoryFactory.makeScreenshotSet(id: "set-1", displayType: .iphone67), MockRepositoryFactory.makeScreenshotSet(id: "set-2", displayType: .ipadPro3gen129), @@ -20,7 +20,7 @@ struct AppScreenshotsTests { } @Test func `list screenshots returns screenshots for set`() async throws { - let mock = MockAppScreenshots() + let mock = MockScreenshotRepository() let screenshots = [ MockRepositoryFactory.makeScreenshot(id: "img-1", fileName: "screen1.png"), MockRepositoryFactory.makeScreenshot(id: "img-2", fileName: "screen2.png"), @@ -34,7 +34,7 @@ struct AppScreenshotsTests { } @Test func `list screenshots returns empty for set with no screenshots`() async throws { - let mock = MockAppScreenshots() + let mock = MockScreenshotRepository() given(mock).listScreenshots(setId: .any).willReturn([]) let result = try await mock.listScreenshots(setId: "empty-set") diff --git a/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationsTests.swift b/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationsTests.swift rename to Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift index 7a6b8de4..546026d6 100644 --- a/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationsTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/Localizations/VersionLocalizationRepositoryTests.swift @@ -3,12 +3,12 @@ import Testing @testable import ASCKit @Suite -struct VersionLocalizationsTests { +struct VersionLocalizationRepositoryTests { // MARK: - list @Test func `list localizations returns localizations for version`() async throws { - let mock = MockVersionLocalizations() + let mock = MockVersionLocalizationRepository() let localizations = [ MockRepositoryFactory.makeLocalization(id: "loc-1", locale: "en-US"), MockRepositoryFactory.makeLocalization(id: "loc-2", locale: "zh-Hans"), @@ -22,7 +22,7 @@ struct VersionLocalizationsTests { } @Test func `list localizations returns empty when version has no localizations`() async throws { - let mock = MockVersionLocalizations() + let mock = MockVersionLocalizationRepository() given(mock).listLocalizations(versionId: .any).willReturn([]) let result = try await mock.listLocalizations(versionId: "v1") @@ -32,7 +32,7 @@ struct VersionLocalizationsTests { // MARK: - create @Test func `create localization returns new localization with locale`() async throws { - let mock = MockVersionLocalizations() + let mock = MockVersionLocalizationRepository() let created = MockRepositoryFactory.makeLocalization(id: "loc-new", versionId: "v1", locale: "fr-FR") given(mock).createLocalization(versionId: .any, locale: .any).willReturn(created) @@ -44,7 +44,7 @@ struct VersionLocalizationsTests { // MARK: - update (mental model: I have a localization, I want to set What's New text) @Test func `update localization returns localization with new whatsNew text`() async throws { - let mock = MockVersionLocalizations() + let mock = MockVersionLocalizationRepository() let updated = MockRepositoryFactory.makeLocalization(id: "loc-1", whatsNew: "Bug fixes and performance improvements") given(mock).updateLocalization( localizationId: .any, @@ -69,7 +69,7 @@ struct VersionLocalizationsTests { } @Test func `update localization with nil fields does not overwrite existing data`() async throws { - let mock = MockVersionLocalizations() + let mock = MockVersionLocalizationRepository() let existing = MockRepositoryFactory.makeLocalization( id: "loc-1", whatsNew: "Previous text", diff --git a/Tests/ASCKitTests/Apps/Versions/AppStoreVersionsTests.swift b/Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift similarity index 89% rename from Tests/ASCKitTests/Apps/Versions/AppStoreVersionsTests.swift rename to Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift index b1d70d86..fd888344 100644 --- a/Tests/ASCKitTests/Apps/Versions/AppStoreVersionsTests.swift +++ b/Tests/ASCKitTests/Apps/Versions/VersionRepositoryTests.swift @@ -3,11 +3,11 @@ import Testing @testable import ASCKit @Suite -struct AppStoreVersionsTests { +struct VersionRepositoryTests { @Test func `list versions returns versions for app`() async throws { - let mock = MockAppStoreVersions() + let mock = MockVersionRepository() let versions = [ MockRepositoryFactory.makeVersion(id: "v1", versionString: "2.1.0", platform: .iOS), MockRepositoryFactory.makeVersion(id: "v2", versionString: "1.5.0", platform: .macOS), @@ -24,7 +24,7 @@ struct AppStoreVersionsTests { @Test func `list versions returns empty when app has no versions`() async throws { - let mock = MockAppStoreVersions() + let mock = MockVersionRepository() given(mock).listVersions(appId: .any).willReturn([]) let result = try await mock.listVersions(appId: "new-app") diff --git a/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDsTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDsTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift index aa3984c0..be0cb830 100644 --- a/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDsTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKBundleIDRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKBundleIDsTests { +struct SDKBundleIDRepositoryTests { @Test func `listBundleIDs maps identifier and platform`() async throws { let stub = StubAPIClient() @@ -18,7 +18,7 @@ struct SDKBundleIDsTests { links: .init(this: "") )) - let repo = SDKBundleIDs(client: stub) + let repo = SDKBundleIDRepository(client: stub) let result = try await repo.listBundleIDs(platform: nil, identifier: nil) #expect(result[0].id == "bid-1") @@ -40,7 +40,7 @@ struct SDKBundleIDsTests { links: .init(this: "") )) - let repo = SDKBundleIDs(client: stub) + let repo = SDKBundleIDRepository(client: stub) let result = try await repo.listBundleIDs(platform: nil, identifier: nil) #expect(result[0].platform == .macOS) @@ -48,7 +48,7 @@ struct SDKBundleIDsTests { @Test func `deleteBundleID calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKBundleIDs(client: stub) + let repo = SDKBundleIDRepository(client: stub) try await repo.deleteBundleID(id: "bid-1") @@ -66,7 +66,7 @@ struct SDKBundleIDsTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKBundleIDs(client: stub) + let repo = SDKBundleIDRepository(client: stub) let result = try await repo.listBundleIDs(platform: nil, identifier: nil) #expect(result.count == 75) diff --git a/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificatesTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/CodeSigning/Internal/SDKCertificatesTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift index 0db1b732..7a7d0a48 100644 --- a/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificatesTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKCertificateRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKCertificatesTests { +struct SDKCertificateRepositoryTests { @Test func `listCertificates maps name and type`() async throws { let stub = StubAPIClient() @@ -24,7 +24,7 @@ struct SDKCertificatesTests { links: .init(this: "") )) - let repo = SDKCertificates(client: stub) + let repo = SDKCertificateRepository(client: stub) let result = try await repo.listCertificates(certificateType: nil, limit: nil) #expect(result[0].id == "cert-1") @@ -48,7 +48,7 @@ struct SDKCertificatesTests { links: .init(this: "") )) - let repo = SDKCertificates(client: stub) + let repo = SDKCertificateRepository(client: stub) let result = try await repo.listCertificates(certificateType: nil, limit: nil) #expect(result[0].expirationDate == expiration) @@ -56,7 +56,7 @@ struct SDKCertificatesTests { @Test func `revokeCertificate calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKCertificates(client: stub) + let repo = SDKCertificateRepository(client: stub) try await repo.revokeCertificate(id: "cert-1") diff --git a/Tests/ASCKitTests/CodeSigning/Internal/SDKDevicesTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift similarity index 93% rename from Tests/ASCKitTests/CodeSigning/Internal/SDKDevicesTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift index 1ad86c5c..67b1bf93 100644 --- a/Tests/ASCKitTests/CodeSigning/Internal/SDKDevicesTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKDeviceRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKDevicesTests { +struct SDKDeviceRepositoryTests { @Test func `listDevices maps name udid and deviceClass`() async throws { let stub = StubAPIClient() @@ -25,7 +25,7 @@ struct SDKDevicesTests { links: .init(this: "") )) - let repo = SDKDevices(client: stub) + let repo = SDKDeviceRepository(client: stub) let result = try await repo.listDevices(platform: nil) #expect(result[0].id == "dev-1") @@ -50,7 +50,7 @@ struct SDKDevicesTests { links: .init(this: "") )) - let repo = SDKDevices(client: stub) + let repo = SDKDeviceRepository(client: stub) let result = try await repo.listDevices(platform: nil) #expect(result[0].isEnabled == false) @@ -67,7 +67,7 @@ struct SDKDevicesTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKDevices(client: stub) + let repo = SDKDeviceRepository(client: stub) let result = try await repo.listDevices(platform: nil) #expect(result.count == 75) diff --git a/Tests/ASCKitTests/CodeSigning/Internal/SDKProfilesTests.swift b/Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/CodeSigning/Internal/SDKProfilesTests.swift rename to Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift index 752d2cfc..d7d837b0 100644 --- a/Tests/ASCKitTests/CodeSigning/Internal/SDKProfilesTests.swift +++ b/Tests/ASCKitTests/CodeSigning/Internal/SDKProfileRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKProfilesTests { +struct SDKProfileRepositoryTests { @Test func `listProfiles injects bundleIdId from request when filtering by bundle id`() async throws { let stub = StubAPIClient() @@ -18,7 +18,7 @@ struct SDKProfilesTests { links: .init(this: "") )) - let repo = SDKProfiles(client: stub) + let repo = SDKProfileRepository(client: stub) let result = try await repo.listProfiles(bundleIdId: "bid-99", profileType: nil) #expect(result[0].id == "prof-1") @@ -43,7 +43,7 @@ struct SDKProfilesTests { links: .init(this: "") )) - let repo = SDKProfiles(client: stub) + let repo = SDKProfileRepository(client: stub) let result = try await repo.listProfiles(bundleIdId: nil, profileType: nil) #expect(result[0].bundleIdId == "bid-from-relationship") @@ -52,7 +52,7 @@ struct SDKProfilesTests { @Test func `deleteProfile calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKProfiles(client: stub) + let repo = SDKProfileRepository(client: stub) try await repo.deleteProfile(id: "prof-1") @@ -70,7 +70,7 @@ struct SDKProfilesTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKProfiles(client: stub) + let repo = SDKProfileRepository(client: stub) let result = try await repo.listProfiles(bundleIdId: "bid-1", profileType: nil) #expect(result.count == 75) @@ -88,7 +88,7 @@ struct SDKProfilesTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKProfiles(client: stub) + let repo = SDKProfileRepository(client: stub) let result = try await repo.listProfiles(bundleIdId: nil, profileType: nil) #expect(result.count == 75) @@ -100,7 +100,7 @@ struct SDKProfilesTests { let stub = StubAPIClient() stub.willReturn(ProfilesResponse(data: [], links: .init(this: ""))) - let repo = SDKProfiles(client: stub) + let repo = SDKProfileRepository(client: stub) _ = try await repo.listProfiles(bundleIdId: nil, profileType: nil) let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) diff --git a/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterTests.swift b/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift similarity index 93% rename from Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterTests.swift rename to Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift index 641b39a6..55ca398f 100644 --- a/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterTests.swift +++ b/Tests/ASCKitTests/GameCenter/Internal/SDKGameCenterRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKGameCenterTests { +struct SDKGameCenterRepositoryTests { // MARK: - getDetail @@ -18,7 +18,7 @@ struct SDKGameCenterTests { links: .init(this: "") )) - let repo = SDKGameCenter(client: stub) + let repo = SDKGameCenterRepository(client: stub) let detail = try await repo.getDetail(appId: "app-42") #expect(detail.id == "gc-99") @@ -37,7 +37,7 @@ struct SDKGameCenterTests { links: .init(this: "") )) - let repo = SDKGameCenter(client: stub) + let repo = SDKGameCenterRepository(client: stub) let detail = try await repo.getDetail(appId: "app-1") #expect(detail.isArcadeEnabled == false) @@ -65,7 +65,7 @@ struct SDKGameCenterTests { links: .init(this: "") )) - let repo = SDKGameCenter(client: stub) + let repo = SDKGameCenterRepository(client: stub) let result = try await repo.listAchievements(gameCenterDetailId: "gc-42") #expect(result[0].id == "ach-1") @@ -98,7 +98,7 @@ struct SDKGameCenterTests { links: .init(this: "") )) - let repo = SDKGameCenter(client: stub) + let repo = SDKGameCenterRepository(client: stub) let result = try await repo.createAchievement( gameCenterDetailId: "gc-1", referenceName: "High Score", @@ -119,7 +119,7 @@ struct SDKGameCenterTests { @Test func `deleteAchievement calls void request`() async throws { let stub = StubAPIClient() - let repo = SDKGameCenter(client: stub) + let repo = SDKGameCenterRepository(client: stub) try await repo.deleteAchievement(id: "ach-1") #expect(stub.voidRequestCalled == true) @@ -147,7 +147,7 @@ struct SDKGameCenterTests { links: .init(this: "") )) - let repo = SDKGameCenter(client: stub) + let repo = SDKGameCenterRepository(client: stub) let result = try await repo.listLeaderboards(gameCenterDetailId: "gc-42") #expect(result[0].id == "lb-1") @@ -179,7 +179,7 @@ struct SDKGameCenterTests { links: .init(this: "") )) - let repo = SDKGameCenter(client: stub) + let repo = SDKGameCenterRepository(client: stub) let result = try await repo.createLeaderboard( gameCenterDetailId: "gc-1", referenceName: "Speed Run", @@ -199,7 +199,7 @@ struct SDKGameCenterTests { @Test func `deleteLeaderboard calls void request`() async throws { let stub = StubAPIClient() - let repo = SDKGameCenter(client: stub) + let repo = SDKGameCenterRepository(client: stub) try await repo.deleteLeaderboard(id: "lb-1") #expect(stub.voidRequestCalled == true) diff --git a/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationTests.swift b/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationTests.swift rename to Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift index 6a13eabb..f843468d 100644 --- a/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationTests.swift +++ b/Tests/ASCKitTests/GameCenter/Moderation/Internal/SDKGameCenterModerationRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct SDKGameCenterModerationTests { +struct SDKGameCenterModerationRepositoryTests { // MARK: - Score moderations @@ -37,7 +37,7 @@ struct SDKGameCenterModerationTests { links: .init(this: "") )) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.listScoreModerations(leaderboardId: "lb-42", blockedOnly: false) #expect(result == [ @@ -72,7 +72,7 @@ struct SDKGameCenterModerationTests { links: .init(this: "") )) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.listScoreModerations(leaderboardId: "lb-42", blockedOnly: true) #expect(result == [ @@ -97,7 +97,7 @@ struct SDKGameCenterModerationTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<200, nextCursor: "page-2"), page(200..<250, nextCursor: nil)]) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.listScoreModerations(leaderboardId: "lb-42", blockedOnly: false) #expect(result.count == 250) @@ -116,7 +116,7 @@ struct SDKGameCenterModerationTests { links: .init(this: "") )) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.updateScoreModeration(id: "mod-1", isBlocked: true) #expect(result == ASCKit.GameCenterScoreModeration( @@ -133,7 +133,7 @@ struct SDKGameCenterModerationTests { links: .init(this: "") )) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.updateScoreModeration(id: "mod-1", isBlocked: false) #expect(result.isBlocked == false) @@ -154,7 +154,7 @@ struct SDKGameCenterModerationTests { links: .init(this: "") )) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.listBlockedPlayers(gameCenterDetailId: "gc-42") #expect(result == [ @@ -172,7 +172,7 @@ struct SDKGameCenterModerationTests { links: .init(this: "") )) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.listBlockedPlayers(gameCenterDetailId: "gc-42") #expect(result.map(\.isBlocked) == [true]) @@ -191,7 +191,7 @@ struct SDKGameCenterModerationTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<200, nextCursor: "page-2"), page(200..<230, nextCursor: nil)]) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.listBlockedPlayers(gameCenterDetailId: "gc-42") #expect(result.count == 230) @@ -209,7 +209,7 @@ struct SDKGameCenterModerationTests { links: .init(this: "") )) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.updatePlayer(id: "player-1", isBlocked: false) #expect(result == ASCKit.GameCenterPlayer( @@ -225,7 +225,7 @@ struct SDKGameCenterModerationTests { links: .init(this: "") )) - let repo = SDKGameCenterModeration(client: stub) + let repo = SDKGameCenterModerationRepository(client: stub) let result = try await repo.updatePlayer(id: "player-1", isBlocked: true) #expect(result.isBlocked == true) diff --git a/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundlesTests.swift b/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundlesTests.swift rename to Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift index 59a2cdb2..9dbf63cd 100644 --- a/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundlesTests.swift +++ b/Tests/ASCKitTests/Iris/AppBundles/Internal/IrisSDKAppBundleRepositoryTests.swift @@ -4,7 +4,7 @@ import Testing @testable import ASCKit @Suite -struct IrisSDKAppBundlesTests { +struct IrisSDKAppBundleRepositoryTests { private let session = IrisSession(cookies: "myacinfo=a") private func reply(_ status: Int, _ body: String) -> (Data, HTTPURLResponse) { @@ -25,7 +25,7 @@ struct IrisSDKAppBundlesTests { ]} """#)) - let bundles = try await IrisSDKAppBundles(client: iris).listAppBundles(session: session) + let bundles = try await IrisSDKAppBundleRepository(client: iris).listAppBundles(session: session) #expect(bundles == [ AppBundle(id: "b1", name: "Bakery", bundleId: "com.example.bakery", sku: "BAKE", primaryLocale: "en-GB", platforms: ["IOS"]), @@ -39,7 +39,7 @@ struct IrisSDKAppBundlesTests { {"data":{"id":"new","type":"apps","attributes":{"bundleId":"com.example.new","sku":"NEW","primaryLocale":"en-US","platformNames":["IOS"]}}} """#)) - let bundle = try await IrisSDKAppBundles(client: iris).createApp( + let bundle = try await IrisSDKAppBundleRepository(client: iris).createApp( session: session, name: "New App", bundleId: "com.example.new", sku: "NEW", primaryLocale: "en-US", platforms: ["IOS"], versionString: "1.0" ) @@ -53,7 +53,7 @@ struct IrisSDKAppBundlesTests { .willThrow(IrisAPIError.httpError(statusCode: 409, body: "bundle id taken")) do { - _ = try await IrisSDKAppBundles(client: iris).createApp( + _ = try await IrisSDKAppBundleRepository(client: iris).createApp( session: session, name: "Dup", bundleId: "com.example.dup", sku: "DUP", primaryLocale: "en-US", platforms: ["IOS"], versionString: "1.0" ) diff --git a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStatesTests.swift b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift similarity index 94% rename from Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStatesTests.swift rename to Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift index 8bf7407f..3716618a 100644 --- a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStatesTests.swift +++ b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift @@ -36,7 +36,7 @@ private final class CapturedURL: @unchecked Sendable { } @Suite(.serialized) -struct IrisSDKInAppPurchaseStatesTests { +struct IrisSDKInAppPurchaseStateRepositoryTests { @Test func `fetchSubmitFlags returns map of iapId to submitWithNextAppStoreVersion`() async throws { IrisStateURLProtocolStub.handler = { _ in @@ -67,7 +67,7 @@ struct IrisSDKInAppPurchaseStatesTests { } let client = IrisClient(session: IrisStateURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseStates(client: client) + let repo = IrisSDKInAppPurchaseStateRepository(client: client) let flags = try await repo.fetchSubmitFlags( session: IrisSession(cookies: "myacinfo=A"), appId: "app-7" @@ -89,7 +89,7 @@ struct IrisSDKInAppPurchaseStatesTests { } let client = IrisClient(session: IrisStateURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseStates(client: client) + let repo = IrisSDKInAppPurchaseStateRepository(client: client) _ = try await repo.fetchSubmitFlags( session: IrisSession(cookies: "myacinfo=A"), appId: "app-7" @@ -116,7 +116,7 @@ struct IrisSDKInAppPurchaseStatesTests { } let client = IrisClient(session: IrisStateURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseStates(client: client) + let repo = IrisSDKInAppPurchaseStateRepository(client: client) let flags = try await repo.fetchSubmitFlags( session: IrisSession(cookies: "myacinfo=A"), appId: "app-7" diff --git a/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionsTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift similarity index 86% rename from Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionsTests.swift rename to Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift index b241d72f..0e40d370 100644 --- a/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionsTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/FileIrisSessionRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct FileIrisSessionsTests { +struct FileIrisSessionRepositoryTests { private func tempURL() -> URL { FileManager.default.temporaryDirectory @@ -13,7 +13,7 @@ struct FileIrisSessionsTests { @Test func `save then load roundtrips the session`() throws { let url = tempURL() defer { try? FileManager.default.removeItem(at: url) } - let repo = FileIrisSessions(fileURL: url) + let repo = FileIrisSessionRepository(fileURL: url) let session = IrisAuthSession( cookies: "myacinfo=A1", scnt: "scnt", serviceKey: "key", appleIDSessionID: "sess", providerID: 42, teamId: "T", userEmail: "u@x.com", @@ -25,13 +25,13 @@ struct FileIrisSessionsTests { @Test func `current returns nil when no session is persisted`() throws { let url = tempURL() - let repo = FileIrisSessions(fileURL: url) + let repo = FileIrisSessionRepository(fileURL: url) #expect(try repo.current() == nil) } @Test func `delete removes the persisted file`() throws { let url = tempURL() - let repo = FileIrisSessions(fileURL: url) + let repo = FileIrisSessionRepository(fileURL: url) try repo.save(IrisAuthSession( cookies: "c", scnt: "s", serviceKey: "k", appleIDSessionID: "id", userEmail: "u@x.com", expiresAt: Date() @@ -44,7 +44,7 @@ struct FileIrisSessionsTests { @Test func `save writes file with 0600 permissions`() throws { let url = tempURL() defer { try? FileManager.default.removeItem(at: url) } - let repo = FileIrisSessions(fileURL: url) + let repo = FileIrisSessionRepository(fileURL: url) try repo.save(IrisAuthSession( cookies: "c", scnt: "s", serviceKey: "k", appleIDSessionID: "id", userEmail: "u@x.com", expiresAt: Date() diff --git a/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift index 808fcc2c..ee434aab 100644 --- a/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/StoredSRPIrisCookieProviderTests.swift @@ -23,7 +23,7 @@ struct StoredSRPIrisCookieProviderTests { } @Test func `resolveSession returns cookies from the persisted session when it has not expired`() throws { - let storage = MockIrisSessions() + let storage = MockIrisSessionRepository() given(storage).current().willReturn( session(cookies: "myacinfo=1; itctx=2", expiresAt: Date().addingTimeInterval(3600)) ) @@ -33,7 +33,7 @@ struct StoredSRPIrisCookieProviderTests { } @Test func `resolveSession throws noCookiesFound when storage is empty`() { - let storage = MockIrisSessions() + let storage = MockIrisSessionRepository() given(storage).current().willReturn(nil) let provider = StoredSRPIrisCookieProvider(sessionRepository: storage) #expect(throws: IrisCookieError.noCookiesFound) { @@ -42,7 +42,7 @@ struct StoredSRPIrisCookieProviderTests { } @Test func `resolveSession throws when the persisted session has expired`() { - let storage = MockIrisSessions() + let storage = MockIrisSessionRepository() given(storage).current().willReturn( session(expiresAt: Date(timeIntervalSinceNow: -60)) ) @@ -53,7 +53,7 @@ struct StoredSRPIrisCookieProviderTests { } @Test func `resolveStatus reports srpLogin source and counts cookies`() throws { - let storage = MockIrisSessions() + let storage = MockIrisSessionRepository() given(storage).current().willReturn( session( cookies: "myacinfo=1; itctx=2; dqsid=3", diff --git a/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift b/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift index 2973bd93..eea95beb 100644 --- a/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/IrisResponseDecodingTests.swift @@ -87,7 +87,7 @@ struct IrisResponseDecodingTests { // MARK: - mapToAppBundle @Test func `maps resource to AppBundle with all fields`() { - let repo = IrisSDKAppBundles() + let repo = IrisSDKAppBundleRepository() let resource = makeResource( id: "app-1", name: "Test", @@ -106,28 +106,28 @@ struct IrisResponseDecodingTests { } @Test func `maps resource with nil name uses fallback`() { - let repo = IrisSDKAppBundles() + let repo = IrisSDKAppBundleRepository() let resource = makeResource(id: "app-1") let bundle = repo.mapToAppBundle(resource, fallbackName: "Fallback") #expect(bundle.name == "Fallback") } @Test func `maps resource with nil name and no fallback uses empty string`() { - let repo = IrisSDKAppBundles() + let repo = IrisSDKAppBundleRepository() let resource = makeResource(id: "app-1") let bundle = repo.mapToAppBundle(resource) #expect(bundle.name == "") } @Test func `maps resource with nil platforms uses empty array`() { - let repo = IrisSDKAppBundles() + let repo = IrisSDKAppBundleRepository() let resource = makeResource(id: "app-1") let bundle = repo.mapToAppBundle(resource) #expect(bundle.platforms == []) } @Test func `maps resource with nil primaryLocale defaults to en-US`() { - let repo = IrisSDKAppBundles() + let repo = IrisSDKAppBundleRepository() let resource = makeResource(id: "app-1") let bundle = repo.mapToAppBundle(resource) #expect(bundle.primaryLocale == "en-US") diff --git a/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterTests.swift b/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift similarity index 98% rename from Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterTests.swift rename to Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift index fb727455..a3e7ef33 100644 --- a/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterTests.swift +++ b/Tests/ASCKitTests/Iris/ResolutionCenter/Internal/IrisSDKResolutionCenterRepositoryTests.swift @@ -107,10 +107,10 @@ private let rejectionsJSON = Data(""" private let emptyThreadsJSON = Data(#"{"data":[]}"#.utf8) @Suite(.serialized) -struct IrisSDKResolutionCenterTests { +struct IrisSDKResolutionCenterRepositoryTests { - private func makeRepo() -> IrisSDKResolutionCenter { - IrisSDKResolutionCenter( + private func makeRepo() -> IrisSDKResolutionCenterRepository { + IrisSDKResolutionCenterRepository( client: IrisClient(session: IrisResolutionCenterURLProtocolStub.makeSession()) ) } diff --git a/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportsTests.swift b/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift similarity index 92% rename from Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportsTests.swift rename to Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift index 541c0f12..b3068498 100644 --- a/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportsTests.swift +++ b/Tests/ASCKitTests/Reports/Internal/SDKAnalyticsReportRepositoryTests.swift @@ -17,7 +17,7 @@ struct SDKAnalyticsReportRepositoryCreateRequestTests { links: .init(this: "") )) - let repo = SDKAnalyticsReports(client: stub) + let repo = SDKAnalyticsReportRepository(client: stub) let result = try await repo.createRequest(appId: "app-42", accessType: .oneTimeSnapshot) #expect(result.id == "req-new") @@ -39,7 +39,7 @@ struct SDKAnalyticsReportRepositoryListRequestsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReports(client: stub) + let repo = SDKAnalyticsReportRepository(client: stub) let result = try await repo.listRequests(appId: "app-99", accessType: nil) #expect(result.count == 2) @@ -56,7 +56,7 @@ struct SDKAnalyticsReportRepositoryListRequestsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReports(client: stub) + let repo = SDKAnalyticsReportRepository(client: stub) let result = try await repo.listRequests(appId: "app-1", accessType: nil) #expect(result[0].isStoppedDueToInactivity == true) @@ -76,7 +76,7 @@ struct SDKAnalyticsReportRepositoryListReportsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReports(client: stub) + let repo = SDKAnalyticsReportRepository(client: stub) let result = try await repo.listReports(requestId: "req-42", category: nil) #expect(result.count == 2) @@ -98,7 +98,7 @@ struct SDKAnalyticsReportRepositoryListInstancesTests { links: .init(this: "") )) - let repo = SDKAnalyticsReports(client: stub) + let repo = SDKAnalyticsReportRepository(client: stub) let result = try await repo.listInstances(reportId: "rpt-42", granularity: nil) #expect(result.count == 1) @@ -120,7 +120,7 @@ struct SDKAnalyticsReportRepositoryListSegmentsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReports(client: stub) + let repo = SDKAnalyticsReportRepository(client: stub) let result = try await repo.listSegments(instanceId: "inst-42") #expect(result.count == 1) @@ -139,7 +139,7 @@ struct SDKAnalyticsReportRepositoryListSegmentsTests { links: .init(this: "") )) - let repo = SDKAnalyticsReports(client: stub) + let repo = SDKAnalyticsReportRepository(client: stub) let result = try await repo.listSegments(instanceId: "inst-1") #expect(result[0].checksum == nil) diff --git a/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplatesTests.swift b/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift similarity index 86% rename from Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplatesTests.swift rename to Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift index dd6f32c8..763d3d7d 100644 --- a/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplatesTests.swift +++ b/Tests/ASCKitTests/Screenshots/Gallery/GalleryTemplateRepositoryTests.swift @@ -3,13 +3,13 @@ import Testing import Mockable @testable import ASCKit -@Suite("GalleryTemplates") -struct GalleryTemplatesTests { +@Suite("GalleryTemplateRepository") +struct GalleryTemplateRepositoryTests { // ── User: "I browse gallery templates" ── @Test func `list returns all galleries`() async throws { - let repo = MockGalleryTemplates() + let repo = MockGalleryTemplateRepository() let g1 = Gallery(appName: "App1", screenshots: ["s.png"]) g1.template = MockRepositoryFactory.makeGalleryTemplate(id: "neon-pop") let g2 = Gallery(appName: "App2", screenshots: ["s.png"]) @@ -26,7 +26,7 @@ struct GalleryTemplatesTests { // ── User: "I pick a specific gallery template" ── @Test func `get returns gallery by template id`() async throws { - let repo = MockGalleryTemplates() + let repo = MockGalleryTemplateRepository() let g = Gallery(appName: "App", screenshots: ["s.png"]) g.template = MockRepositoryFactory.makeGalleryTemplate(id: "neon-pop", name: "Neon Pop") @@ -37,7 +37,7 @@ struct GalleryTemplatesTests { } @Test func `get returns nil for unknown id`() async throws { - let repo = MockGalleryTemplates() + let repo = MockGalleryTemplateRepository() given(repo).getGallery(templateId: .value("unknown")).willReturn(nil) let gallery = try await repo.getGallery(templateId: "unknown") diff --git a/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplatesTests.swift b/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift similarity index 88% rename from Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplatesTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift index 84cc8666..6bfebe3a 100644 --- a/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplatesTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/AggregateGalleryTemplateRepositoryTests.swift @@ -3,17 +3,17 @@ import Mockable import Testing @testable import ASCKit -@Suite("AggregateGalleryTemplates") -struct AggregateGalleryTemplatesTests { +@Suite("AggregateGalleryTemplateRepository") +struct AggregateGalleryTemplateRepositoryTests { @Test func `empty repository returns no galleries`() async throws { - let repo = AggregateGalleryTemplates() + let repo = AggregateGalleryTemplateRepository() let galleries = try await repo.listGalleries() #expect(galleries.isEmpty) } @Test func `registered provider galleries are returned`() async throws { - let repo = AggregateGalleryTemplates() + let repo = AggregateGalleryTemplateRepository() let provider = MockGalleryTemplateProvider() given(provider).providerId.willReturn("test") given(provider).galleries().willReturn([ @@ -29,7 +29,7 @@ struct AggregateGalleryTemplatesTests { } @Test func `multiple providers are aggregated in registration order`() async throws { - let repo = AggregateGalleryTemplates() + let repo = AggregateGalleryTemplateRepository() let providerA = MockGalleryTemplateProvider() given(providerA).providerId.willReturn("a") given(providerA).galleries().willReturn([makeGallery(templateId: "a-1", appName: "A1")]) @@ -50,7 +50,7 @@ struct AggregateGalleryTemplatesTests { } @Test func `getGallery returns the matching template`() async throws { - let repo = AggregateGalleryTemplates() + let repo = AggregateGalleryTemplateRepository() let provider = MockGalleryTemplateProvider() given(provider).providerId.willReturn("test") given(provider).galleries().willReturn([ @@ -65,7 +65,7 @@ struct AggregateGalleryTemplatesTests { } @Test func `getGallery returns nil when templateId is unknown`() async throws { - let repo = AggregateGalleryTemplates() + let repo = AggregateGalleryTemplateRepository() let provider = MockGalleryTemplateProvider() given(provider).providerId.willReturn("test") given(provider).galleries().willReturn([makeGallery(templateId: "t-1", appName: "Alpha")]) @@ -76,7 +76,7 @@ struct AggregateGalleryTemplatesTests { } @Test func `provider errors propagate to caller`() async throws { - let repo = AggregateGalleryTemplates() + let repo = AggregateGalleryTemplateRepository() let provider = MockGalleryTemplateProvider() given(provider).providerId.willReturn("broken") given(provider).galleries().willThrow(StubError.boom) diff --git a/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplatesTests.swift b/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift similarity index 91% rename from Tests/ASCKitTests/Screenshots/Internal/AggregateTemplatesTests.swift rename to Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift index ba819652..1549359b 100644 --- a/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplatesTests.swift +++ b/Tests/ASCKitTests/Screenshots/Internal/AggregateTemplateRepositoryTests.swift @@ -2,17 +2,17 @@ import Foundation import Testing @testable import ASCKit -@Suite("AggregateTemplates") -struct AggregateTemplatesTests { +@Suite("AggregateTemplateRepository") +struct AggregateTemplateRepositoryTests { @Test func `empty repository returns no templates`() async throws { - let repo = AggregateTemplates() + let repo = AggregateTemplateRepository() let templates = try await repo.listTemplates(size: nil) #expect(templates.isEmpty) } @Test func `registered provider templates are returned`() async throws { - let repo = AggregateTemplates() + let repo = AggregateTemplateRepository() let provider = StubTemplateProvider(providerId: "test", templates: [ makeTemplate(id: "t-1", name: "Template One"), makeTemplate(id: "t-2", name: "Template Two"), @@ -26,7 +26,7 @@ struct AggregateTemplatesTests { } @Test func `multiple providers are aggregated`() async throws { - let repo = AggregateTemplates() + let repo = AggregateTemplateRepository() await repo.register(provider: StubTemplateProvider(providerId: "a", templates: [ makeTemplate(id: "a-1"), ])) @@ -40,7 +40,7 @@ struct AggregateTemplatesTests { } @Test func `list filters by size`() async throws { - let repo = AggregateTemplates() + let repo = AggregateTemplateRepository() await repo.register(provider: StubTemplateProvider(providerId: "test", templates: [ makeTemplate(id: "portrait-1", supportedSizes: [.portrait]), makeTemplate(id: "landscape-1", supportedSizes: [.landscape]), @@ -59,7 +59,7 @@ struct AggregateTemplatesTests { } @Test func `get template by id finds across providers`() async throws { - let repo = AggregateTemplates() + let repo = AggregateTemplateRepository() await repo.register(provider: StubTemplateProvider(providerId: "a", templates: [ makeTemplate(id: "a-1", name: "From A"), ])) diff --git a/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift b/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift index 5481c8bf..94b7141c 100644 --- a/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift +++ b/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift @@ -11,10 +11,10 @@ struct SubmissionPlannerTests { ) private struct Repos { - let iaps = MockInAppPurchases() - let groups = MockSubscriptionGroups() - let subscriptions = MockSubscriptions() - let versions = MockProductVersions() + let iaps = MockInAppPurchaseRepository() + let groups = MockSubscriptionGroupRepository() + let subscriptions = MockSubscriptionRepository() + let versions = MockProductVersionRepository() var planner: SubmissionPlanner { SubmissionPlanner(iapRepo: iaps, groupRepo: groups, subscriptionRepo: subscriptions, productVersionRepo: versions) diff --git a/Tests/ASCKitTests/Territories/Internal/SDKTerritoriesTests.swift b/Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/Territories/Internal/SDKTerritoriesTests.swift rename to Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift index 240d25dd..0f943ade 100644 --- a/Tests/ASCKitTests/Territories/Internal/SDKTerritoriesTests.swift +++ b/Tests/ASCKitTests/Territories/Internal/SDKTerritoryRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKTerritoriesTests { +struct SDKTerritoryRepositoryTests { @Test func `listTerritories maps id and currency from SDK response`() async throws { let stub = StubAPIClient() @@ -16,7 +16,7 @@ struct SDKTerritoriesTests { links: .init(this: "") )) - let repo = SDKTerritories(client: stub) + let repo = SDKTerritoryRepository(client: stub) let result = try await repo.listTerritories() #expect(result.count == 3) @@ -35,7 +35,7 @@ struct SDKTerritoriesTests { links: .init(this: "") )) - let repo = SDKTerritories(client: stub) + let repo = SDKTerritoryRepository(client: stub) let result = try await repo.listTerritories() #expect(result[0].id == "USA") diff --git a/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift b/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift index a38423fc..8d91783e 100644 --- a/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift +++ b/Tests/ASCKitTests/TestHelpers/MockRepositoryFactory.swift @@ -172,7 +172,7 @@ struct MockRepositoryFactory { localizationId: String = "loc-1", displayType: ScreenshotDisplayType = .iphone67, screenshotsCount: Int = 0, - repo: (any AppScreenshots)? = nil + repo: (any ScreenshotRepository)? = nil ) -> AppScreenshotSet { AppScreenshotSet( id: id, diff --git a/Tests/ASCKitTests/Users/Internal/SDKUsersTests.swift b/Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift similarity index 93% rename from Tests/ASCKitTests/Users/Internal/SDKUsersTests.swift rename to Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift index be6076c3..a09f0478 100644 --- a/Tests/ASCKitTests/Users/Internal/SDKUsersTests.swift +++ b/Tests/ASCKitTests/Users/Internal/SDKUserRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKUsersTests { +struct SDKUserRepositoryTests { @Test func `listUsers maps username roles and visibility`() async throws { let stub = StubAPIClient() @@ -25,7 +25,7 @@ struct SDKUsersTests { links: .init(this: "") )) - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) let result = try await repo.listUsers(role: nil) #expect(result[0].id == "u-1") @@ -39,7 +39,7 @@ struct SDKUsersTests { @Test func `removeUser calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) try await repo.removeUser(id: "u-1") @@ -48,7 +48,7 @@ struct SDKUsersTests { @Test func `cancelUserInvitation calls void endpoint`() async throws { let stub = StubAPIClient() - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) try await repo.cancelUserInvitation(id: "inv-1") @@ -76,7 +76,7 @@ struct SDKUsersTests { links: .init(this: "") )) - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) let result = try await repo.listUserInvitations(role: nil) #expect(result[0].id == "inv-1") @@ -104,7 +104,7 @@ struct SDKUsersTests { links: .init(this: "") )) - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) let result = try await repo.updateUser(id: "u-1", roles: [.admin]) #expect(result.id == "u-1") @@ -131,7 +131,7 @@ struct SDKUsersTests { links: .init(this: "") )) - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) let result = try await repo.inviteUser( email: "hire@example.com", firstName: "Alex", @@ -159,7 +159,7 @@ struct SDKUsersTests { links: .init(this: "") )) - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) let result = try await repo.listUsers(role: .admin) #expect(result[0].roles == [.admin]) @@ -185,7 +185,7 @@ struct SDKUsersTests { links: .init(this: "") )) - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) let result = try await repo.listUserInvitations(role: .admin) #expect(result[0].roles == [.admin]) @@ -202,7 +202,7 @@ struct SDKUsersTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKUsers(client: stub) + let repo = SDKUserRepository(client: stub) let result = try await repo.listUsers(role: nil) #expect(result.count == 75) diff --git a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunsTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunsTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift index cb7873c3..c8729c90 100644 --- a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunsTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudBuildRunRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKXcodeCloudBuildRunsTests { +struct SDKXcodeCloudBuildRunRepositoryTests { private func makeSDKBuildRun( id: String = "run-1", @@ -31,7 +31,7 @@ struct SDKXcodeCloudBuildRunsTests { links: .init(this: "") )) - let repo = SDKXcodeCloudBuildRuns(client: stub) + let repo = SDKXcodeCloudBuildRunRepository(client: stub) let result = try await repo.listBuildRuns(workflowId: "wf-1") #expect(result[0].id == "run-1") @@ -47,7 +47,7 @@ struct SDKXcodeCloudBuildRunsTests { links: .init(this: "") )) - let repo = SDKXcodeCloudBuildRuns(client: stub) + let repo = SDKXcodeCloudBuildRunRepository(client: stub) let result = try await repo.listBuildRuns(workflowId: "wf-99") #expect(result[0].workflowId == "wf-99") @@ -60,7 +60,7 @@ struct SDKXcodeCloudBuildRunsTests { links: .init(this: "") )) - let repo = SDKXcodeCloudBuildRuns(client: stub) + let repo = SDKXcodeCloudBuildRunRepository(client: stub) let result = try await repo.getBuildRun(id: "run-42") #expect(result.id == "run-42") @@ -76,7 +76,7 @@ struct SDKXcodeCloudBuildRunsTests { links: .init(this: "") )) - let repo = SDKXcodeCloudBuildRuns(client: stub) + let repo = SDKXcodeCloudBuildRunRepository(client: stub) let result = try await repo.startBuildRun(workflowId: "wf-1", clean: false) #expect(result.id == "run-new") @@ -95,7 +95,7 @@ struct SDKXcodeCloudBuildRunsTests { let stub = StubAPIClient() stub.willReturnPages([page(0..<50, nextCursor: "page-2"), page(50..<75, nextCursor: nil)]) - let repo = SDKXcodeCloudBuildRuns(client: stub) + let repo = SDKXcodeCloudBuildRunRepository(client: stub) let result = try await repo.listBuildRuns(workflowId: "wf-1") #expect(result.count == 75) diff --git a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductsTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift similarity index 88% rename from Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductsTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift index cb1ab3f8..e097cd4f 100644 --- a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductsTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudProductRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKXcodeCloudProductsTests { +struct SDKXcodeCloudProductRepositoryTests { @Test func `listProducts maps name and productType from SDK response`() async throws { let stub = StubAPIClient() @@ -21,7 +21,7 @@ struct SDKXcodeCloudProductsTests { links: .init(this: "") )) - let repo = SDKXcodeCloudProducts(client: stub) + let repo = SDKXcodeCloudProductRepository(client: stub) let result = try await repo.listProducts(appId: nil) #expect(result[0].id == "prod-1") @@ -45,7 +45,7 @@ struct SDKXcodeCloudProductsTests { links: .init(this: "") )) - let repo = SDKXcodeCloudProducts(client: stub) + let repo = SDKXcodeCloudProductRepository(client: stub) let result = try await repo.listProducts(appId: nil) #expect(result[0].appId == "app-99") @@ -55,7 +55,7 @@ struct SDKXcodeCloudProductsTests { let stub = StubAPIClient() stub.willReturn(CiProductsResponse(data: [], links: .init(this: ""))) - let repo = SDKXcodeCloudProducts(client: stub) + let repo = SDKXcodeCloudProductRepository(client: stub) let result = try await repo.listProducts(appId: "app-123") #expect(result.isEmpty) diff --git a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowsTests.swift b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift similarity index 90% rename from Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowsTests.swift rename to Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift index 8419341d..5ad42ad5 100644 --- a/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowsTests.swift +++ b/Tests/ASCKitTests/XcodeCloud/Internal/SDKXcodeCloudWorkflowRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKXcodeCloudWorkflowsTests { +struct SDKXcodeCloudWorkflowRepositoryTests { @Test func `listWorkflows maps name and isEnabled from SDK response`() async throws { let stub = StubAPIClient() @@ -21,7 +21,7 @@ struct SDKXcodeCloudWorkflowsTests { links: .init(this: "") )) - let repo = SDKXcodeCloudWorkflows(client: stub) + let repo = SDKXcodeCloudWorkflowRepository(client: stub) let result = try await repo.listWorkflows(productId: "prod-1") #expect(result[0].id == "wf-1") @@ -45,7 +45,7 @@ struct SDKXcodeCloudWorkflowsTests { links: .init(this: "") )) - let repo = SDKXcodeCloudWorkflows(client: stub) + let repo = SDKXcodeCloudWorkflowRepository(client: stub) let result = try await repo.listWorkflows(productId: "prod-42") #expect(result[0].productId == "prod-42") diff --git a/docs/documentation-design/layout.md b/docs/documentation-design/layout.md index 4ccda2e5..08dc728b 100644 --- a/docs/documentation-design/layout.md +++ b/docs/documentation-design/layout.md @@ -52,7 +52,7 @@ They don't care which Swift type, repository method or SDK call changed; that's **Before (0.17.8):** a removed REST route is hidden at the end of an 1,100-char `Added` bullet: -> - **`asc iris iap-submissions delete --submission-id `** — iris-side dequeue of an IAP submission (`DELETE /iris/v1/inAppPurchaseSubmissions/{id}`). Iris-queued submissions don't round-trip through the public-SDK delete; they can only be removed via this iris-cookie-authed path. New `IrisClient.delete`, new `IrisInAppPurchaseSubmissions.deleteSubmission(session:submissionId:)`. REST equivalent: … `RESTPathResolver.resourcePath` now converts spaces … Removed the short-lived public-SDK alias `POST /api/v1/iap/:iapId/unsubmit` (incorrect — …). +> - **`asc iris iap-submissions delete --submission-id `** — iris-side dequeue of an IAP submission (`DELETE /iris/v1/inAppPurchaseSubmissions/{id}`). Iris-queued submissions don't round-trip through the public-SDK delete; they can only be removed via this iris-cookie-authed path. New `IrisClient.delete`, new `IrisInAppPurchaseSubmissionRepository.deleteSubmission(session:submissionId:)`. REST equivalent: … `RESTPathResolver.resourcePath` now converts spaces … Removed the short-lived public-SDK alias `POST /api/v1/iap/:iapId/unsubmit` (incorrect — …). A script calling `POST /api/v1/iap/:iapId/unsubmit` broke, and the only notice was the last sentence of a bullet about something else. diff --git a/docs/features/concept-folders/design.md b/docs/features/concept-folders/design.md index 5962c88a..f555efaf 100644 --- a/docs/features/concept-folders/design.md +++ b/docs/features/concept-folders/design.md @@ -4,7 +4,7 @@ description: The source layout reworked from layers (Domain/, Infrastructure/) t # Concept folders, not layers -**Status: BUILT** — steps 1–5: one `ASCKit` module in concept folders; docs and skills follow; one composition root, held by a test; every adapter's decisions tested with only the bare call in `Internal/System/`; protocols named for what they are. asc-cli is split by layer: `Sources/Domain/` +**Status: BUILT** — steps 1–5: one `ASCKit` module in concept folders; docs and skills follow; one composition root, held by a test; every adapter's decisions tested with only the bare call in `Internal/System/`; `Repository` for CRUD, role nouns for workflows. asc-cli is split by layer: `Sources/Domain/` and `Sources/Infrastructure/` are two modules that mirror each other folder for folder. Every concept therefore lives in two places, and every change to one touches both trees. The goal, stated as a test: @@ -27,7 +27,7 @@ one touches both trees. The goal, stated as a test: | **The two trees already disagree** | `Domain/Screenshots/` is implemented by `Infrastructure/ScreenshotPlans/`; `Infrastructure/Client/`, `Web/` and `Iris/Auth/` have no Domain twin | finding an implementation means knowing a second name | | **The module split is paid for by hand** | 613 `Domain.X` qualifiers in 69 files, to tell a Domain type from the SDK type of the same name (`Domain.Territory` vs the SDK's `Territory`) | every new adapter repeats the qualifier dance | | **Implementations leak to the way in** | `ASCCommand` imports `Infrastructure` in 80 files; outside `ClientProvider`, 14 files name 12 implementation types (22 uses) — `FileAuthStorage()` in 10 auth and report commands, and `RESTRoutes` builds its own `CompositeAuthProvider`, `ClientFactory` and five more | swapping an implementation (keychain auth storage, another renderer) edits every command that names it | -| **The outside call is mixed with decisions** | the SDK adapters are already split right: they depend on the narrow `APIClient` role, whose real implementation is the SDK's own `APIProvider`, and 472 tests drive them through `StubAPIClient`. The rest are not: seven adapters (`ShellRunner`, `IrisClient`, `WebKitHTMLRenderer`, `BrowserIrisCookieProvider`, `IrisSDKAppBundles`, `IrisSDKSignIn`, `MarketplacePlugins`, ~860 lines) hold their decisions beside a `Process`, `URLSession`, WebKit or cookie call, and `codecov.yml` skips each by file path | their decisions — argv, environment, status → error, parsing — have no test | +| **The outside call is mixed with decisions** | the SDK adapters are already split right: they depend on the narrow `APIClient` role, whose real implementation is the SDK's own `APIProvider`, and 472 tests drive them through `StubAPIClient`. The rest are not: seven adapters (`ShellRunner`, `IrisClient`, `WebKitHTMLRenderer`, `BrowserIrisCookieProvider`, `IrisSDKAppBundleRepository`, `IrisSDKSignIn`, `MarketplacePlugins`, ~860 lines) hold their decisions beside a `Process`, `URLSession`, WebKit or cookie call, and `codecov.yml` skips each by file path | their decisions — argv, environment, status → error, parsing — have no test | ## 2 · The shape — outside to inside @@ -58,11 +58,11 @@ Sources/ ├── Shared/ the kernel: Affordance, APIError, OutputFormat, pagination, RESTPathResolver │ └── Internal/ APIClient, ClientFactory, HTTPPerforming, SDKFilter, uploads ├── Apps/ - │ ├── App.swift Apps.swift App+RESTRoutes.swift public face + │ ├── App.swift AppRepository.swift App+RESTRoutes.swift public face │ ├── Internal/OpenAPIAppRepository.swift implementation │ ├── Builds/ - │ │ ├── Build.swift Builds.swift … public face - │ │ └── Internal/SDKBuilds.swift … implementation + │ │ ├── Build.swift BuildRepository.swift … public face + │ │ └── Internal/SDKBuildRepository.swift … implementation │ ├── Versions/ TestFlight/ InAppPurchases/ Subscriptions/ … (same shape, nested as today) ├── Auth/ Internal/ (FileAuthProvider, EnvironmentAuthProvider, CompositeAuthProvider) ├── Iris/ Internal/ Internal/Auth/ Internal/Auth/SRP/ @@ -117,7 +117,7 @@ safety net; any step that moves a rule writes its test first. | 2 | **docs and skills follow** ✓ | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | | 3 | **one composition root** ✓ | 22 uses of 12 `Internal/` types in 14 `ASCCommand` files outside `ClientProvider`; `RESTRoutes` wires its own `ClientFactory` | `ClientProvider` gains `makeAuthStorage`, `makeEnvironmentAuthProvider`, `makeXcodeBuildRunner`, `makeProjectConfigStorage`; commands and `RESTRoutes` ask it for the public protocol | "should build every concept's Internal implementation only in the composition root" | | 4 | **`Internal/System/` per adapter** ✓ (one commit each) | seven untested adapters mix decisions with I/O; `codecov.yml` lists each file | each adapter's decisions become a tested value or orchestrator in `Internal/`; only the call stays, ≤100 lines, in `Internal/System/`; the per-file ignores become one `**/Internal/System/**` rule. The SDK adapters stay as they are | per adapter, its decisions: e.g. "should add the given variables on top of the inherited environment" | -| 5 | **names for roles** ✓ | 75 `XxxRepository` protocols and their ~75 implementations | collections take the plural of the aggregate (`Apps`, `Builds`, `AppStoreVersions`, `AppScreenshots`); the rest a role noun (`IrisSignIn`, `TestFlight`, `GameCenter`, `Reports`, `AppPrices`, `ReviewSubmissions`, `…ReviewAssets`); implementations say how (`SDKBuilds`, `SimctlSimulators`, `MarketplacePlugins`); mocks, `make…` factories and file names follow. `XxxProvider`s stay: providing is what they do, and the rule bans Service / Manager / Port / Helper / Repository | none — behaviour unchanged; 2,958 tests before and after | +| 5 | **names for roles** ✓ | 75 `XxxRepository` protocols, 11 of which run a workflow rather than CRUD | `XxxRepository` stays for the 64 CRUD protocols. The 11 workflows take role nouns: `IrisSignIn`, `Reports`, `ReviewSubmissions`, `InAppPurchaseSubmissions`, `SubscriptionSubmissions`, `IrisInAppPurchaseSubmissions`, `AppWall`, `Simulators`, `Skills`, `Plugins`, `Themes`; their implementations, mocks and `make…` factories follow. `XxxProvider`s stay | none — behaviour unchanged; 2,958 tests before and after | Step 1 removes most of §1's cost on its own; 3 and 4 make the fence real; 5 is cosmetic and can wait. diff --git a/docs/features/iap-subscriptions/pricing.md b/docs/features/iap-subscriptions/pricing.md index 4aec5bd9..264a0022 100644 --- a/docs/features/iap-subscriptions/pricing.md +++ b/docs/features/iap-subscriptions/pricing.md @@ -81,5 +81,5 @@ IAP pricing endpoints live alongside the IAP resource (see [IAP REST routes](REA ## Testing ```bash -swift test --filter 'SubscriptionPricePoint|SDKSubscriptionPrices|SubscriptionPricesSet' +swift test --filter 'SubscriptionPricePoint|SDKSubscriptionPriceRepository|SubscriptionPricesSet' ``` diff --git a/docs/features/iap-subscriptions/review-assets.md b/docs/features/iap-subscriptions/review-assets.md index 3d0f4483..9bee09c0 100644 --- a/docs/features/iap-subscriptions/review-assets.md +++ b/docs/features/iap-subscriptions/review-assets.md @@ -121,5 +121,5 @@ Upload and delete are CLI-only (multipart-style chunked upload would be a separa ## Testing ```bash -swift test --filter 'ReviewScreenshot|PromotionalImage|SDKInAppPurchaseReviewAssets|SDKSubscriptionReviewAssets' +swift test --filter 'ReviewScreenshot|PromotionalImage|SDKInAppPurchaseReviewRepository|SDKSubscriptionReviewRepository' ``` diff --git a/docs/features/iap-subscriptions/submission-iris-parity.md b/docs/features/iap-subscriptions/submission-iris-parity.md index e5609a93..59008fb1 100644 --- a/docs/features/iap-subscriptions/submission-iris-parity.md +++ b/docs/features/iap-subscriptions/submission-iris-parity.md @@ -42,7 +42,7 @@ The web UI expresses "alongside next version" via `submitWithNextAppStoreVersion - `Sources/ASCKit/Iris/Internal/IrisClient.swift` — handles cookie injection, `[asc-ui]` CSRF header, JSON:API content-type - `Sources/ASCKit/Iris/Internal/BrowserIrisCookieProvider.swift` — pulls cookies from the user's logged-in browser -- Working precedent: `IrisSDKAppBundles` already calls iris through `IrisClient` +- Working precedent: `IrisSDKAppBundleRepository` already calls iris through `IrisClient` ## Shipped approach (IAP) @@ -110,8 +110,8 @@ For an established-app IAP that's ready, the agent sees both `submit` and `addTo #### Where the two signals come from -- **`isFirstTimeSubmission`** — derived per-batch in `SDKInAppPurchases.listInAppPurchases`. Every IAP returned for the app is checked via `InAppPurchaseState.hasBeenApproved` (`approved | developerRemovedFromSale | removedFromSale`); if zero are shipped, every unapproved IAP gets `true`. **Zero extra API calls** — derived from data already in the listing response. -- **`submitWithNextAppStoreVersion`** — best-effort enrichment via `IrisSDKInAppPurchaseStates.fetchSubmitFlags`. One iris call per `iap list`, server-side filtered to `state=READY_TO_SUBMIT` with only the one field. Failures (no iris cookies, network error, malformed response) silently leave the flag `false` so CI scripts using API-key auth keep their existing JSON output unchanged. +- **`isFirstTimeSubmission`** — derived per-batch in `SDKInAppPurchaseRepository.listInAppPurchases`. Every IAP returned for the app is checked via `InAppPurchaseState.hasBeenApproved` (`approved | developerRemovedFromSale | removedFromSale`); if zero are shipped, every unapproved IAP gets `true`. **Zero extra API calls** — derived from data already in the listing response. +- **`submitWithNextAppStoreVersion`** — best-effort enrichment via `IrisSDKInAppPurchaseStateRepository.fetchSubmitFlags`. One iris call per `iap list`, server-side filtered to `state=READY_TO_SUBMIT` with only the one field. Failures (no iris cookies, network error, malformed response) silently leave the flag `false` so CI scripts using API-key auth keep their existing JSON output unchanged. **Caveat — only `iap list` has this context.** `isFirstTimeSubmission` and the iris enrichment are computed on the list path only; an IAP returned by any other command (e.g. `iap create` or `iap update`) has `isFirstTimeSubmission` defaulting to `false`. Agents that need the right affordance should `list` first. diff --git a/docs/features/iap-subscriptions/win-back-offers.md b/docs/features/iap-subscriptions/win-back-offers.md index 5454e526..685ed3e3 100644 --- a/docs/features/iap-subscriptions/win-back-offers.md +++ b/docs/features/iap-subscriptions/win-back-offers.md @@ -26,7 +26,7 @@ wait-months # minimum gap between offers shown to the same custo ## SDK gap -The generated `WinBackOfferPriceInlineCreate` is missing `territory` and `subscriptionPricePoint` relationship fields. `SDKWinBackOffers.createWinBackOffer` builds the body manually with a private `AnyCodable` type-erased enum. The ID convention matches ASC web (`${newPromoOfferPrice-N}`, 1-based). +The generated `WinBackOfferPriceInlineCreate` is missing `territory` and `subscriptionPricePoint` relationship fields. `SDKWinBackOfferRepository.createWinBackOffer` builds the body manually with a private `AnyCodable` type-erased enum. The ID convention matches ASC web (`${newPromoOfferPrice-N}`, 1-based). ## Domain model diff --git a/docs/features/iris/iris-srp-login.md b/docs/features/iris/iris-srp-login.md index 58e67ff8..1036917b 100644 --- a/docs/features/iris/iris-srp-login.md +++ b/docs/features/iris/iris-srp-login.md @@ -97,7 +97,7 @@ Sources/ │ ├── IrisAuthCredentials.swift appleId, password │ ├── IrisAuthSession.swift cookies, scnt, serviceKey, appleIDSessionID, providerID, teamId, userEmail, expiresAt │ ├── IrisSignIn.swift @Mockable: login, requestTwoFactorCode, submitTwoFactorCode, logout -│ ├── IrisSessions.swift @Mockable: save(IrisAuthSession), load() throws -> IrisAuthSession?, clear() +│ ├── IrisSessionRepository.swift @Mockable: save(IrisAuthSession), load() throws -> IrisAuthSession?, clear() │ ├── IrisAuthError.swift invalidCredentials, twoFactorRequired, twoFactorRejected, applePromptRequired, networkError │ ├── TwoFactorChallenge.swift method (trustedDevice/phone), maskedDestination, codeLength │ └── PendingTwoFactorState.swift serialized partial session: scnt, serviceKey, appleIDSessionID, twoFactorCookieBag @@ -109,10 +109,10 @@ Sources/ │ ├── IdmsaAPIClient.swift HTTP for idmsa.apple.com (signin/init, signin/complete, verify//securitycode, 2sv/trust); cookie jar & header threading │ ├── OlympusClient.swift olympus/v1/session for team metadata │ ├── IrisSDKSignIn.swift implements `ASCKit.IrisSignIn`; composes AppleSRPClient + IdmsaAPIClient + OlympusClient -│ ├── KeychainIrisSessionRepository.swift implements `ASCKit.IrisSessions` via macOS Keychain (Security framework) -│ ├── FileIrisSessions.swift implements `ASCKit.IrisSessions` via `~/.asc/iris/session.json`, written with `0600` -│ ├── CompositeIrisSessionRepository.swift implements `ASCKit.IrisSessions` by trying Keychain first, falling back to file (so macOS gets keychain protection, Linux silently falls through) -│ ├── KeychainIrisCookieProvider.swift implements existing `ASCKit.IrisCookieProvider`; reads from any `IrisSessions` +│ ├── KeychainIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` via macOS Keychain (Security framework) +│ ├── FileIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` via `~/.asc/iris/session.json`, written with `0600` +│ ├── CompositeIrisSessionRepository.swift implements `ASCKit.IrisSessionRepository` by trying Keychain first, falling back to file (so macOS gets keychain protection, Linux silently falls through) +│ ├── KeychainIrisCookieProvider.swift implements existing `ASCKit.IrisCookieProvider`; reads from any `IrisSessionRepository` │ └── CompositeIrisCookieProvider.swift implements `ASCKit.IrisCookieProvider`; resolution order env → stored → browser │ └── ASCCommand/Commands/Iris/Auth/ (new — CLI) diff --git a/docs/features/screenshot-editor/design.md b/docs/features/screenshot-editor/design.md index 9c0f303c..be423cce 100644 --- a/docs/features/screenshot-editor/design.md +++ b/docs/features/screenshot-editor/design.md @@ -17,7 +17,7 @@ Contributor notes for the browser editor in `homepage/editor/` and the import co │ │ js/app.js state │ │ (AsyncParsableCommand) │ │ │ │ js/compositor.js Canvas2D │ │ → /usr/bin/unzip │ │ │ │ js/texts.js drag layers │ │ → JSONDecoder → Manifest │ │ -│ │ js/export.js JSZip ZIP │ │ → AppScreenshots │ │ +│ │ js/export.js JSZip ZIP │ │ → ScreenshotRepository │ │ │ │ js/devices.js async load │ └──────────────────────────────┘ │ │ │ frames/devices.json │ │ │ └──────────────────────────────┘ Domain │ @@ -26,7 +26,7 @@ Contributor notes for the browser editor in `homepage/editor/` and the import co │ ASC API │ ├ LocalizationManifest │ │ │ ┌──────────────────────────────┐ │ └ ScreenshotEntry │ │ │ │ listLocalizations │ │ │ │ -│ │ createLocalization │ │ AppScreenshots │ │ +│ │ createLocalization │ │ ScreenshotRepository │ │ │ │ listScreenshotSets │◀──│ + importScreenshots(...) │ │ │ │ createScreenshotSet │ └──────────────────────────────┘ │ │ │ uploadScreenshot (3-step) │ │ @@ -62,13 +62,13 @@ public struct ScreenshotManifest: Codable, Sendable { } ``` -### Updated `AppScreenshots` +### Updated `ScreenshotRepository` `importScreenshots` was added to the existing `@Mockable` protocol: ```swift @Mockable -public protocol AppScreenshots: Sendable { +public protocol ScreenshotRepository: Sendable { // ... existing methods ... func importScreenshots( versionId: String, @@ -149,7 +149,7 @@ homepage/editor/ Web editor source Sources/ ├── ASCKit/Apps/Versions/Localizations/ScreenshotSets/ │ ├── ScreenshotImport.swift ScreenshotManifest + nested types -│ └── AppScreenshots.swift Modified: added importScreenshots +│ └── ScreenshotRepository.swift Modified: added importScreenshots │ ├── ASCKit/Apps/Versions/Localizations/ScreenshotSets/Internal/ │ └── OpenAPIScreenshotRepository.swift Modified: implements importScreenshots diff --git a/docs/library.md b/docs/library.md index 261f6671..b67d6ef8 100644 --- a/docs/library.md +++ b/docs/library.md @@ -46,11 +46,11 @@ struct StaticAuthProvider: AuthProvider { let factory = ClientFactory() let authProvider = StaticAuthProvider(credentials: credentials) -let appRepo = try factory.makeApps(authProvider: authProvider) +let appRepo = try factory.makeAppRepository(authProvider: authProvider) let apps = try await appRepo.listApps(limit: 50) apps.data.forEach { print($0.name, $0.bundleId) } -let buildRepo = try factory.makeBuilds(authProvider: authProvider) +let buildRepo = try factory.makeBuildRepository(authProvider: authProvider) let builds = try await buildRepo.listBuilds(appId: "YOUR_APP_ID", platform: nil, version: nil, limit: 10) ``` From bac708f7061cf0668d9d40a8a63b3dd31677b208 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 21:04:32 +0800 Subject: [PATCH 16/18] refactor: the submission protocols are repositories again SubmissionRepository, InAppPurchaseSubmissionRepository, SubscriptionSubmissionRepository and IrisInAppPurchaseSubmissionRepository are CRUD over a submission resource (submit is create or an isSubmitted update), so they keep the Repository name they had on main; their implementations, mocks and make* factories follow. The one workflow in them, SubmissionRepository.submitVersion, moves to the domain next. CLAUDE.md and the implement-feature skill say where a workflow over aggregates lives: a method on the model, built from repository primitives. Co-Authored-By: Claude Opus 5.5 --- .claude/skills/implement-feature/SKILL.md | 2 +- CLAUDE.md | 2 +- Sources/ASCCommand/ClientProvider.swift | 16 +++---- .../ASCCommand/Commands/IAP/IAPSubmit.swift | 4 +- .../ASCCommand/Commands/IAP/IAPUnsubmit.swift | 4 +- .../IrisIAPSubmissionsCreate.swift | 4 +- .../IrisIAPSubmissionsDelete.swift | 4 +- .../ReviewSubmissionItemsAdd.swift | 4 +- .../ReviewSubmissionItemsList.swift | 4 +- .../ReviewSubmissionItemsRemove.swift | 4 +- .../ReviewSubmissionsCreate.swift | 4 +- .../ReviewSubmissionsGet.swift | 4 +- .../ReviewSubmissionsList.swift | 4 +- .../ReviewSubmissionsSubmit.swift | 4 +- .../Subscriptions/SubscriptionsSubmit.swift | 4 +- .../Subscriptions/SubscriptionsUnsubmit.swift | 4 +- .../Commands/Versions/VersionsSubmit.swift | 8 ++-- .../Controllers/IAPSubmissionController.swift | 2 +- .../IrisIAPSubmissionsController.swift | 2 +- .../ReviewSubmissionsController.swift | 2 +- .../SubscriptionSubmissionController.swift | 2 +- .../VersionSubmissionController.swift | 2 +- .../ASCCommand/Commands/Web/RESTRoutes.swift | 10 ++--- ...> InAppPurchaseSubmissionRepository.swift} | 2 +- ...DKInAppPurchaseSubmissionRepository.swift} | 2 +- ...SDKSubscriptionSubmissionRepository.swift} | 2 +- ...=> SubscriptionSubmissionRepository.swift} | 2 +- ...DKInAppPurchaseSubmissionRepository.swift} | 6 +-- ...isInAppPurchaseSubmissionRepository.swift} | 4 +- .../IrisResolutionCenterRepository.swift | 2 +- .../Shared/Internal/ClientFactory.swift | 16 +++---- ...wift => OpenAPISubmissionRepository.swift} | 2 +- .../ASCKit/Submissions/SubmissionPlan.swift | 2 +- ...sions.swift => SubmissionRepository.swift} | 2 +- .../Commands/IAP/IAPSubmitTests.swift | 2 +- .../Commands/IAP/IAPUnsubmitTests.swift | 2 +- .../IrisIAPSubmissionsCreateTests.swift | 4 +- .../IrisIAPSubmissionsDeleteTests.swift | 2 +- .../ReviewSubmissionItemsListTests.swift | 4 +- .../ReviewSubmissionsBuildTests.swift | 18 ++++---- .../ReviewSubmissionsGetTests.swift | 2 +- .../ReviewSubmissionsListTests.swift | 10 ++--- .../SubscriptionsSubmitTests.swift | 2 +- .../SubscriptionsUnsubmitTests.swift | 2 +- .../Versions/VersionsSubmitTests.swift | 6 +-- .../Commands/Web/RESTRoutesTests.swift | 14 +++--- ...ppPurchaseSubmissionRepositoryTests.swift} | 6 +-- ...bscriptionSubmissionRepositoryTests.swift} | 6 +-- ...SDKInAppPurchaseStateRepositoryTests.swift | 2 +- ...ppPurchaseSubmissionRepositoryTests.swift} | 10 ++--- .../Internal/Auth/OlympusClientTests.swift | 2 +- .../SDKSubmissionRepositoryTests.swift | 44 +++++++++---------- .../Submissions/SubmissionPlannerTests.swift | 4 +- .../submission-iris-parity.md | 6 +-- 54 files changed, 145 insertions(+), 145 deletions(-) rename Sources/ASCKit/Apps/InAppPurchases/{InAppPurchaseSubmissions.swift => InAppPurchaseSubmissionRepository.swift} (73%) rename Sources/ASCKit/Apps/InAppPurchases/Internal/{SDKInAppPurchaseSubmissions.swift => SDKInAppPurchaseSubmissionRepository.swift} (91%) rename Sources/ASCKit/Apps/Subscriptions/Internal/{SDKSubscriptionSubmissions.swift => SDKSubscriptionSubmissionRepository.swift} (91%) rename Sources/ASCKit/Apps/Subscriptions/{SubscriptionSubmissions.swift => SubscriptionSubmissionRepository.swift} (74%) rename Sources/ASCKit/Iris/InAppPurchases/Internal/{IrisSDKInAppPurchaseSubmissions.swift => IrisSDKInAppPurchaseSubmissionRepository.swift} (92%) rename Sources/ASCKit/Iris/InAppPurchases/{IrisInAppPurchaseSubmissions.swift => IrisInAppPurchaseSubmissionRepository.swift} (84%) rename Sources/ASCKit/Submissions/Internal/{OpenAPIReviewSubmissions.swift => OpenAPISubmissionRepository.swift} (99%) rename Sources/ASCKit/Submissions/{ReviewSubmissions.swift => SubmissionRepository.swift} (94%) rename Tests/ASCKitTests/Apps/InAppPurchases/Internal/{SDKInAppPurchaseSubmissionsTests.swift => SDKInAppPurchaseSubmissionRepositoryTests.swift} (80%) rename Tests/ASCKitTests/Apps/Subscriptions/Internal/{SDKSubscriptionSubmissionsTests.swift => SDKSubscriptionSubmissionRepositoryTests.swift} (82%) rename Tests/ASCKitTests/Iris/InAppPurchases/Internal/{IrisSDKInAppPurchaseSubmissionsTests.swift => IrisSDKInAppPurchaseSubmissionRepositoryTests.swift} (94%) diff --git a/.claude/skills/implement-feature/SKILL.md b/.claude/skills/implement-feature/SKILL.md index 758d1335..c62313e4 100644 --- a/.claude/skills/implement-feature/SKILL.md +++ b/.claude/skills/implement-feature/SKILL.md @@ -110,7 +110,7 @@ See [command-affordances.md](references/command-affordances.md) for: ### 4. Repository protocol — primitives only, but allow composition in adapters -`XxxRepository` is for CRUD over an aggregate only. A protocol whose job is a workflow (sign in, submit for review, boot, download) takes a role noun instead: `IrisSignIn`, `ReviewSubmissions`, `Simulators`, `Reports`. +`XxxRepository` is for CRUD over an aggregate only — a state change like `submit` is an update. A protocol that runs something outside asc-cli (sign in, boot, install, download) takes a role noun instead: `IrisSignIn`, `Simulators`, `Reports`. A workflow over aggregates (find the draft, add the item, submit) is a domain operation on the model, built from repository primitives — `version.submitForReview(to:)`, `SubmissionPlan.submit(repo:)` — never a repository method. ```swift @Mockable diff --git a/CLAUDE.md b/CLAUDE.md index 572ceeb6..bb50b780 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -56,7 +56,7 @@ Concept folders mirror the App Store Connect resource hierarchy (`ASCKit/Apps/Ve **Rules every change follows:** - Models are `public struct` + `Sendable` + `Equatable` + `Codable`; the JSON encoding is the public schema. Optional text fields use `encodeIfPresent` so nil is omitted. -- **`XxxRepository` is for CRUD only** (list / get / create / update / delete an aggregate). A protocol that does more — a workflow like sign in, submit for review, boot, download — takes a role noun (`IrisSignIn`, `ReviewSubmissions`, `Simulators`, `Reports`). Never `XxxService` / `XxxManager`. +- **`XxxRepository` is for CRUD only** (list / get / create / update / delete an aggregate; a state change like `submit` is an update). A protocol that runs something outside asc-cli — sign in, boot, install, download — takes a role noun (`IrisSignIn`, `Simulators`, `Reports`). A workflow *over* aggregates (find the draft, add the item, submit) is a method on the model, not a repository method: `version.submitForReview(to:)`. Never `XxxService` / `XxxManager`. - Every model carries its **parent ID** (`AppStoreVersion.appId`, `AppScreenshot.setId`). The API doesn't return parent IDs, so the `Internal/` mappers inject them from the request. - State enums expose **semantic booleans** (`isLive`, `isEditable`, `isPending`) for agent decisions. - **CAEOAS:** every model provides `structuredAffordances` — ready-to-run next commands, state-aware (e.g. `submitForReview` only when `isEditable`). The CLI `affordances` and REST `_links` both derive from it. diff --git a/Sources/ASCCommand/ClientProvider.swift b/Sources/ASCCommand/ClientProvider.swift index 1b2fed07..c590291f 100644 --- a/Sources/ASCCommand/ClientProvider.swift +++ b/Sources/ASCCommand/ClientProvider.swift @@ -50,10 +50,10 @@ struct ClientProvider { return try factory.makeAppCategoryRepository(authProvider: authProvider) } - static func makeReviewSubmissions() throws -> any ReviewSubmissions { + static func makeSubmissionRepository() throws -> any SubmissionRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeReviewSubmissions(authProvider: authProvider) + return try factory.makeSubmissionRepository(authProvider: authProvider) } static func makeBundleIDRepository() throws -> any BundleIDRepository { @@ -146,10 +146,10 @@ struct ClientProvider { return try factory.makeSubscriptionGroupLocalizationRepository(authProvider: authProvider) } - static func makeInAppPurchaseSubmissions() throws -> any InAppPurchaseSubmissions { + static func makeInAppPurchaseSubmissionRepository() throws -> any InAppPurchaseSubmissionRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeInAppPurchaseSubmissions(authProvider: authProvider) + return try factory.makeInAppPurchaseSubmissionRepository(authProvider: authProvider) } static func makeProductVersionRepository() throws -> any ProductVersionRepository { @@ -170,10 +170,10 @@ struct ClientProvider { return try factory.makeSubscriptionPriceRepository(authProvider: authProvider) } - static func makeSubscriptionSubmissions() throws -> any SubscriptionSubmissions { + static func makeSubscriptionSubmissionRepository() throws -> any SubscriptionSubmissionRepository { let authProvider = CompositeAuthProvider() let factory = ClientFactory() - return try factory.makeSubscriptionSubmissions(authProvider: authProvider) + return try factory.makeSubscriptionSubmissionRepository(authProvider: authProvider) } static func makeSubscriptionPromotionalOfferRepository() throws -> any SubscriptionPromotionalOfferRepository { @@ -436,8 +436,8 @@ struct ClientProvider { ClientFactory().makeIrisAppBundleRepository() } - static func makeIrisInAppPurchaseSubmissions() -> any IrisInAppPurchaseSubmissions { - ClientFactory().makeIrisInAppPurchaseSubmissions() + static func makeIrisInAppPurchaseSubmissionRepository() -> any IrisInAppPurchaseSubmissionRepository { + ClientFactory().makeIrisInAppPurchaseSubmissionRepository() } static func makeIrisResolutionCenterRepository() -> any IrisResolutionCenterRepository { diff --git a/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift b/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift index 00733726..03e3a020 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPSubmit.swift @@ -13,11 +13,11 @@ struct IAPSubmit: AsyncParsableCommand { var iapId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseSubmissions() + let repo = try ClientProvider.makeInAppPurchaseSubmissionRepository() print(try await execute(repo: repo)) } - func execute(repo: any InAppPurchaseSubmissions) async throws -> String { + func execute(repo: any InAppPurchaseSubmissionRepository) async throws -> String { let submission = try await repo.submitInAppPurchase(iapId: iapId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift b/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift index ac48b5b3..a6f0d269 100644 --- a/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift +++ b/Sources/ASCCommand/Commands/IAP/IAPUnsubmit.swift @@ -13,11 +13,11 @@ struct IAPUnsubmit: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeInAppPurchaseSubmissions() + let repo = try ClientProvider.makeInAppPurchaseSubmissionRepository() try await execute(repo: repo) } - func execute(repo: any InAppPurchaseSubmissions) async throws { + func execute(repo: any InAppPurchaseSubmissionRepository) async throws { try await repo.deleteSubmission(submissionId: submissionId) } } diff --git a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift index 431c77b2..3dd3ad80 100644 --- a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreate.swift @@ -25,13 +25,13 @@ struct IrisIAPSubmissionsCreate: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisInAppPurchaseSubmissions() + let repo = ClientProvider.makeIrisInAppPurchaseSubmissionRepository() print(try await execute(cookieProvider: cookieProvider, repo: repo)) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisInAppPurchaseSubmissions, + repo: any IrisInAppPurchaseSubmissionRepository, affordanceMode: AffordanceMode = .cli ) async throws -> String { let session = try cookieProvider.resolveSession() diff --git a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift index 7dded5ee..f78cda31 100644 --- a/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift +++ b/Sources/ASCCommand/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDelete.swift @@ -18,13 +18,13 @@ struct IrisIAPSubmissionsDelete: AsyncParsableCommand { func run() async throws { let cookieProvider = ClientProvider.makeIrisCookieProvider() - let repo = ClientProvider.makeIrisInAppPurchaseSubmissions() + let repo = ClientProvider.makeIrisInAppPurchaseSubmissionRepository() try await execute(cookieProvider: cookieProvider, repo: repo) } func execute( cookieProvider: any IrisCookieProvider, - repo: any IrisInAppPurchaseSubmissions + repo: any IrisInAppPurchaseSubmissionRepository ) async throws { let session = try cookieProvider.resolveSession() try await repo.deleteSubmission(session: session, submissionId: submissionId) diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift index 9c994ebc..0c10b602 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsAdd.swift @@ -25,11 +25,11 @@ struct ReviewSubmissionItemsAdd: AsyncParsableCommand { var subscriptionGroupVersionId: String? func run() async throws { - let repo = try ClientProvider.makeReviewSubmissions() + let repo = try ClientProvider.makeSubmissionRepository() print(try await execute(repo: repo)) } - func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { guard let target = ReviewItemTarget( versionId: versionId, iapVersionId: iapVersionId, diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift index 7bbbaa5b..1c7dc168 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsList.swift @@ -16,11 +16,11 @@ struct ReviewSubmissionItemsList: AsyncParsableCommand { var state: String? func run() async throws { - let repo = try ClientProvider.makeReviewSubmissions() + let repo = try ClientProvider.makeSubmissionRepository() print(try await execute(repo: repo)) } - func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { var items = try await repo.listSubmissionItems(submissionId: submissionId) if let filter = state.flatMap({ ReviewSubmissionItemState(rawValue: $0.uppercased()) }) { items = items.filter { $0.state == filter } diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift index f89d815c..1c88551d 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionItemsRemove.swift @@ -13,11 +13,11 @@ struct ReviewSubmissionItemsRemove: AsyncParsableCommand { var itemId: String func run() async throws { - let repo = try ClientProvider.makeReviewSubmissions() + let repo = try ClientProvider.makeSubmissionRepository() try await execute(repo: repo) } - func execute(repo: any ReviewSubmissions) async throws { + func execute(repo: any SubmissionRepository) async throws { try await repo.removeItem(itemId: itemId) } } diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift index a24fcb70..381bf35b 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsCreate.swift @@ -16,11 +16,11 @@ struct ReviewSubmissionsCreate: AsyncParsableCommand { var platform: String = "ios" func run() async throws { - let repo = try ClientProvider.makeReviewSubmissions() + let repo = try ClientProvider.makeSubmissionRepository() print(try await execute(repo: repo)) } - func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { guard let appStorePlatform = AppStorePlatform(cliArgument: platform) else { throw ValidationError("Unknown platform '\(platform)'. Use: ios, macos, tvos, visionos") } diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift index d23cb134..c2270fb2 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsGet.swift @@ -13,11 +13,11 @@ struct ReviewSubmissionsGet: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeReviewSubmissions() + let repo = try ClientProvider.makeSubmissionRepository() print(try await execute(repo: repo)) } - func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let submission = try await repo.getSubmission(id: submissionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([submission], affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift index 457d4562..1fa86c13 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsList.swift @@ -20,11 +20,11 @@ struct ReviewSubmissionsList: AsyncParsableCommand { var limit: Int? func run() async throws { - let repo = try ClientProvider.makeReviewSubmissions() + let repo = try ClientProvider.makeSubmissionRepository() print(try await execute(repo: repo)) } - func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let parsedStates = state.map { csv in csv.split(separator: ",").compactMap { ReviewSubmissionState(rawValue: String($0).trimmingCharacters(in: .whitespaces).uppercased()) diff --git a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift index 76928039..cec5a855 100644 --- a/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift +++ b/Sources/ASCCommand/Commands/ReviewSubmissions/ReviewSubmissionsSubmit.swift @@ -13,11 +13,11 @@ struct ReviewSubmissionsSubmit: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeReviewSubmissions() + let repo = try ClientProvider.makeSubmissionRepository() print(try await execute(repo: repo)) } - func execute(repo: any ReviewSubmissions, affordanceMode: AffordanceMode = .cli) async throws -> String { + func execute(repo: any SubmissionRepository, affordanceMode: AffordanceMode = .cli) async throws -> String { let submission = try await repo.submit(submissionId: submissionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems([submission], affordanceMode: affordanceMode) diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift index d17689a1..e8a203b4 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsSubmit.swift @@ -13,11 +13,11 @@ struct SubscriptionsSubmit: AsyncParsableCommand { var subscriptionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionSubmissions() + let repo = try ClientProvider.makeSubscriptionSubmissionRepository() print(try await execute(repo: repo)) } - func execute(repo: any SubscriptionSubmissions) async throws -> String { + func execute(repo: any SubscriptionSubmissionRepository) async throws -> String { let submission = try await repo.submitSubscription(subscriptionId: subscriptionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift index fd363838..f7b6abd8 100644 --- a/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift +++ b/Sources/ASCCommand/Commands/Subscriptions/SubscriptionsUnsubmit.swift @@ -13,11 +13,11 @@ struct SubscriptionsUnsubmit: AsyncParsableCommand { var submissionId: String func run() async throws { - let repo = try ClientProvider.makeSubscriptionSubmissions() + let repo = try ClientProvider.makeSubscriptionSubmissionRepository() try await execute(repo: repo) } - func execute(repo: any SubscriptionSubmissions) async throws { + func execute(repo: any SubscriptionSubmissionRepository) async throws { try await repo.deleteSubmission(submissionId: submissionId) } } diff --git a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift index 2ceb1ae8..62db8fdb 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift @@ -33,16 +33,16 @@ struct VersionsSubmit: AsyncParsableCommand { productVersionRepo: try ClientProvider.makeProductVersionRepository() ) print(try await executeWithProducts( - submissionRepo: try ClientProvider.makeReviewSubmissions(), + submissionRepo: try ClientProvider.makeSubmissionRepository(), versionRepo: try ClientProvider.makeVersionRepository(), planner: planner )) } else { - print(try await execute(repo: try ClientProvider.makeReviewSubmissions())) + print(try await execute(repo: try ClientProvider.makeSubmissionRepository())) } } - func execute(repo: any ReviewSubmissions) async throws -> String { + func execute(repo: any SubmissionRepository) async throws -> String { let submission = try await repo.submitVersion(versionId: versionId) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) @@ -54,7 +54,7 @@ struct VersionsSubmit: AsyncParsableCommand { } func executeWithProducts( - submissionRepo: any ReviewSubmissions, + submissionRepo: any SubmissionRepository, versionRepo: any VersionRepository, planner: SubmissionPlanner, affordanceMode: AffordanceMode = .cli diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift index b82d91cd..ac92bad4 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IAPSubmissionController.swift @@ -10,7 +10,7 @@ import HummingbirdWebSocket /// We surface ASC's error verbatim — no client-side gating yet (see readiness-checklist /// design note in CHANGELOG). struct IAPSubmissionController: Sendable { - let repo: any InAppPurchaseSubmissions + let repo: any InAppPurchaseSubmissionRepository func addRoutes(to group: RouterGroup) { group.post("/iap/:iapId/submit") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift index 90ce3a18..4eccbf28 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/IrisIAPSubmissionsController.swift @@ -12,7 +12,7 @@ import HummingbirdWebSocket /// IrisAPIError stack from the repository. struct IrisIAPSubmissionsController: Sendable { let cookieProvider: any IrisCookieProvider - let repo: any IrisInAppPurchaseSubmissions + let repo: any IrisInAppPurchaseSubmissionRepository func addRoutes(to group: RouterGroup) { group.post("/iris/iap/:iapId/submissions") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift b/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift index d57665a5..2a875bdb 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/ReviewSubmissionsController.swift @@ -10,7 +10,7 @@ import ASCKit /// `filter[app]` as required, so fleet listing isn't possible without /// aggregating per-app on the client side. struct ReviewSubmissionsController: Sendable { - let submissionRepo: any ReviewSubmissions + let submissionRepo: any SubmissionRepository func addRoutes(to group: RouterGroup) { group.get("/apps/:appId/review-submissions") { request, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift index 594e8949..7ac587d6 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/SubscriptionSubmissionController.swift @@ -8,7 +8,7 @@ import HummingbirdWebSocket /// Apple constraint: the first subscription within a group must be submitted with a /// new app version; subsequent submissions are standalone. ASC enforces this. struct SubscriptionSubmissionController: Sendable { - let repo: any SubscriptionSubmissions + let repo: any SubscriptionSubmissionRepository func addRoutes(to group: RouterGroup) { group.post("/subscriptions/:subscriptionId/submit") { _, context -> Response in diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift index a39fd92a..0016cc3e 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift @@ -7,7 +7,7 @@ import HummingbirdWebSocket /// version in the same review submission; `?dry-run=true` lists those items and /// submits nothing. Query names match the CLI's `--with-products` / `--dry-run`. struct VersionSubmissionController: Sendable { - let submissionRepo: any ReviewSubmissions + let submissionRepo: any SubmissionRepository let versionRepo: any VersionRepository let planner: SubmissionPlanner diff --git a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift index 5b8c3b54..1b29747b 100644 --- a/Sources/ASCCommand/Commands/Web/RESTRoutes.swift +++ b/Sources/ASCCommand/Commands/Web/RESTRoutes.swift @@ -80,7 +80,7 @@ enum RESTRoutes { } if let productVersionRepo = try? ClientProvider.makeProductVersionRepository() { ProductVersionsController(repo: productVersionRepo).addRoutes(to: v1) - if let submissionRepo = try? ClientProvider.makeReviewSubmissions(), + if let submissionRepo = try? ClientProvider.makeSubmissionRepository(), let versionRepo = try? ClientProvider.makeVersionRepository(), let iapRepo = try? ClientProvider.makeInAppPurchaseRepository(), let groupRepo = try? ClientProvider.makeSubscriptionGroupRepository(), @@ -140,18 +140,18 @@ enum RESTRoutes { if let subReviewRepo = try? ClientProvider.makeSubscriptionReviewRepository() { SubscriptionReviewController(repo: subReviewRepo).addRoutes(to: v1) } - if let iapSubmissionRepo = try? ClientProvider.makeInAppPurchaseSubmissions() { + if let iapSubmissionRepo = try? ClientProvider.makeInAppPurchaseSubmissionRepository() { IAPSubmissionController(repo: iapSubmissionRepo).addRoutes(to: v1) } IrisIAPSubmissionsController( cookieProvider: ClientProvider.makeIrisCookieProvider(), - repo: ClientProvider.makeIrisInAppPurchaseSubmissions() + repo: ClientProvider.makeIrisInAppPurchaseSubmissionRepository() ).addRoutes(to: v1) IrisResolutionCenterController( cookieProvider: ClientProvider.makeIrisCookieProvider(), repo: ClientProvider.makeIrisResolutionCenterRepository() ).addRoutes(to: v1) - if let subSubmissionRepo = try? ClientProvider.makeSubscriptionSubmissions() { + if let subSubmissionRepo = try? ClientProvider.makeSubscriptionSubmissionRepository() { SubscriptionSubmissionController(repo: subSubmissionRepo).addRoutes(to: v1) } @@ -207,7 +207,7 @@ enum RESTRoutes { // Review submissions if let submissions = try? ReviewSubmissionsController( - submissionRepo: ClientProvider.makeReviewSubmissions() + submissionRepo: ClientProvider.makeSubmissionRepository() ) { submissions.addRoutes(to: v1) } // Auth — manages the credential store the rest of the controllers consume. diff --git a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissions.swift b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift similarity index 73% rename from Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissions.swift rename to Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift index 63963152..a57198d4 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissions.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/InAppPurchaseSubmissionRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol InAppPurchaseSubmissions: Sendable { +public protocol InAppPurchaseSubmissionRepository: Sendable { func submitInAppPurchase(iapId: String) async throws -> InAppPurchaseSubmission func deleteSubmission(submissionId: String) async throws } diff --git a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissions.swift b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift similarity index 91% rename from Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissions.swift rename to Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift index e4e44b22..4f348d2b 100644 --- a/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissions.swift +++ b/Sources/ASCKit/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKInAppPurchaseSubmissions: InAppPurchaseSubmissions, @unchecked Sendable { +public struct SDKInAppPurchaseSubmissionRepository: InAppPurchaseSubmissionRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissions.swift b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift similarity index 91% rename from Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissions.swift rename to Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift index 30ec15a8..67728f8d 100644 --- a/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissions.swift +++ b/Sources/ASCKit/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct SDKSubscriptionSubmissions: SubscriptionSubmissions, @unchecked Sendable { +public struct SDKSubscriptionSubmissionRepository: SubscriptionSubmissionRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissions.swift b/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissionRepository.swift similarity index 74% rename from Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissions.swift rename to Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissionRepository.swift index fcff79db..ecacd854 100644 --- a/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissions.swift +++ b/Sources/ASCKit/Apps/Subscriptions/SubscriptionSubmissionRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol SubscriptionSubmissions: Sendable { +public protocol SubscriptionSubmissionRepository: Sendable { func submitSubscription(subscriptionId: String) async throws -> SubscriptionSubmission func deleteSubmission(submissionId: String) async throws } diff --git a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissions.swift b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift similarity index 92% rename from Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissions.swift rename to Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift index 903df151..d857e9ea 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissions.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepository.swift @@ -1,12 +1,12 @@ import Foundation -/// Implements `IrisInAppPurchaseSubmissions` via the iris private API. +/// Implements `IrisInAppPurchaseSubmissionRepository` via the iris private API. /// -/// The user-visible difference from `SDKInAppPurchaseSubmissions` (public SDK) +/// The user-visible difference from `SDKInAppPurchaseSubmissionRepository` (public SDK) /// is `attributes.submitWithNextAppStoreVersion` — the only place it is accepted is /// `POST /iris/v1/inAppPurchaseSubmissions`. The public ASC SDK's /// `InAppPurchaseSubmissionCreateRequest` lacks an `attributes` field entirely. -public struct IrisSDKInAppPurchaseSubmissions: IrisInAppPurchaseSubmissions, @unchecked Sendable { +public struct IrisSDKInAppPurchaseSubmissionRepository: IrisInAppPurchaseSubmissionRepository, @unchecked Sendable { private let client: any IrisAPI public init(client: any IrisAPI = IrisClient()) { diff --git a/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissions.swift b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift similarity index 84% rename from Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissions.swift rename to Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift index 6c6388b0..8e10ca2f 100644 --- a/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissions.swift +++ b/Sources/ASCKit/Iris/InAppPurchases/IrisInAppPurchaseSubmissionRepository.swift @@ -2,11 +2,11 @@ import Mockable /// Repository for the iris-only IAP submission endpoint. /// -/// Distinct from `InAppPurchaseSubmissions` (public SDK, key-auth) so the two +/// Distinct from `InAppPurchaseSubmissionRepository` (public SDK, key-auth) so the two /// auth surfaces don't tangle: `asc iap submit` keeps zero-iris dependency, while this /// path is reachable only when iris cookies are available. @Mockable -public protocol IrisInAppPurchaseSubmissions: Sendable { +public protocol IrisInAppPurchaseSubmissionRepository: Sendable { func submitInAppPurchase( session: IrisSession, iapId: String, diff --git a/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift b/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift index 892def5f..88a851d1 100644 --- a/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift +++ b/Sources/ASCKit/Iris/ResolutionCenter/IrisResolutionCenterRepository.swift @@ -3,7 +3,7 @@ import Mockable /// Repository for reading Resolution Center data via the iris private API. /// -/// Separate from `ReviewSubmissions` (public SDK, key-auth) so the two auth +/// Separate from `SubmissionRepository` (public SDK, key-auth) so the two auth /// surfaces don't tangle: `asc review-submissions *` keeps zero-iris /// dependency, while this path is reachable only when iris cookies are /// available. diff --git a/Sources/ASCKit/Shared/Internal/ClientFactory.swift b/Sources/ASCKit/Shared/Internal/ClientFactory.swift index 249212ac..4f85d6b6 100644 --- a/Sources/ASCKit/Shared/Internal/ClientFactory.swift +++ b/Sources/ASCKit/Shared/Internal/ClientFactory.swift @@ -45,9 +45,9 @@ public struct ClientFactory: Sendable { return SDKAppCategoryRepository(client: provider) } - public func makeReviewSubmissions(authProvider: any AuthProvider) throws -> any ReviewSubmissions { + public func makeSubmissionRepository(authProvider: any AuthProvider) throws -> any SubmissionRepository { let provider = try makeProvider(authProvider: authProvider) - return OpenAPIReviewSubmissions(client: provider) + return OpenAPISubmissionRepository(client: provider) } public func makeBundleIDRepository(authProvider: any AuthProvider) throws -> any BundleIDRepository { @@ -135,9 +135,9 @@ public struct ClientFactory: Sendable { return SDKSubscriptionGroupLocalizationRepository(client: provider) } - public func makeInAppPurchaseSubmissions(authProvider: any AuthProvider) throws -> any InAppPurchaseSubmissions { + public func makeInAppPurchaseSubmissionRepository(authProvider: any AuthProvider) throws -> any InAppPurchaseSubmissionRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKInAppPurchaseSubmissions(client: provider) + return SDKInAppPurchaseSubmissionRepository(client: provider) } public func makeProductVersionRepository(authProvider: any AuthProvider) throws -> any ProductVersionRepository { @@ -155,9 +155,9 @@ public struct ClientFactory: Sendable { return SDKSubscriptionPriceRepository(client: provider) } - public func makeSubscriptionSubmissions(authProvider: any AuthProvider) throws -> any SubscriptionSubmissions { + public func makeSubscriptionSubmissionRepository(authProvider: any AuthProvider) throws -> any SubscriptionSubmissionRepository { let provider = try makeProvider(authProvider: authProvider) - return SDKSubscriptionSubmissions(client: provider) + return SDKSubscriptionSubmissionRepository(client: provider) } public func makeSubscriptionIntroductoryOfferRepository(authProvider: any AuthProvider) throws -> any SubscriptionIntroductoryOfferRepository { @@ -357,8 +357,8 @@ public struct ClientFactory: Sendable { IrisSDKAppBundleRepository() } - public func makeIrisInAppPurchaseSubmissions() -> any IrisInAppPurchaseSubmissions { - IrisSDKInAppPurchaseSubmissions() + public func makeIrisInAppPurchaseSubmissionRepository() -> any IrisInAppPurchaseSubmissionRepository { + IrisSDKInAppPurchaseSubmissionRepository() } public func makeIrisResolutionCenterRepository() -> any IrisResolutionCenterRepository { diff --git a/Sources/ASCKit/Submissions/Internal/OpenAPIReviewSubmissions.swift b/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift similarity index 99% rename from Sources/ASCKit/Submissions/Internal/OpenAPIReviewSubmissions.swift rename to Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift index 31dc1813..0b4b6900 100644 --- a/Sources/ASCKit/Submissions/Internal/OpenAPIReviewSubmissions.swift +++ b/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift @@ -1,6 +1,6 @@ @preconcurrency import AppStoreConnect_Swift_SDK -public struct OpenAPIReviewSubmissions: ReviewSubmissions, @unchecked Sendable { +public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Sendable { private let client: any APIClient public init(client: any APIClient) { diff --git a/Sources/ASCKit/Submissions/SubmissionPlan.swift b/Sources/ASCKit/Submissions/SubmissionPlan.swift index e5a81661..7a6724f8 100644 --- a/Sources/ASCKit/Submissions/SubmissionPlan.swift +++ b/Sources/ASCKit/Submissions/SubmissionPlan.swift @@ -15,7 +15,7 @@ public struct SubmissionPlan: Sendable, Equatable { /// Opens (or reuses) the app's draft, adds the items in order and submits it. /// Stops at the first item Apple refuses, before anything is submitted — the /// items added so far stay in the draft. - public func submit(repo: some ReviewSubmissions) async throws -> ReviewSubmission { + public func submit(repo: some SubmissionRepository) async throws -> ReviewSubmission { let draft = try await repo.createSubmission(appId: appId, platform: platform) for item in items { _ = try await repo.addItem(submissionId: draft.id, target: item.target) diff --git a/Sources/ASCKit/Submissions/ReviewSubmissions.swift b/Sources/ASCKit/Submissions/SubmissionRepository.swift similarity index 94% rename from Sources/ASCKit/Submissions/ReviewSubmissions.swift rename to Sources/ASCKit/Submissions/SubmissionRepository.swift index db32b28b..61401aeb 100644 --- a/Sources/ASCKit/Submissions/ReviewSubmissions.swift +++ b/Sources/ASCKit/Submissions/SubmissionRepository.swift @@ -1,7 +1,7 @@ import Mockable @Mockable -public protocol ReviewSubmissions: Sendable { +public protocol SubmissionRepository: Sendable { func submitVersion(versionId: String) async throws -> ReviewSubmission func listSubmissions(appId: String, states: [ReviewSubmissionState]?, limit: Int?) async throws -> [ReviewSubmission] func getSubmission(id: String) async throws -> ReviewSubmission diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift index 64ba4e2a..7dfebcfc 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPSubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPSubmitTests { @Test func `submitted iap includes submission id, iapId and affordances`() async throws { - let mockRepo = MockInAppPurchaseSubmissions() + let mockRepo = MockInAppPurchaseSubmissionRepository() given(mockRepo).submitInAppPurchase(iapId: .any) .willReturn(InAppPurchaseSubmission(id: "sub-1", iapId: "iap-1")) diff --git a/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift b/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift index 8a73c0df..576bb817 100644 --- a/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/IAP/IAPUnsubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct IAPUnsubmitTests { @Test func `unsubmit deletes submission by id`() async throws { - let mockRepo = MockInAppPurchaseSubmissions() + let mockRepo = MockInAppPurchaseSubmissionRepository() given(mockRepo).deleteSubmission(submissionId: .any).willReturn(()) let cmd = try IAPUnsubmit.parse(["--submission-id", "sub-1"]) diff --git a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift index fdd54e41..62b78be2 100644 --- a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsCreateTests.swift @@ -12,7 +12,7 @@ struct IrisIAPSubmissionsCreateTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisInAppPurchaseSubmissions() + let mockRepo = MockIrisInAppPurchaseSubmissionRepository() given(mockRepo).submitInAppPurchase( session: .any, iapId: .any, submitWithNextAppStoreVersion: .any ).willReturn( @@ -46,7 +46,7 @@ struct IrisIAPSubmissionsCreateTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisInAppPurchaseSubmissions() + let mockRepo = MockIrisInAppPurchaseSubmissionRepository() given(mockRepo).submitInAppPurchase( session: .any, iapId: .any, submitWithNextAppStoreVersion: .value(false) ).willReturn( diff --git a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift index f657f854..cfdb264f 100644 --- a/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift +++ b/Tests/ASCCommandTests/Commands/Iris/InAppPurchases/IrisIAPSubmissionsDeleteTests.swift @@ -12,7 +12,7 @@ struct IrisIAPSubmissionsDeleteTests { IrisSession(cookies: "myacinfo=test") ) - let mockRepo = MockIrisInAppPurchaseSubmissions() + let mockRepo = MockIrisInAppPurchaseSubmissionRepository() given(mockRepo).deleteSubmission(session: .any, submissionId: .any).willReturn(()) let cmd = try IrisIAPSubmissionsDelete.parse(["--submission-id", "iap-7"]) diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift index 57c6f185..724d5be6 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionItemsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewSubmissionItemsListTests { @Test func `listed items show id, submissionId, state, linked resource, and affordances`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissionItems(submissionId: .value("sub-1")).willReturn([ ReviewSubmissionItem( id: "item-1", @@ -43,7 +43,7 @@ struct ReviewSubmissionItemsListTests { } @Test func `items filtered by state returns only matching items`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissionItems(submissionId: .value("sub-1")).willReturn([ ReviewSubmissionItem(id: "i-1", submissionId: "sub-1", state: .rejected, linkedResourceId: "v-9", linkedResourceType: .appStoreVersion), diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift index 1a5edc4a..225c48d9 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsBuildTests.swift @@ -10,7 +10,7 @@ struct ReviewSubmissionsBuildTests { // MARK: - create @Test func `creating a submission shows the draft with commands to add items and submit`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).createSubmission(appId: .value("app-1"), platform: .value(.iOS)).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview) ) @@ -40,7 +40,7 @@ struct ReviewSubmissionsBuildTests { } @Test func `creating a submission for macOS asks for a macOS draft`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).createSubmission(appId: .any, platform: .value(.macOS)).willReturn( ReviewSubmission(id: "sub-2", appId: "app-1", platform: .macOS, state: .readyForReview) ) @@ -53,13 +53,13 @@ struct ReviewSubmissionsBuildTests { @Test func `creating a submission rejects an unknown platform`() async throws { let cmd = try ReviewSubmissionsCreate.parse(["--app-id", "app-1", "--platform", "android"]) - await #expect(throws: ValidationError.self) { try await cmd.execute(repo: MockReviewSubmissions()) } + await #expect(throws: ValidationError.self) { try await cmd.execute(repo: MockSubmissionRepository()) } } // MARK: - items add @Test func `adding a subscription version shows the new item and how to remove it`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).addItem(submissionId: .value("sub-1"), target: .value(.subscriptionVersion("sv-1"))).willReturn( ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .readyForReview, linkedResourceId: "sv-1", linkedResourceType: .subscriptionVersion) @@ -96,7 +96,7 @@ struct ReviewSubmissionsBuildTests { ("--subscription-group-version-id", .subscriptionGroupVersion("x-1")), ] for (flag, target) in cases { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).addItem(submissionId: .any, target: .any).willReturn( ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .readyForReview) ) @@ -108,16 +108,16 @@ struct ReviewSubmissionsBuildTests { @Test func `adding an item needs exactly one version flag`() async throws { let none = try ReviewSubmissionItemsAdd.parse(["--submission-id", "sub-1"]) - await #expect(throws: ValidationError.self) { try await none.execute(repo: MockReviewSubmissions()) } + await #expect(throws: ValidationError.self) { try await none.execute(repo: MockSubmissionRepository()) } let two = try ReviewSubmissionItemsAdd.parse(["--submission-id", "sub-1", "--version-id", "v-1", "--iap-version-id", "iv-1"]) - await #expect(throws: ValidationError.self) { try await two.execute(repo: MockReviewSubmissions()) } + await #expect(throws: ValidationError.self) { try await two.execute(repo: MockSubmissionRepository()) } } // MARK: - items remove @Test func `removing an item removes it from its submission`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).removeItem(itemId: .any).willReturn() let cmd = try ReviewSubmissionItemsRemove.parse(["--item-id", "item-1"]) @@ -129,7 +129,7 @@ struct ReviewSubmissionsBuildTests { // MARK: - submit @Test func `submitting shows the submission waiting for review`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).submit(submissionId: .value("sub-1")).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .waitingForReview) ) diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift index 68f93361..bb425283 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsGetTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewSubmissionsGetTests { @Test func `get submission shows id, appId, state, and affordances`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).getSubmission(id: .value("sub-1")).willReturn( ReviewSubmission(id: "sub-1", appId: "app-42", platform: .iOS, state: .unresolvedIssues) ) diff --git a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift index 0c7671a3..c10eeae1 100644 --- a/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift +++ b/Tests/ASCCommandTests/Commands/ReviewSubmissions/ReviewSubmissionsListTests.swift @@ -7,7 +7,7 @@ import Testing struct ReviewSubmissionsListTests { @Test func `listed submissions show id, appId, state, platform, and affordances`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissions(appId: .value("app-42"), states: .any, limit: .any) .willReturn([ ReviewSubmission(id: "sub-1", appId: "app-42", platform: .iOS, state: .waitingForReview), @@ -36,7 +36,7 @@ struct ReviewSubmissionsListTests { } @Test func `unresolved issues submission exposes listRejectedItems affordance`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissions( appId: .any, states: .any, @@ -53,7 +53,7 @@ struct ReviewSubmissionsListTests { } @Test func `state filter parses comma-separated values and passes them to repo`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissions( appId: .value("app-1"), states: .value([.waitingForReview, .inReview, .readyForReview]), @@ -78,7 +78,7 @@ struct ReviewSubmissionsListTests { } @Test func `unresolved issues state is preserved through listing`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissions( appId: .value("app-1"), states: .value([.unresolvedIssues]), @@ -98,7 +98,7 @@ struct ReviewSubmissionsListTests { } @Test func `no state filter passes nil to repo and lists all states`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissions( appId: .value("app-1"), states: .value(nil), diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift index d0d8930f..2759e6d3 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsSubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsSubmitTests { @Test func `submitted subscription includes id, subscriptionId and affordances`() async throws { - let mockRepo = MockSubscriptionSubmissions() + let mockRepo = MockSubscriptionSubmissionRepository() given(mockRepo).submitSubscription(subscriptionId: .any) .willReturn(SubscriptionSubmission(id: "submit-1", subscriptionId: "sub-1")) diff --git a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift index 1f06edfd..3788a161 100644 --- a/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Subscriptions/SubscriptionsUnsubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct SubscriptionsUnsubmitTests { @Test func `unsubmit deletes submission by id`() async throws { - let mockRepo = MockSubscriptionSubmissions() + let mockRepo = MockSubscriptionSubmissionRepository() given(mockRepo).deleteSubmission(submissionId: .any).willReturn(()) let cmd = try SubscriptionsUnsubmit.parse(["--submission-id", "sub-submit-1"]) diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift index 3dd2eb6b..77ad9654 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift @@ -7,7 +7,7 @@ import Testing struct VersionsSubmitTests { @Test func `submitted version returns submission in waitingForReview state`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).submitVersion(versionId: .any).willReturn( ReviewSubmission( id: "sub-1", @@ -71,7 +71,7 @@ struct VersionsSubmitTests { @Test func `a dry run lists what would go to review with the app version and submits nothing`() async throws { let (iaps, versions) = readyLifetimeIAP() - let submissions = MockReviewSubmissions() + let submissions = MockSubmissionRepository() let cmd = try VersionsSubmit.parse(["--version-id", "v-1", "--with-products", "--dry-run", "--pretty"]) let output = try await cmd.executeWithProducts( @@ -108,7 +108,7 @@ struct VersionsSubmitTests { @Test func `with products the app version and ready products are submitted together`() async throws { let (iaps, versions) = readyLifetimeIAP() - let submissions = MockReviewSubmissions() + let submissions = MockSubmissionRepository() given(submissions).createSubmission(appId: .any, platform: .any).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview) ) diff --git a/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift index 5a0bbcb0..bd75fa24 100644 --- a/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift +++ b/Tests/ASCCommandTests/Commands/Web/RESTRoutesTests.swift @@ -296,7 +296,7 @@ struct RESTRoutesTests { // MARK: - Review Submissions @Test func `review submissions list returns JSON with _links`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissions(appId: .any, states: .any, limit: .any).willReturn([ ReviewSubmission(id: "sub-1", appId: "42", platform: .iOS, state: .waitingForReview), ]) @@ -312,7 +312,7 @@ struct RESTRoutesTests { } @Test func `review submissions get returns JSON with _links`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).getSubmission(id: .value("sub-1")).willReturn( ReviewSubmission(id: "sub-1", appId: "42", platform: .iOS, state: .unresolvedIssues) ) @@ -326,7 +326,7 @@ struct RESTRoutesTests { } @Test func `review submission items list returns JSON with _links for parent and version`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).listSubmissionItems(submissionId: .value("sub-1")).willReturn([ ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .rejected, linkedResourceId: "v-9", linkedResourceType: .appStoreVersion), @@ -1006,7 +1006,7 @@ struct RESTRoutesTests { let mockCookieProvider = MockIrisCookieProvider() given(mockCookieProvider).resolveSession().willReturn(IrisSession(cookies: "myacinfo=test")) - let mockRepo = MockIrisInAppPurchaseSubmissions() + let mockRepo = MockIrisInAppPurchaseSubmissionRepository() given(mockRepo).submitInAppPurchase( session: .any, iapId: .any, submitWithNextAppStoreVersion: .any ).willReturn( @@ -1061,7 +1061,7 @@ struct RESTRoutesTests { } @Test func `unresolved submission REST links to the iris resolution-center endpoint`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).getSubmission(id: .value("sub-1")).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .macOS, state: .unresolvedIssues) ) @@ -1181,7 +1181,7 @@ struct RESTRoutesTests { // MARK: - Building a review submission @Test func `a draft submission links to adding items and submitting, and a new item links to removing it`() async throws { - let mockRepo = MockReviewSubmissions() + let mockRepo = MockSubmissionRepository() given(mockRepo).createSubmission(appId: .any, platform: .any).willReturn( ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview) ) @@ -1222,7 +1222,7 @@ struct RESTRoutesTests { subscriptionRepo: MockSubscriptionRepository(), productVersionRepo: productVersions) let output = try await VersionsSubmit.parse(["--version-id", "v-1", "--dry-run"]).executeWithProducts( - submissionRepo: MockReviewSubmissions(), versionRepo: versionRepo, planner: planner, affordanceMode: .rest + submissionRepo: MockSubmissionRepository(), versionRepo: versionRepo, planner: planner, affordanceMode: .rest ).replacingOccurrences(of: "\\/", with: "/") #expect(output.contains("\"_links\"")) diff --git a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionsTests.swift b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift similarity index 80% rename from Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionsTests.swift rename to Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift index 89e94ef3..4ba02e66 100644 --- a/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionsTests.swift +++ b/Tests/ASCKitTests/Apps/InAppPurchases/Internal/SDKInAppPurchaseSubmissionRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKInAppPurchaseSubmissionsTests { +struct SDKInAppPurchaseSubmissionRepositoryTests { @Test func `submitInAppPurchase injects iapId into result`() async throws { let stub = StubAPIClient() @@ -12,7 +12,7 @@ struct SDKInAppPurchaseSubmissionsTests { links: .init(this: "") )) - let repo = SDKInAppPurchaseSubmissions(client: stub) + let repo = SDKInAppPurchaseSubmissionRepository(client: stub) let result = try await repo.submitInAppPurchase(iapId: "iap-abc") #expect(result.id == "sub-1") @@ -21,7 +21,7 @@ struct SDKInAppPurchaseSubmissionsTests { @Test func `deleteSubmission performs void request via manual DELETE`() async throws { let stub = StubAPIClient() - let repo = SDKInAppPurchaseSubmissions(client: stub) + let repo = SDKInAppPurchaseSubmissionRepository(client: stub) try await repo.deleteSubmission(submissionId: "sub-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionsTests.swift b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift similarity index 82% rename from Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionsTests.swift rename to Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift index 232eb695..d55f34ea 100644 --- a/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionsTests.swift +++ b/Tests/ASCKitTests/Apps/Subscriptions/Internal/SDKSubscriptionSubmissionRepositoryTests.swift @@ -3,7 +3,7 @@ import Testing @testable import ASCKit @Suite -struct SDKSubscriptionSubmissionsTests { +struct SDKSubscriptionSubmissionRepositoryTests { @Test func `submitSubscription injects subscriptionId into result`() async throws { let stub = StubAPIClient() @@ -15,7 +15,7 @@ struct SDKSubscriptionSubmissionsTests { links: .init(this: "") )) - let repo = SDKSubscriptionSubmissions(client: stub) + let repo = SDKSubscriptionSubmissionRepository(client: stub) let result = try await repo.submitSubscription(subscriptionId: "sub-abc") #expect(result.id == "submit-1") @@ -24,7 +24,7 @@ struct SDKSubscriptionSubmissionsTests { @Test func `deleteSubmission performs void request via manual DELETE`() async throws { let stub = StubAPIClient() - let repo = SDKSubscriptionSubmissions(client: stub) + let repo = SDKSubscriptionSubmissionRepository(client: stub) try await repo.deleteSubmission(submissionId: "sub-1") #expect(stub.voidRequestCalled == true) } diff --git a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift index 3716618a..9a926291 100644 --- a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift +++ b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseStateRepositoryTests.swift @@ -2,7 +2,7 @@ import Foundation import Testing @testable import ASCKit -/// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionsTests` +/// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionRepositoryTests` /// for why we don't share `URLProtocolStub` between iris suites. final class IrisStateURLProtocolStub: URLProtocol, @unchecked Sendable { nonisolated(unsafe) static var handler: (@Sendable (URLRequest) -> (HTTPURLResponse, Data))? diff --git a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionsTests.swift b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift similarity index 94% rename from Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionsTests.swift rename to Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift index 93c6bd4d..5efff7d5 100644 --- a/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionsTests.swift +++ b/Tests/ASCKitTests/Iris/InAppPurchases/Internal/IrisSDKInAppPurchaseSubmissionRepositoryTests.swift @@ -49,7 +49,7 @@ final class IrisSubmissionsURLProtocolStub: URLProtocol, @unchecked Sendable { } @Suite(.serialized) -struct IrisSDKInAppPurchaseSubmissionsTests { +struct IrisSDKInAppPurchaseSubmissionRepositoryTests { @Test func `submitInAppPurchase posts JSON-API body with submitWithNextAppStoreVersion attribute`() async throws { let captured = CapturedBody() @@ -63,7 +63,7 @@ struct IrisSDKInAppPurchaseSubmissionsTests { } let client = IrisClient(session: IrisSubmissionsURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseSubmissions(client: client) + let repo = IrisSDKInAppPurchaseSubmissionRepository(client: client) _ = try await repo.submitInAppPurchase( session: IrisSession(cookies: "myacinfo=ABC"), iapId: "iap-7", @@ -92,7 +92,7 @@ struct IrisSDKInAppPurchaseSubmissionsTests { } let client = IrisClient(session: IrisSubmissionsURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseSubmissions(client: client) + let repo = IrisSDKInAppPurchaseSubmissionRepository(client: client) let submission = try await repo.submitInAppPurchase( session: IrisSession(cookies: "myacinfo=ABC"), iapId: "iap-7", @@ -117,7 +117,7 @@ struct IrisSDKInAppPurchaseSubmissionsTests { } let client = IrisClient(session: IrisSubmissionsURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseSubmissions(client: client) + let repo = IrisSDKInAppPurchaseSubmissionRepository(client: client) _ = try await repo.submitInAppPurchase( session: IrisSession(cookies: "myacinfo=ABC"), iapId: "iap-7", @@ -141,7 +141,7 @@ struct IrisSDKInAppPurchaseSubmissionsTests { } let client = IrisClient(session: IrisSubmissionsURLProtocolStub.makeSession()) - let repo = IrisSDKInAppPurchaseSubmissions(client: client) + let repo = IrisSDKInAppPurchaseSubmissionRepository(client: client) try await repo.deleteSubmission( session: IrisSession(cookies: "myacinfo=ABC"), submissionId: "iap-7" diff --git a/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift b/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift index 869a795e..a9b1c66e 100644 --- a/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift +++ b/Tests/ASCKitTests/Iris/Internal/Auth/OlympusClientTests.swift @@ -2,7 +2,7 @@ import Foundation import Testing @testable import ASCKit -/// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionsTests` +/// Private URLProtocol subclass — see `IrisSDKInAppPurchaseSubmissionRepositoryTests` /// for the rationale (avoids racing the shared `URLProtocolStub.handler` static used /// by `IdmsaAPIClientTests` when suites run in parallel). final class OlympusURLProtocolStub: URLProtocol, @unchecked Sendable { diff --git a/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift index 7bb76867..c20e9cd2 100644 --- a/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift @@ -54,7 +54,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let result = try await repo.submitVersion(versionId: "v-1") #expect(result.id == "sub-99") @@ -99,7 +99,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let result = try await repo.submitVersion(versionId: "v-2") #expect(result.platform == .macOS) @@ -153,7 +153,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let result = try await repo.submitVersion(versionId: "v-3") #expect(result.id == "sub-existing") @@ -181,7 +181,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let results = try await repo.listSubmissions(appId: "app-42", states: nil, limit: nil) #expect(results.count == 2) @@ -205,7 +205,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let result = try await repo.getSubmission(id: "sub-77") #expect(result.id == "sub-77") @@ -240,7 +240,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let results = try await repo.listSubmissionItems(submissionId: "sub-1") #expect(results.count == 2) @@ -266,7 +266,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let results = try await repo.listSubmissionItems(submissionId: "sub-1") #expect(results.first?.linkedResourceId == nil) @@ -287,7 +287,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let results = try await repo.listSubmissions( appId: "app-9", states: [.inReview, .waitingForReview], @@ -304,7 +304,7 @@ struct SDKSubmissionRepositoryTests { let stub = StubAPIClient() stub.willReturn(ReviewSubmissionItemsResponse(data: [], links: .init(this: ""))) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) _ = try await repo.listSubmissionItems(submissionId: "sub-1") let query = Dictionary(uniqueKeysWithValues: (stub.lastQuery ?? []).map { ($0.0, $0.1 ?? "") }) @@ -340,7 +340,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let items = try await repo.listSubmissionItems(submissionId: "sub-1") #expect(items.map(\.linkedResourceType) == [.inAppPurchaseVersion, .subscriptionVersion, .subscriptionGroupVersion]) @@ -357,7 +357,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let submission = try await repo.createSubmission(appId: "app-1", platform: .iOS) #expect(submission == ASCKit.ReviewSubmission(id: "draft-1", appId: "app-1", platform: .iOS, state: .readyForReview)) @@ -373,7 +373,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let submission = try await repo.createSubmission(appId: "app-1", platform: .iOS) #expect(submission == ASCKit.ReviewSubmission(id: "new-1", appId: "app-1", platform: .iOS, state: .readyForReview)) @@ -396,7 +396,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let item = try await repo.addItem(submissionId: "sub-1", target: target) let post = stub.requests.first { $0.method == "POST" } @@ -413,7 +413,7 @@ struct SDKSubmissionRepositoryTests { @Test func `removing an item deletes it from its submission`() async throws { let stub = StubAPIClient() - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) try await repo.removeItem(itemId: "item-1") #expect(stub.requests.map { "\($0.method) \($0.path)" } == ["DELETE /v1/reviewSubmissionItems/item-1"]) @@ -428,7 +428,7 @@ struct SDKSubmissionRepositoryTests { links: .init(this: "") )) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) let submission = try await repo.submit(submissionId: "sub-1") let patch = stub.requests.first { $0.method == "PATCH" } @@ -463,7 +463,7 @@ struct SDKSubmissionRepositoryTests { let stub = StubAPIClient() stub.errorToThrow = appVersionNotReviewable() - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) await #expect { _ = try await repo.addItem(submissionId: "sub-1", target: .appStoreVersion("v-1")) } throws: { error in @@ -479,7 +479,7 @@ struct SDKSubmissionRepositoryTests { let stub = StubAPIClient() stub.errorToThrow = appVersionNotReviewable() - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) await #expect { _ = try await repo.submit(submissionId: "sub-1") } throws: { error in @@ -495,7 +495,7 @@ struct SDKSubmissionRepositoryTests { detail: "An unexpected error occurred on the server side."), ]), nil) - let repo = OpenAPIReviewSubmissions(client: stub) + let repo = OpenAPISubmissionRepository(client: stub) await #expect { _ = try await repo.addItem(submissionId: "sub-1", target: .appStoreVersion("v-1")) } throws: { error in @@ -539,7 +539,7 @@ struct SDKSubmissionRepositoryTests { @Test func `should add the version before submitting when the open draft is empty`() async throws { let stub = submitVersionStub(openDrafts: [openDraft], itemsInDraft: []) - let submission = try await OpenAPIReviewSubmissions(client: stub).submitVersion(versionId: "v-1") + let submission = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ "POST /v1/reviewSubmissionItems", @@ -558,7 +558,7 @@ struct SDKSubmissionRepositoryTests { ), ]) - let submission = try await OpenAPIReviewSubmissions(client: stub).submitVersion(versionId: "v-1") + let submission = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ "PATCH /v1/reviewSubmissions/sub-1", @@ -574,7 +574,7 @@ struct SDKSubmissionRepositoryTests { ), ]) - _ = try await OpenAPIReviewSubmissions(client: stub).submitVersion(versionId: "v-1") + _ = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ "POST /v1/reviewSubmissionItems", @@ -592,7 +592,7 @@ struct SDKSubmissionRepositoryTests { stub.errorsByRequest[refusedRequest] = appVersionNotReviewable() await #expect { - _ = try await OpenAPIReviewSubmissions(client: stub).submitVersion(versionId: "v-1") + _ = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") } throws: { error in String(describing: error) == """ Apple refused the review submission: This resource cannot be reviewed, please check associated errors to see why. diff --git a/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift b/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift index 94b7141c..d69e7cbe 100644 --- a/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift +++ b/Tests/ASCKitTests/Submissions/SubmissionPlannerTests.swift @@ -118,7 +118,7 @@ struct SubmissionPlannerTests { PlannedReviewItem(kind: .appStoreVersion, versionId: "v-1", productId: "app-1", name: "1.0"), PlannedReviewItem(kind: .inAppPurchaseVersion, versionId: "iv-1", productId: "iap-1", name: "Lifetime"), ]) - let repo = MockReviewSubmissions() + let repo = MockSubmissionRepository() given(repo).createSubmission(appId: .any, platform: .any).willReturn( MockRepositoryFactory.makeReviewSubmission(id: "sub-1", appId: "app-1", state: .readyForReview) ) @@ -141,7 +141,7 @@ struct SubmissionPlannerTests { PlannedReviewItem(kind: .appStoreVersion, versionId: "v-1", productId: "app-1", name: "1.0"), PlannedReviewItem(kind: .inAppPurchaseVersion, versionId: "iv-1", productId: "iap-1", name: "Lifetime"), ]) - let repo = MockReviewSubmissions() + let repo = MockSubmissionRepository() given(repo).createSubmission(appId: .any, platform: .any).willReturn( MockRepositoryFactory.makeReviewSubmission(id: "sub-1", state: .readyForReview) ) diff --git a/docs/features/iap-subscriptions/submission-iris-parity.md b/docs/features/iap-subscriptions/submission-iris-parity.md index 59008fb1..88e65ab4 100644 --- a/docs/features/iap-subscriptions/submission-iris-parity.md +++ b/docs/features/iap-subscriptions/submission-iris-parity.md @@ -11,7 +11,7 @@ | Auth | Team API key (`AuthKey_*.p8`) | Browser cookie session (iris) | | First-time IAP submission | Tends to fail (no flag to express "attach to next version") | Works with `submitWithNextAppStoreVersion: true` | -`InAppPurchaseSubmissionCreateRequest` in `appstoreconnect-swift-sdk` exposes only `data.type` + `data.relationships.inAppPurchaseV2` — there's no `attributes` field on the create request at all. Our existing `SDKInAppPurchaseSubmissions.submitInAppPurchase` is built on this shape. +`InAppPurchaseSubmissionCreateRequest` in `appstoreconnect-swift-sdk` exposes only `data.type` + `data.relationships.inAppPurchaseV2` — there's no `attributes` field on the create request at all. Our existing `SDKInAppPurchaseSubmissionRepository.submitInAppPurchase` is built on this shape. The iris request shape Apple's web UI sends (verified via DevTools curl): @@ -71,7 +71,7 @@ Returns the submission resource with a `_links.viewIAP → /api/v1/iap/:iapId` s ### Domain protocol ```swift -public protocol IrisInAppPurchaseSubmissions: Sendable { +public protocol IrisInAppPurchaseSubmissionRepository: Sendable { func submitInAppPurchase( session: IrisSession, iapId: String, @@ -80,7 +80,7 @@ public protocol IrisInAppPurchaseSubmissions: Sendable { } ``` -Distinct from `InAppPurchaseSubmissions` (public SDK) so the two auth surfaces don't tangle. +Distinct from `InAppPurchaseSubmissionRepository` (public SDK) so the two auth surfaces don't tangle. ### Discoverability From 3c323f64577f6e1bfcaa12992b7be9285b8f0e95 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 21:09:40 +0800 Subject: [PATCH 17/18] feat(versions): a version sends itself to review, refusing when not editable AppStoreVersion.submitForReview(to:) runs the submit workflow from the SubmissionRepository's primitives: its app's open draft for its platform, the version added unless the draft holds it, the draft submitted. It refuses a version that can't be edited (the same isEditable that offers the submitForReview affordance) before anything reaches Apple: versionNotEditable names the state and which states can go. asc versions submit and POST /api/v1/versions/:id/submit both load the version and call it; REST answers that refusal with 422. SubmissionRepository.submitVersion, which re-fetched the version and duplicated createSubmission's find-or-create inside the adapter, is gone. createSubmission now explains Apple's refusal to open a draft, as submitVersion did. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 +- .../Commands/Versions/VersionsSubmit.swift | 10 +- .../VersionSubmissionController.swift | 10 +- .../Versions/AppStoreVersion+Review.swift | 18 ++ .../OpenAPISubmissionRepository.swift | 86 +----- .../Submissions/ReviewSubmissionError.swift | 5 + .../Submissions/SubmissionRepository.swift | 1 - .../Versions/VersionsSubmitTests.swift | 40 ++- .../VersionSubmissionRoutesTests.swift | 63 ++++ .../AppStoreVersionSubmitForReviewTests.swift | 75 +++++ .../SDKSubmissionRepositoryTests.swift | 270 ++---------------- docs/features/concept-folders/design.md | 4 +- 12 files changed, 231 insertions(+), 354 deletions(-) create mode 100644 Sources/ASCKit/Apps/Versions/AppStoreVersion+Review.swift create mode 100644 Tests/ASCCommandTests/Commands/Web/Controllers/VersionSubmissionRoutesTests.swift create mode 100644 Tests/ASCKitTests/Apps/Versions/AppStoreVersionSubmitForReviewTests.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index ccf85e72..21b6f4e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed -- **Breaking (library):** `ASCKit` is one module (`import ASCKit` replaces `import Domain` / `import Infrastructure`), and the 11 non-CRUD repositories take role names (`IrisAuthRepository` → `IrisSignIn`, …). CLI and REST unchanged. → [design](docs/features/concept-folders/design.md) +- `asc versions submit` and `POST /api/v1/versions/:id/submit` refuse a version that can't be edited (e.g. Ready for Sale) before calling Apple, saying which states can go to review. +- **Breaking (library):** one `ASCKit` module (`import ASCKit`); 7 non-CRUD repositories take role names (`IrisAuthRepository` → `IrisSignIn`, …); `SubmissionRepository.submitVersion` → `AppStoreVersion.submitForReview(to:)`. → [design](docs/features/concept-folders/design.md) --- diff --git a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift index 62db8fdb..8c6b78a2 100644 --- a/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift +++ b/Sources/ASCCommand/Commands/Versions/VersionsSubmit.swift @@ -38,12 +38,16 @@ struct VersionsSubmit: AsyncParsableCommand { planner: planner )) } else { - print(try await execute(repo: try ClientProvider.makeSubmissionRepository())) + print(try await execute( + versionRepo: try ClientProvider.makeVersionRepository(), + submissionRepo: try ClientProvider.makeSubmissionRepository() + )) } } - func execute(repo: any SubmissionRepository) async throws -> String { - let submission = try await repo.submitVersion(versionId: versionId) + func execute(versionRepo: any VersionRepository, submissionRepo: any SubmissionRepository) async throws -> String { + let version = try await versionRepo.getVersion(id: versionId) + let submission = try await version.submitForReview(to: submissionRepo) let formatter = OutputFormatter(format: globals.outputFormat, pretty: globals.pretty) return try formatter.formatAgentItems( diff --git a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift index 0016cc3e..e33b290f 100644 --- a/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift +++ b/Sources/ASCCommand/Commands/Web/Controllers/VersionSubmissionController.swift @@ -18,10 +18,16 @@ struct VersionSubmissionController: Sendable { let withProducts = query["with-products"].map { $0 == "true" } ?? false let dryRun = query["dry-run"].map { $0 == "true" } ?? false + let version = try await self.versionRepo.getVersion(id: versionId) guard withProducts || dryRun else { - return try restFormat(try await self.submissionRepo.submitVersion(versionId: versionId)) + do { + return try restFormat(try await version.submitForReview(to: self.submissionRepo)) + } catch let error as ReviewSubmissionError { + // Refused here, before anything reaches Apple: the version can't be edited. + guard case .versionNotEditable = error else { throw error } + return jsonError(error.description, status: .unprocessableContent) + } } - let version = try await self.versionRepo.getVersion(id: versionId) let plan = try await self.planner.plan(for: version) if dryRun { return try restFormat(plan.items) } return try restFormat(try await plan.submit(repo: self.submissionRepo)) diff --git a/Sources/ASCKit/Apps/Versions/AppStoreVersion+Review.swift b/Sources/ASCKit/Apps/Versions/AppStoreVersion+Review.swift new file mode 100644 index 00000000..a6a270e2 --- /dev/null +++ b/Sources/ASCKit/Apps/Versions/AppStoreVersion+Review.swift @@ -0,0 +1,18 @@ +extension AppStoreVersion { + /// Sends this version to App Review: into its app's open draft for its platform + /// (Apple allows one), adding the version unless the draft already holds it, + /// then submitting the draft. Only an editable version can go — the same + /// `isEditable` that offers the `submitForReview` affordance. + public func submitForReview(to submissions: any SubmissionRepository) async throws -> ReviewSubmission { + guard isEditable else { + throw ReviewSubmissionError.versionNotEditable(versionString: versionString, state: state) + } + let draft = try await submissions.createSubmission(appId: appId, platform: platform) + // A refused submit leaves its draft open, so it may already hold this version. + let items = try await submissions.listSubmissionItems(submissionId: draft.id) + if !items.contains(where: { $0.linkedResourceId == id }) { + _ = try await submissions.addItem(submissionId: draft.id, target: .appStoreVersion(id)) + } + return try await submissions.submit(submissionId: draft.id) + } +} diff --git a/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift b/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift index 0b4b6900..8873025e 100644 --- a/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift +++ b/Sources/ASCKit/Submissions/Internal/OpenAPISubmissionRepository.swift @@ -7,60 +7,6 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send self.client = client } - public func submitVersion(versionId: String) async throws -> ASCKit.ReviewSubmission { - // Step 1: Fetch the version to extract appId and platform - let versionReq = APIEndpoint.v1.appStoreVersions.id(versionId).get( - parameters: .init(include: [.app]) - ) - let versionResp = try await client.request(versionReq) - guard - let appId = versionResp.data.relationships?.app?.data?.id, - let sdkPlatform = versionResp.data.attributes?.platform, - let platform = ASCKit.AppStorePlatform(rawValue: sdkPlatform.rawValue) - else { - throw APIError.unknown("Failed to extract appId and platform from version \(versionId)") - } - - // Step 2: Check for an existing open submission (UNRESOLVED_ISSUES or READY_FOR_REVIEW) - let filterPlatform = APIEndpoint.V1.ReviewSubmissions.GetParameters.FilterPlatform(rawValue: sdkPlatform.rawValue) - let listReq = APIEndpoint.v1.reviewSubmissions.get(parameters: .init( - filterPlatform: filterPlatform.map { [$0] }, - filterState: [.unresolvedIssues, .readyForReview], - filterApp: [appId] - )) - let listResp = try await client.request(listReq) - if let existing = listResp.data.first { - // A refused submit leaves its draft open and empty, so it may not contain this version yet. - let items = try await listSubmissionItems(submissionId: existing.id) - if !items.contains(where: { $0.linkedResourceId == versionId }) { - _ = try await addItem(submissionId: existing.id, target: .appStoreVersion(versionId)) - } - return try await patchSubmitted(id: existing.id, appId: appId, platform: platform) - } - - // Step 3: Create new review submission - let submissionResp = try await explainingRefusal { - try await client.request(APIEndpoint.v1.reviewSubmissions.post( - ReviewSubmissionCreateRequest( - data: .init( - type: .reviewSubmissions, - attributes: .init(platform: sdkPlatform), - relationships: .init( - app: .init(data: .init(type: .apps, id: appId)) - ) - ) - ) - )) - } - let submissionId = submissionResp.data.id - - // Step 4: Add the version as a review submission item - _ = try await addItem(submissionId: submissionId, target: .appStoreVersion(versionId)) - - // Step 5: Submit for review - return try await patchSubmitted(id: submissionId, appId: appId, platform: platform) - } - public func createSubmission(appId: String, platform: ASCKit.AppStorePlatform) async throws -> ASCKit.ReviewSubmission { guard let sdkPlatform = AppStoreConnect_Swift_SDK.Platform(rawValue: platform.rawValue) else { throw APIError.unknown("Unsupported review submission platform \(platform.rawValue)") @@ -73,13 +19,15 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send if let open = listResp.data.first { return mapListedSubmission(open, appId: appId) } - let created = try await client.request(APIEndpoint.v1.reviewSubmissions.post( - ReviewSubmissionCreateRequest(data: .init( - type: .reviewSubmissions, - attributes: .init(platform: sdkPlatform), - relationships: .init(app: .init(data: .init(type: .apps, id: appId))) + let created = try await explainingRefusal { + try await client.request(APIEndpoint.v1.reviewSubmissions.post( + ReviewSubmissionCreateRequest(data: .init( + type: .reviewSubmissions, + attributes: .init(platform: sdkPlatform), + relationships: .init(app: .init(data: .init(type: .apps, id: appId))) + )) )) - )) + } return mapListedSubmission(created.data, appId: appId) } @@ -225,24 +173,6 @@ public struct OpenAPISubmissionRepository: SubmissionRepository, @unchecked Send ) } - private func patchSubmitted( - id: String, - appId: String, - platform: ASCKit.AppStorePlatform - ) async throws -> ASCKit.ReviewSubmission { - let submitReq = APIEndpoint.v1.reviewSubmissions.id(id).patch( - ReviewSubmissionUpdateRequest( - data: .init( - type: .reviewSubmissions, - id: id, - attributes: .init(isSubmitted: true) - ) - ) - ) - let finalResp = try await explainingRefusal { try await client.request(submitReq) } - return mapSubmission(finalResp.data, appId: appId, platform: platform) - } - private func mapSubmission( _ sdkSubmission: AppStoreConnect_Swift_SDK.ReviewSubmission, appId: String, diff --git a/Sources/ASCKit/Submissions/ReviewSubmissionError.swift b/Sources/ASCKit/Submissions/ReviewSubmissionError.swift index e9ee3fec..b7385773 100644 --- a/Sources/ASCKit/Submissions/ReviewSubmissionError.swift +++ b/Sources/ASCKit/Submissions/ReviewSubmissionError.swift @@ -5,12 +5,17 @@ import Foundation /// which its headline message only points at. public enum ReviewSubmissionError: Error, Equatable, Sendable, CustomStringConvertible, LocalizedError { case refused(message: String, reasons: [String]) + /// The version can't go to review in its current state (only an editable one can). + case versionNotEditable(versionString: String, state: AppStoreVersionState) public var description: String { switch self { case .refused(let message, let reasons): (["Apple refused the review submission: \(message)"] + reasons.map { " - \($0)" }) .joined(separator: "\n") + case .versionNotEditable(let versionString, let state): + "Version \(versionString) can't go to review while it is \(state.displayName). " + + "Only a version being prepared for submission, or one that was rejected, can." } } diff --git a/Sources/ASCKit/Submissions/SubmissionRepository.swift b/Sources/ASCKit/Submissions/SubmissionRepository.swift index 61401aeb..e69a772a 100644 --- a/Sources/ASCKit/Submissions/SubmissionRepository.swift +++ b/Sources/ASCKit/Submissions/SubmissionRepository.swift @@ -2,7 +2,6 @@ import Mockable @Mockable public protocol SubmissionRepository: Sendable { - func submitVersion(versionId: String) async throws -> ReviewSubmission func listSubmissions(appId: String, states: [ReviewSubmissionState]?, limit: Int?) async throws -> [ReviewSubmission] func getSubmission(id: String) async throws -> ReviewSubmission func listSubmissionItems(submissionId: String) async throws -> [ReviewSubmissionItem] diff --git a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift index 77ad9654..4a832701 100644 --- a/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift +++ b/Tests/ASCCommandTests/Commands/Versions/VersionsSubmitTests.swift @@ -6,19 +6,21 @@ import Testing @Suite struct VersionsSubmitTests { - @Test func `submitted version returns submission in waitingForReview state`() async throws { - let mockRepo = MockSubmissionRepository() - given(mockRepo).submitVersion(versionId: .any).willReturn( - ReviewSubmission( - id: "sub-1", - appId: "app-42", - platform: .iOS, - state: .waitingForReview - ) - ) + private func draftThenSubmitted() -> MockSubmissionRepository { + let submissions = MockSubmissionRepository() + given(submissions).createSubmission(appId: .value("app-1"), platform: .value(.iOS)) + .willReturn(ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview)) + given(submissions).listSubmissionItems(submissionId: .value("sub-1")).willReturn([]) + given(submissions).addItem(submissionId: .value("sub-1"), target: .value(.appStoreVersion("v-1"))) + .willReturn(ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .readyForReview, linkedResourceId: "v-1")) + given(submissions).submit(submissionId: .value("sub-1")) + .willReturn(ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .waitingForReview)) + return submissions + } + @Test func `should show the submission waiting for review after submitting a version`() async throws { let cmd = try VersionsSubmit.parse(["--version-id", "v-1", "--pretty"]) - let output = try await cmd.execute(repo: mockRepo) + let output = try await cmd.execute(versionRepo: appVersionRepo(), submissionRepo: draftThenSubmitted()) #expect(output == """ { @@ -27,9 +29,9 @@ struct VersionsSubmitTests { "affordances" : { "getSubmission" : "asc review-submissions get --submission-id sub-1", "listItems" : "asc review-submissions items list --submission-id sub-1", - "listVersions" : "asc versions list --app-id app-42" + "listVersions" : "asc versions list --app-id app-1" }, - "appId" : "app-42", + "appId" : "app-1", "id" : "sub-1", "platform" : "IOS", "state" : "WAITING_FOR_REVIEW" @@ -39,6 +41,18 @@ struct VersionsSubmitTests { """) } + @Test func `should refuse to submit a version that is already on sale`() async throws { + let versions = MockVersionRepository() + given(versions).getVersion(id: .value("v-1")).willReturn( + AppStoreVersion(id: "v-1", appId: "app-1", versionString: "1.0", platform: .iOS, state: .readyForSale) + ) + let cmd = try VersionsSubmit.parse(["--version-id", "v-1"]) + + await #expect(throws: ReviewSubmissionError.versionNotEditable(versionString: "1.0", state: .readyForSale)) { + try await cmd.execute(versionRepo: versions, submissionRepo: MockSubmissionRepository()) + } + } + // MARK: - --with-products private func planner(iapRepo: MockInAppPurchaseRepository, versionRepo: MockProductVersionRepository) -> SubmissionPlanner { diff --git a/Tests/ASCCommandTests/Commands/Web/Controllers/VersionSubmissionRoutesTests.swift b/Tests/ASCCommandTests/Commands/Web/Controllers/VersionSubmissionRoutesTests.swift new file mode 100644 index 00000000..a77bd532 --- /dev/null +++ b/Tests/ASCCommandTests/Commands/Web/Controllers/VersionSubmissionRoutesTests.swift @@ -0,0 +1,63 @@ +import Foundation +import Hummingbird +import HummingbirdTesting +import HummingbirdWebSocket +import Mockable +import NIOCore +import Testing +@testable import ASCCommand +@testable import ASCKit + +@Suite +struct VersionSubmissionRoutesTests { + private func versions(_ state: AppStoreVersionState) -> MockVersionRepository { + let versions = MockVersionRepository() + given(versions).getVersion(id: .value("v-1")).willReturn( + AppStoreVersion(id: "v-1", appId: "app-1", versionString: "1.0", platform: .iOS, state: state) + ) + return versions + } + + private func submissions() -> MockSubmissionRepository { + let submissions = MockSubmissionRepository() + given(submissions).createSubmission(appId: .value("app-1"), platform: .value(.iOS)) + .willReturn(ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview)) + given(submissions).listSubmissionItems(submissionId: .value("sub-1")).willReturn([]) + given(submissions).addItem(submissionId: .value("sub-1"), target: .value(.appStoreVersion("v-1"))) + .willReturn(ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .readyForReview, linkedResourceId: "v-1")) + given(submissions).submit(submissionId: .value("sub-1")) + .willReturn(ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .waitingForReview)) + return submissions + } + + private func post(versions: MockVersionRepository, submissions: MockSubmissionRepository) async throws -> String { + let router = Router(context: BasicWebSocketRequestContext.self) + let planner = SubmissionPlanner( + iapRepo: MockInAppPurchaseRepository(), groupRepo: MockSubscriptionGroupRepository(), + subscriptionRepo: MockSubscriptionRepository(), productVersionRepo: MockProductVersionRepository() + ) + VersionSubmissionController(submissionRepo: submissions, versionRepo: versions, planner: planner) + .addRoutes(to: router.group("/api/v1")) + return try await Application(router: router).test(.router) { client in + try await client.execute(uri: "/api/v1/versions/v-1/submit", method: .post) { String(buffer: $0.body) } + } + } + + @Test func `should answer with the submission waiting for review after submitting a version over REST`() async throws { + let response = try await post(versions: versions(.prepareForSubmission), submissions: submissions()) + + let json = try #require(try JSONSerialization.jsonObject(with: Data(response.utf8)) as? [String: Any]) + let submission = try #require(json["data"] as? [String: Any] ?? (json["data"] as? [[String: Any]])?.first) + #expect(submission["id"] as? String == "sub-1") + #expect(submission["state"] as? String == "WAITING_FOR_REVIEW") + } + + @Test func `should send nothing to Apple when the version is already on sale`() async throws { + let submissions = MockSubmissionRepository() + + let response = try await post(versions: versions(.readyForSale), submissions: submissions) + + #expect(response.contains("Version 1.0 can't go to review while it is Ready for Sale.")) + verify(submissions).createSubmission(appId: .any, platform: .any).called(0) + } +} diff --git a/Tests/ASCKitTests/Apps/Versions/AppStoreVersionSubmitForReviewTests.swift b/Tests/ASCKitTests/Apps/Versions/AppStoreVersionSubmitForReviewTests.swift new file mode 100644 index 00000000..49069c2e --- /dev/null +++ b/Tests/ASCKitTests/Apps/Versions/AppStoreVersionSubmitForReviewTests.swift @@ -0,0 +1,75 @@ +import Mockable +import Testing +@testable import ASCKit + +@Suite +struct AppStoreVersionSubmitForReviewTests { + private func version(_ state: AppStoreVersionState) -> AppStoreVersion { + AppStoreVersion(id: "v-1", appId: "app-1", versionString: "1.0", platform: .iOS, state: state) + } + + private let draft = ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .readyForReview) + private let submitted = ReviewSubmission(id: "sub-1", appId: "app-1", platform: .iOS, state: .waitingForReview) + + private func submissions(draftHolds items: [ReviewSubmissionItem]) -> MockSubmissionRepository { + let submissions = MockSubmissionRepository() + given(submissions).createSubmission(appId: .value("app-1"), platform: .value(.iOS)).willReturn(draft) + given(submissions).listSubmissionItems(submissionId: .value("sub-1")).willReturn(items) + given(submissions).addItem(submissionId: .value("sub-1"), target: .value(.appStoreVersion("v-1"))) + .willReturn(ReviewSubmissionItem(id: "item-new", submissionId: "sub-1", state: .readyForReview, linkedResourceId: "v-1")) + given(submissions).submit(submissionId: .value("sub-1")).willReturn(submitted) + return submissions + } + + @Test func `should send an editable version to review in its app's open draft for its platform`() async throws { + let submissions = submissions(draftHolds: []) + + let submission = try await version(.prepareForSubmission).submitForReview(to: submissions) + + #expect(submission == submitted) + verify(submissions).addItem(submissionId: .value("sub-1"), target: .value(.appStoreVersion("v-1"))).called(1) + } + + @Test func `should send a rejected version back to review`() async throws { + let submission = try await version(.rejected).submitForReview(to: submissions(draftHolds: [])) + + #expect(submission == submitted) + } + + @Test func `should not add the version again when its draft already holds it`() async throws { + let submissions = submissions(draftHolds: [ + ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .readyForReview, linkedResourceId: "v-1"), + ]) + + let submission = try await version(.prepareForSubmission).submitForReview(to: submissions) + + #expect(submission == submitted) + verify(submissions).addItem(submissionId: .any, target: .any).called(0) + } + + @Test func `should add the version when its draft holds only other items`() async throws { + let submissions = submissions(draftHolds: [ + ReviewSubmissionItem(id: "item-1", submissionId: "sub-1", state: .readyForReview, linkedResourceId: "iap-v-1"), + ]) + + _ = try await version(.prepareForSubmission).submitForReview(to: submissions) + + verify(submissions).addItem(submissionId: .value("sub-1"), target: .value(.appStoreVersion("v-1"))).called(1) + } + + @Test func `should refuse to send a version to review when it can no longer be edited`() async { + let submissions = MockSubmissionRepository() + + await #expect(throws: ReviewSubmissionError.versionNotEditable(versionString: "1.0", state: .readyForSale)) { + try await version(.readyForSale).submitForReview(to: submissions) + } + verify(submissions).createSubmission(appId: .any, platform: .any).called(0) + } + + @Test func `should say why a version can't go to review and which ones can`() { + let error = ReviewSubmissionError.versionNotEditable(versionString: "1.0", state: .readyForSale) + + #expect(error.description + == "Version 1.0 can't go to review while it is Ready for Sale. Only a version being prepared for submission, or one that was rejected, can.") + } +} diff --git a/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift b/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift index c20e9cd2..524d5fc0 100644 --- a/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift +++ b/Tests/ASCKitTests/Submissions/Internal/SDKSubmissionRepositoryTests.swift @@ -6,161 +6,6 @@ import Testing @Suite struct SDKSubmissionRepositoryTests { - @Test func `submitVersion injects appId from version relationship`() async throws { - let stub = SequencedStubAPIClient() - - // Step 1: version response with app relationship - stub.enqueue(AppStoreVersionResponse( - data: AppStoreVersion( - type: .appStoreVersions, - id: "v-1", - attributes: .init(platform: .ios, versionString: "1.0.0"), - relationships: .init( - app: .init(data: .init(type: .apps, id: "app-42")) - ) - ), - links: .init(this: "") - )) - - // Step 2: no existing open submissions - stub.enqueue(ReviewSubmissionsResponse(data: [], links: .init(this: ""))) - - // Step 3: create submission response - stub.enqueue(ReviewSubmissionResponse( - data: ReviewSubmission( - type: .reviewSubmissions, - id: "sub-99", - attributes: .init(state: .waitingForReview) - ), - links: .init(this: "") - )) - - // Step 4: add item response - stub.enqueue(ReviewSubmissionItemResponse( - data: ReviewSubmissionItem( - type: .reviewSubmissionItems, - id: "item-1" - ), - links: .init(this: "") - )) - - // Step 5: patch (submitted) response - stub.enqueue(ReviewSubmissionResponse( - data: ReviewSubmission( - type: .reviewSubmissions, - id: "sub-99", - attributes: .init(state: .waitingForReview) - ), - links: .init(this: "") - )) - - let repo = OpenAPISubmissionRepository(client: stub) - let result = try await repo.submitVersion(versionId: "v-1") - - #expect(result.id == "sub-99") - #expect(result.appId == "app-42") - #expect(result.platform == .iOS) - #expect(result.state == .waitingForReview) - } - - @Test func `submitVersion maps state correctly`() async throws { - let stub = SequencedStubAPIClient() - - stub.enqueue(AppStoreVersionResponse( - data: AppStoreVersion( - type: .appStoreVersions, - id: "v-2", - attributes: .init(platform: .macOs, versionString: "2.0.0"), - relationships: .init( - app: .init(data: .init(type: .apps, id: "app-7")) - ) - ), - links: .init(this: "") - )) - stub.enqueue(ReviewSubmissionsResponse(data: [], links: .init(this: ""))) - stub.enqueue(ReviewSubmissionResponse( - data: ReviewSubmission( - type: .reviewSubmissions, - id: "sub-77", - attributes: .init(state: .inReview) - ), - links: .init(this: "") - )) - stub.enqueue(ReviewSubmissionItemResponse( - data: ReviewSubmissionItem(type: .reviewSubmissionItems, id: "item-2"), - links: .init(this: "") - )) - stub.enqueue(ReviewSubmissionResponse( - data: ReviewSubmission( - type: .reviewSubmissions, - id: "sub-77", - attributes: .init(state: .inReview) - ), - links: .init(this: "") - )) - - let repo = OpenAPISubmissionRepository(client: stub) - let result = try await repo.submitVersion(versionId: "v-2") - - #expect(result.platform == .macOS) - #expect(result.state == .inReview) - #expect(result.isPending == true) - } - - @Test func `should resubmit an open draft that already contains the version`() async throws { - let stub = SequencedStubAPIClient() - - // Step 1: version response - stub.enqueue(AppStoreVersionResponse( - data: AppStoreVersion( - type: .appStoreVersions, - id: "v-3", - attributes: .init(platform: .ios, versionString: "1.0.0"), - relationships: .init( - app: .init(data: .init(type: .apps, id: "app-42")) - ) - ), - links: .init(this: "") - )) - - // Step 2: existing submission with UNRESOLVED_ISSUES - stub.enqueue(ReviewSubmissionsResponse( - data: [ReviewSubmission( - type: .reviewSubmissions, - id: "sub-existing", - attributes: .init(state: .unresolvedIssues) - )], - links: .init(this: "") - )) - - // Step 3: the draft already contains this version, so no item is added - stub.enqueue(ReviewSubmissionItemsResponse( - data: [ReviewSubmissionItem( - type: .reviewSubmissionItems, - id: "item-1", - relationships: .init(appStoreVersion: .init(data: .init(type: .appStoreVersions, id: "v-3"))) - )], - links: .init(this: "") - )) - - // Step 4: patch (resubmit) response — skips create + add item - stub.enqueue(ReviewSubmissionResponse( - data: ReviewSubmission( - type: .reviewSubmissions, - id: "sub-existing", - attributes: .init(state: .waitingForReview) - ), - links: .init(this: "") - )) - - let repo = OpenAPISubmissionRepository(client: stub) - let result = try await repo.submitVersion(versionId: "v-3") - - #expect(result.id == "sub-existing") - #expect(result.appId == "app-42") - #expect(result.state == .waitingForReview) - } - @Test func `listSubmissions maps sdk submissions and injects appId from param`() async throws { let stub = SequencedStubAPIClient() stub.enqueue(ReviewSubmissionsResponse( @@ -382,6 +227,22 @@ struct SDKSubmissionRepositoryTests { #expect(post?.body == #"{"data":{"attributes":{"platform":"IOS"},"relationships":{"app":{"data":{"id":"app-1","type":"apps"}}},"type":"reviewSubmissions"}}"#) } + @Test func `should list each reason Apple gave when it refuses to open a draft`() async throws { + let stub = StubAPIClient() + stub.willReturn(ReviewSubmissionsResponse(data: [], links: .init(this: ""))) + stub.errorsByRequest["POST /v1/reviewSubmissions"] = appVersionNotReviewable() + + await #expect { + _ = try await OpenAPISubmissionRepository(client: stub).createSubmission(appId: "app-1", platform: .iOS) + } throws: { error in + String(describing: error) == """ + Apple refused the review submission: This resource cannot be reviewed, please check associated errors to see why. + - A screenshot for one of the following types is required but was not provided: APP_IPAD_PRO_3GEN_129 + - App is not eligible for submission until pricing has been set. + """ + } + } + @Test func `adding each kind of version sends it as the item's relationship`() async throws { let cases: [(ReviewItemTarget, String, ASCKit.ReviewSubmissionItemLinkedResource)] = [ (.appStoreVersion("v-1"), #""appStoreVersion":{"data":{"id":"v-1","type":"appStoreVersions"}}"#, .appStoreVersion), @@ -502,103 +363,4 @@ struct SDKSubmissionRepositoryTests { !(error is ReviewSubmissionError) && String(describing: error).contains("UNEXPECTED_ERROR") } } - - // MARK: - submitVersion with an open draft, and Apple's refusals - - /// Answers every request `submitVersion` makes for version v-1 of app-1. - private func submitVersionStub( - openDrafts: [AppStoreConnect_Swift_SDK.ReviewSubmission] = [], - itemsInDraft: [AppStoreConnect_Swift_SDK.ReviewSubmissionItem] = [] - ) -> StubAPIClient { - let stub = StubAPIClient() - stub.willReturn(AppStoreVersionResponse( - data: AppStoreVersion( - type: .appStoreVersions, id: "v-1", - attributes: .init(platform: .ios, versionString: "1.0.0"), - relationships: .init(app: .init(data: .init(type: .apps, id: "app-1"))) - ), - links: .init(this: "") - )) - stub.willReturn(ReviewSubmissionsResponse(data: openDrafts, links: .init(this: ""))) - stub.willReturn(ReviewSubmissionItemsResponse(data: itemsInDraft, links: .init(this: ""))) - stub.willReturn(ReviewSubmissionItemResponse( - data: ReviewSubmissionItem(type: .reviewSubmissionItems, id: "item-new"), - links: .init(this: "") - )) - stub.willReturn(ReviewSubmissionResponse( - data: ReviewSubmission(type: .reviewSubmissions, id: "sub-1", attributes: .init(state: .waitingForReview)), - links: .init(this: "") - )) - return stub - } - - private var openDraft: AppStoreConnect_Swift_SDK.ReviewSubmission { - ReviewSubmission(type: .reviewSubmissions, id: "sub-1", attributes: .init(state: .readyForReview)) - } - - @Test func `should add the version before submitting when the open draft is empty`() async throws { - let stub = submitVersionStub(openDrafts: [openDraft], itemsInDraft: []) - - let submission = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") - - #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ - "POST /v1/reviewSubmissionItems", - "PATCH /v1/reviewSubmissions/sub-1", - ]) - let addItem = stub.requests.first { $0.method == "POST" } - #expect(addItem?.body == #"{"data":{"relationships":{"appStoreVersion":{"data":{"id":"v-1","type":"appStoreVersions"}},"reviewSubmission":{"data":{"id":"sub-1","type":"reviewSubmissions"}}},"type":"reviewSubmissionItems"}}"#) - #expect(submission.state == .waitingForReview) - } - - @Test func `should submit without adding the version again when the open draft already contains it`() async throws { - let stub = submitVersionStub(openDrafts: [openDraft], itemsInDraft: [ - ReviewSubmissionItem( - type: .reviewSubmissionItems, id: "item-1", - relationships: .init(appStoreVersion: .init(data: .init(type: .appStoreVersions, id: "v-1"))) - ), - ]) - - let submission = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") - - #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ - "PATCH /v1/reviewSubmissions/sub-1", - ]) - #expect(submission.state == .waitingForReview) - } - - @Test func `should add the version when the open draft only contains other items`() async throws { - let stub = submitVersionStub(openDrafts: [openDraft], itemsInDraft: [ - ReviewSubmissionItem( - type: .reviewSubmissionItems, id: "item-1", - relationships: .init(inAppPurchaseVersion: .init(data: .init(type: .inAppPurchaseVersions, id: "iap-v-1"))) - ), - ]) - - _ = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") - - #expect(stub.requests.filter { $0.method != "GET" }.map { "\($0.method) \($0.path)" } == [ - "POST /v1/reviewSubmissionItems", - "PATCH /v1/reviewSubmissions/sub-1", - ]) - } - - @Test(arguments: [ - "POST /v1/reviewSubmissions", - "POST /v1/reviewSubmissionItems", - "PATCH /v1/reviewSubmissions/sub-1", - ]) - func `should list each reason Apple gave when it refuses to submit a version`(refusedRequest: String) async throws { - let stub = submitVersionStub() - stub.errorsByRequest[refusedRequest] = appVersionNotReviewable() - - await #expect { - _ = try await OpenAPISubmissionRepository(client: stub).submitVersion(versionId: "v-1") - } throws: { error in - String(describing: error) == """ - Apple refused the review submission: This resource cannot be reviewed, please check associated errors to see why. - - A screenshot for one of the following types is required but was not provided: APP_IPAD_PRO_3GEN_129 - - App is not eligible for submission until pricing has been set. - """ - } - } } diff --git a/docs/features/concept-folders/design.md b/docs/features/concept-folders/design.md index f555efaf..9ce3550a 100644 --- a/docs/features/concept-folders/design.md +++ b/docs/features/concept-folders/design.md @@ -4,7 +4,7 @@ description: The source layout reworked from layers (Domain/, Infrastructure/) t # Concept folders, not layers -**Status: BUILT** — steps 1–5: one `ASCKit` module in concept folders; docs and skills follow; one composition root, held by a test; every adapter's decisions tested with only the bare call in `Internal/System/`; `Repository` for CRUD, role nouns for workflows. asc-cli is split by layer: `Sources/Domain/` +**Status: BUILT** — steps 1–5: one `ASCKit` module in concept folders; docs and skills follow; one composition root, held by a test; every adapter's decisions tested with only the bare call in `Internal/System/`; `Repository` for CRUD, role nouns for what runs outside asc-cli, workflows over aggregates on the model. asc-cli is split by layer: `Sources/Domain/` and `Sources/Infrastructure/` are two modules that mirror each other folder for folder. Every concept therefore lives in two places, and every change to one touches both trees. The goal, stated as a test: @@ -117,7 +117,7 @@ safety net; any step that moves a rule writes its test first. | 2 | **docs and skills follow** ✓ | `CLAUDE.md`, `docs/design.md`, `implement-feature` / `fix-bug` / `improvement` skills describe `Domain → Infrastructure` (16 files) | describe concept folders; link this doc | — | | 3 | **one composition root** ✓ | 22 uses of 12 `Internal/` types in 14 `ASCCommand` files outside `ClientProvider`; `RESTRoutes` wires its own `ClientFactory` | `ClientProvider` gains `makeAuthStorage`, `makeEnvironmentAuthProvider`, `makeXcodeBuildRunner`, `makeProjectConfigStorage`; commands and `RESTRoutes` ask it for the public protocol | "should build every concept's Internal implementation only in the composition root" | | 4 | **`Internal/System/` per adapter** ✓ (one commit each) | seven untested adapters mix decisions with I/O; `codecov.yml` lists each file | each adapter's decisions become a tested value or orchestrator in `Internal/`; only the call stays, ≤100 lines, in `Internal/System/`; the per-file ignores become one `**/Internal/System/**` rule. The SDK adapters stay as they are | per adapter, its decisions: e.g. "should add the given variables on top of the inherited environment" | -| 5 | **names for roles** ✓ | 75 `XxxRepository` protocols, 11 of which run a workflow rather than CRUD | `XxxRepository` stays for the 64 CRUD protocols. The 11 workflows take role nouns: `IrisSignIn`, `Reports`, `ReviewSubmissions`, `InAppPurchaseSubmissions`, `SubscriptionSubmissions`, `IrisInAppPurchaseSubmissions`, `AppWall`, `Simulators`, `Skills`, `Plugins`, `Themes`; their implementations, mocks and `make…` factories follow. `XxxProvider`s stay | none — behaviour unchanged; 2,958 tests before and after | +| 5 | **names for roles** ✓ | 75 `XxxRepository` protocols; some ran something outside asc-cli, and one (`SubmissionRepository.submitVersion`) held a workflow over aggregates | `XxxRepository` stays for the 68 that are CRUD — a state change such as submit is an update. The 7 that run something outside asc-cli take role nouns: `IrisSignIn`, `Reports`, `AppWall`, `Simulators`, `Skills`, `Plugins`, `Themes`. The workflow moves to the model: `AppStoreVersion.submitForReview(to:)` (refuses a version that can't be edited, by the same `isEditable` as its affordance), built from the repository's primitives like `SubmissionPlan.submit(repo:)`. `XxxProvider`s stay | "should refuse to send a version to review when it can no longer be edited"; the rest is a rename, 2,958 → 2,961 tests | Step 1 removes most of §1's cost on its own; 3 and 4 make the fence real; 5 is cosmetic and can wait. From f91d908b473c15fcdc5c76053527ad137b670981 Mon Sep 17 00:00:00 2001 From: slamhan Date: Thu, 19 Nov 2026 21:14:45 +0800 Subject: [PATCH 18/18] fix(web): Submit for Review reports a failed submission as failed DataProvider.fetch answers null when the command fails and only logs the reason, so the Submissions page showed 'Submitted for App Store Review!' even when versions submit was refused (a version that can't be edited, or Apple's refusal). It now shows an error toast pointing to the command log. Mock mode is unaffected: it never answers null. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 +++ .../command-center/js/presentation/pages/submissions.js | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21b6f4e2..3098f591 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `asc versions submit` and `POST /api/v1/versions/:id/submit` refuse a version that can't be edited (e.g. Ready for Sale) before calling Apple, saying which states can go to review. - **Breaking (library):** one `ASCKit` module (`import ASCKit`); 7 non-CRUD repositories take role names (`IrisAuthRepository` → `IrisSignIn`, …); `SubmissionRepository.submitVersion` → `AppStoreVersion.submitForReview(to:)`. → [design](docs/features/concept-folders/design.md) +### Fixed +- Command Center's Submit for Review no longer reports success when `versions submit` fails; it says the submission didn't go and points to the command log. + --- ## [0.18.9] - 2026-11-08 diff --git a/apps/asc-web/command-center/js/presentation/pages/submissions.js b/apps/asc-web/command-center/js/presentation/pages/submissions.js index c84bbbbc..7f635917 100644 --- a/apps/asc-web/command-center/js/presentation/pages/submissions.js +++ b/apps/asc-web/command-center/js/presentation/pages/submissions.js @@ -64,7 +64,13 @@ async function checkReadiness() { async function submitForReview() { const vid = document.getElementById('submitVersionId')?.value || 'v-ps-002'; showToast('Submitting...', 'info'); - await DataProvider.fetch(`versions submit --version-id ${vid}`); + const submission = await DataProvider.fetch(`versions submit --version-id ${vid}`); + // DataProvider answers null when the command fails (e.g. the version can't be + // edited, or Apple refused it); the reason is already in the command log. + if (!submission) { + showToast('Not submitted for review — see the command log for why.', 'error'); + return; + } showToast('Submitted for App Store Review!', 'success'); }