Skip to content

Commit

Permalink
Collection usage
Browse files Browse the repository at this point in the history
  • Loading branch information
underthestars-zhy committed Apr 29, 2023
1 parent 1033848 commit 5dae753
Showing 1 changed file with 67 additions and 9 deletions.
76 changes: 67 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let mobbinAPI = MobbinAPI(userInfo: UserInfo(...), token: Token(...))

```swift
struct UserInfo {
...
...
}
```

Expand Down Expand Up @@ -74,7 +74,7 @@ After a successful login, MobbinAPI can obtain a token, which will be used in al

```swift
struct Token {
...
...
}
```

Expand Down Expand Up @@ -122,7 +122,7 @@ let iOSAppsCount = try await mobbinAPI.iOSAppsCount

```swift
struct App {
....
....
}
```

Expand Down Expand Up @@ -169,7 +169,7 @@ Mobbin can provide all the screens snapshots of the app.

```swift
struct Screen {
....
....
}
```

Expand All @@ -196,7 +196,7 @@ Mobbin can provide the entire flows of the app, which consists of a series of sc

```swift
struct Flow {
....
....
}
```

Expand All @@ -213,10 +213,10 @@ struct Flow {

```swift
struct Flow {
...
struct Screen {
....
}
...
struct Screen {
....
}
}
```

Expand Down Expand Up @@ -254,3 +254,61 @@ Will support in the future.
## Collection

MobbinAPI supports **full control** over an account's collections.

### Platforms Count

Platform count refers to the number of screens or flows in a particular collection's platform.

```swift
let platfrom = try await api.platformCount(of: Collection(...))
```

### Query Collection

```swift
let collections = try await api.queryCollections()
```

### Delete Collection

```swift
try await api.delete(collection: Collection(...))
```

### Create Collection

```swift
let workspace = try await api.fetchWorkspace()

try await api.createCollection(in: workspace, name: "...", description: "...")
```

### Eidt Collection

```swift
let newCollection = try await api.edit(collection: collection, name: "...", description: "...")
```

### Apps in the Collection

The following method can fetch apps in collections. The result is a `Collection.App` structure, which is almost the same as the normal `App` structure.

```swift
let apps = try await api.queryApps(in: Collection(...))
```

### Screens in the Collection

The following method can fetch screens in collections. The result is a `Collection.Screen` structure, which is almost the same as the normal `Screen` structure.

```swift
let apps = try await api.queryScreens(in: Collection(...))
```

### Flows in the Collection

The following method can fetch flows in collections. The result is a `Collection.Flow` structure, which is almost the same as the normal `Flow` structure.

```swift
let apps = try await api.queryFlows(in: Collection(...))
```

0 comments on commit 5dae753

Please sign in to comment.