Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / MatchHistoryResource

Interface: MatchHistoryResource ​

Defined in: packages/ts-sdk/src/resources/match-history.ts:56

Server-owned simulator history APIs.

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

console.log(matchHistoryResource)

Methods ​

createReplayShare() ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

const { createReplayShare } = matchHistoryResource

console.log(createReplayShare)

createReplayShare(request, options?): Promise<CreateMatchHistoryReplayShareResponse>

Defined in: packages/ts-sdk/src/resources/match-history.ts:77

Creates or returns a stable opaque replay link for one disclosure scope.

Parameters ​

request ​

CreateMatchHistoryReplayShareInput

options? ​

SimulatorRequestOptions

Returns ​

Promise<CreateMatchHistoryReplayShareResponse>


deckStats() ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

const { deckStats } = matchHistoryResource

console.log(deckStats)

deckStats(request, options?): Promise<MatchHistoryDeckStatsResponse>

Defined in: packages/ts-sdk/src/resources/match-history.ts:60

Returns private lifetime simulator results for My SWU deck ids.

Parameters ​

request ​

MatchHistoryDeckStatsRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<MatchHistoryDeckStatsResponse>


list() ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

const { list } = matchHistoryResource

console.log(list)

list(request, options?): Promise<MatchHistoryListResponse>

Defined in: packages/ts-sdk/src/resources/match-history.ts:67

Lists saved and completed matches visible to the supplied identities.

Parameters ​

request ​

MatchHistoryListRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<MatchHistoryListResponse>


loadReplayShare() ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

const { loadReplayShare } = matchHistoryResource

console.log(loadReplayShare)

loadReplayShare(shareToken, options?): Promise<SharedMatchHistoryReplayResponse>

Defined in: packages/ts-sdk/src/resources/match-history.ts:82

Loads a replay through an opaque link without participant identities.

Parameters ​

shareToken ​

string

options? ​

SimulatorRequestOptions

Returns ​

Promise<SharedMatchHistoryReplayResponse>


recover() ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

const { recover } = matchHistoryResource

console.log(recover)

recover(request, options?): Promise<MatchRecoveryResponse>

Defined in: packages/ts-sdk/src/resources/match-history.ts:94

Restores an owned Solo-versus-AI source after its runtime is lost.

Parameters ​

request ​

MatchRecoveryRequest

options? ​

SimulatorRequestOptions

Returns ​

Promise<MatchRecoveryResponse>


replay() ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

const { replay } = matchHistoryResource

console.log(replay)

replay(request, options?): Promise<MatchHistoryReplayResponse>

Defined in: packages/ts-sdk/src/resources/match-history.ts:72

Loads public and post-game reveal-all frames for an authorized result.

Parameters ​

request ​

MatchHistoryReplayInput

options? ​

SimulatorRequestOptions

Returns ​

Promise<MatchHistoryReplayResponse>


restore() ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

const { restore } = matchHistoryResource

console.log(restore)

restore(request, options?): Promise<RestoreHistoryResponse>

Defined in: packages/ts-sdk/src/resources/match-history.ts:89

Restores one authorized row whose eligibility is available.

Parameters ​

request ​

MatchHistoryRestoreInput

options? ​

SimulatorRequestOptions

Returns ​

Promise<RestoreHistoryResponse>


submitAiGameFeedback() ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

const matchHistoryResource = simulatorClient.matchHistory

const { submitAiGameFeedback } = matchHistoryResource

console.log(submitAiGameFeedback)

submitAiGameFeedback(request, options?): Promise<SubmitAiGameFeedbackResponse>

Defined in: packages/ts-sdk/src/resources/match-history.ts:99

Creates feedback once for one completed Solo-versus-AI game.

Parameters ​

request ​

SubmitAiGameFeedbackInput

options? ​

SimulatorRequestOptions

Returns ​

Promise<SubmitAiGameFeedbackResponse>

Released under the MIT License.