n8n-nodes-didomi 1.0.0
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/LICENSE.md +19 -0
- package/README.md +157 -0
- package/dist/credentials/DidomiApi.credentials.d.ts +10 -0
- package/dist/credentials/DidomiApi.credentials.js +60 -0
- package/dist/credentials/DidomiApi.credentials.js.map +1 -0
- package/dist/credentials/icons/didomi.svg +5 -0
- package/dist/nodes/Didomi/Didomi.node.d.ts +5 -0
- package/dist/nodes/Didomi/Didomi.node.js +851 -0
- package/dist/nodes/Didomi/Didomi.node.js.map +1 -0
- package/dist/nodes/Didomi/Didomi.node.json +20 -0
- package/dist/nodes/Didomi/didomi.svg +5 -0
- package/dist/package.json +60 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +11 -0
- package/package.json +60 -0
|
@@ -0,0 +1,851 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Didomi = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class Didomi {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
name: 'didomi',
|
|
9
|
+
displayName: 'Didomi',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
description: 'Use the Didomi API',
|
|
13
|
+
defaults: { name: 'Didomi' },
|
|
14
|
+
icon: 'file:didomi.svg',
|
|
15
|
+
inputs: [{ type: "main" }],
|
|
16
|
+
outputs: [{ type: "main" }],
|
|
17
|
+
usableAsTool: true,
|
|
18
|
+
credentials: [{ name: 'didomiApi', required: true }],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Resource',
|
|
22
|
+
name: 'resource',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'Compliance Report', value: 'complianceReport', description: 'Analyzes website compliance by scanning pages to detect trackers and vendors, generating reports with insights and recommendations' },
|
|
27
|
+
{ name: 'Consent And Preference', value: 'consentAndPreference', description: 'Manages user consent data by enabling creation, retrieval, and updates of consent records and preferences across platforms' },
|
|
28
|
+
{ name: 'Data Manager', value: 'dataManager', description: 'Enables centralized management of user data, preferences, and privacy requests' },
|
|
29
|
+
{ name: 'Privacy Request', value: 'privacyRequest', description: 'Handles user privacy requests such as data access, deletion, and opt-out' },
|
|
30
|
+
{ name: 'Widget', value: 'widget', description: 'Provides access to widget configurations, enabling retrieval and customization of consent and preference interfaces' }
|
|
31
|
+
],
|
|
32
|
+
default: 'dataManager',
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Operation',
|
|
37
|
+
name: 'operation',
|
|
38
|
+
type: 'options',
|
|
39
|
+
noDataExpression: true,
|
|
40
|
+
displayOptions: { show: { resource: ['complianceReport'] } },
|
|
41
|
+
options: [
|
|
42
|
+
{ name: 'Create Property', value: 'complianceReportPropertyCreatePost', action: 'Creates a property', description: 'Creates a property' },
|
|
43
|
+
{ name: 'Create Report', value: 'complianceReportCreatePost', action: 'Creates a report', description: 'Creates a report' },
|
|
44
|
+
{ name: 'Delete Property', value: 'complianceReportPropertyDelete', action: 'Deletes a property', description: 'Deletes a property' },
|
|
45
|
+
{ name: 'Get Property', value: 'complianceReportPropertyGet', action: 'Gets a property', description: 'Gets a property' },
|
|
46
|
+
{ name: 'Get Report', value: 'complianceReportGet', action: 'Gets a report', description: 'Gets a report' },
|
|
47
|
+
{ name: 'List Properties', value: 'complianceReportPropertiesList', action: 'Lists all properties', description: 'Lists all properties' },
|
|
48
|
+
{ name: 'List Reports', value: 'complianceReportsList', action: 'Lists all reports', description: 'Lists all reports' },
|
|
49
|
+
{ name: 'Update Property', value: 'complianceReportPropertyPatch', action: 'Updates a property', description: 'Updates a property' }
|
|
50
|
+
],
|
|
51
|
+
default: 'complianceReportPropertyCreatePost',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
displayName: 'Operation',
|
|
55
|
+
name: 'operation',
|
|
56
|
+
type: 'options',
|
|
57
|
+
noDataExpression: true,
|
|
58
|
+
displayOptions: { show: { resource: ['consentAndPreference'] } },
|
|
59
|
+
options: [
|
|
60
|
+
{ name: 'Approve Pending Events', value: 'consentAndPreferencePendingEventsApprovePatch', action: 'Approves pending events', description: 'Approves pending events' },
|
|
61
|
+
{ name: 'Create Consent Event', value: 'consentAndPreferenceConsentEventCreatePost', action: 'Creates a consent event', description: 'Creates a consent event' },
|
|
62
|
+
{ name: 'Create Consent User', value: 'consentAndPreferenceConsentUserCreatePost', action: 'Creates a consent user', description: 'Creates a consent user' },
|
|
63
|
+
{ name: 'Create Secret', value: 'consentAndPreferenceSecretCreatePost', action: 'Creates a secret', description: 'Creates a secret' },
|
|
64
|
+
{ name: 'Create Token', value: 'consentAndPreferenceTokenCreatePost', action: 'Creates a token', description: 'Creates a token' },
|
|
65
|
+
{ name: 'Delete Consent Event', value: 'consentAndPreferenceConsentEventDelete', action: 'Deletes all consent envents', description: 'Deletes all consent envents' },
|
|
66
|
+
{ name: 'Get Consent User', value: 'consentAndPreferenceConsentUserGet', action: 'Creates a consent user', description: 'Creates a consent user' },
|
|
67
|
+
{ name: 'Get Pending Event', value: 'consentAndPreferencePendingEventGet', action: 'Gets a pending event', description: 'Gets a pending event' },
|
|
68
|
+
{ name: 'Get Proof', value: 'consentAndPreferenceProofGet', action: 'Gets a consent user', description: 'Gets a consent user' },
|
|
69
|
+
{ name: 'List Consent Users', value: 'consentAndPreferenceConsentUserList', action: 'Lists all consent users', description: 'Lists all consent users' },
|
|
70
|
+
{ name: 'List Pending Events', value: 'consentAndPreferencePendingEventsList', action: 'Lists all pending events', description: 'Lists all pending events' },
|
|
71
|
+
{ name: 'Upload Proof', value: 'consentAndPreferenceProofUploadPost', action: 'Uploads a proof', description: 'Uploads a proof' }
|
|
72
|
+
],
|
|
73
|
+
default: 'consentAndPreferencePendingEventsApprovePatch',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
displayName: 'Operation',
|
|
77
|
+
name: 'operation',
|
|
78
|
+
type: 'options',
|
|
79
|
+
noDataExpression: true,
|
|
80
|
+
displayOptions: { show: { resource: ['dataManager'] } },
|
|
81
|
+
options: [
|
|
82
|
+
{ name: 'Add Preference Into Your Configuration Tree', value: 'dataManagerPreferenceIntoYourConfigurationTreeAddPost', action: 'Adds a preference into your configuration tree', description: 'Adds a preference into your configuration tree' },
|
|
83
|
+
{ name: 'Add Purpose Into Your Configuration Tree', value: 'dataManagerPurposeIntoYourConfigurationTreeAddPost', action: 'Adds a purpose into your configuration tree', description: 'Adds a purpose into your configuration tree' },
|
|
84
|
+
{ name: 'Create Preference', value: 'dataManagerPreferenceCreatePost', action: 'Creates a preference', description: 'Creates a preference' },
|
|
85
|
+
{ name: 'Create Purpose', value: 'dataManagerPurposeCreatePost', action: 'Creates a purpose', description: 'Creates a purpose' },
|
|
86
|
+
{ name: 'Delete Preference', value: 'dataManagerPreferenceDelete', action: 'Deletes a preference', description: 'Deletes a preference' },
|
|
87
|
+
{ name: 'Delete Purpose', value: 'dataManagerPurposeDelete', action: 'Deletes a purpose', description: 'Deletes a purpose' },
|
|
88
|
+
{ name: 'Delete Selected Preference', value: 'dataManagerSelectedPreferenceDelete', action: 'Deletes multiple selected preferences', description: 'Deletes multiple selected preferences' },
|
|
89
|
+
{ name: 'Delete Selected Purpose', value: 'dataManagerSelectedPurposeDelete', action: 'Deletes a selected purpose', description: 'Deletes a selected purpose' },
|
|
90
|
+
{ name: 'Get Available Regulations and Related Information', value: 'dataManagerAvailableRegulationsAndRelatedInformationGet', action: 'Gets available regulations and related information', description: 'Retrieves the regulations supported' },
|
|
91
|
+
{ name: 'Get Configuration Tree', value: 'dataManagerConfigurationTreeGet', action: 'Gets a configuration tree', description: 'Retrieves data of your configuration tree' },
|
|
92
|
+
{ name: 'Get Preference', value: 'dataManagerPreferenceGet', action: 'Gets a preference', description: 'Gets a preference' },
|
|
93
|
+
{ name: 'Get Purpose', value: 'dataManagerPurposeGet', action: 'Gets a purpose', description: 'Gets a purpose' },
|
|
94
|
+
{ name: 'List Preferences', value: 'dataManagerPreferencesList', action: 'Lists preferences', description: 'Lists preferences' },
|
|
95
|
+
{ name: 'List Purposes', value: 'dataManagerPurposesList', action: 'Lists all purposes', description: 'Lists all purposes' },
|
|
96
|
+
{ name: 'List User Rights', value: 'dataManagerUserRightsList', action: 'Lists all user rights', description: 'Lists all user rights' },
|
|
97
|
+
{ name: 'Update Preference', value: 'dataManagerPreferencePatch', action: 'Updates a preference', description: 'Updates a preference' },
|
|
98
|
+
{ name: 'Update Purpose', value: 'dataManagerPurposePatch', action: 'Updates a purpose', description: 'Updates a purpose' }
|
|
99
|
+
],
|
|
100
|
+
default: 'dataManagerPreferenceIntoYourConfigurationTreeAddPost',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
displayName: 'Operation',
|
|
104
|
+
name: 'operation',
|
|
105
|
+
type: 'options',
|
|
106
|
+
noDataExpression: true,
|
|
107
|
+
displayOptions: { show: { resource: ['privacyRequest'] } },
|
|
108
|
+
options: [
|
|
109
|
+
{ name: 'Configure Recipient Email Address', value: 'privacyRequestRecipientEmailAddressPatch', action: 'Configures the recipients of an email', description: 'Configures the recipients of an email' },
|
|
110
|
+
{ name: 'Create Link', value: 'privacyRequestLinkCreatePost', action: 'Creates a link', description: 'Creates a link' },
|
|
111
|
+
{ name: 'Create New Template Email', value: 'privacyRequestNewTemplateEmailCreatePost', action: 'Creates a new template email', description: 'Creates a new template email' },
|
|
112
|
+
{ name: 'Create Note', value: 'privacyRequestNoteCreatePost', action: 'Creates a note', description: 'Creates a note' },
|
|
113
|
+
{ name: 'Create Request', value: 'privacyRequestCreatePost', action: 'Creates a request', description: 'Creates a request' },
|
|
114
|
+
{ name: 'Get Note', value: 'privacyRequestNoteGet', action: 'Gets a note', description: 'Gets a note' },
|
|
115
|
+
{ name: 'Get Provider Configuration Schemas', value: 'privacyRequestProviderConfigurationSchemasGet', action: 'Gets provider configuration schemas', description: 'Gets provider configuration schemas' },
|
|
116
|
+
{ name: 'Get Request', value: 'privacyRequestGet', action: 'Gets a request', description: 'Gets a request' },
|
|
117
|
+
{ name: 'List Notes', value: 'privacyRequestNotesList', action: 'Lists all notes', description: 'Lists all notes' },
|
|
118
|
+
{ name: 'List Requests', value: 'privacyRequestList', action: 'Lists all requests', description: 'Lists all requests' },
|
|
119
|
+
{ name: 'Update Request', value: 'privacyRequestPatch', action: 'Updates a request', description: 'Updates a request' }
|
|
120
|
+
],
|
|
121
|
+
default: 'privacyRequestRecipientEmailAddressPatch',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
displayName: 'Operation',
|
|
125
|
+
name: 'operation',
|
|
126
|
+
type: 'options',
|
|
127
|
+
noDataExpression: true,
|
|
128
|
+
displayOptions: { show: { resource: ['widget'] } },
|
|
129
|
+
options: [
|
|
130
|
+
{ name: 'Create Authentication Provider', value: 'widgetAuthenticationProviderCreatePost', action: 'Creates an authentication provider', description: 'Creates an authentication provider' },
|
|
131
|
+
{ name: 'Create Consent Notice', value: 'widgetConsentNoticeCreatePost', action: 'Creates a consent notice', description: 'Creates a consent notice' },
|
|
132
|
+
{ name: 'Create Widget', value: 'widgetCreatePost', action: 'Creates a widget', description: 'Creates a widget' },
|
|
133
|
+
{ name: 'Delete Widget', value: 'widgetDelete', action: 'Deletes a widget', description: 'Deletes a widget' },
|
|
134
|
+
{ name: 'Get Archived Widget', value: 'widgetArchivedWidgetGet', action: 'Gets an archived widget', description: 'Gets an archived widget' },
|
|
135
|
+
{ name: 'Get Current Draft Configuration For Notice', value: 'widgetCurrentDraftConfigurationForNoticeGet', action: 'Gets the current draft configuration for a notice', description: 'Gets the current draft configuration for a notice' },
|
|
136
|
+
{ name: 'Get Custom Theme', value: 'widgetCustomThemeGet', action: 'Gets a custom theme', description: 'Gets a custom theme' },
|
|
137
|
+
{ name: 'Get Deployment', value: 'widgetDeploymentGet', action: 'Gets a deployment', description: 'Gets a deployment' },
|
|
138
|
+
{ name: 'Get Entity', value: 'widgetEntityGet', action: 'Gets an entity', description: 'Gets an entity' },
|
|
139
|
+
{ name: 'Get Widget', value: 'widgetGet', action: 'Gets a widget', description: 'Gets a widget' },
|
|
140
|
+
{ name: 'List Archived Widget', value: 'widgetArchivedWidgetList', action: 'Lists all archived widget', description: 'Lists all archived widget' },
|
|
141
|
+
{ name: 'List Custom Themes', value: 'widgetCustomThemesList', action: 'Lists all custom themes', description: 'Lists all custom themes' },
|
|
142
|
+
{ name: 'List Deployments', value: 'widgetDeploymentsList', action: 'Lists all deployments', description: 'Lists all deployments' },
|
|
143
|
+
{ name: 'List Entities', value: 'widgetEntitiesList', action: 'Lists all entities', description: 'Lists all entities' },
|
|
144
|
+
{ name: 'List Widgets', value: 'widgetList', action: 'Lists all widgets', description: 'Lists all widgets' },
|
|
145
|
+
{ name: 'Publish Current Draft Configuration For Notice', value: 'widgetCurrentDraftConfigurationForNoticePublishPost', action: 'Publishes the current draft configuration for a notice', description: 'Publishes the current draft configuration for a notice' },
|
|
146
|
+
{ name: 'Publish Widget', value: 'widgetPublishPost', action: 'Publishes a widget', description: 'Publishes a widget' },
|
|
147
|
+
{ name: 'Set Default Authentication Provider', value: 'widgetDefaultAuthenticationProviderSetPatch', action: 'Sets a default authentication provider', description: 'Sets a default authentication provider' },
|
|
148
|
+
{ name: 'Update Component', value: 'widgetComponentPatch', action: 'Updates a component', description: 'Updates a component' },
|
|
149
|
+
{ name: 'Update Current Draft Configuration For Notice', value: 'widgetCurrentDraftConfigurationForNoticePatch', action: 'Updates the current draft configuration for a notice', description: 'Updates the current draft configuration for a notice' },
|
|
150
|
+
{ name: 'Update Custom Theme', value: 'widgetCustomThemePatch', action: 'Updates a custom theme', description: 'Updates a custom theme' },
|
|
151
|
+
{ name: 'Update Entity', value: 'widgetEntityPatch', action: 'Updates an entity', description: 'Updates an entity' },
|
|
152
|
+
{ name: 'Update Multiple Components', value: 'widgetMultipleComponentsPatch', action: 'Updates multiple components', description: 'Updates multiple components' },
|
|
153
|
+
{ name: 'Update Multiple Entities', value: 'widgetMultipleEntitiesPatch', action: 'Updates multiple entities', description: 'Updates multiple entities' },
|
|
154
|
+
{ name: 'Update Widget', value: 'widgetPatch', action: 'Updates a widget', description: 'Updates a widget' }
|
|
155
|
+
],
|
|
156
|
+
default: 'widgetAuthenticationProviderCreatePost',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
displayName: 'Archived Widget ID',
|
|
160
|
+
name: 'archivedWidgetId',
|
|
161
|
+
type: 'string',
|
|
162
|
+
default: '',
|
|
163
|
+
displayOptions: { show: { operation: ['widgetArchivedWidgetGet'] } }
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Authentification Provider ID',
|
|
167
|
+
name: 'authentificationProviderId',
|
|
168
|
+
type: 'string',
|
|
169
|
+
default: '',
|
|
170
|
+
displayOptions: { show: { operation: ['widgetDefaultAuthenticationProviderSetPatch'] } }
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Component ID',
|
|
174
|
+
name: 'componentId',
|
|
175
|
+
type: 'string',
|
|
176
|
+
default: '',
|
|
177
|
+
displayOptions: { show: { operation: ['widgetComponentPatch'] } }
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
displayName: 'Configuration Tree ID',
|
|
181
|
+
name: 'configurationTreeId',
|
|
182
|
+
type: 'string',
|
|
183
|
+
default: '',
|
|
184
|
+
displayOptions: { show: { operation: ['dataManagerPreferenceIntoYourConfigurationTreeAddPost', 'dataManagerPurposeIntoYourConfigurationTreeAddPost', 'dataManagerSelectedPreferenceDelete', 'dataManagerSelectedPurposeDelete'] } }
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
displayName: 'Consent Event ID',
|
|
188
|
+
name: 'consentEventId',
|
|
189
|
+
type: 'string',
|
|
190
|
+
default: '',
|
|
191
|
+
displayOptions: { show: { operation: ['consentAndPreferenceConsentEventDelete', 'consentAndPreferencePendingEventGet', 'consentAndPreferencePendingEventsApprovePatch'] } }
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
displayName: 'Current Draft Configuration ID',
|
|
195
|
+
name: 'currentDraftConfigurationId',
|
|
196
|
+
type: 'string',
|
|
197
|
+
default: '',
|
|
198
|
+
displayOptions: { show: { operation: ['widgetCurrentDraftConfigurationForNoticePatch'] } }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
displayName: 'Custom Theme ID',
|
|
202
|
+
name: 'customThemeId',
|
|
203
|
+
type: 'string',
|
|
204
|
+
default: '',
|
|
205
|
+
displayOptions: { show: { operation: ['widgetCustomThemeGet', 'widgetCustomThemePatch'] } }
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
displayName: 'Deployment ID',
|
|
209
|
+
name: 'deploymentId',
|
|
210
|
+
type: 'string',
|
|
211
|
+
default: '',
|
|
212
|
+
displayOptions: { show: { operation: ['widgetDeploymentGet'] } }
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
displayName: 'Email ID',
|
|
216
|
+
name: 'emailId',
|
|
217
|
+
type: 'string',
|
|
218
|
+
default: '',
|
|
219
|
+
displayOptions: { show: { operation: ['privacyRequestRecipientEmailAddressPatch'] } }
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
displayName: 'Entity ID',
|
|
223
|
+
name: 'entityId',
|
|
224
|
+
type: 'string',
|
|
225
|
+
default: '',
|
|
226
|
+
displayOptions: { show: { operation: ['widgetEntityGet', 'widgetEntityPatch'] } }
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
displayName: 'Organization User ID',
|
|
230
|
+
name: 'organizationUserId',
|
|
231
|
+
type: 'string',
|
|
232
|
+
default: '',
|
|
233
|
+
displayOptions: { show: { operation: ['consentAndPreferenceConsentUserGet'] } }
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
displayName: 'Preference ID',
|
|
237
|
+
name: 'preferenceId',
|
|
238
|
+
type: 'string',
|
|
239
|
+
default: '',
|
|
240
|
+
displayOptions: { show: { operation: ['dataManagerPreferenceDelete', 'dataManagerPreferenceGet', 'dataManagerPreferencePatch'] } }
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
displayName: 'Proof ID',
|
|
244
|
+
name: 'proofId',
|
|
245
|
+
type: 'string',
|
|
246
|
+
default: '',
|
|
247
|
+
displayOptions: { show: { operation: ['consentAndPreferenceProofGet'] } }
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
displayName: 'Property ID',
|
|
251
|
+
name: 'propertyId',
|
|
252
|
+
type: 'string',
|
|
253
|
+
default: '',
|
|
254
|
+
displayOptions: { show: { operation: ['complianceReportPropertyDelete', 'complianceReportPropertyGet', 'complianceReportPropertyPatch'] } }
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
displayName: 'Purpose ID',
|
|
258
|
+
name: 'purposeId',
|
|
259
|
+
type: 'string',
|
|
260
|
+
default: '',
|
|
261
|
+
displayOptions: { show: { operation: ['dataManagerPurposeDelete', 'dataManagerPurposeGet', 'dataManagerPurposePatch'] } }
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
displayName: 'Report ID',
|
|
265
|
+
name: 'reportId',
|
|
266
|
+
type: 'string',
|
|
267
|
+
default: '',
|
|
268
|
+
displayOptions: { show: { operation: ['complianceReportGet'] } }
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
displayName: 'Request ID',
|
|
272
|
+
name: 'requestId',
|
|
273
|
+
type: 'string',
|
|
274
|
+
default: '',
|
|
275
|
+
displayOptions: { show: { operation: ['privacyRequestGet', 'privacyRequestPatch'] } }
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
displayName: 'Selected Preference ID',
|
|
279
|
+
name: 'selectedPreferenceId',
|
|
280
|
+
type: 'string',
|
|
281
|
+
default: '',
|
|
282
|
+
displayOptions: { show: { operation: ['dataManagerSelectedPreferenceDelete'] } }
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
displayName: 'Selected Purpose ID',
|
|
286
|
+
name: 'selectedPurposeId',
|
|
287
|
+
type: 'string',
|
|
288
|
+
default: '',
|
|
289
|
+
displayOptions: { show: { operation: ['dataManagerSelectedPurposeDelete'] } }
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: 'Widget ID',
|
|
293
|
+
name: 'widgetId',
|
|
294
|
+
type: 'string',
|
|
295
|
+
default: '',
|
|
296
|
+
displayOptions: { show: { operation: ['widgetDelete', 'widgetGet', 'widgetPatch'] } }
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
displayName: 'Query Parameters',
|
|
300
|
+
name: 'queryParameters',
|
|
301
|
+
type: 'collection',
|
|
302
|
+
placeholder: 'Add Parameter',
|
|
303
|
+
default: {},
|
|
304
|
+
options: [
|
|
305
|
+
{
|
|
306
|
+
displayName: 'By Organization User ID',
|
|
307
|
+
name: 'by_organization_user_id',
|
|
308
|
+
type: 'boolean',
|
|
309
|
+
default: true
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
displayName: 'Cursor',
|
|
313
|
+
name: 'cursor',
|
|
314
|
+
type: 'string',
|
|
315
|
+
default: ''
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
displayName: 'Generate TCFCS',
|
|
319
|
+
name: 'generate_tcfcs',
|
|
320
|
+
type: 'boolean',
|
|
321
|
+
default: true
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
displayName: 'ID',
|
|
325
|
+
name: 'id',
|
|
326
|
+
type: 'string',
|
|
327
|
+
default: ''
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
displayName: 'Limit',
|
|
331
|
+
name: 'limit',
|
|
332
|
+
description: 'Max number of results to return',
|
|
333
|
+
type: 'number',
|
|
334
|
+
default: 50,
|
|
335
|
+
typeOptions: {
|
|
336
|
+
minValue: 1
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
displayName: 'Merge Users',
|
|
341
|
+
name: 'merge_users',
|
|
342
|
+
type: 'boolean',
|
|
343
|
+
default: true
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
displayName: 'Notice ID',
|
|
347
|
+
name: 'notice_id',
|
|
348
|
+
type: 'string',
|
|
349
|
+
default: ''
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
displayName: 'Or',
|
|
353
|
+
name: 'or',
|
|
354
|
+
type: 'string',
|
|
355
|
+
default: ''
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
displayName: 'Organization ID',
|
|
359
|
+
name: 'organization_id',
|
|
360
|
+
type: 'string',
|
|
361
|
+
default: ''
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
displayName: 'Organization User ID',
|
|
365
|
+
name: 'organization_user_id',
|
|
366
|
+
type: 'string',
|
|
367
|
+
default: ''
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
displayName: 'Property ID',
|
|
371
|
+
name: 'property_id',
|
|
372
|
+
type: 'string',
|
|
373
|
+
default: ''
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
displayName: 'Regulation',
|
|
377
|
+
name: 'regulation',
|
|
378
|
+
type: 'string',
|
|
379
|
+
default: ''
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
displayName: 'Request ID',
|
|
383
|
+
name: 'request_id',
|
|
384
|
+
type: 'string',
|
|
385
|
+
default: ''
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
displayName: 'Request Type',
|
|
389
|
+
name: 'request_type',
|
|
390
|
+
type: 'string',
|
|
391
|
+
default: ''
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
displayName: 'Score',
|
|
395
|
+
name: 'score',
|
|
396
|
+
type: 'number',
|
|
397
|
+
default: ''
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
displayName: 'Skip',
|
|
401
|
+
name: 'skip',
|
|
402
|
+
description: 'Number of skipped items (ie offset of the first item to be returned)',
|
|
403
|
+
type: 'number',
|
|
404
|
+
default: 0
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
displayName: 'Status',
|
|
408
|
+
name: 'status',
|
|
409
|
+
type: 'options',
|
|
410
|
+
options: [
|
|
411
|
+
{
|
|
412
|
+
name: 'Failed',
|
|
413
|
+
value: 'failed'
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
name: 'Partial',
|
|
417
|
+
value: 'partial'
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: 'Pending',
|
|
421
|
+
value: 'pending'
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
name: 'Queued',
|
|
425
|
+
value: 'queued'
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: 'Success',
|
|
429
|
+
value: 'success'
|
|
430
|
+
}
|
|
431
|
+
],
|
|
432
|
+
default: 'success'
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
displayName: 'Tracker Count',
|
|
436
|
+
name: 'tracker_count',
|
|
437
|
+
type: 'number',
|
|
438
|
+
default: ''
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
displayName: 'Translations',
|
|
442
|
+
name: 'translations',
|
|
443
|
+
type: 'boolean',
|
|
444
|
+
default: false
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
displayName: 'Vendors Count',
|
|
448
|
+
name: 'vendors_count',
|
|
449
|
+
type: 'number',
|
|
450
|
+
default: ''
|
|
451
|
+
},
|
|
452
|
+
]
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
displayName: 'Request Body',
|
|
456
|
+
name: 'requestBody',
|
|
457
|
+
type: 'json',
|
|
458
|
+
default: '{}',
|
|
459
|
+
displayOptions: { show: { operation: ['complianceReportCreatePost', 'complianceReportPropertyCreatePost', 'complianceReportPropertyPatch', 'consentAndPreferencePendingEventsApprovePatch', 'consentAndPreferenceConsentEventCreatePost', 'consentAndPreferenceConsentUserCreatePost', 'consentAndPreferenceProofUploadPost', 'consentAndPreferenceSecretCreatePost', 'consentAndPreferenceTokenCreatePost', 'dataManagerPurposeIntoYourConfigurationTreeAddPost', 'dataManagerPreferenceIntoYourConfigurationTreeAddPost', 'dataManagerPreferenceCreatePost', 'dataManagerPreferencePatch', 'dataManagerPurposeCreatePost', 'dataManagerPurposePatch', 'privacyRequestCreatePost', 'privacyRequestLinkCreatePost', 'privacyRequestNewTemplateEmailCreatePost', 'privacyRequestNoteCreatePost', 'privacyRequestPatch', 'privacyRequestRecipientEmailAddressPatch', 'widgetAuthenticationProviderCreatePost', 'widgetComponentPatch', 'widgetConsentNoticeCreatePost', 'widgetCreatePost', 'widgetCurrentDraftConfigurationForNoticePatch', 'widgetCurrentDraftConfigurationForNoticePublishPost', 'widgetCustomThemePatch', 'widgetDefaultAuthenticationProviderSetPatch', 'widgetEntityPatch', 'widgetMultipleComponentsPatch', 'widgetMultipleEntitiesPatch', 'widgetPatch', 'widgetPublishPost'] } }
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
async execute() {
|
|
465
|
+
const items = this.getInputData();
|
|
466
|
+
const returnData = [];
|
|
467
|
+
const credentials = await this.getCredentials('didomiApi');
|
|
468
|
+
const { apiKey, apiSecret } = credentials;
|
|
469
|
+
if (!apiKey || !apiSecret) {
|
|
470
|
+
throw new n8n_workflow_1.ApplicationError('Missing API Key or API Secret');
|
|
471
|
+
}
|
|
472
|
+
const authResponse = await this.helpers.request({
|
|
473
|
+
method: 'POST',
|
|
474
|
+
url: 'https://api.didomi.io/v1/sessions',
|
|
475
|
+
headers: {
|
|
476
|
+
'Content-Type': 'application/json'
|
|
477
|
+
},
|
|
478
|
+
body: {
|
|
479
|
+
type: 'api-key',
|
|
480
|
+
key: apiKey,
|
|
481
|
+
secret: apiSecret
|
|
482
|
+
},
|
|
483
|
+
json: true,
|
|
484
|
+
});
|
|
485
|
+
const accessToken = authResponse === null || authResponse === void 0 ? void 0 : authResponse.access_token;
|
|
486
|
+
if (!accessToken) {
|
|
487
|
+
throw new n8n_workflow_1.ApplicationError('Failed to retrieve access token');
|
|
488
|
+
}
|
|
489
|
+
for (let i = 0; i < items.length; i++) {
|
|
490
|
+
try {
|
|
491
|
+
const operation = this.getNodeParameter('operation', i, '');
|
|
492
|
+
const resource = this.getNodeParameter('resource', i, '');
|
|
493
|
+
const archivedWidgetId = this.getNodeParameter('archivedWidgetId', i, '');
|
|
494
|
+
const authentificationProviderId = this.getNodeParameter('authentificationProviderId', i, '');
|
|
495
|
+
const componentId = this.getNodeParameter('componentId', i, '');
|
|
496
|
+
const configurationTreeId = this.getNodeParameter('configurationTreeId', i, '');
|
|
497
|
+
const consentEventId = this.getNodeParameter('consentEventId', i, '');
|
|
498
|
+
const currentDraftConfigurationId = this.getNodeParameter('currentDraftConfigurationId', i, '');
|
|
499
|
+
const customThemeId = this.getNodeParameter('customThemeId', i, '');
|
|
500
|
+
const deploymentId = this.getNodeParameter('deploymentId', i, '');
|
|
501
|
+
const emailId = this.getNodeParameter('emailId', i, '');
|
|
502
|
+
const entityId = this.getNodeParameter('entityId', i, '');
|
|
503
|
+
const organizationUserId = this.getNodeParameter('organizationUserId', i, '');
|
|
504
|
+
const preferenceId = this.getNodeParameter('preferenceId', i, '');
|
|
505
|
+
const proofId = this.getNodeParameter('proofId', i, '');
|
|
506
|
+
const propertyId = this.getNodeParameter('propertyId', i, '');
|
|
507
|
+
const purposeId = this.getNodeParameter('purposeId', i, '');
|
|
508
|
+
const reportId = this.getNodeParameter('reportId', i, '');
|
|
509
|
+
const requestId = this.getNodeParameter('requestId', i, '');
|
|
510
|
+
const selectedPreferenceId = this.getNodeParameter('selectedPreferenceId', i, '');
|
|
511
|
+
const selectedPurposeId = this.getNodeParameter('selectedPurposeId', i, '');
|
|
512
|
+
const widgetId = this.getNodeParameter('widgetId', i, '');
|
|
513
|
+
const queryParameters = this.getNodeParameter('queryParameters', i, {});
|
|
514
|
+
const requestBody = this.getNodeParameter('requestBody', i, '');
|
|
515
|
+
let url = 'https://api.didomi.io';
|
|
516
|
+
const queryParams = new URLSearchParams();
|
|
517
|
+
Object.entries(queryParameters).forEach(([key, value]) => {
|
|
518
|
+
if (value !== '')
|
|
519
|
+
queryParams.append(key, String(value));
|
|
520
|
+
});
|
|
521
|
+
const queryString = queryParams.toString() ? `?${queryParams.toString()}` : '';
|
|
522
|
+
switch (resource) {
|
|
523
|
+
case 'consentAndPreference':
|
|
524
|
+
switch (operation) {
|
|
525
|
+
case 'consentAndPreferenceConsentEventDelete':
|
|
526
|
+
case 'consentAndPreferencePendingEventGet':
|
|
527
|
+
case 'consentAndPreferencePendingEventsApprovePatch':
|
|
528
|
+
if (consentEventId == '') {
|
|
529
|
+
throw new n8n_workflow_1.ApplicationError('Consent Event ID is required');
|
|
530
|
+
}
|
|
531
|
+
url += `/consents/events/${consentEventId}${queryString}`;
|
|
532
|
+
break;
|
|
533
|
+
case 'consentAndPreferenceConsentEventCreatePost':
|
|
534
|
+
case 'consentAndPreferencePendingEventsList':
|
|
535
|
+
url += `/consents/events${queryString}`;
|
|
536
|
+
break;
|
|
537
|
+
case 'consentAndPreferenceConsentUserGet':
|
|
538
|
+
if (organizationUserId == '') {
|
|
539
|
+
throw new n8n_workflow_1.ApplicationError('Organization User ID is required');
|
|
540
|
+
}
|
|
541
|
+
url += `/consents/users/${organizationUserId}${queryString}`;
|
|
542
|
+
break;
|
|
543
|
+
case 'consentAndPreferenceConsentUserList':
|
|
544
|
+
case 'consentAndPreferenceConsentUserCreatePost':
|
|
545
|
+
url += `/consents/users${queryString}`;
|
|
546
|
+
break;
|
|
547
|
+
case 'consentAndPreferenceProofGet':
|
|
548
|
+
if (proofId == '') {
|
|
549
|
+
throw new n8n_workflow_1.ApplicationError('Proof ID is required');
|
|
550
|
+
}
|
|
551
|
+
url += `/consents/proofs/${proofId}.png${queryString}`;
|
|
552
|
+
break;
|
|
553
|
+
case 'consentAndPreferenceProofUploadPost':
|
|
554
|
+
url += `/consents/proofs${queryString}`;
|
|
555
|
+
break;
|
|
556
|
+
case 'consentAndPreferenceSecretCreatePost':
|
|
557
|
+
url += `/secrets`;
|
|
558
|
+
break;
|
|
559
|
+
case 'consentAndPreferenceTokenCreatePost':
|
|
560
|
+
url += `/consents/tokens${queryString}`;
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
break;
|
|
564
|
+
case 'complianceReport':
|
|
565
|
+
switch (operation) {
|
|
566
|
+
case 'complianceReportsList':
|
|
567
|
+
case 'complianceReportCreatePost':
|
|
568
|
+
url += `/reports/compliances/reports${queryString}`;
|
|
569
|
+
break;
|
|
570
|
+
case 'complianceReportGet':
|
|
571
|
+
if (reportId == '') {
|
|
572
|
+
throw new n8n_workflow_1.ApplicationError('Report ID is required');
|
|
573
|
+
}
|
|
574
|
+
url += `/reports/compliances/reports/${reportId}${queryString}`;
|
|
575
|
+
break;
|
|
576
|
+
case 'complianceReportPropertyDelete':
|
|
577
|
+
case 'complianceReportPropertyGet':
|
|
578
|
+
case 'complianceReportPropertyPatch':
|
|
579
|
+
if (propertyId == '') {
|
|
580
|
+
throw new n8n_workflow_1.ApplicationError('Property ID is required');
|
|
581
|
+
}
|
|
582
|
+
url += `/reports/compliances/properties/${propertyId}${queryString}`;
|
|
583
|
+
break;
|
|
584
|
+
case 'complianceReportPropertyCreatePost':
|
|
585
|
+
case 'complianceReportPropertiesList':
|
|
586
|
+
url += `/reports/compliances/properties${queryString}`;
|
|
587
|
+
break;
|
|
588
|
+
}
|
|
589
|
+
break;
|
|
590
|
+
case 'dataManager':
|
|
591
|
+
switch (operation) {
|
|
592
|
+
case 'dataManagerPurposesList':
|
|
593
|
+
url += `/metadata/purposes${queryString}`;
|
|
594
|
+
break;
|
|
595
|
+
case 'dataManagerUserRightsList':
|
|
596
|
+
url += `/dsar/user-rights${queryString}`;
|
|
597
|
+
break;
|
|
598
|
+
case 'dataManagerAvailableRegulationsAndRelatedInformationGet':
|
|
599
|
+
url += `/compliance/v1/regulations?$search[releaseStatus]=stable`;
|
|
600
|
+
break;
|
|
601
|
+
case 'dataManagerConfigurationTreeGet':
|
|
602
|
+
url += `/config-trees${queryString}`;
|
|
603
|
+
break;
|
|
604
|
+
case 'dataManagerPreferencesList':
|
|
605
|
+
case 'dataManagerPreferenceCreatePost':
|
|
606
|
+
url += `/preferences${queryString}`;
|
|
607
|
+
break;
|
|
608
|
+
case 'dataManagerPreferenceDelete':
|
|
609
|
+
case 'dataManagerPreferenceGet':
|
|
610
|
+
case 'dataManagerPreferencePatch':
|
|
611
|
+
if (preferenceId == '') {
|
|
612
|
+
throw new n8n_workflow_1.ApplicationError('Preference ID is required');
|
|
613
|
+
}
|
|
614
|
+
url += `/preferences/${preferenceId}${queryString}`;
|
|
615
|
+
break;
|
|
616
|
+
case 'dataManagerPreferenceIntoYourConfigurationTreeAddPost':
|
|
617
|
+
if (configurationTreeId == '') {
|
|
618
|
+
throw new n8n_workflow_1.ApplicationError('Configuration Tree ID is required');
|
|
619
|
+
}
|
|
620
|
+
url += `/config-trees/${configurationTreeId}/selected-preferences${queryString}`;
|
|
621
|
+
break;
|
|
622
|
+
case 'dataManagerPurposeIntoYourConfigurationTreeAddPost':
|
|
623
|
+
if (configurationTreeId == '') {
|
|
624
|
+
throw new n8n_workflow_1.ApplicationError('Configuration Tree ID is required');
|
|
625
|
+
}
|
|
626
|
+
url += `/config-trees/${configurationTreeId}/selected-purposes${queryString}`;
|
|
627
|
+
break;
|
|
628
|
+
case 'dataManagerPurposeCreatePost':
|
|
629
|
+
url += `/metadata/purposes${queryString}`;
|
|
630
|
+
break;
|
|
631
|
+
case 'dataManagerPurposeDelete':
|
|
632
|
+
case 'dataManagerPurposeGet':
|
|
633
|
+
case 'dataManagerPurposePatch':
|
|
634
|
+
if (purposeId == '') {
|
|
635
|
+
throw new n8n_workflow_1.ApplicationError('Purpose ID is required');
|
|
636
|
+
}
|
|
637
|
+
url += `/metadata/purposes/${purposeId}${queryString}`;
|
|
638
|
+
break;
|
|
639
|
+
case 'dataManagerSelectedPreferenceDelete':
|
|
640
|
+
if (configurationTreeId == '') {
|
|
641
|
+
throw new n8n_workflow_1.ApplicationError('Configuration Tree ID is required');
|
|
642
|
+
}
|
|
643
|
+
if (selectedPreferenceId == '') {
|
|
644
|
+
throw new n8n_workflow_1.ApplicationError('Selected Preference ID is required');
|
|
645
|
+
}
|
|
646
|
+
url += `/config-trees/${configurationTreeId}/selected-preferences/${selectedPreferenceId}${queryString}`;
|
|
647
|
+
break;
|
|
648
|
+
case 'dataManagerSelectedPurposeDelete':
|
|
649
|
+
if (configurationTreeId == '') {
|
|
650
|
+
throw new n8n_workflow_1.ApplicationError('Configuration Tree ID is required');
|
|
651
|
+
}
|
|
652
|
+
if (selectedPurposeId == '') {
|
|
653
|
+
throw new n8n_workflow_1.ApplicationError('Selected Purpose ID is required');
|
|
654
|
+
}
|
|
655
|
+
url += `/config-trees/${configurationTreeId}/selected-purposes/${selectedPurposeId}${queryString}`;
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
break;
|
|
659
|
+
case 'privacyRequest':
|
|
660
|
+
switch (operation) {
|
|
661
|
+
case 'privacyRequestGet':
|
|
662
|
+
case 'privacyRequestPatch':
|
|
663
|
+
if (requestId == '') {
|
|
664
|
+
throw new n8n_workflow_1.ApplicationError('Request ID is required');
|
|
665
|
+
}
|
|
666
|
+
url += `/dsar/requests/${requestId}${queryString}`;
|
|
667
|
+
break;
|
|
668
|
+
case 'privacyRequestList':
|
|
669
|
+
case 'privacyRequestCreatePost':
|
|
670
|
+
url += `/dsar/requests${queryString}`;
|
|
671
|
+
break;
|
|
672
|
+
case 'privacyRequestLinkCreatePost':
|
|
673
|
+
url += `/dsar/links${queryString}`;
|
|
674
|
+
break;
|
|
675
|
+
case 'privacyRequestNewTemplateEmailCreatePost':
|
|
676
|
+
url += `/marketplace/emails${queryString}`;
|
|
677
|
+
break;
|
|
678
|
+
case 'privacyRequestNoteCreatePost':
|
|
679
|
+
case 'privacyRequestNoteGet':
|
|
680
|
+
case 'privacyRequestNotesList':
|
|
681
|
+
url += `/dsar/requests/notes${queryString}`;
|
|
682
|
+
break;
|
|
683
|
+
case 'privacyRequestProviderConfigurationSchemasGet':
|
|
684
|
+
url += `/marketplace/emails/properties-schema${queryString}`;
|
|
685
|
+
break;
|
|
686
|
+
case 'privacyRequestRecipientEmailAddressPatch':
|
|
687
|
+
if (emailId == '') {
|
|
688
|
+
throw new n8n_workflow_1.ApplicationError('Email ID is required');
|
|
689
|
+
}
|
|
690
|
+
url += `/marketplace/emails/${emailId}${queryString}`;
|
|
691
|
+
break;
|
|
692
|
+
}
|
|
693
|
+
break;
|
|
694
|
+
case 'widget':
|
|
695
|
+
switch (operation) {
|
|
696
|
+
case 'widgetArchivedWidgetGet':
|
|
697
|
+
if (archivedWidgetId == '') {
|
|
698
|
+
throw new n8n_workflow_1.ApplicationError('Archived Widget ID is required');
|
|
699
|
+
}
|
|
700
|
+
url += `/widgets/archived/${archivedWidgetId}${queryString}`;
|
|
701
|
+
break;
|
|
702
|
+
case 'widgetArchivedWidgetList':
|
|
703
|
+
url += `/widgets/archived${queryString}`;
|
|
704
|
+
break;
|
|
705
|
+
case 'widgetAuthenticationProviderCreatePost':
|
|
706
|
+
url += `/auth-providers`;
|
|
707
|
+
break;
|
|
708
|
+
case 'widgetComponentPatch':
|
|
709
|
+
if (componentId == '') {
|
|
710
|
+
throw new n8n_workflow_1.ApplicationError('Component ID is required');
|
|
711
|
+
}
|
|
712
|
+
url += `/widgets/layout-components/${componentId}`;
|
|
713
|
+
break;
|
|
714
|
+
case 'widgetConsentNoticeCreatePost':
|
|
715
|
+
url += `/v1/widgets/notices`;
|
|
716
|
+
break;
|
|
717
|
+
case 'widgetCreatePost':
|
|
718
|
+
url += `/widgets${queryString}`;
|
|
719
|
+
break;
|
|
720
|
+
case 'widgetCurrentDraftConfigurationForNoticeGet':
|
|
721
|
+
url += `/v1/widgets/notices/configs${queryString}`;
|
|
722
|
+
break;
|
|
723
|
+
case 'widgetCurrentDraftConfigurationForNoticePatch':
|
|
724
|
+
if (currentDraftConfigurationId == '') {
|
|
725
|
+
throw new n8n_workflow_1.ApplicationError('Current Draft Configuration ID for Notice is required');
|
|
726
|
+
}
|
|
727
|
+
url += `/v1/widgets/notices/configs/${currentDraftConfigurationId}`;
|
|
728
|
+
break;
|
|
729
|
+
case 'widgetCurrentDraftConfigurationForNoticePublishPost':
|
|
730
|
+
url += `/v1/widgets/notices/deployments`;
|
|
731
|
+
break;
|
|
732
|
+
case 'widgetCustomThemesList':
|
|
733
|
+
url += `/widgets/themes${queryString}`;
|
|
734
|
+
break;
|
|
735
|
+
case 'widgetCustomThemeGet':
|
|
736
|
+
case 'widgetCustomThemePatch':
|
|
737
|
+
if (customThemeId == '') {
|
|
738
|
+
throw new n8n_workflow_1.ApplicationError('Custom Theme ID is required');
|
|
739
|
+
}
|
|
740
|
+
url += `/widgets/themes/${customThemeId}${queryString}`;
|
|
741
|
+
break;
|
|
742
|
+
case 'widgetDefaultAuthenticationProviderSetPatch':
|
|
743
|
+
if (authentificationProviderId == '') {
|
|
744
|
+
throw new n8n_workflow_1.ApplicationError('Authentification Provider ID is required');
|
|
745
|
+
}
|
|
746
|
+
url += `/auth-providers/${authentificationProviderId}${queryString}`;
|
|
747
|
+
break;
|
|
748
|
+
case 'widgetDeploymentGet':
|
|
749
|
+
if (deploymentId == '') {
|
|
750
|
+
throw new n8n_workflow_1.ApplicationError('Deployment ID is required');
|
|
751
|
+
}
|
|
752
|
+
url += `/widgets/deployments/${deploymentId}${queryString}`;
|
|
753
|
+
break;
|
|
754
|
+
case 'widgetEntitiesList':
|
|
755
|
+
case 'widgetMultipleEntitiesPatch':
|
|
756
|
+
url += `/widgets/preferences-centers/layout-entities${queryString}`;
|
|
757
|
+
break;
|
|
758
|
+
case 'widgetEntityGet':
|
|
759
|
+
case 'widgetEntityPatch':
|
|
760
|
+
if (entityId == '') {
|
|
761
|
+
throw new n8n_workflow_1.ApplicationError('Entity ID is required');
|
|
762
|
+
}
|
|
763
|
+
url += `/widgets/preferences-centers/layout-entities/${entityId}${queryString}`;
|
|
764
|
+
break;
|
|
765
|
+
case 'widgetDelete':
|
|
766
|
+
case 'widgetGet':
|
|
767
|
+
case 'widgetPatch':
|
|
768
|
+
if (widgetId == '') {
|
|
769
|
+
throw new n8n_workflow_1.ApplicationError('Widget ID is required');
|
|
770
|
+
}
|
|
771
|
+
url += `/widgets/${widgetId}${queryString}`;
|
|
772
|
+
break;
|
|
773
|
+
case 'widgetList':
|
|
774
|
+
url += `/widgets${queryString}`;
|
|
775
|
+
break;
|
|
776
|
+
case 'widgetMultipleComponentsPatch':
|
|
777
|
+
url += `/widgets/preferences-centers/layout-components${queryString}`;
|
|
778
|
+
break;
|
|
779
|
+
case 'widgetDeploymentsList':
|
|
780
|
+
case 'widgetPublishPost':
|
|
781
|
+
url += `/widgets/deployments${queryString}`;
|
|
782
|
+
break;
|
|
783
|
+
}
|
|
784
|
+
break;
|
|
785
|
+
default:
|
|
786
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource:${resource}`);
|
|
787
|
+
}
|
|
788
|
+
const httpMethod = operation.endsWith('Delete') ? 'DELETE' :
|
|
789
|
+
operation.endsWith('Patch') ? 'PATCH' :
|
|
790
|
+
operation.endsWith('Post') ? 'POST' : 'GET';
|
|
791
|
+
const operationsWithoutBody = [
|
|
792
|
+
'complianceReportPropertyDelete',
|
|
793
|
+
'consentAndPreferenceConsentEventDelete',
|
|
794
|
+
'dataManagerPreferenceDelete',
|
|
795
|
+
'dataManagerPurposeDelete',
|
|
796
|
+
'dataManagerSelectedPreferenceDelete',
|
|
797
|
+
'dataManagerSelectedPurposeDelete',
|
|
798
|
+
'widgetDelete'
|
|
799
|
+
];
|
|
800
|
+
let body;
|
|
801
|
+
let headers = {
|
|
802
|
+
'Content-Type': 'application/json',
|
|
803
|
+
'Authorization': `Bearer ${accessToken}`
|
|
804
|
+
};
|
|
805
|
+
if (!operationsWithoutBody.includes(operation) && ['DELETE', 'PATCH', 'POST', 'PUT'].includes(httpMethod)) {
|
|
806
|
+
body = JSON.parse(requestBody);
|
|
807
|
+
}
|
|
808
|
+
let requestConf;
|
|
809
|
+
requestConf = {
|
|
810
|
+
method: httpMethod,
|
|
811
|
+
url,
|
|
812
|
+
headers,
|
|
813
|
+
...(body ? { body } : {}),
|
|
814
|
+
};
|
|
815
|
+
console.log('url : ' + url);
|
|
816
|
+
console.log('requestConf : ' + JSON.stringify(requestConf));
|
|
817
|
+
const responseData = await this.helpers.request(requestConf);
|
|
818
|
+
console.log('responseData : ' + responseData);
|
|
819
|
+
if (typeof responseData === 'string') {
|
|
820
|
+
const trimmed = responseData.trim();
|
|
821
|
+
if (trimmed !== '') {
|
|
822
|
+
try {
|
|
823
|
+
returnData.push({ json: JSON.parse(trimmed) });
|
|
824
|
+
}
|
|
825
|
+
catch (e) {
|
|
826
|
+
returnData.push({ text: trimmed });
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
returnData.push({ 'Status Code': '204 No Content' });
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
else if (responseData) {
|
|
834
|
+
returnData.push(responseData);
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
837
|
+
returnData.push({ 'Status Code': '204 No Content' });
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
catch (error) {
|
|
841
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
842
|
+
message: `Error calling Didomi API: ${error.message}`,
|
|
843
|
+
description: error.stack || 'No stack trace available'
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
return [this.helpers.returnJsonArray(returnData)];
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
exports.Didomi = Didomi;
|
|
851
|
+
//# sourceMappingURL=Didomi.node.js.map
|