scolladon / sfdc-generate-package

generate package.xml from source
MIT License
25 stars 23 forks source link

Retrieving metadata.js from Salesforce Metadata API #35

Open ArielS1 opened 4 years ago

ArielS1 commented 4 years ago

Hi,

I would like to consult with you about a change i want to make. The idea is to run the metadata API each time to retrieve the version specific metadata so it will be future proof without having to update metadata.js manually in the repository each version release.

The user will have to input in the cli a username and password of an org (any org, since the metadata api result will be the same for every org) and build the metadata.js in memory instead of using metadata.js repository file.

The problem is that i guess not every company will be willing to make a callout from this package, or to input their org credentials.

So there are few options:

  1. Force everybody to work with metadata API to use this package (my favorite)
  2. Build some NodeJS app that will run on heroku/Google Cloud Functuin with a Trailhead Playground org credentials and the package will send a request to that endpoint and receive the metadata of a specific version, this way companies won't have to use their org credentials, but they will be allowed to choose if to use our endpoint or the real metadata api.
  3. use option 1 or 2 and still maintaining the metadata.js manually for companies that will still want to work offline with this package

Please tell me what is your preferred work of action and i'll try to implement. If you would like to discuss further about it, you can get my email from Ben Bozou.

Best regards,

Ariel

scolladon commented 4 years ago

Hello,

Very good point. I think in the future, the best would be to use source format. This package generation tool could be refactored using a sfdx plugin. This way it will be able to benefit from the sfdx project connection and retrieve the metadata version of the target sandbox (and so deal with preview easily).

Another way is to use the vs code extension. I don't know how it is done

ArielS1 commented 4 years ago

But still not everybody use this package with a UI or with VS code and it should also support cli auth using a username and password, this is what i specificly need anyway. and if needed the auth method can be extended to support sfdx, certificate or whatever