mirror of
https://github.com/caronc/apprise.git
synced 2025-02-25 14:42:14 +01:00
Inconsistent Notification Plugin Information Cleanup (#889)
This commit is contained in:
parent
3d36108446
commit
ab55aef0d0
4
.gitignore
vendored
4
.gitignore
vendored
@ -27,6 +27,10 @@ sdist/
|
|||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
|
|
||||||
|
# Generated from Docker Instance
|
||||||
|
.bash_history
|
||||||
|
.python_history
|
||||||
|
|
||||||
# Installer logs
|
# Installer logs
|
||||||
pip-log.txt
|
pip-log.txt
|
||||||
pip-delete-this-directory.txt
|
pip-delete-this-directory.txt
|
||||||
|
@ -127,10 +127,10 @@ class NotifyBark(NotifyBase):
|
|||||||
|
|
||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
|
'{schema}://{host}/{targets}',
|
||||||
'{schema}://{host}:{port}/{targets}',
|
'{schema}://{host}:{port}/{targets}',
|
||||||
'{schema}://{user}:{password}@{host}/{targets}',
|
'{schema}://{user}:{password}@{host}/{targets}',
|
||||||
'{schema}://{user}:{password}@{host}:{port}/{targets}',
|
'{schema}://{user}:{password}@{host}:{port}/{targets}',
|
||||||
'{schema}://{user}:{password}@{host}/{targets}',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Define our template arguments
|
# Define our template arguments
|
||||||
@ -163,6 +163,7 @@ class NotifyBark(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -151,6 +151,12 @@ class NotifyBoxcar(NotifyBase):
|
|||||||
'to': {
|
'to': {
|
||||||
'alias_of': 'targets',
|
'alias_of': 'targets',
|
||||||
},
|
},
|
||||||
|
'access': {
|
||||||
|
'alias_of': 'access_key',
|
||||||
|
},
|
||||||
|
'secret': {
|
||||||
|
'alias_of': 'secret_key',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
def __init__(self, access, secret, targets=None, include_image=True,
|
def __init__(self, access, secret, targets=None, include_image=True,
|
||||||
@ -381,6 +387,16 @@ class NotifyBoxcar(NotifyBase):
|
|||||||
results['targets'] += \
|
results['targets'] += \
|
||||||
NotifyBoxcar.parse_list(results['qsd'].get('to'))
|
NotifyBoxcar.parse_list(results['qsd'].get('to'))
|
||||||
|
|
||||||
|
# Access
|
||||||
|
if 'access' in results['qsd'] and results['qsd']['access']:
|
||||||
|
results['access'] = NotifyBoxcar.unquote(
|
||||||
|
results['qsd']['access'].strip())
|
||||||
|
|
||||||
|
# Secret
|
||||||
|
if 'secret' in results['qsd'] and results['qsd']['secret']:
|
||||||
|
results['secret'] = NotifyBoxcar.unquote(
|
||||||
|
results['qsd']['secret'].strip())
|
||||||
|
|
||||||
# Include images with our message
|
# Include images with our message
|
||||||
results['include_image'] = \
|
results['include_image'] = \
|
||||||
parse_bool(results['qsd'].get('image', True))
|
parse_bool(results['qsd'].get('image', True))
|
||||||
|
@ -121,11 +121,13 @@ class NotifyBulkSMS(NotifyBase):
|
|||||||
'user': {
|
'user': {
|
||||||
'name': _('User Name'),
|
'name': _('User Name'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
'password': {
|
'password': {
|
||||||
'name': _('Password'),
|
'name': _('Password'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
'target_phone': {
|
'target_phone': {
|
||||||
'name': _('Target Phone No'),
|
'name': _('Target Phone No'),
|
||||||
@ -144,6 +146,7 @@ class NotifyBulkSMS(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -114,6 +114,7 @@ class NotifyD7Networks(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -103,13 +103,18 @@ class NotifyDingTalk(NotifyBase):
|
|||||||
'regex': (r'^[a-z0-9]+$', 'i'),
|
'regex': (r'^[a-z0-9]+$', 'i'),
|
||||||
},
|
},
|
||||||
'secret': {
|
'secret': {
|
||||||
'name': _('Token'),
|
'name': _('Secret'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
'regex': (r'^[a-z0-9]+$', 'i'),
|
'regex': (r'^[a-z0-9]+$', 'i'),
|
||||||
},
|
},
|
||||||
'targets': {
|
'target_phone_no': {
|
||||||
'name': _('Target Phone No'),
|
'name': _('Target Phone No'),
|
||||||
|
'type': 'string',
|
||||||
|
'map_to': 'targets',
|
||||||
|
},
|
||||||
|
'targets': {
|
||||||
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -385,8 +385,13 @@ class NotifyEmail(NotifyBase):
|
|||||||
'min': 1,
|
'min': 1,
|
||||||
'max': 65535,
|
'max': 65535,
|
||||||
},
|
},
|
||||||
|
'target_email': {
|
||||||
|
'name': _('Target Email'),
|
||||||
|
'type': 'string',
|
||||||
|
'map_to': 'targets',
|
||||||
|
},
|
||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Target Emails'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -157,7 +157,6 @@ class NotifyFCM(NotifyBase):
|
|||||||
'project': {
|
'project': {
|
||||||
'name': _('Project ID'),
|
'name': _('Project ID'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'required': True,
|
|
||||||
},
|
},
|
||||||
'target_device': {
|
'target_device': {
|
||||||
'name': _('Target Device'),
|
'name': _('Target Device'),
|
||||||
@ -173,6 +172,7 @@ class NotifyFCM(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -97,8 +97,8 @@ class NotifyFlock(NotifyBase):
|
|||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
'{schema}://{token}',
|
'{schema}://{token}',
|
||||||
'{schema}://{user}@{token}',
|
'{schema}://{botname}@{token}',
|
||||||
'{schema}://{user}@{token}/{targets}',
|
'{schema}://{botname}@{token}/{targets}',
|
||||||
'{schema}://{token}/{targets}',
|
'{schema}://{token}/{targets}',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -111,9 +111,10 @@ class NotifyFlock(NotifyBase):
|
|||||||
'private': True,
|
'private': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
},
|
},
|
||||||
'user': {
|
'botname': {
|
||||||
'name': _('Bot Name'),
|
'name': _('Bot Name'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
|
'map_to': 'user',
|
||||||
},
|
},
|
||||||
'to_user': {
|
'to_user': {
|
||||||
'name': _('To User ID'),
|
'name': _('To User ID'),
|
||||||
|
@ -122,9 +122,15 @@ class NotifyGitter(NotifyBase):
|
|||||||
'required': True,
|
'required': True,
|
||||||
'regex': (r'^[a-z0-9]{40}$', 'i'),
|
'regex': (r'^[a-z0-9]{40}$', 'i'),
|
||||||
},
|
},
|
||||||
|
'target_room': {
|
||||||
|
'name': _('Target Room'),
|
||||||
|
'type': 'string',
|
||||||
|
'map_to': 'targets',
|
||||||
|
},
|
||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Rooms'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -134,7 +134,6 @@ class NotifyGotify(NotifyBase):
|
|||||||
'type': 'string',
|
'type': 'string',
|
||||||
'map_to': 'fullpath',
|
'map_to': 'fullpath',
|
||||||
'default': '/',
|
'default': '/',
|
||||||
'required': True,
|
|
||||||
},
|
},
|
||||||
'port': {
|
'port': {
|
||||||
'name': _('Port'),
|
'name': _('Port'),
|
||||||
|
@ -174,7 +174,6 @@ class NotifyJoin(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
'required': True,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -370,6 +370,7 @@ class NotifyLametric(NotifyBase):
|
|||||||
|
|
||||||
# Device Mode
|
# Device Mode
|
||||||
'{schema}://{apikey}@{host}',
|
'{schema}://{apikey}@{host}',
|
||||||
|
'{schema}://{user}:{apikey}@{host}',
|
||||||
'{schema}://{apikey}@{host}:{port}',
|
'{schema}://{apikey}@{host}:{port}',
|
||||||
'{schema}://{user}:{apikey}@{host}:{port}',
|
'{schema}://{user}:{apikey}@{host}:{port}',
|
||||||
)
|
)
|
||||||
@ -404,7 +405,6 @@ class NotifyLametric(NotifyBase):
|
|||||||
'host': {
|
'host': {
|
||||||
'name': _('Hostname'),
|
'name': _('Hostname'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'required': True,
|
|
||||||
},
|
},
|
||||||
'port': {
|
'port': {
|
||||||
'name': _('Port'),
|
'name': _('Port'),
|
||||||
|
@ -102,6 +102,7 @@ class NotifyLine(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ class NotifyMSG91(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
'sender': {
|
'sender': {
|
||||||
'name': _('Sender ID'),
|
'name': _('Sender ID'),
|
||||||
|
@ -152,8 +152,13 @@ class NotifyMailgun(NotifyBase):
|
|||||||
'private': True,
|
'private': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
},
|
},
|
||||||
|
'target_email': {
|
||||||
|
'name': _('Target Email'),
|
||||||
|
'type': 'string',
|
||||||
|
'map_to': 'targets',
|
||||||
|
},
|
||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Target Emails'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -175,7 +175,6 @@ class NotifyMatrix(NotifyBase):
|
|||||||
'host': {
|
'host': {
|
||||||
'name': _('Hostname'),
|
'name': _('Hostname'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'required': True,
|
|
||||||
},
|
},
|
||||||
'port': {
|
'port': {
|
||||||
'name': _('Port'),
|
'name': _('Port'),
|
||||||
@ -194,6 +193,7 @@ class NotifyMatrix(NotifyBase):
|
|||||||
},
|
},
|
||||||
'token': {
|
'token': {
|
||||||
'name': _('Access Token'),
|
'name': _('Access Token'),
|
||||||
|
'private': True,
|
||||||
'map_to': 'password',
|
'map_to': 'password',
|
||||||
},
|
},
|
||||||
'target_user': {
|
'target_user': {
|
||||||
|
@ -91,11 +91,11 @@ class NotifyMattermost(NotifyBase):
|
|||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
'{schema}://{host}/{token}',
|
'{schema}://{host}/{token}',
|
||||||
'{schema}://{host}/{token}:{port}',
|
'{schema}://{host}:{port}/{token}',
|
||||||
|
'{schema}://{host}/{fullpath}/{token}',
|
||||||
|
'{schema}://{host}:{port}/{fullpath}/{token}',
|
||||||
'{schema}://{botname}@{host}/{token}',
|
'{schema}://{botname}@{host}/{token}',
|
||||||
'{schema}://{botname}@{host}:{port}/{token}',
|
'{schema}://{botname}@{host}:{port}/{token}',
|
||||||
'{schema}://{host}/{fullpath}/{token}',
|
|
||||||
'{schema}://{host}/{fullpath}{token}:{port}',
|
|
||||||
'{schema}://{botname}@{host}/{fullpath}/{token}',
|
'{schema}://{botname}@{host}/{fullpath}/{token}',
|
||||||
'{schema}://{botname}@{host}:{port}/{fullpath}/{token}',
|
'{schema}://{botname}@{host}:{port}/{fullpath}/{token}',
|
||||||
)
|
)
|
||||||
|
@ -67,6 +67,8 @@ class NotifyNextcloud(NotifyBase):
|
|||||||
|
|
||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
|
'{schema}://{host}/{targets}',
|
||||||
|
'{schema}://{host}:{port}/{targets}',
|
||||||
'{schema}://{user}:{password}@{host}/{targets}',
|
'{schema}://{user}:{password}@{host}/{targets}',
|
||||||
'{schema}://{user}:{password}@{host}:{port}/{targets}',
|
'{schema}://{user}:{password}@{host}:{port}/{targets}',
|
||||||
)
|
)
|
||||||
|
@ -96,6 +96,11 @@ class NotifyNextcloudTalk(NotifyBase):
|
|||||||
'private': True,
|
'private': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
},
|
},
|
||||||
|
'target_room_id': {
|
||||||
|
'name': _('Room ID'),
|
||||||
|
'type': 'string',
|
||||||
|
'map_to': 'targets',
|
||||||
|
},
|
||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
@ -112,12 +112,12 @@ class NotifyNotica(NotifyBase):
|
|||||||
'{schema}://{user}:{password}@{host}:{port}/{token}',
|
'{schema}://{user}:{password}@{host}:{port}/{token}',
|
||||||
|
|
||||||
# Self-hosted notica servers (with custom path)
|
# Self-hosted notica servers (with custom path)
|
||||||
'{schema}://{host}{path}{token}',
|
'{schema}://{host}{path}/{token}',
|
||||||
'{schema}://{host}:{port}{path}{token}',
|
'{schema}://{host}:{port}/{path}/{token}',
|
||||||
'{schema}://{user}@{host}{path}{token}',
|
'{schema}://{user}@{host}/{path}/{token}',
|
||||||
'{schema}://{user}@{host}:{port}{path}{token}',
|
'{schema}://{user}@{host}:{port}{path}/{token}',
|
||||||
'{schema}://{user}:{password}@{host}{path}{token}',
|
'{schema}://{user}:{password}@{host}{path}/{token}',
|
||||||
'{schema}://{user}:{password}@{host}:{port}{path}{token}',
|
'{schema}://{user}:{password}@{host}:{port}/{path}/{token}',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Define our template tokens
|
# Define our template tokens
|
||||||
|
@ -148,8 +148,13 @@ class NotifyOffice365(NotifyBase):
|
|||||||
'private': True,
|
'private': True,
|
||||||
'required': True,
|
'required': True,
|
||||||
},
|
},
|
||||||
|
'target_email': {
|
||||||
|
'name': _('Target Email'),
|
||||||
|
'type': 'string',
|
||||||
|
'map_to': 'targets',
|
||||||
|
},
|
||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Target Emails'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -146,6 +146,7 @@ class NotifyOneSignal(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ class NotifyPagerDuty(NotifyBase):
|
|||||||
},
|
},
|
||||||
# Optional but triggers V2 API
|
# Optional but triggers V2 API
|
||||||
'integrationkey': {
|
'integrationkey': {
|
||||||
'name': _('Routing Key'),
|
'name': _('Integration Key'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
'required': True
|
'required': True
|
||||||
|
@ -93,6 +93,7 @@ class NotifyPopcornNotify(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -186,6 +186,7 @@ class NotifyReddit(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class NotifyRyver(NotifyBase):
|
|||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
'{schema}://{organization}/{token}',
|
'{schema}://{organization}/{token}',
|
||||||
'{schema}://{user}@{organization}/{token}',
|
'{schema}://{botname}@{organization}/{token}',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Define our template tokens
|
# Define our template tokens
|
||||||
@ -109,9 +109,10 @@ class NotifyRyver(NotifyBase):
|
|||||||
'private': True,
|
'private': True,
|
||||||
'regex': (r'^[A-Z0-9]{15}$', 'i'),
|
'regex': (r'^[A-Z0-9]{15}$', 'i'),
|
||||||
},
|
},
|
||||||
'user': {
|
'botname': {
|
||||||
'name': _('Bot Name'),
|
'name': _('Bot Name'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
|
'map_to': 'user',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -174,6 +174,7 @@ class NotifySES(NotifyBase):
|
|||||||
'name': _('Region'),
|
'name': _('Region'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'regex': (r'^[a-z]{2}-[a-z-]+?-[0-9]+$', 'i'),
|
'regex': (r'^[a-z]{2}-[a-z-]+?-[0-9]+$', 'i'),
|
||||||
|
'required': True,
|
||||||
'map_to': 'region_name',
|
'map_to': 'region_name',
|
||||||
},
|
},
|
||||||
'targets': {
|
'targets': {
|
||||||
|
@ -145,6 +145,7 @@ class NotifySMSEagle(NotifyBase):
|
|||||||
'token': {
|
'token': {
|
||||||
'name': _('Access Token'),
|
'name': _('Access Token'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
'target_phone': {
|
'target_phone': {
|
||||||
'name': _('Target Phone No'),
|
'name': _('Target Phone No'),
|
||||||
@ -170,6 +171,7 @@ class NotifySMSEagle(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ class NotifySNS(NotifyBase):
|
|||||||
|
|
||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
'{schema}://{access_key_id}/{secret_access_key}{region}/{targets}',
|
'{schema}://{access_key_id}/{secret_access_key}/{region}/{targets}',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Define our template tokens
|
# Define our template tokens
|
||||||
@ -125,6 +125,7 @@ class NotifySNS(NotifyBase):
|
|||||||
'type': 'string',
|
'type': 'string',
|
||||||
'required': True,
|
'required': True,
|
||||||
'regex': (r'^[a-z]{2}-[a-z-]+?-[0-9]+$', 'i'),
|
'regex': (r'^[a-z]{2}-[a-z-]+?-[0-9]+$', 'i'),
|
||||||
|
'required': True,
|
||||||
'map_to': 'region_name',
|
'map_to': 'region_name',
|
||||||
},
|
},
|
||||||
'target_phone_no': {
|
'target_phone_no': {
|
||||||
|
@ -68,7 +68,7 @@ class NotifyServerChan(NotifyBase):
|
|||||||
|
|
||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
'{schema}://{token}/',
|
'{schema}://{token}',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Define our template tokens
|
# Define our template tokens
|
||||||
|
@ -109,12 +109,12 @@ class NotifySimplePush(NotifyBase):
|
|||||||
|
|
||||||
# Used for encrypted logins
|
# Used for encrypted logins
|
||||||
'password': {
|
'password': {
|
||||||
'name': _('Encrypted Password'),
|
'name': _('Password'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
},
|
},
|
||||||
'salt': {
|
'salt': {
|
||||||
'name': _('Encrypted Salt'),
|
'name': _('Salt'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
'map_to': 'user',
|
'map_to': 'user',
|
||||||
|
@ -165,10 +165,10 @@ class NotifySlack(NotifyBase):
|
|||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
# Webhook
|
# Webhook
|
||||||
'{schema}://{token_a}/{token_b}{token_c}',
|
'{schema}://{token_a}/{token_b}/{token_c}',
|
||||||
'{schema}://{botname}@{token_a}/{token_b}{token_c}',
|
'{schema}://{botname}@{token_a}/{token_b}{token_c}',
|
||||||
'{schema}://{token_a}/{token_b}{token_c}/{targets}',
|
'{schema}://{token_a}/{token_b}/{token_c}/{targets}',
|
||||||
'{schema}://{botname}@{token_a}/{token_b}{token_c}/{targets}',
|
'{schema}://{botname}@{token_a}/{token_b}/{token_c}/{targets}',
|
||||||
|
|
||||||
# Bot
|
# Bot
|
||||||
'{schema}://{access_token}/',
|
'{schema}://{access_token}/',
|
||||||
@ -198,7 +198,6 @@ class NotifySlack(NotifyBase):
|
|||||||
'name': _('Token A'),
|
'name': _('Token A'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
'required': True,
|
|
||||||
'regex': (r'^[A-Z0-9]+$', 'i'),
|
'regex': (r'^[A-Z0-9]+$', 'i'),
|
||||||
},
|
},
|
||||||
# Token required as part of the Webhook request
|
# Token required as part of the Webhook request
|
||||||
@ -207,7 +206,6 @@ class NotifySlack(NotifyBase):
|
|||||||
'name': _('Token B'),
|
'name': _('Token B'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
'required': True,
|
|
||||||
'regex': (r'^[A-Z0-9]+$', 'i'),
|
'regex': (r'^[A-Z0-9]+$', 'i'),
|
||||||
},
|
},
|
||||||
# Token required as part of the Webhook request
|
# Token required as part of the Webhook request
|
||||||
@ -216,7 +214,6 @@ class NotifySlack(NotifyBase):
|
|||||||
'name': _('Token C'),
|
'name': _('Token C'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
'required': True,
|
|
||||||
'regex': (r'^[A-Za-z0-9]+$', 'i'),
|
'regex': (r'^[A-Za-z0-9]+$', 'i'),
|
||||||
},
|
},
|
||||||
'target_encoded_id': {
|
'target_encoded_id': {
|
||||||
|
@ -135,7 +135,6 @@ class NotifySpontit(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
'required': True,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -165,7 +165,6 @@ class NotifySyslog(NotifyBase):
|
|||||||
'host': {
|
'host': {
|
||||||
'name': _('Hostname'),
|
'name': _('Hostname'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'required': True,
|
|
||||||
},
|
},
|
||||||
'port': {
|
'port': {
|
||||||
'name': _('Port'),
|
'name': _('Port'),
|
||||||
|
@ -106,10 +106,12 @@ class NotifyTwist(NotifyBase):
|
|||||||
'name': _('Password'),
|
'name': _('Password'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'private': True,
|
'private': True,
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
'email': {
|
'email': {
|
||||||
'name': _('Email'),
|
'name': _('Email'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
'target_channel': {
|
'target_channel': {
|
||||||
'name': _('Target Channel'),
|
'name': _('Target Channel'),
|
||||||
|
@ -132,6 +132,7 @@ class NotifyTwitter(NotifyBase):
|
|||||||
ratelimit_remaining = 1
|
ratelimit_remaining = 1
|
||||||
|
|
||||||
templates = (
|
templates = (
|
||||||
|
'{schema}://{ckey}/{csecret}/{akey}/{asecret}',
|
||||||
'{schema}://{ckey}/{csecret}/{akey}/{asecret}/{targets}',
|
'{schema}://{ckey}/{csecret}/{akey}/{asecret}/{targets}',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -78,7 +78,6 @@ class NotifyVoipms(NotifyBase):
|
|||||||
|
|
||||||
# Define object templates
|
# Define object templates
|
||||||
templates = (
|
templates = (
|
||||||
'{schema}://{password}:{email}',
|
|
||||||
'{schema}://{password}:{email}/{from_phone}/{targets}',
|
'{schema}://{password}:{email}/{from_phone}/{targets}',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -111,6 +110,7 @@ class NotifyVoipms(NotifyBase):
|
|||||||
'targets': {
|
'targets': {
|
||||||
'name': _('Targets'),
|
'name': _('Targets'),
|
||||||
'type': 'list:string',
|
'type': 'list:string',
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -131,6 +131,7 @@ class NotifyZulip(NotifyBase):
|
|||||||
'name': _('Bot Name'),
|
'name': _('Bot Name'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'regex': (r'^[A-Z0-9_-]{1,32}$', 'i'),
|
'regex': (r'^[A-Z0-9_-]{1,32}$', 'i'),
|
||||||
|
'required': True,
|
||||||
},
|
},
|
||||||
'organization': {
|
'organization': {
|
||||||
'name': _('Organization'),
|
'name': _('Organization'),
|
||||||
|
@ -165,6 +165,9 @@ def _sanitize_token(tokens, default_delimiter):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Used for tracking groups
|
||||||
|
group_map = {}
|
||||||
|
|
||||||
# Iterate over our tokens
|
# Iterate over our tokens
|
||||||
for key in tokens.keys():
|
for key in tokens.keys():
|
||||||
|
|
||||||
@ -181,15 +184,28 @@ def _sanitize_token(tokens, default_delimiter):
|
|||||||
# Default type to key
|
# Default type to key
|
||||||
tokens[key]['map_to'] = key
|
tokens[key]['map_to'] = key
|
||||||
|
|
||||||
|
# Track our map_to objects
|
||||||
|
if tokens[key]['map_to'] not in group_map:
|
||||||
|
group_map[tokens[key]['map_to']] = set()
|
||||||
|
group_map[tokens[key]['map_to']].add(key)
|
||||||
|
|
||||||
if 'type' not in tokens[key]:
|
if 'type' not in tokens[key]:
|
||||||
# Default type to string
|
# Default type to string
|
||||||
tokens[key]['type'] = 'string'
|
tokens[key]['type'] = 'string'
|
||||||
|
|
||||||
elif tokens[key]['type'].startswith('list') \
|
elif tokens[key]['type'].startswith('list'):
|
||||||
and 'delim' not in tokens[key]:
|
if 'delim' not in tokens[key]:
|
||||||
# Default list delimiter (if not otherwise specified)
|
# Default list delimiter (if not otherwise specified)
|
||||||
tokens[key]['delim'] = default_delimiter
|
tokens[key]['delim'] = default_delimiter
|
||||||
|
|
||||||
|
if key in group_map[tokens[key]['map_to']]: # pragma: no branch
|
||||||
|
# Remove ourselves from the list
|
||||||
|
group_map[tokens[key]['map_to']].remove(key)
|
||||||
|
|
||||||
|
# Pointing to the set directly so we can dynamically update
|
||||||
|
# ourselves
|
||||||
|
tokens[key]['group'] = group_map[tokens[key]['map_to']]
|
||||||
|
|
||||||
elif tokens[key]['type'].startswith('choice') \
|
elif tokens[key]['type'].startswith('choice') \
|
||||||
and 'default' not in tokens[key] \
|
and 'default' not in tokens[key] \
|
||||||
and 'values' in tokens[key] \
|
and 'values' in tokens[key] \
|
||||||
@ -266,6 +282,13 @@ def details(plugin):
|
|||||||
# # Identifies if the entry specified is required or not
|
# # Identifies if the entry specified is required or not
|
||||||
# 'required': True,
|
# 'required': True,
|
||||||
#
|
#
|
||||||
|
# # Identifies all tokens detected to be associated with the
|
||||||
|
# # list:string
|
||||||
|
# # This is ony present in list:string objects and is only set
|
||||||
|
# # if this element acts as an alias for several other
|
||||||
|
# # kwargs/fields.
|
||||||
|
# 'group': [],
|
||||||
|
#
|
||||||
# # Identify a default value
|
# # Identify a default value
|
||||||
# 'default': 'http',
|
# 'default': 'http',
|
||||||
#
|
#
|
||||||
|
@ -1486,6 +1486,7 @@ def test_apprise_details_plugin_verification():
|
|||||||
valid_schema_keys = (
|
valid_schema_keys = (
|
||||||
'name', 'private', 'required', 'type', 'values', 'min', 'max',
|
'name', 'private', 'required', 'type', 'values', 'min', 'max',
|
||||||
'regex', 'default', 'list', 'delim', 'prefix', 'map_to', 'alias_of',
|
'regex', 'default', 'list', 'delim', 'prefix', 'map_to', 'alias_of',
|
||||||
|
'group',
|
||||||
)
|
)
|
||||||
for entry in details['schemas']:
|
for entry in details['schemas']:
|
||||||
|
|
||||||
|
@ -89,6 +89,12 @@ apprise_url_tests = (
|
|||||||
'instance': NotifyBoxcar,
|
'instance': NotifyBoxcar,
|
||||||
'requests_response_code': requests.codes.created,
|
'requests_response_code': requests.codes.created,
|
||||||
}),
|
}),
|
||||||
|
('boxcar://?access=%s&secret=%s&to=tag5' % ('d' * 64, 'b' * 64), {
|
||||||
|
# Test access and secret kwargs
|
||||||
|
'privacy_url': 'boxcar://d...d/****/',
|
||||||
|
'instance': NotifyBoxcar,
|
||||||
|
'requests_response_code': requests.codes.created,
|
||||||
|
}),
|
||||||
# An invalid tag
|
# An invalid tag
|
||||||
('boxcar://%s/%s/@%s' % ('a' * 64, 'b' * 64, 't' * 64), {
|
('boxcar://%s/%s/@%s' % ('a' * 64, 'b' * 64, 't' * 64), {
|
||||||
'instance': NotifyBoxcar,
|
'instance': NotifyBoxcar,
|
||||||
|
Loading…
Reference in New Issue
Block a user