n8n/packages/nodes-base/nodes/Stripe/descriptions/CustomerCardDescription.ts

161 lines
2.7 KiB
TypeScript
Raw Normal View History

:sparkles: Add Stripe regular node (#1470) * :tada: Register node * :art: Add SVG icon * :zap: Add preliminary node stub * :zap: Add resource description stubs * :art: Fix SVG size and position * :zap: Implement charge operations * :zap: Implement customer operations * :art: Apply cosmetic changes * :zap: Fix customer address fields * :zap: Add stub and fields for invoice * :zap: Add invoice item stubs * :zap: Implement source operations * :zap: Reduce scope per feedback * :zap: Add continueOnFail functionality * :art: Prettify error thrown * :fire: Remove unused resource * :zap: Replace source in card with token * :hammer: Remove logging * :wrench: Fix shipping address in charge:create * :wrench: Load update fields for charge:update * :zap: Implement token:create to ease testing * :zap: Simplify card token fields * :zap: Update description parameters * :wrench: Fix field adjusters * :zap: Remove unused source options * :wrench: Fix shipping fields adjuster * :fire: Remove PNG icon * :fire: Remove logging * :hammer: Reorder address fields * :bug: Fix shipping field in charge:update * :lipstick: Apply cosmetic change * :zap: Small improvements * :zap: Fix lintings in main file * :zap: Lint all descriptions * :zap: Add target="_blank" attribute * :zap: Fix various lintings for charge * :zap: Fix lintings for coupon * :zap: Fix lintings for customer * :zap: Fix lintings for source * :zap: Fix lintings for token * :zap: Reorder address fields * :zap: Fix casing in credentials * :hammer: Place recipient name above address in shipping * :zap: Remove references to string in descriptions * :zap: Apply minor renamings * :fire: Remove logging * :hammer: Simplify error handling * :zap: Fix indentation * :zap: Move cardFields to root level for Token creation Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-10 04:15:14 -07:00
import {
INodeProperties,
} from 'n8n-workflow';
export const customerCardOperations: INodeProperties[] = [
:sparkles: Add Stripe regular node (#1470) * :tada: Register node * :art: Add SVG icon * :zap: Add preliminary node stub * :zap: Add resource description stubs * :art: Fix SVG size and position * :zap: Implement charge operations * :zap: Implement customer operations * :art: Apply cosmetic changes * :zap: Fix customer address fields * :zap: Add stub and fields for invoice * :zap: Add invoice item stubs * :zap: Implement source operations * :zap: Reduce scope per feedback * :zap: Add continueOnFail functionality * :art: Prettify error thrown * :fire: Remove unused resource * :zap: Replace source in card with token * :hammer: Remove logging * :wrench: Fix shipping address in charge:create * :wrench: Load update fields for charge:update * :zap: Implement token:create to ease testing * :zap: Simplify card token fields * :zap: Update description parameters * :wrench: Fix field adjusters * :zap: Remove unused source options * :wrench: Fix shipping fields adjuster * :fire: Remove PNG icon * :fire: Remove logging * :hammer: Reorder address fields * :bug: Fix shipping field in charge:update * :lipstick: Apply cosmetic change * :zap: Small improvements * :zap: Fix lintings in main file * :zap: Lint all descriptions * :zap: Add target="_blank" attribute * :zap: Fix various lintings for charge * :zap: Fix lintings for coupon * :zap: Fix lintings for customer * :zap: Fix lintings for source * :zap: Fix lintings for token * :zap: Reorder address fields * :zap: Fix casing in credentials * :hammer: Place recipient name above address in shipping * :zap: Remove references to string in descriptions * :zap: Apply minor renamings * :fire: Remove logging * :hammer: Simplify error handling * :zap: Fix indentation * :zap: Move cardFields to root level for Token creation Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-10 04:15:14 -07:00
{
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,
:sparkles: Add Stripe regular node (#1470) * :tada: Register node * :art: Add SVG icon * :zap: Add preliminary node stub * :zap: Add resource description stubs * :art: Fix SVG size and position * :zap: Implement charge operations * :zap: Implement customer operations * :art: Apply cosmetic changes * :zap: Fix customer address fields * :zap: Add stub and fields for invoice * :zap: Add invoice item stubs * :zap: Implement source operations * :zap: Reduce scope per feedback * :zap: Add continueOnFail functionality * :art: Prettify error thrown * :fire: Remove unused resource * :zap: Replace source in card with token * :hammer: Remove logging * :wrench: Fix shipping address in charge:create * :wrench: Load update fields for charge:update * :zap: Implement token:create to ease testing * :zap: Simplify card token fields * :zap: Update description parameters * :wrench: Fix field adjusters * :zap: Remove unused source options * :wrench: Fix shipping fields adjuster * :fire: Remove PNG icon * :fire: Remove logging * :hammer: Reorder address fields * :bug: Fix shipping field in charge:update * :lipstick: Apply cosmetic change * :zap: Small improvements * :zap: Fix lintings in main file * :zap: Lint all descriptions * :zap: Add target="_blank" attribute * :zap: Fix various lintings for charge * :zap: Fix lintings for coupon * :zap: Fix lintings for customer * :zap: Fix lintings for source * :zap: Fix lintings for token * :zap: Reorder address fields * :zap: Fix casing in credentials * :hammer: Place recipient name above address in shipping * :zap: Remove references to string in descriptions * :zap: Apply minor renamings * :fire: Remove logging * :hammer: Simplify error handling * :zap: Fix indentation * :zap: Move cardFields to root level for Token creation Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-10 04:15:14 -07:00
default: 'get',
options: [
{
name: 'Add',
value: 'add',
description: 'Add a customer card',
},
{
name: 'Get',
value: 'get',
description: 'Get a customer card',
},
{
name: 'Remove',
value: 'remove',
description: 'Remove a customer card',
},
],
displayOptions: {
show: {
resource: [
'customerCard',
],
},
},
},
];
:sparkles: Add Stripe regular node (#1470) * :tada: Register node * :art: Add SVG icon * :zap: Add preliminary node stub * :zap: Add resource description stubs * :art: Fix SVG size and position * :zap: Implement charge operations * :zap: Implement customer operations * :art: Apply cosmetic changes * :zap: Fix customer address fields * :zap: Add stub and fields for invoice * :zap: Add invoice item stubs * :zap: Implement source operations * :zap: Reduce scope per feedback * :zap: Add continueOnFail functionality * :art: Prettify error thrown * :fire: Remove unused resource * :zap: Replace source in card with token * :hammer: Remove logging * :wrench: Fix shipping address in charge:create * :wrench: Load update fields for charge:update * :zap: Implement token:create to ease testing * :zap: Simplify card token fields * :zap: Update description parameters * :wrench: Fix field adjusters * :zap: Remove unused source options * :wrench: Fix shipping fields adjuster * :fire: Remove PNG icon * :fire: Remove logging * :hammer: Reorder address fields * :bug: Fix shipping field in charge:update * :lipstick: Apply cosmetic change * :zap: Small improvements * :zap: Fix lintings in main file * :zap: Lint all descriptions * :zap: Add target="_blank" attribute * :zap: Fix various lintings for charge * :zap: Fix lintings for coupon * :zap: Fix lintings for customer * :zap: Fix lintings for source * :zap: Fix lintings for token * :zap: Reorder address fields * :zap: Fix casing in credentials * :hammer: Place recipient name above address in shipping * :zap: Remove references to string in descriptions * :zap: Apply minor renamings * :fire: Remove logging * :hammer: Simplify error handling * :zap: Fix indentation * :zap: Move cardFields to root level for Token creation Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-10 04:15:14 -07:00
export const customerCardFields: INodeProperties[] = [
:sparkles: Add Stripe regular node (#1470) * :tada: Register node * :art: Add SVG icon * :zap: Add preliminary node stub * :zap: Add resource description stubs * :art: Fix SVG size and position * :zap: Implement charge operations * :zap: Implement customer operations * :art: Apply cosmetic changes * :zap: Fix customer address fields * :zap: Add stub and fields for invoice * :zap: Add invoice item stubs * :zap: Implement source operations * :zap: Reduce scope per feedback * :zap: Add continueOnFail functionality * :art: Prettify error thrown * :fire: Remove unused resource * :zap: Replace source in card with token * :hammer: Remove logging * :wrench: Fix shipping address in charge:create * :wrench: Load update fields for charge:update * :zap: Implement token:create to ease testing * :zap: Simplify card token fields * :zap: Update description parameters * :wrench: Fix field adjusters * :zap: Remove unused source options * :wrench: Fix shipping fields adjuster * :fire: Remove PNG icon * :fire: Remove logging * :hammer: Reorder address fields * :bug: Fix shipping field in charge:update * :lipstick: Apply cosmetic change * :zap: Small improvements * :zap: Fix lintings in main file * :zap: Lint all descriptions * :zap: Add target="_blank" attribute * :zap: Fix various lintings for charge * :zap: Fix lintings for coupon * :zap: Fix lintings for customer * :zap: Fix lintings for source * :zap: Fix lintings for token * :zap: Reorder address fields * :zap: Fix casing in credentials * :hammer: Place recipient name above address in shipping * :zap: Remove references to string in descriptions * :zap: Apply minor renamings * :fire: Remove logging * :hammer: Simplify error handling * :zap: Fix indentation * :zap: Move cardFields to root level for Token creation Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-10 04:15:14 -07:00
// ----------------------------------
// customerCard: add
// ----------------------------------
{
displayName: 'Customer ID',
name: 'customerId',
type: 'string',
required: true,
default: '',
description: 'ID of the customer to be associated with this card',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'add',
],
},
},
},
{
displayName: 'Card Token',
name: 'token',
type: 'string',
required: true,
default: '',
placeholder: 'tok_1IMfKdJhRTnqS5TKQVG1LI9o',
description: 'Token representing sensitive card information',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'add',
],
},
},
},
// ----------------------------------
// customerCard: remove
// ----------------------------------
{
displayName: 'Customer ID',
name: 'customerId',
type: 'string',
required: true,
default: '',
description: 'ID of the customer whose card to remove',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'remove',
],
},
},
},
{
displayName: 'Card ID',
name: 'cardId',
type: 'string',
required: true,
default: '',
description: 'ID of the card to remove',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'remove',
],
},
},
},
// ----------------------------------
// customerCard: get
// ----------------------------------
{
displayName: 'Customer ID',
name: 'customerId',
type: 'string',
required: true,
default: '',
description: 'ID of the customer whose card to retrieve',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'get',
],
},
},
},
{
displayName: 'Source ID',
name: 'sourceId',
type: 'string',
required: true,
default: '',
description: 'ID of the source to retrieve',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'get',
],
},
},
},
];