forked from LBRYCommunity/lbry-sdk
fix json api generator
This commit is contained in:
parent
345196aa3b
commit
801f05f45e
3 changed files with 190 additions and 176 deletions
338
docs/api.json
338
docs/api.json
File diff suppressed because one or more lines are too long
|
@ -2186,7 +2186,6 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
[--claim_id=<claim_id> | --claim_ids=<claim_ids>...]
|
[--claim_id=<claim_id> | --claim_ids=<claim_ids>...]
|
||||||
[--channel=<channel> |
|
[--channel=<channel> |
|
||||||
[[--channel_ids=<channel_ids>...] [--not_channel_ids=<not_channel_ids>...]]]
|
[[--channel_ids=<channel_ids>...] [--not_channel_ids=<not_channel_ids>...]]]
|
||||||
[--blocklist_channel_ids=<blocklist_channel_ids>...]
|
|
||||||
[--has_channel_signature] [--valid_channel_signature | --invalid_channel_signature]
|
[--has_channel_signature] [--valid_channel_signature | --invalid_channel_signature]
|
||||||
[--is_controlling] [--release_time=<release_time>] [--public_key_id=<public_key_id>]
|
[--is_controlling] [--release_time=<release_time>] [--public_key_id=<public_key_id>]
|
||||||
[--timestamp=<timestamp>] [--creation_timestamp=<creation_timestamp>]
|
[--timestamp=<timestamp>] [--creation_timestamp=<creation_timestamp>]
|
||||||
|
@ -2227,9 +2226,6 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
use in conjunction with --valid_channel_signature
|
use in conjunction with --valid_channel_signature
|
||||||
--not_channel_ids=<not_channel_ids>: (list) exclude claims signed by any of these channels
|
--not_channel_ids=<not_channel_ids>: (list) exclude claims signed by any of these channels
|
||||||
(arguments must be claim ids of the channels)
|
(arguments must be claim ids of the channels)
|
||||||
--blocklist_channel_ids=<blocklist_channel_ids>: (list) channel_ids of channels containing
|
|
||||||
reposts of claims you want to be blocked from
|
|
||||||
search results
|
|
||||||
--has_channel_signature : (bool) claims with a channel signature (valid or invalid)
|
--has_channel_signature : (bool) claims with a channel signature (valid or invalid)
|
||||||
--valid_channel_signature : (bool) claims with a valid channel signature or no signature,
|
--valid_channel_signature : (bool) claims with a valid channel signature or no signature,
|
||||||
use in conjunction with --has_channel_signature to
|
use in conjunction with --has_channel_signature to
|
||||||
|
|
|
@ -452,6 +452,10 @@ def resolve_url(raw_url):
|
||||||
def _apply_constraints_for_array_attributes(constraints, attr, cleaner, for_count=False):
|
def _apply_constraints_for_array_attributes(constraints, attr, cleaner, for_count=False):
|
||||||
any_items = set(cleaner(constraints.pop(f'any_{attr}s', []))[:ATTRIBUTE_ARRAY_MAX_LENGTH])
|
any_items = set(cleaner(constraints.pop(f'any_{attr}s', []))[:ATTRIBUTE_ARRAY_MAX_LENGTH])
|
||||||
all_items = set(cleaner(constraints.pop(f'all_{attr}s', []))[:ATTRIBUTE_ARRAY_MAX_LENGTH])
|
all_items = set(cleaner(constraints.pop(f'all_{attr}s', []))[:ATTRIBUTE_ARRAY_MAX_LENGTH])
|
||||||
|
not_items = set(cleaner(constraints.pop(f'not_{attr}s', []))[:ATTRIBUTE_ARRAY_MAX_LENGTH])
|
||||||
|
|
||||||
|
all_items = {item for item in all_items if item not in not_items}
|
||||||
|
any_items = {item for item in any_items if item not in not_items}
|
||||||
|
|
||||||
any_queries = {}
|
any_queries = {}
|
||||||
|
|
||||||
|
@ -529,3 +533,23 @@ def _apply_constraints_for_array_attributes(constraints, attr, cleaner, for_coun
|
||||||
AND {attr} IN ({values})
|
AND {attr} IN ({values})
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not_items:
|
||||||
|
constraints.update({
|
||||||
|
f'$not_{attr}{i}': item for i, item in enumerate(not_items)
|
||||||
|
})
|
||||||
|
values = ', '.join(
|
||||||
|
f':$not_{attr}{i}' for i in range(len(not_items))
|
||||||
|
)
|
||||||
|
if for_count:
|
||||||
|
constraints[f'claim.claim_hash__not_in#_not_{attr}'] = f"""
|
||||||
|
SELECT claim_hash FROM {attr} WHERE {attr} IN ({values})
|
||||||
|
"""
|
||||||
|
else:
|
||||||
|
constraints[f'#_not_{attr}'] = f"""
|
||||||
|
NOT EXISTS(
|
||||||
|
SELECT 1 FROM {attr} WHERE
|
||||||
|
claim.claim_hash={attr}.claim_hash
|
||||||
|
AND {attr} IN ({values})
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
|
Loading…
Reference in a new issue