-
Notifications
You must be signed in to change notification settings - Fork 11
/
conveyor_schema.json
640 lines (640 loc) · 18.5 KB
/
conveyor_schema.json
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
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
{"$schema": "https://rawgit.com/mzernetsch/jrgen/master/jrgen-spec.schema.json",
"jrgen": "1.1",
"jsonrpc": "2.0",
"info": {
"title": "Conveyor",
"description": [
"An api which handles various stemit rpc requests.",
"This api follows the json-rpc 2.0 specification. More information available at http://www.jsonrpc.org/specification.",
"## Drafts",
"Drafts provide ability to store and resume editing posts.",
"## Feature Flags",
"Feature flags allows our apps (condenser mainly) to hide certain features behind flags.",
"Flags can be set individually for users or probabilistically to roll out a feature incrementally, for example `set_flag_probability orange_theme 0.5` will enable the flag for ~50% of our users. Changing the flag probability does not re-randomize the user selection so that a user that had their flag enabled at 0.5 will still have it enabled when going to 0.75. This is achieved by seeding a PRNG with the shasum of username+flag.",
"Flags set individually per user always takes precedence.",
"## User Data",
"Conveyor is the central point for storing sensitive user data (email, phone, etc). No other services should store this data and should instead query for it here every time.",
"## Tags",
"Tagging mechanism for other services, allows defining and assigning tags to accounts (or other identifiers) and querying for them."
],
"version": "1.0"
},
"definitions": {
"account": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"},
"vote_sp": {
"description": "SP minus delegated away plus delegated to",
"type": "number",
"default": 100.1
},
"joined_at": {
"description": "account creation date",
"type": "string",
"default": "2016-03-24T17:00"
},
"reputation": {
"description": "legacy rep score (centered at 25)",
"type": "number",
"default": 100
},
"context_account": {"$ref":"#/definitions/account_name"},
"context_recent_sends": {
"description": "last 30d number of xfers to this acct",
"type": "integer",
"default": 100
},
"context_is_following": {
"description": "if context_account follows this user",
"type": "boolean",
"default": false
},
"context_is_follower": {
"description": "if context_account follows this user",
"type": "boolean",
"default": false
},
"context_is_muted": {
"description": "if context_account muted (ignored) this user",
"type": "boolean",
"default": false
},
"tags": {
"description": "{abuse exchange verified none}",
"type": "array",
"items": {
"type": "string",
"enum": [
"abuse",
"exchange",
"verified",
"none"
]
},
"default": ["none"]
},
"value_sp": {
"description": "effective SP value of all held tokens",
"type": "string",
"default": "1000.1"
},
"follower_count": {
"description": "follower count",
"type": "integer",
"default": 100
},
"following_count": {
"description": "following count",
"type": "integer",
"default": 100
}
}
},
"account_name": {
"type":"string",
"description": "steem blockchain account",
"default":"steemit"
},
"email":{
"type":"string",
"format":"email",
"default":"steemit@steemit.com"
},
"flag": {
"type":"string",
"default": "example-flag"
},
"phone": {
"type":"string",
"default":"+10008675309"
},
"prices": {
"type": "object",
"properties": {
"steem_sbd": {
"type": "number",
"default": 0.8221426365
},
"steem_usd": {
"type": "number",
"default": 0.827
},
"steem_vest": {
"type": "number",
"default": 2019.1003284361
}
}
},
"summarized_url": {
"type": "object",
"properties": {
"blacklisted": {
"type": "boolean",
"default": false
},
"description": {
"type": "string",
"default": "a description of the content found at the given url"
},
"favicon": {
"type": "string",
"default": "http://url/of/FAVICON.ICO"
},
"image": {
"type": "string",
"default": "http://url/of/image.jpg"
},
"videos": {
"type": "array",
"items": {
"$ref": "#/definitions/summarized_url_video"
}
},
"title": {
"type": "string",
"default": "a title pulled from the given url"
}
}
},
"summarized_url_video": {
"type": "object",
"properties": {
"src": {
"type": "string",
"default": "video source"
},
"height": {
"type": "number",
"default": "height dimension of video"
},
"width":{
"type": "number",
"default": "width dimension of video"
}
}
},
"probability":{
"type":"number",
"min":0,
"max":1,
"default":0.5
},
"saved_draft": {
"type":"object",
"properties":{
"title":{
"type":"string",
"default":"example draft title"
},
"body":{
"type":"string",
"default":"example draft body"
},
"uuid":{"$ref":"#/definitions/uuid"}
}
},
"request_signature":{
"type":"string",
"default":"dlfkjdlkfjsldkfjsdlkfjsldkfj"
},
"tag": {
"type":"string",
"default":"example-tag"
},
"uid": {
"type":"string",
"default":"1001"
},
"unsaved_draft": {
"type":"object",
"properties":{
"title":{
"type":"string",
"default":"example draft title"
},
"body":{
"type":"string",
"default":"example draft body"
}
}
},
"uuid": {
"type":"string",
"default": "dce998f6-b811-4181-a056-19886a6db7c6"
},
"userData": {
"type": "object",
"properties": {
"email": {"$ref":"#/definitions/email"},
"phone": {"$ref":"#/definitions/phone"}
}
}
},
"methods": {
"conveyor.list_drafts": {
"summary":"List stored drafts for account.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["drafts"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"}
},
"required": ["account"]
},
"result":{
"description":"",
"type":"array",
"items":{"$ref":"#/definitions/saved_draft"
}
}
},
"conveyor.save_draft":{
"summary":"Save draft for account.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["drafts"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"},
"draft": {"$ref":"#/definitions/unsaved_draft"}
},
"required": ["account","draft"]
},
"result":{
"description":"",
"type":"object",
"properties":{
"uuid":{"$ref":"#/definitions/uuid"}
}}
},
"conveyor.remove_draft":{
"summary":"Delete saved draft with uuid for account.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["drafts"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"},
"uuid": {"$ref":"#/definitions/uuid"}
},
"required": ["account","uuid"]
},
"result":{
"description":"",
"type":"object",
"properties":{
"uuid":{"$ref":"#/definitions/uuid"}
}}
},
"conveyor.get_feature_flag":{
"summary":"Get specific flag for the username account.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["feature-flags"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"},
"flag": {"$ref":"#/definitions/flag"}
},
"required": ["account","flag"]
},
"result":{
"description":"",
"type":"object",
"properties":{}}
},
"conveyor.set_feature_flag":{
"summary":"Set a flag override for the username account.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["feature-flags"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"},
"flag": {"$ref":"#/definitions/flag"},
"value": {
"oneOf": [
{"type":"boolean"},
{"type":"null"}]
}
},
"required": ["account","flag","value"]
},
"result":{
"description":"",
"type":"object",
"properties":{}}
},
"conveyor.get_feature_flags":{
"summary":"Get feature flags object for the username account",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["feature-flags"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"}
},
"required": ["account"]
},
"result":{
"description":"",
"type":"object",
"properties":{}}
},
"conveyor.set_feature_flag_probability":{
"summary":"Set the probability expressed as a fraction 0.0 to 1.0 that a flag will resolve to true.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["feature-flags"],
"params": {
"type": "object",
"properties": {
"flag": {"$ref":"#/definitions/flag"},
"probability": {"$ref":"#/definitions/probability"}
},
"required": ["flag","probability"]
},
"result":{
"description":"",
"type":"object",
"properties":{}}
},
"conveyor.get_feature_flag_probabilities":{
"summary":"Get all the set flag probabilities.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["feature-flags"],
"params": {
"type": "object",
"properties": {}
},
"result":{
"description":"",
"type":"object",
"properties":{}}
},
"conveyor.get_user_data":{
"summary":"Return user data for account, returns an error if the account is not found.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["user-data"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"}
},
"required": ["account"]
},
"result":{
"$ref":"#/definitions/userData"
}
},
"conveyor.set_user_data":{
"summary":"Set user data for account.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["user-data"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"},
"userData":{"$ref":"#/definitions/userData"}
},
"required": ["account","userData"]
},
"result":{
"description":"",
"type":"object",
"properties":{}}
},
"conveyor.is_email_registered":{
"summary":"Check if the email address is in the database.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["user-data"],
"params": {
"type": "object",
"properties": {
"email": {
"$ref": "#/definitions/email"
}
},
"required": ["email"]
},
"result":{
"description":"",
"type":"boolean",
"default":false
}
},
"conveyor.is_phone_registered":{
"summary":"Check if the phone number is in the database.",
"description":"*Authenticated: requires signature of account or an admin account.*",
"tags":["user-data"],
"params": {
"type": "object",
"properties": {
"phone": {
"$ref": "#/definitions/phone"
}
},
"required": ["phone"]
},
"result":{
"description":"",
"type":"boolean",
"default":false}
},
"conveyor.define_tag":{
"summary":"",
"description":"*Authenticated: requires signature of admin account.*",
"tags":["tags"],
"params": {
"type": "object",
"properties": {
"tag": {"$ref":"#/definitions/tag"},
"description": {
"type":"string",
"default":"tag-string is an example tag"}
},
"required": ["tag","description"]
},
"result":{
"description":"",
"type":"boolean",
"default":false}
},
"conveyor.list_tags":{
"summary":"List all defined tags.",
"description":"*Authenticated: requires signature of admin account.*",
"tags":["tags"],
"params": {
"type": "object",
"properties": {}
},
"result":{
"description":"",
"type":"array",
"items":{"$ref":"#/definitions/tag"}
}
},
"conveyor.assign_tag":{
"summary":"Assign tag to user, throws if tag is not defined.",
"description":"*Authenticated: requires signature of admin account.*",
"tags":["tags"],
"params": {
"type":"object",
"properties":{
"uid":{"$ref":"#/definitions/uid"},
"tag":{"$ref":"#/definitions/tag"},
"memo":{"type":"string","default":"this is a tag memo"}
},
"required":["uid","tag"]
},
"result":{
"description":"",
"type":"array",
"items":{"type":"string"}}
},
"conveyor.unassign_tag":{
"summary":"Remove tag from user.",
"description":"*Authenticated: requires signature of admin account.*",
"tags":["tags"],
"params": {
"type": "object",
"properties": {
"uid": {"$ref":"#/definitions/uid"},
"tag":{"$ref":"#/definitions/tag"}
},
"required": ["uid","tag"]
},
"result":{
"description":"",
"type":"object",
"properties":{}}
},
"conveyor.get_users_by_tags":{
"summary":"Get a list of users that has tags assigned.",
"description":"tags can be either a string or an array of strings in which case the user must have all the tags givento be included in the response. *Authenticated: requires signature of an admin account.* ",
"tags":["tags"],
"params": {
"type":"object",
"properties": {
"tags":{
"oneOf": [
{"$ref":"#/definitions/tag"},
{
"type": "array",
"items":{"$ref":"#/definitions/tag"}
}
]
}
},
"required": ["tags"]
},
"result":{
"description":"",
"type":"array",
"items":{"$ref":"#/definitions/uid"}}
},
"conveyor.get_tags_for_user":{
"summary":"Get a list of tags assigned to uid.",
"description":"*Authenticated: requires signature of an admin account.*",
"tags":["tags"],
"params": {
"type": "object",
"properties": {
"uid": {"$ref":"#/definitions/uid"},
"audit":{
"type":"boolean",
"default": false
}
},
"required": ["uid","audit"]
},
"result":{
"description":"",
"type":"array",
"items":{"type":"string"}}
},
"conveyor.get_account": {
"summary":"Lookup a user by account name",
"tags":["user"],
"params": {
"type": "object",
"properties": {
"account": {"$ref":"#/definitions/account_name"},
"context_account": {
"description": "the user performing the search",
"type":"string",
"default":"steemit"
}
},
"required": ["account"]
},
"result":{
"$ref":"#/definitions/account"}
},
"conveyor.autocomplete_account": {
"summary":"Lookup users by account name prefix",
"tags":["user"],
"params": {
"type": "object",
"properties":{
"account_substring": {
"type": "string",
"default":"ste"
},
"context_account": {
"description": "the user performing the search",
"type":"string",
"default":"steemit"
}
},
"required": ["account_substring"]
},
"result":{
"type":"object",
"properties": {
"recent": {
"description":"recently referenced accounts",
"type":"array",
"items": {"$ref":"#/definitions/account"},
"maxItems":10
},
"friend": {
"description":"friend accounts",
"type":"array",
"items": {"$ref":"#/definitions/account"},
"maxItems":10
},
"global": {
"description":"all accounts",
"type":"array",
"items": {"$ref":"#/definitions/account"},
"maxItems":10
}
}
}
},
"conveyor.get_prices": {
"summary":"","description":"Find the exchange rates of various tokens based on internal markets.",
"tags":["prices"],
"params":null,
"result":{
"$ref":"#/definitions/prices"
}
},
"conveyor.summarize_url": {
"summary":"","description":"Get summary data from a link",
"tags":["tbd"],
"params":null,
"result":{
"$ref":"#/definitions/summarized_url"
},
"errors":[
{
"description": "URL cannot be fetched for some reason",
"code": 400
}
]
}
}
}