-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy path_sfB2CClientIDUpdate.js
More file actions
32 lines (28 loc) · 1.17 KB
/
_sfB2CClientIDUpdate.js
File metadata and controls
32 lines (28 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* eslint-disable max-len */
'use strict';
// Initialize required modules
const sObjectAPIs = require('../../lib/apis/sfdc/sObject');
/**
* @function _sfB2CClientIDUpdate
* @description Attempts to update / reset the seed B2CClientID record used by the Salesforce Platform
*
* @param {connection} authConnection Represents the connection that should be used to perform the getQuery
* @param {Object} environmentDef Represents the already-validated environment details to use when performing the actions
* @param {String} recordId represents the Salesforce B2C Client ID recordID value to update
* @returns {Promise} Returns the B2CClientID record creation results
*/
module.exports = (authConnection, environmentDef, recordId) => {
// Attempt to create the B2C ClientID record
return sObjectAPIs.update(
authConnection,
'B2C_Client_ID__c',
{
Id: recordId,
Name: environmentDef.b2cClientId,
JWT_Certificate_Name__c: environmentDef.sfCertDeveloperName,
Is_Active__c: true,
Audit_Authentication_API_Interactions__c: true,
B2C_Client_ID_Label__c: 'Default B2C ClientID'
}
);
};