Code Monkey home page Code Monkey logo

platform-client's Introduction

DEPRECATED

No Maintenance Intended

This is no longer supported, please consider using the official Coveo CLI instead.

Description

⛔️ DEPRECATED This repository contains a command line tool to perform administrative tasks in the Coveo Cloud V2 Platform. It also allows the automation of tasks that previously had to be done manually, like graduating the configuration from organizations in a different stage (e.g.: DEV, UAT, PROD).

Moving from platformclient CLI to coveo CLI.

Authentication

Unlike the platformclient CLI, the Coveo CLI supports Oauth. This means, you no longer need to enter API keys on every commands. Instead, you only need to authenticate once to the Coveo platform and the CLI will keep you authenticated as long as your API key has not expired. Otherwise, you will be asked to authenticate again.

How to authenticate with the Coveo CLI

coveo auth:login --organization=<organizationId>

Download commands

The platformclient download-<resourceType> commands have been replaced with coveo org:resources:pull --resourceTypes <resourceTypes>. Unlike the platformclient CLI, the Coveo CLI can pull all the organization resources if the --resourceTypes flag is not specified. Once you have pulled your organization resources with the coveo org:resources:pull command, you can push them to any organization.

Example

How to pull/download all the fields available in your organization.

with the platformclient CLI
platformclient download-fields [options] <origin>
with the coveo CLI
coveo org:resources:pull --resourceTypes field

Diff commands

The platformclient diff-<resourceType> commands have been replaced with coveo org:resources:preview. Once you have pulled your resources with the coveo org:resources:pull command, you can preview the changes against any organization.

Example for previewing only one resource type

with the platformclient CLI
platformclient diff-fields [options] <origin> <destination>
with the coveo CLI
coveo org:resources:preview --target <destination>

Graduate commands

The platformclient graduate-<resourceType> commands have been replaced with coveo org:resources:push. Once you have pulled your resources with the coveo org:resources:pull command, you can push the changes to any organization.

with the platformclient CLI
platformclient diff-fields [options] <origin> <destination>
with the coveo CLI
coveo org:resources:push --target <destination>

platformclient upload-

The platformclient upload-<resourceType> commands can also be replaced with coveo org:resources:push.

platform-client's People

Contributors

ancientwinds avatar dependabot[bot] avatar fdallairecoveo avatar jpdery26 avatar plavigueur avatar y-lakhdar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jmdrolet jpdery26

platform-client's Issues

Fix command.sh error on windows

On Windows, the generated command.sh triggers an error:

Error: Cannot find module 'C:\Users\xxx\Documents\project\l\UserxxxAppDataRoamingnpmnode_modulescoveo-platform-clientbinclient-global.js'

Work on logging

  • Should always be verbose, regardless of the logLevel parameter
  • Count is invalid. Sources to graduate, update or delete count does not take into account ignored sources.

Add QA environment

Currently only Dev and Prod environments are available with the option --env.

Document this in the readme.

Add whitelist option on source and extension diff/graduate

Right now, the --ignoreSources option is really confusing and not great when you only have one source to graduate/diff.

Add a --onlySources option to whitelist the sources to graduate.

2 Strategies:

  1. This option will first pull all the orgs list and do a difference.
  2. Implement a whitelist strategy

Diff and graduate system fields

Currently, only non-system fields are taken into account during the diff/graduation.
However, a system field can now be modified. This change needs to be reflected in the final organization.

Investigate on what should be the best option to graduate the system fields.

Ignore leading space in option

platformclient diff-sources org001 org002 xxxxxxxxxx -S " Source To ignore, Second Source to Ignore"

If the 2 sources do not have a leading space, they will not be found.

TODO: Ignore the leading from the command.

documentation

  • Be more specific about the environments (interactive client).
  • Add HIPAA environment but disabled.

The platform ignore the mapping ids on the source creation

New sources have new IDs after graduation (which is not the case for sources that are updated).

Result: When a source is created during a graduation, the mapping order changes and the diff detects that new source does not match its equivalent in the origin org.

Add an option to whitelist and blacklist source parameters

At this moment, the source diff have a default set of keys to whitelist and blacklist.

Add an option to override it

const includeOnly = [
        'logicalIndex',
        'mappings',
        'postConversionExtensions',
        'preConversionExtensions',
        'configuration.addressPatterns',
        'configuration.documentConfig',
        'configuration.extendedDataFiles',
        'configuration.parameters',
        'configuration.startingAddresses',
        'configuration.sourceSecurityOption',
        'configuration.permissions',
        'additionalInfos'
      ];

const keysToIgnore = [
        'configuration.parameters.SourceId',
        'configuration.parameters.OrganizationId',
        'configuration.parameters.ClientSecret',
        'configuration.parameters.ClientId',
        'configuration.parameters.IsSandbox'
      ];

graduate search pages

POST method is not working for search pages graduation.

The page should be instantiated first.

Add option to add 2 API keys

Using one master API key can be dangerous if you don't know what you are doing.

All commands should allow the user to use either one master API key or 2 specific API keys

Each command syntax should be:
command [options] <origin> <destination> <apiKey...>

Package in a script

Package in a script in order to use as a static resource in other projects =)

Remove ansi characters form log file

Make logs more readable by removing strings injected by chalk.

�[0m1 new source found�[0m |
�[0m2 updated source found�[0m |
�[0mSuccessfully loaded �[36mpushTest�[39m source from �[1m�[36mccliprodozvzoaua�[39m�[22m�[0m |
�[0m0 deleted source found�[0m |

Traces when doing downloading assets

Hi,

The ootb output of the platformclient download-extensions cmd is a list of "Successfully loaded" assets. It would be nice to have the same for platformclient download-sources and platformclient download-pages.

Thanks,
LG

Review sources comparaison logic

  • If end-user copy mappings (manage mappings -> JSON) on the source from org A and apply them on the equivalent source from org B, then run a diff-sources between org A and org B - differences will be detected on mappings which is unexpected.

  • if end-user copy mappings by editing JSON on the source directly and grab the mapping array in the main JSON of the source from org A and apply it on the equivalent source from org B, then run a diff-sources between org A and B - No differences will be detected.

Upload sources command trigger error

✖ Error occurred for dummyOrg: Unable to load sources
{
"message": "Access is denied.",
"errorCode": "ACCESS_DENIED",
"requestID": "b4762254-c3b2-4636-8969-1c16cf2ecffb"
}
✖ Graduation operation failed
Consult the logs for more information

This error should not be displayed as it is expected

Diff object to get

Make sure the order does not impact the diff (same logic as the mapping diff)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.