Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Configuration object to allow for more APIs (such as Search API) #139

Closed
AleksandrRogov opened this issue Mar 25, 2023 · 0 comments
Assignees
Labels
v2 The issue is a task for v2 development
Milestone

Comments

@AleksandrRogov
Copy link
Owner

AleksandrRogov commented Mar 25, 2023

Configuration object for DynamicsWebApi needs to be rewritten to allow for configuration of Dataverse Search API.

webApiUrl and webApiVersion must be removed and marked as deprecated in v1. #136

The following properties should be added to a configuration object:

Property Name Type Description
dataApi ApiConfig Configuration object for Dataverse Web API. The name is based on the url path data.
searchApi ApiConfig Configuration object for Dataverse Search API. The name is based on the url path search
serverUrl String The url to Dataverse API server, for example: https://contoso.api.crm.dynamics.com/

dataApi and searchApi should implement ApiConfig interface that has the following properties:

Property Name Type Description
path String A path to API, for example: "data" or "search"
version String API Version, for example: "1.0" or "9.2"

Each API configuration will have a default path and version:

dataApi

{
    path: "data",
    version: "9.2"
}

searchApi

{
    path: "search",
    version: "1.0"
}

Default configuration values will allow developers to omit initialization of all configuration properties if not needed. For example:

new DynamicsWebApi({
    serverUrl: "https://contoso.api.crm.dynamics.com/"
});

//requests to Data API will go to https://contoso.api.crm.dynamics.com/api/data/v9.2/
//requests to Search API will go to https://contoso.api.crm.dynamics.com/api/search/v1.0/

new DynamicsWebApi({
    serverUrl: "https://contoso.api.crm.dynamics.com/",
    dataApi: {
        version: "9.1"
    }
});

//requests to Data API will go to https://contoso.api.crm.dynamics.com/api/data/v9.1/
//requests to Search API will go to https://contoso.api.crm.dynamics.com/api/search/v1.0/

new DynamicsWebApi({
    serverUrl: "https://contoso.api.crm.dynamics.com/",
    searchApi: {
        path: "future-search"
    }
});

//requests to Data API will go to https://contoso.api.crm.dynamics.com/api/data/v9.2/
//requests to Search API will go to https://contoso.api.crm.dynamics.com/api/future-search/v1.0/

//and so on...
@AleksandrRogov AleksandrRogov converted this from a draft issue Mar 25, 2023
@AleksandrRogov AleksandrRogov self-assigned this Mar 25, 2023
@AleksandrRogov AleksandrRogov added this to the v2 milestone Mar 25, 2023
@AleksandrRogov AleksandrRogov added the v2 The issue is a task for v2 development label Mar 25, 2023
This was referenced Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 The issue is a task for v2 development
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant