Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .spec-sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
abca177b38fbfab3c7f757398c7546d27f97f2858b4acc96421dae669862c0c8
06a7c92e23df7c44f8898a2b18abec43aa5c14b8f12ea10e1ce65a94a14a0fb4
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ for try await order in controlResell.allOrders(bucket: "to_send") { print(order.

// Writes (API key with `items:write` / `conversations:write`).
let item = try await controlResell.call { try await $0.createItem(.init(body: .json(.init(name: "Jacket")))).created.body.json }
_ = try await controlResell.call { try await $0.publishItem(.init(path: .init(id: item.id), body: .json(.init(accountIds: [accountId])))).ok }
// publishItem, dropItemPrice and republishItem take an optional `scheduledAt` (a Date, at most 30 days ahead): the action starts then
// instead of now (tomorrow here), and the 202 receipt (`.accepted`) carries the date.
_ = try await controlResell.call { try await $0.publishItem(.init(path: .init(id: item.id), body: .json(.init(accountIds: [accountId], scheduledAt: Date().addingTimeInterval(86_400))))).accepted }

// Webhooks (`webhooks:read` / `webhooks:write`); allWebhookEvents catches up the last 7 days.
for try await event in controlResell.allWebhookEvents(type: "item.sold") { print(event._type) }
Expand Down
6 changes: 3 additions & 3 deletions Sources/ControlResell/Generated/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,7 @@ public struct Client: APIProtocol {
}
/// Publish an item on the seller's accounts
///
/// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`.
/// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`.
///
/// - Remark: HTTP `POST /api/public/v1/items/{id}/publish`.
/// - Remark: Generated from `#/paths//api/public/v1/items/{id}/publish/post(publishItem)`.
Expand Down Expand Up @@ -2744,7 +2744,7 @@ public struct Client: APIProtocol {
}
/// Lower the price of an item's listings
///
/// Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`.
/// Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`.
///
/// - Remark: HTTP `POST /api/public/v1/items/{id}/price-drop`.
/// - Remark: Generated from `#/paths//api/public/v1/items/{id}/price-drop/post(dropItemPrice)`.
Expand Down Expand Up @@ -3054,7 +3054,7 @@ public struct Client: APIProtocol {
}
/// Republish an item on the seller's accounts
///
/// Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`.
/// Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`.
///
/// This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace ("list it on eBay"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit.
///
Expand Down
24 changes: 21 additions & 3 deletions Sources/ControlResell/Generated/Types+Components+Schemas.swift
Original file line number Diff line number Diff line change
Expand Up @@ -779,21 +779,27 @@ extension Components {
public var accountIds: [Swift.String]
/// - Remark: Generated from `#/components/schemas/PublishRequest/cancelBeforeProceeding`.
public var cancelBeforeProceeding: Swift.Bool?
/// - Remark: Generated from `#/components/schemas/PublishRequest/scheduledAt`.
public var scheduledAt: Foundation.Date?
/// Creates a new `PublishRequest`.
///
/// - Parameters:
/// - accountIds:
/// - cancelBeforeProceeding:
/// - scheduledAt:
public init(
accountIds: [Swift.String],
cancelBeforeProceeding: Swift.Bool? = nil
cancelBeforeProceeding: Swift.Bool? = nil,
scheduledAt: Foundation.Date? = nil
) {
self.accountIds = accountIds
self.cancelBeforeProceeding = cancelBeforeProceeding
self.scheduledAt = scheduledAt
}
public enum CodingKeys: String, CodingKey {
case accountIds
case cancelBeforeProceeding
case scheduledAt
}
}
/// - Remark: Generated from `#/components/schemas/ScheduledAction`.
Expand Down Expand Up @@ -843,6 +849,8 @@ extension Components {
public var roundStep: Swift.String?
/// - Remark: Generated from `#/components/schemas/PriceDropRequest/accountIds`.
public var accountIds: [Swift.String]?
/// - Remark: Generated from `#/components/schemas/PriceDropRequest/scheduledAt`.
public var scheduledAt: Foundation.Date?
/// Creates a new `PriceDropRequest`.
///
/// - Parameters:
Expand All @@ -851,25 +859,29 @@ extension Components {
/// - roundType:
/// - roundStep:
/// - accountIds:
/// - scheduledAt:
public init(
_type: Swift.String,
value: Swift.String,
roundType: Swift.String? = nil,
roundStep: Swift.String? = nil,
accountIds: [Swift.String]? = nil
accountIds: [Swift.String]? = nil,
scheduledAt: Foundation.Date? = nil
) {
self._type = _type
self.value = value
self.roundType = roundType
self.roundStep = roundStep
self.accountIds = accountIds
self.scheduledAt = scheduledAt
}
public enum CodingKeys: String, CodingKey {
case _type = "type"
case value
case roundType
case roundStep
case accountIds
case scheduledAt
}
}
/// - Remark: Generated from `#/components/schemas/RepublishRequest`.
Expand All @@ -882,29 +894,35 @@ extension Components {
public var priceVariation: Swift.String?
/// - Remark: Generated from `#/components/schemas/RepublishRequest/allowIfDeleted`.
public var allowIfDeleted: Swift.Bool?
/// - Remark: Generated from `#/components/schemas/RepublishRequest/scheduledAt`.
public var scheduledAt: Foundation.Date?
/// Creates a new `RepublishRequest`.
///
/// - Parameters:
/// - accountIds:
/// - priceDrop:
/// - priceVariation:
/// - allowIfDeleted:
/// - scheduledAt:
public init(
accountIds: [Swift.String]? = nil,
priceDrop: Components.Schemas.PriceDropRequest? = nil,
priceVariation: Swift.String? = nil,
allowIfDeleted: Swift.Bool? = nil
allowIfDeleted: Swift.Bool? = nil,
scheduledAt: Foundation.Date? = nil
) {
self.accountIds = accountIds
self.priceDrop = priceDrop
self.priceVariation = priceVariation
self.allowIfDeleted = allowIfDeleted
self.scheduledAt = scheduledAt
}
public enum CodingKeys: String, CodingKey {
case accountIds
case priceDrop
case priceVariation
case allowIfDeleted
case scheduledAt
}
}
/// - Remark: Generated from `#/components/schemas/ItemUpdateRequest`.
Expand Down
10 changes: 5 additions & 5 deletions Sources/ControlResell/Generated/Types+Operations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5365,7 +5365,7 @@ public enum Operations {
}
/// Publish an item on the seller's accounts
///
/// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`.
/// Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item ("list it on eBay"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`.
///
/// - Remark: HTTP `POST /api/public/v1/items/{id}/publish`.
/// - Remark: Generated from `#/paths//api/public/v1/items/{id}/publish/post(publishItem)`.
Expand Down Expand Up @@ -5450,7 +5450,7 @@ public enum Operations {
self.body = body
}
}
/// The publication is scheduled on every account of the request.
/// The publication is scheduled on every account of the request, at `scheduledAt`.
///
/// - Remark: Generated from `#/paths//api/public/v1/items/{id}/publish/post(publishItem)/responses/202`.
///
Expand Down Expand Up @@ -6063,7 +6063,7 @@ public enum Operations {
}
/// Lower the price of an item's listings
///
/// Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`.
/// Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`.
///
/// - Remark: HTTP `POST /api/public/v1/items/{id}/price-drop`.
/// - Remark: Generated from `#/paths//api/public/v1/items/{id}/price-drop/post(dropItemPrice)`.
Expand Down Expand Up @@ -6148,7 +6148,7 @@ public enum Operations {
self.body = body
}
}
/// The price drop is scheduled on every account named.
/// The price drop is scheduled on every account named, at `scheduledAt`.
///
/// - Remark: Generated from `#/paths//api/public/v1/items/{id}/price-drop/post(dropItemPrice)/responses/202`.
///
Expand Down Expand Up @@ -6761,7 +6761,7 @@ public enum Operations {
}
/// Republish an item on the seller's accounts
///
/// Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`.
/// Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`.
///
/// This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace ("list it on eBay"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit.
///
Expand Down
Loading
Loading