n8n/packages/nodes-base/nodes/Spontit/PushDescription.ts

153 lines
5.7 KiB
TypeScript
Raw Normal View History

import { INodeProperties } from 'n8n-workflow';
export const pushOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
refactor: Apply more nodelinting rules (#3324) * :pencil2: Alphabetize lint rules * :fire: Remove duplicates * :zap: Update `lintfix` script * :shirt: Apply `node-param-operation-without-no-data-expression` (#3329) * :shirt: Apply `node-param-operation-without-no-data-expression` * :shirt: Add exceptions * :shirt: Apply `node-param-description-weak` (#3328) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-value-duplicate` (#3331) * :shirt: Apply `node-param-description-miscased-json` (#3337) * :shirt: Apply `node-param-display-name-excess-inner-whitespace` (#3335) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-type-options-missing-from-limit` (#3336) * Rule workig as intended * :pencil2: Uncomment rules Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-name-duplicate` (#3338) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-wrong-for-simplify` (#3334) * :zap: fix * :zap: exceptions * :zap: changed rule ignoring from file to line * :shirt: Apply `node-param-resource-without-no-data-expression` (#3339) * :shirt: Apply `node-param-display-name-untrimmed` (#3341) * :shirt: Apply `node-param-display-name-miscased-id` (#3340) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-resource-with-plural-option` (#3342) * :shirt: Apply `node-param-description-wrong-for-upsert` (#3333) * :zap: fix * :zap: replaced record with contact in description * :zap: fix Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-description-identical-to-name` (#3343) * :shirt: Apply `node-param-option-name-containing-star` (#3347) * :shirt: Apply `node-param-display-name-wrong-for-update-fields` (#3348) * :shirt: Apply `node-param-option-name-wrong-for-get-all` (#3345) * :zap: fix * :zap: exceptions * :shirt: Apply node-param-display-name-wrong-for-simplify (#3344) * Rule working as intended * Uncomented other rules * :shirt: Undo and add exceptions Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :zap: Alphabetize lint rules * :zap: Restore `lintfix` script Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com> Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
2022-05-20 14:47:24 -07:00
noDataExpression: true,
displayOptions: {
show: {
resource: ['push'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a push notification',
action: 'Create a push notification',
},
],
default: 'create',
},
];
export const pushFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* push:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Content',
name: 'content',
type: 'string',
default: '',
displayOptions: {
show: {
operation: ['create'],
resource: ['push'],
},
},
description:
'To provide text in a push, supply one of either "content" or "pushContent" (or both). Limited to 2500 characters. (Required if a value for "pushContent" is not provided).',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: ['create'],
resource: ['push'],
},
},
default: {},
options: [
{
displayName: 'Channel Name',
name: 'channelName',
type: 'string',
default: '',
description:
"The name of a channel you created. If you have not yet created a channel, simply don't provide this value and the push will be sent to your main account.",
},
{
displayName: 'Expiration Stamp',
name: 'expirationStamp',
type: 'dateTime',
default: '',
description:
'A Unix timestamp. When to automatically expire your push notification. The default is 10 days after pushing. The push will become unaccessible within 15-30 minutes of the selected time, but will remain on all device screens until dismissed or clicked.',
},
{
displayName: 'iOS DeepLink',
name: 'iOSDeepLink',
type: 'string',
default: '',
description:
'An iOS deep link. Use this to deep link into other apps. Alternatively, you can provide a universal link in the link attribute and set openLinkInApp to false.',
},
{
displayName: 'Link',
name: 'link',
type: 'string',
default: '',
description: 'A link that can be attached to your push. Must be a valid URL.',
},
{
displayName: 'Open In Home Feed',
name: 'openInHomeFeed',
type: 'boolean',
default: false,
description:
'Whether the notification opens to the home feed or to a standalone page with the notification. The default (openInHomeFeed=False) is to open the notification on a standalone page.',
},
{
displayName: 'Open Link In App',
name: 'openLinkInApp',
type: 'boolean',
default: false,
description:
'Whether to open the provided link within the iOS app or in Safari. Android PWA opens all links in the default web browser.',
},
{
displayName: 'Push To Emails',
name: 'pushToEmails',
type: 'string',
default: '',
description:
"<p>Emails (strings) to whom to send the notification. If all three attributes 'pushToFollowers', 'pushToPhoneNumbers' and 'pushToEmails' are not supplied, then everyone who follows the channel will receive the push notification.</p><p>If 'pushToFollowers' is supplied, only those listed in the array will receive the push notification.</p><p>If one of the userIds supplied does not follow the specified channel, then that userId value will be ignored.</p><p>See the \"Followers\" section to learn how to list the userIds of those who follow one of your channels.</p>.",
},
{
displayName: 'Push To Followers',
name: 'pushToFollowers',
type: 'string',
default: '',
description:
"<p>User IDs (strings) to whom to send the notification. If all three attributes 'pushToFollowers', 'pushToPhoneNumbers' and 'pushToEmails' are not supplied, then everyone who follows the channel will receive the push notification.</p><p>If 'pushToFollowers' is supplied, only those listed in the array will receive the push notification.</p><p>If one of the userIds supplied does not follow the specified channel, then that userId value will be ignored.</p><p>See the \"Followers\" section to learn how to list the userIds of those who follow one of your channels.</p>.",
},
{
displayName: 'Push To Phone Numbers',
name: 'pushToPhoneNumbers',
type: 'string',
default: '',
description:
"<p>Phone numbers (strings) to whom to send the notification. If all three attributes 'pushToFollowers', 'pushToPhoneNumbers' and 'pushToEmails' are not supplied, then everyone who follows the channel will receive the push notification.</p><p>If 'pushToFollowers' is supplied, only those listed in the array will receive the push notification.</p><p>If one of the userIds supplied does not follow the specified channel, then that userId value will be ignored.</p><p>See the \"Followers\" section to learn how to list the userIds of those who follow one of your channels.</p>.",
},
{
displayName: 'Schedule',
name: 'schedule',
type: 'dateTime',
default: '',
description: 'A Unix timestamp. Schedule a push to be sent at a later date and time.',
},
{
displayName: 'Subtitle',
name: 'subtitle',
type: 'string',
default: '',
description:
'The subtitle of your push. Limited to 20 characters. Only appears on iOS devices.',
},
{
displayName: 'Title',
name: 'pushTitle',
type: 'string',
default: '',
description: 'The title of push. Appears in bold at the top. Limited to 100 characters.',
},
],
},
];