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

Update the graph SDK and include 'me'-endpoint #6519

Merged
merged 1 commit into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/enhancement-update-graph-sdk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Update the graph SDK

We've updated the graph SDK to include the "me"-endpoint.

https://github.com/owncloud/web/pull/6519
96 changes: 95 additions & 1 deletion packages/web-client/src/generated/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Libre Graph API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v0.10.0
* The version of the OpenAPI document: v0.11.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -2906,6 +2906,100 @@ export class MeDrivesApi extends BaseAPI {
}


/**
* MeUserApi - axios parameter creator
* @export
*/
export const MeUserApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
meGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/me`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};

/**
* MeUserApi - functional programming interface
* @export
*/
export const MeUserApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = MeUserApiAxiosParamCreator(configuration)
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async meGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.meGet(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

/**
* MeUserApi - factory interface
* @export
*/
export const MeUserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = MeUserApiFp(configuration)
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
meGet(options?: any): AxiosPromise<User> {
return localVarFp.meGet(options).then((request) => request(axios, basePath));
},
};
};

/**
* MeUserApi - object-oriented interface
* @export
* @class MeUserApi
* @extends {BaseAPI}
*/
export class MeUserApi extends BaseAPI {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof MeUserApi
*/
public meGet(options?: AxiosRequestConfig) {
return MeUserApiFp(this.configuration).meGet(options).then((request) => request(this.axios, this.basePath));
}
}


/**
* UserApi - axios parameter creator
* @export
Expand Down
2 changes: 1 addition & 1 deletion packages/web-client/src/generated/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Libre Graph API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v0.10.0
* The version of the OpenAPI document: v0.11.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion packages/web-client/src/generated/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Libre Graph API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v0.10.0
* The version of the OpenAPI document: v0.11.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion packages/web-client/src/generated/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Libre Graph API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v0.10.0
* The version of the OpenAPI document: v0.11.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion packages/web-client/src/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Libre Graph API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v0.10.0
* The version of the OpenAPI document: v0.11.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
8 changes: 6 additions & 2 deletions packages/web-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
DrivesApiFactory,
CollectionOfDrives,
UserApiFactory,
User
User,
MeUserApiFactory
} from './generated'

export interface Graph {
Expand All @@ -19,6 +20,7 @@ export interface Graph {
}
users: {
getUser: (userId: string) => AxiosPromise<User>
getMe: () => AxiosPromise<User>
}
}

Expand All @@ -29,6 +31,7 @@ const graph = (baseURI: string, axiosClient: AxiosInstance): Graph => {
})

const meDrivesApi = new MeDrivesApi(config, config.basePath, axiosClient)
const meUserApiFactory = MeUserApiFactory(config, config.basePath, axiosClient)
const userApiFactory = UserApiFactory(config, config.basePath, axiosClient)
const drivesApiFactory = DrivesApiFactory(config, config.basePath, axiosClient)

Expand All @@ -45,7 +48,8 @@ const graph = (baseURI: string, axiosClient: AxiosInstance): Graph => {
drivesApiFactory.deleteDrive(id, ifMatch, options)
},
users: {
getUser: (userId: string) => userApiFactory.getUser(userId)
getUser: (userId: string) => userApiFactory.getUser(userId),
getMe: () => meUserApiFactory.meGet()
}
}
}
Expand Down