-
Notifications
You must be signed in to change notification settings - Fork 397
/
Copy pathjinteki-GameAPI-1.0.0.yaml
464 lines (464 loc) · 12.1 KB
/
jinteki-GameAPI-1.0.0.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
---
openapi: 3.0.0
info:
title: JNet Game API
description: "Game state API for the Jinteki.net Netrunner server.\n\nTo enable API access, a user must create an API key in the `Settings` page and select the `Allow API access to game information` checkbox when creating a new game. \n"
license:
name: MIT License
url: https://github.com/mtgred/netrunner/blob/master/LICENSE.txt
version: 1.0.0
servers:
- url: https://virtserver.swaggerhub.com/jinteki/GameAPI/1.0.0
description: SwaggerHub API Auto Mocking
- url: https://jinteki.net
description: Jinetki.net Production Server
security:
- ApiKeyAuth: []
tags:
- name: Board Info
description: Information about the user's game board state
- name: Meta Info
description: Generic game information
paths:
/game/decklist:
get:
tags:
- Board Info
summary: list user's deck information
description: |
Return extended information about the deck the user has selected for the game.
operationId: listDecklist
responses:
"200":
description: deck information
content:
application/json:
schema:
$ref: '#/components/schemas/DeckList'
"404":
description: Unknown x-jnet-api-key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"403":
description: No game for API key or API access not enabled for game
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"204":
description: Player has not yet selected a deck
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/game/deck:
get:
tags:
- Board Info
summary: list user's cards that have not been drawn
description: |
Return the card codes that are in the user's R&D or Stack. This list is explicitly *not* ordered to match the draw order.
operationId: listDeck
responses:
"200":
description: undrawn card codes
content:
application/json:
schema:
$ref: '#/components/schemas/CardList'
"404":
description: Unknown x-jnet-api-key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"403":
description: No game for API key or API access not enabled for game
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"204":
description: Player has not yet selected a deck
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/game/hand:
get:
tags:
- Board Info
summary: list user's cards that are in their hand
description: |
Return the card codes that are in the user's HQ or Grip
operationId: listHand
responses:
"200":
description: card codes in hand
content:
application/json:
schema:
$ref: '#/components/schemas/CardList'
"404":
description: Unknown x-jnet-api-key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"403":
description: No game for API key or API access not enabled for game
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"204":
description: Player has not yet selected a deck
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/game/discard:
get:
tags:
- Board Info
summary: list user's cards that are in their discard pile
description: |
Return the card codes that are in the user's Archives or Heap
operationId: listDiscard
responses:
"200":
description: card codes in discard pile
content:
application/json:
schema:
$ref: '#/components/schemas/CardList'
"404":
description: Unknown x-jnet-api-key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"403":
description: No game for API key or API access not enabled for game
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"204":
description: Player has not yet selected a deck
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/game/log:
get:
tags:
- Meta Info
summary: list game log messages
description: Returns a text representation of the in-game message log
operationId: listLog
responses:
"200":
description: Game log messages
content:
application/json:
schema:
$ref: '#/components/schemas/MessageList'
"404":
description: Unknown x-jnet-api-key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
"403":
description: No game for API key or API access not enabled for game
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
components:
schemas:
ErrorMessage:
required:
- message
type: object
properties:
message:
type: string
example: Informative error message
DeckList:
required:
- cards
- identity
- name
type: object
properties:
name:
type: string
example: Test Deck
identity:
$ref: '#/components/schemas/DeckList_identity'
cards:
type: array
items:
$ref: '#/components/schemas/DeckList_cards'
CardDetail:
required:
- code
- cost
- cycle_code
- deck-limit
- faction
- factioncost
- image
- number
- set_code
- setname
- side
- subtype
- subtypes
- text
- title
- type
- uniqueness
type: object
properties:
faction:
type: string
example: Apex
cycle_code:
type: string
example: terminal-directive
factioncost:
type: integer
example: 0
setname:
type: string
example: Terminal Directive Cards
number:
type: integer
example: 25
type:
type: string
example: Resource
title:
type: string
example: Dean Lister
uniqueness:
type: boolean
example: true
code:
pattern: ^\d{5}$
type: string
example: "13025"
side:
type: string
example: Runner
image:
type: string
format: url
example: https://jinteki.net/img/cards/en/default/stock/13025.png
cost:
type: integer
example: 2
deck-limit:
type: integer
example: 3
set_code:
type: string
example: td
subtype:
type: string
example: Connection
text:
type: string
example: '[trash]: Choose an <strong>icebreaker</strong>. Until the end of the run, that <strong>icebreaker</strong> has +1 strength for each card in your grip.'
subtypes:
type: array
items:
type: string
example: Connection
IdentityDetail:
required:
- baselink
- code
- cycle_code
- deck-limit
- faction
- image
- influencelimit
- minimumdecksize
- number
- set_code
- setname
- side
- subtype
- subtypes
- text
- title
- type
- uniqueness
type: object
properties:
faction:
type: string
example: Apex
cycle_code:
type: string
example: data-and-destiny
setname:
type: string
example: Data and Destiny
influencelimit:
type: integer
example: 25
number:
type: integer
example: 29
type:
type: string
example: Identity
title:
type: string
example: 'Apex: Invasive Predator'
uniqueness:
type: boolean
example: false
baselink:
type: integer
example: 0
code:
pattern: ^\d{5}$
type: string
example: "13025"
side:
type: string
example: Runner
image:
type: string
format: url
example: https://jinteki.net/img/cards/en/default/stock/09029.png
deck-limit:
type: integer
example: 1
set_code:
type: string
example: dad
subtype:
type: string
example: Digital
minimumdecksize:
type: integer
example: 45
text:
type: string
example: |-
You cannot install non-<strong>virtual</strong> resources.
When your turn begins, you may install 1 card from your grip facedown.
subtypes:
type: array
items:
type: string
example: Digital
CardList:
required:
- cards
type: object
properties:
cards:
type: array
items:
pattern: ^\d{5}$
type: string
example: "11075"
example:
cards:
- "11075"
- "26048"
- "30041"
- "30056"
- "30069"
MessageItem:
required:
- text
- user
type: object
properties:
user:
type: string
example: test1
text:
type: string
example: test1 has created the game.
example:
user: __system__
text: test1 has created the game.
MessageList:
required:
- messages
type: object
properties:
messages:
type: array
items:
$ref: '#/components/schemas/MessageItem'
example:
messages:
- user: __system__
text: test1 has created the game.
- user: __system__
text: '[hr]'
- user: __system__
text: test1 takes a mulligan.
DeckList_identity:
required:
- details
- title
type: object
properties:
title:
type: string
example: 'Apex: Invasive Predator'
details:
$ref: '#/components/schemas/IdentityDetail'
DeckList_cards:
required:
- details
- qty
- title
type: object
properties:
qty:
type: integer
example: 3
title:
type: string
example: Assimilator
details:
$ref: '#/components/schemas/CardDetail'
responses:
UnknownKey:
description: Unknown x-jnet-api-key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
UnknownGame:
description: No game for API key or API access not enabled for game
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
NoDeckSelected:
description: Player has not yet selected a deck
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
securitySchemes:
ApiKeyAuth:
type: apiKey
name: X-JNET-API
in: header