Skip to content

Commit

Permalink
adding v5.1 conf file
Browse files Browse the repository at this point in the history
  • Loading branch information
ivikramsahu committed Sep 2, 2020
1 parent c1389f5 commit 17fb5a7
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 46 deletions.
17 changes: 12 additions & 5 deletions lib/APIHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,20 @@ class APIHelper {

// load parameter value
const element = parameters[keys[iter]];
if (element === null) {

if (element.value === null) {
replaceValue = '';
} else if (element instanceof Array) {
replaceValue = element.map(el => encodeURIComponent(el));
replaceValue = replaceValue.join('/');
} else if (element.value instanceof Array) {
if (element.encode === true) {
replaceValue = element.value.map(el => encodeURIComponent(el));
replaceValue = replaceValue.join('/');
} else {
replaceValue = element.value.join('/');
}
} else if (element.encode === true) {
replaceValue = encodeURIComponent(element.value.toString());
} else {
replaceValue = encodeURIComponent(element.toString());
replaceValue = element.value.toString();
}
queryString = queryString.replace(`{${keys[iter]}}`, replaceValue);
}
Expand Down
42 changes: 21 additions & 21 deletions lib/ModelFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ const EmailStruct = require('../lib/Models/EmailStruct');
const Attachments = require('../lib/Models/Attachments');
const Send = require('../lib/Models/Send');
const DomainStruct = require('../lib/Models/DomainStruct');
const DeleteDomain = require('../lib/Models/DeleteDomain');
const AddEmailOrDomainToSuppressionList =
require('../lib/Models/AddEmailOrDomainToSuppressionList');
const RemoveEmailOrDomainToSuppressionList =
require('../lib/Models/RemoveEmailOrDomainToSuppressionList');
const CreateSubaccount = require('../lib/Models/CreateSubaccount');
const UpdateSubaccount = require('../lib/Models/UpdateSubaccount');
const UpdateCredisOfSubaccount = require('../lib/Models/UpdateCredisOfSubaccount');
const UpdateRecurringCredisOfSubaccount =
require('../lib/Models/UpdateRecurringCredisOfSubaccount');
const DeleteSubacoount = require('../lib/Models/DeleteSubacoount');
const EnableOrDisableSubacoount = require('../lib/Models/EnableOrDisableSubacoount');
const Deletedomain = require('../lib/Models/Deletedomain');
const AddemailordomaintoSuppressionlist =
require('../lib/Models/AddemailordomaintoSuppressionlist');
const RemoveemailordomaintoSuppressionlist =
require('../lib/Models/RemoveemailordomaintoSuppressionlist');
const Createsubaccount = require('../lib/Models/Createsubaccount');
const Updatesubaccount = require('../lib/Models/Updatesubaccount');
const UpdateCredisofsubaccount = require('../lib/Models/UpdateCredisofsubaccount');
const UpdaterecurringCredisofsubaccount =
require('../lib/Models/UpdaterecurringCredisofsubaccount');
const Deletesubacoount = require('../lib/Models/Deletesubacoount');
const Enableordisablesubacoount = require('../lib/Models/Enableordisablesubacoount');

const classMap = {
Content,
Expand All @@ -36,15 +36,15 @@ const classMap = {
Attachments,
Send,
DomainStruct,
DeleteDomain,
AddEmailOrDomainToSuppressionList,
RemoveEmailOrDomainToSuppressionList,
CreateSubaccount,
UpdateSubaccount,
UpdateCredisOfSubaccount,
UpdateRecurringCredisOfSubaccount,
DeleteSubacoount,
EnableOrDisableSubacoount,
Deletedomain,
AddemailordomaintoSuppressionlist,
RemoveemailordomaintoSuppressionlist,
Createsubaccount,
Updatesubaccount,
UpdateCredisofsubaccount,
UpdaterecurringCredisofsubaccount,
Deletesubacoount,
Enableordisablesubacoount,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const Configuration = {
// The base Uri for API calls
BASEURI: 'https://api.pepipost.com/v5',
BASEURI: 'https://api.pepipost.com/v5.1',

// Your Pepipost API Key. You will find the api key in the Pepipost application in Integrations.
apiKey: '',
Expand Down
45 changes: 26 additions & 19 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const SubaccountsController = require('./Controllers/SubaccountsController');
const SubaccountsDeleteController = require('./Controllers/SubaccountsDeleteController');
const SubaccountsGetSubAccountsController =
require('./Controllers/SubaccountsGetSubAccountsController');
const SubaccountsGetcreditddetailsController =
require('./Controllers/SubaccountsGetcreditddetailsController');
const SetrecurringcreditddetailsController =
require('./Controllers/SetrecurringcreditddetailsController');
const SubaccountsSetsubaccountcreditController =
Expand All @@ -24,6 +26,8 @@ const SubaccountsCreateSubaccountController =
require('./Controllers/SubaccountsCreateSubaccountController');
const SuppressionController = require('./Controllers/SuppressionController');
const DomainDeleteController = require('./Controllers/DomainDeleteController');
const DomainGetDomainsController = require('./Controllers/DomainGetDomainsController');
const TemplateController = require('./Controllers/TemplateController');
const DomainController = require('./Controllers/DomainController');
const Content = require('./Models/Content');
const Personalizations = require('./Models/Personalizations');
Expand All @@ -34,16 +38,16 @@ const TypeEnum = require('./Models/TypeEnum');
const Attachments = require('./Models/Attachments');
const Send = require('./Models/Send');
const DomainStruct = require('./Models/DomainStruct');
const DeleteDomain = require('./Models/DeleteDomain');
const AddEmailOrDomainToSuppressionList = require('./Models/AddEmailOrDomainToSuppressionList');
const RemoveEmailOrDomainToSuppressionList =
require('./Models/RemoveEmailOrDomainToSuppressionList');
const CreateSubaccount = require('./Models/CreateSubaccount');
const UpdateSubaccount = require('./Models/UpdateSubaccount');
const UpdateCredisOfSubaccount = require('./Models/UpdateCredisOfSubaccount');
const UpdateRecurringCredisOfSubaccount = require('./Models/UpdateRecurringCredisOfSubaccount');
const DeleteSubacoount = require('./Models/DeleteSubacoount');
const EnableOrDisableSubacoount = require('./Models/EnableOrDisableSubacoount');
const Deletedomain = require('./Models/Deletedomain');
const AddemailordomaintoSuppressionlist = require('./Models/AddemailordomaintoSuppressionlist');
const RemoveemailordomaintoSuppressionlist =
require('./Models/RemoveemailordomaintoSuppressionlist');
const Createsubaccount = require('./Models/Createsubaccount');
const Updatesubaccount = require('./Models/Updatesubaccount');
const UpdateCredisofsubaccount = require('./Models/UpdateCredisofsubaccount');
const UpdaterecurringCredisofsubaccount = require('./Models/UpdaterecurringCredisofsubaccount');
const Deletesubacoount = require('./Models/Deletesubacoount');
const Enableordisablesubacoount = require('./Models/Enableordisablesubacoount');
const ActionEnum = require('./Models/ActionEnum');
const AggregatedByEnum = require('./Models/AggregatedByEnum');
const EventsEnum = require('./Models/EventsEnum');
Expand All @@ -62,12 +66,15 @@ const initializer = {
SubaccountsController,
SubaccountsDeleteController,
SubaccountsGetSubAccountsController,
SubaccountsGetcreditddetailsController,
SetrecurringcreditddetailsController,
SubaccountsSetsubaccountcreditController,
SubaccountsUpdateSubaccountController,
SubaccountsCreateSubaccountController,
SuppressionController,
DomainDeleteController,
DomainGetDomainsController,
TemplateController,
DomainController,
// models of PepipostLib
Content,
Expand All @@ -79,15 +86,15 @@ const initializer = {
Attachments,
Send,
DomainStruct,
DeleteDomain,
AddEmailOrDomainToSuppressionList,
RemoveEmailOrDomainToSuppressionList,
CreateSubaccount,
UpdateSubaccount,
UpdateCredisOfSubaccount,
UpdateRecurringCredisOfSubaccount,
DeleteSubacoount,
EnableOrDisableSubacoount,
Deletedomain,
AddemailordomaintoSuppressionlist,
RemoveemailordomaintoSuppressionlist,
Createsubaccount,
Updatesubaccount,
UpdateCredisofsubaccount,
UpdaterecurringCredisofsubaccount,
Deletesubacoount,
Enableordisablesubacoount,
ActionEnum,
AggregatedByEnum,
EventsEnum,
Expand Down

0 comments on commit 17fb5a7

Please sign in to comment.