n8n-nodes-smartcontact 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,8 +12,12 @@ Credentials: an API key from Settings › API keys & agents (kind "Integration")
12
12
 
13
13
  ## Build and publish (SmartContact's npm account)
14
14
 
15
+ Published as https://www.npmjs.com/package/n8n-nodes-smartcontact (npm account `smartcontact-crm`, operations@). For a new
16
+ version: bump `version`, then, with a short-lived granular publish token from Dave in a scratch npmrc:
17
+
15
18
  npm ci --ignore-scripts
16
19
  npm run build
17
- npm publish # then submit for n8n verification: https://docs.n8n.io/integrations/creating-nodes/deploy/submit-community-nodes/
20
+ npm publish --access public --userconfig <scratch npmrc>
18
21
 
19
- Self-hosted n8n users can install it from Settings › Community Nodes as `n8n-nodes-smartcontact` once published.
22
+ n8n verification (n8n Cloud) needs publishing from GitHub Actions with provenance: see docs/guides/D2-n8n.md.
23
+ Self-hosted n8n users install it from Settings › Community Nodes as `n8n-nodes-smartcontact`.
@@ -19,7 +19,7 @@ const fieldsCollection = (resource, operations, options, required = false) => ({
19
19
  default: {},
20
20
  displayOptions: show(resource, operations),
21
21
  // Each field the user adds goes into the JSON body under its own name.
22
- options: options.map((o) => ({ ...o, routing: { send: { type: 'body', property: o.name } } })),
22
+ options: options.map((o) => ({ ...o, routing: { send: { type: 'body', property: o.name, ...(o.type === 'dateTime' ? { value: '={{ $value ? new Date($value).toISOString() : undefined }}' } : {}) } } })),
23
23
  });
24
24
  const text = (displayName, name, extra = {}) => ({ displayName, name, type: 'string', default: '', ...extra });
25
25
  const companyFields = [
@@ -49,8 +49,9 @@ const dealFields = [
49
49
  text('Expected Close (YYYY-MM-DD)', 'expected_close'),
50
50
  text('Owner ID', 'owner_id'),
51
51
  ];
52
+ // A task always needs a due date and time.
53
+ const taskDue = { displayName: 'Due', name: 'due_at', type: 'dateTime', default: '' };
52
54
  const taskFields = [
53
- { displayName: 'Due', name: 'due_at', type: 'dateTime', default: '' },
54
55
  text('Notes', 'notes', { typeOptions: { rows: 3 } }),
55
56
  { displayName: 'About', name: 'target_type', type: 'options', default: 'company', options: [{ name: 'Company', value: 'company' }, { name: 'Contact', value: 'contact' }, { name: 'Deal', value: 'deal' }] },
56
57
  text('About (Record ID)', 'target_id'),
@@ -87,7 +88,8 @@ function crud(resource, label, required, optional) {
87
88
  ...f,
88
89
  required: true,
89
90
  displayOptions: show(resource, ['create']),
90
- routing: { send: { type: 'body', property: f.name } },
91
+ // The API wants a date-time with an offset; n8n's picker can give a local one.
92
+ routing: { send: { type: 'body', property: f.name, ...(f.type === 'dateTime' ? { value: '={{ new Date($value).toISOString() }}' } : {}) } },
91
93
  })),
92
94
  idField(resource, label, ['get', 'update']),
93
95
  { displayName: 'Search', name: 'q', type: 'string', default: '', displayOptions: show(resource, ['find']), description: 'Name, email, domain or postcode' },
@@ -127,7 +129,7 @@ class SmartContact {
127
129
  ...crud('company', 'Company', [text('Name', 'name')], companyFields),
128
130
  ...crud('contact', 'Contact', [], contactFields),
129
131
  ...crud('deal', 'Deal', [text('Name', 'name')], dealFields),
130
- ...crud('task', 'Task', [text('Title', 'title')], taskFields),
132
+ ...crud('task', 'Task', [text('Title', 'title'), taskDue], taskFields),
131
133
  {
132
134
  displayName: 'Operation',
133
135
  name: 'operation',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-smartcontact",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "SmartContact CRM nodes for n8n: instant triggers from SmartContact webhooks, and actions on companies, contacts, deals, tasks and notes",
5
5
  "keywords": ["n8n-community-node-package", "smartcontact", "crm"],
6
6
  "license": "MIT",