Skip to content

Commit

Permalink
Merge pull request #1353 from Accenture/feature/1270-add-method-repla…
Browse files Browse the repository at this point in the history
…cereference-to-findreplace-contentblockbyx-with-one-of-the-other-options

Feature/1270 add method replaceReference to find & replace contentBlockByX with one of the other options
  • Loading branch information
JoernBerkefeld committed Jun 7, 2024
2 parents bef1914 + dd97295 commit c59b169
Show file tree
Hide file tree
Showing 95 changed files with 4,062 additions and 371 deletions.
52 changes: 38 additions & 14 deletions @types/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type SoapRequestParams = import('../types/mcdev.d.js').SoapRequestParams;
export type TemplateMap = import('../types/mcdev.d.js').TemplateMap;
export type TypeKeyCombo = import('../types/mcdev.d.js').TypeKeyCombo;
export type ExplainType = import('../types/mcdev.d.js').ExplainType;
export type ContentBlockConversionTypes = import('../types/mcdev.d.js').ContentBlockConversionTypes;
/**
* @typedef {import('../types/mcdev.d.js').BuObject} BuObject
* @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract
Expand All @@ -34,6 +35,7 @@ export type ExplainType = import('../types/mcdev.d.js').ExplainType;
* @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap
* @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo
* @typedef {import('../types/mcdev.d.js').ExplainType} ExplainType
* @typedef {import('../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes
*/
/**
* main class
Expand Down Expand Up @@ -103,7 +105,7 @@ declare class Mcdev {
/**
* helper to show an off-the-logs message to users
*/
static "__#6@#welcomeMessage"(): void;
static "__#7@#welcomeMessage"(): void;
/**
* Retrieve all metadata from the specified business unit into the local file system.
*
Expand All @@ -124,7 +126,7 @@ declare class Mcdev {
* @param {boolean} [changelogOnly] skip saving, only create json in memory
* @returns {Promise.<object>} ensure that BUs are worked on sequentially
*/
static "__#6@#retrieveBU"(cred: string, bu: string, selectedTypesArr?: string[] | TypeKeyCombo, keys?: string[], changelogOnly?: boolean): Promise<object>;
static "__#7@#retrieveBU"(cred: string, bu: string, selectedTypesArr?: string[] | TypeKeyCombo, keys?: string[], changelogOnly?: boolean): Promise<object>;
/**
* Deploys all metadata located in the 'deploy' directory to the specified business unit
*
Expand Down Expand Up @@ -229,21 +231,21 @@ declare class Mcdev {
*
* @param {string} businessUnit references credentials from properties.json
* @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type
* @param {string[]} keyArr customerkey of the metadata
* @param {string[] | undefined} keyArr customerkey of the metadata
* @param {string} market market localizations
* @returns {Promise.<MultiMetadataTypeList>} -
*/
static buildTemplate(businessUnit: string, selectedTypes: string | TypeKeyCombo, keyArr: string[], market: string): Promise<MultiMetadataTypeList>;
static buildTemplate(businessUnit: string, selectedTypes: string | TypeKeyCombo, keyArr: string[] | undefined, market: string): Promise<MultiMetadataTypeList>;
/**
* Build a specific metadata file based on a template.
*
* @param {string} businessUnit references credentials from properties.json
* @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type
* @param {string[]} nameArr name of the metadata
* @param {string[] | undefined} nameArr name of the metadata
* @param {string} market market localizations
* @returns {Promise.<MultiMetadataTypeList>} -
*/
static buildDefinition(businessUnit: string, selectedTypes: string | TypeKeyCombo, nameArr: string[], market: string): Promise<MultiMetadataTypeList>;
static buildDefinition(businessUnit: string, selectedTypes: string | TypeKeyCombo, nameArr: string[] | undefined, market: string): Promise<MultiMetadataTypeList>;
/**
* Build a specific metadata file based on a template using a list of bu-market combos
*
Expand Down Expand Up @@ -294,6 +296,18 @@ declare class Mcdev {
static pause(businessUnit: string, selectedType?: string, keys?: string[]): Promise<{
[x: string]: string[];
}>;
/**
* Updates the key to match the name field
*
* @param {string} businessUnit name of BU
* @param {TypeKeyCombo|undefined} selectedTypesArr limit retrieval to given metadata type
* @param {ContentBlockConversionTypes} to what to replace with
* @param {ContentBlockConversionTypes[]} [fromList] what to replace
* @returns {Promise.<Object.<string, object>>} key1: business unit name, key2:type value: list of fixed item keys
*/
static replaceCbReference(businessUnit: string, selectedTypesArr: TypeKeyCombo | undefined, to: ContentBlockConversionTypes, fromList?: ContentBlockConversionTypes[]): Promise<{
[x: string]: object;
}>;
/**
* Updates the key to match the name field
*
Expand All @@ -308,34 +322,44 @@ declare class Mcdev {
/**
* run a method across BUs
*
* @param {'execute'|'pause'|'fixKeys'} methodName what to run
* @param {'execute'|'pause'|'fixKeys'|'replaceCbReference'} methodName what to run
* @param {string} businessUnit name of BU
* @param {string} [selectedType] limit to given metadata types
* @param {string[]} [keys] customerkey of the metadata
* @returns {Promise.<Object.<string, string[]>>} key: business unit name, value: list of affected item keys
*/
static "__#6@#runMethod"(methodName: 'execute' | 'pause' | 'fixKeys', businessUnit: string, selectedType?: string, keys?: string[]): Promise<{
static "__#7@#runMethod"(methodName: 'execute' | 'pause' | 'fixKeys' | 'replaceCbReference', businessUnit: string, selectedType?: string, keys?: string[]): Promise<{
[x: string]: string[];
}>;
/**
* helper for Mcdev.#runMethod
*
* @param {'execute'|'pause'|'fixKeys'} methodName what to run
* @param {'execute'|'pause'|'fixKeys'|'replaceCbReference'} methodName what to run
* @param {string} cred name of Credential
* @param {string} bu name of BU
* @param {string} [type] limit execution to given metadata type
* @param {string[]} [keyArr] customerkey of the metadata
* @returns {Promise.<string[]>} list of keys that were affected
*/
static "__#6@#runOnBU"(methodName: 'execute' | 'pause' | 'fixKeys', cred: string, bu: string, type?: string, keyArr?: string[]): Promise<string[]>;
static "__#7@#runOnBU"(methodName: 'execute' | 'pause' | 'fixKeys' | 'replaceCbReference', cred: string, bu: string, type?: string, keyArr?: string[]): Promise<string[]>;
/**
* helper for Mcdev.#runOnBU
*
* @param {string} selectedType limit execution to given metadata type
* @param {BuObject} buObject properties for auth
* @returns {Promise.<string[]>} keyArr
*/
static "__#6@#retrieveKeysWithLike"(selectedType: string, buObject: BuObject): Promise<string[]>;
static "__#7@#retrieveKeysWithLike"(selectedType: string, buObject: BuObject): Promise<string[]>;
/**
* Updates the key to match the name field
*
* @param {string} cred name of Credential
* @param {string} bu name of BU
* @param {string} type limit execution to given metadata type
* @param {string[]} [keyArr] customerkey of the metadata
* @returns {Promise.<string[]>} list of keys that were affected
*/
static "__#7@#fixKeys"(cred: string, bu: string, type: string, keyArr?: string[]): Promise<string[]>;
/**
* Updates the key to match the name field
*
Expand All @@ -345,15 +369,15 @@ declare class Mcdev {
* @param {string[]} [keyArr] customerkey of the metadata
* @returns {Promise.<string[]>} list of keys that were affected
*/
static "__#6@#fixKeys"(cred: string, bu: string, type: string, keyArr?: string[]): Promise<string[]>;
static "__#7@#replaceCbReference"(cred: string, bu: string, type: string, keyArr?: string[]): Promise<string[]>;
/**
* helper to convert CSVs into an array. if only one value was given, it's also returned as an array
*
* @param {string|string[]} metadataOption potentially comma-separated value or null
* @param {string|string[]|undefined} metadataOption potentially comma-separated value or null
* @param {string[]} [allowedIdentifiers] 'key', 'id', 'name'
* @param {boolean} [firstOnly] removes all but the first entry if enabled
* @returns {TypeKeyCombo} values split into an array.
*/
static metadataToTypeKey(metadataOption: string | string[], allowedIdentifiers?: string[], firstOnly?: boolean): TypeKeyCombo;
static metadataToTypeKey(metadataOption: string | string[] | undefined, allowedIdentifiers?: string[], firstOnly?: boolean): TypeKeyCombo;
}
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion @types/lib/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c59b169

Please sign in to comment.