Skip to content

fix: Change base urls (box/box-codegen#491) #199

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

Merged
merged 2 commits into from
May 17, 2024
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
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "3eadef2", "specHash": "6c3dd22", "version": "0.5.4" }
{ "engineHash": "fa753d5", "specHash": "6c3dd22", "version": "0.5.4" }
4 changes: 2 additions & 2 deletions docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Calling the `client.withCustomBaseUrls()` method creates a new client, leaving t

```js
const newClient = client.withCustomBaseUrls({
baseUrl: 'https://api.box.com/2.0',
uploadUrl: 'https://upload.box.com/api/2.0',
baseUrl: 'https://api.box.com',
uploadUrl: 'https://upload.box.com/api',
oauth2Url: 'https://account.box.com/api/oauth2',
});
```
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions src/managers/ai.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class AiManager {
readonly [key: string]: string;
} = prepareParams({ ...{}, ...headers.extraHeaders });
const response: FetchResponse = (await fetch(
''.concat(this.networkSession.baseUrls.baseUrl, '/ai/ask') as string,
''.concat(this.networkSession.baseUrls.baseUrl, '/2.0/ai/ask') as string,
{
method: 'POST',
headers: headersMap,
Expand Down Expand Up @@ -163,7 +163,10 @@ export class AiManager {
readonly [key: string]: string;
} = prepareParams({ ...{}, ...headers.extraHeaders });
const response: FetchResponse = (await fetch(
''.concat(this.networkSession.baseUrls.baseUrl, '/ai/text_gen') as string,
''.concat(
this.networkSession.baseUrls.baseUrl,
'/2.0/ai/text_gen'
) as string,
{
method: 'POST',
headers: headersMap,
Expand Down
15 changes: 12 additions & 3 deletions src/managers/authorization.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ export class AuthorizationManager {
readonly [key: string]: string;
} = prepareParams({ ...{}, ...headers.extraHeaders });
const response: FetchResponse = (await fetch(
''.concat('https://api.box.com/oauth2/token') as string,
''.concat(
this.networkSession.baseUrls.baseUrl,
'/oauth2/token'
) as string,
{
method: 'POST',
headers: headersMap,
Expand Down Expand Up @@ -312,7 +315,10 @@ export class AuthorizationManager {
readonly [key: string]: string;
} = prepareParams({ ...{}, ...headers.extraHeaders });
const response: FetchResponse = (await fetch(
''.concat('https://api.box.com/oauth2/token#refresh') as string,
''.concat(
this.networkSession.baseUrls.baseUrl,
'/oauth2/token#refresh'
) as string,
{
method: 'POST',
headers: headersMap,
Expand Down Expand Up @@ -341,7 +347,10 @@ export class AuthorizationManager {
readonly [key: string]: string;
} = prepareParams({ ...{}, ...headers.extraHeaders });
const response: FetchResponse = (await fetch(
''.concat('https://api.box.com/oauth2/revoke') as string,
''.concat(
this.networkSession.baseUrls.baseUrl,
'/oauth2/revoke'
) as string,
{
method: 'POST',
headers: headersMap,
Expand Down
6 changes: 3 additions & 3 deletions src/managers/avatars.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class AvatarsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/users/',
'/2.0/users/',
toString(userId) as string,
'/avatar'
) as string,
Expand Down Expand Up @@ -212,7 +212,7 @@ export class AvatarsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/users/',
'/2.0/users/',
toString(userId) as string,
'/avatar'
) as string,
Expand Down Expand Up @@ -252,7 +252,7 @@ export class AvatarsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/users/',
'/2.0/users/',
toString(userId) as string,
'/avatar'
) as string,
Expand Down
14 changes: 7 additions & 7 deletions src/managers/chunkedUploads.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ export class ChunkedUploadsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.uploadUrl,
'/files/upload_sessions'
'/2.0/files/upload_sessions'
) as string,
{
method: 'POST',
Expand Down Expand Up @@ -484,7 +484,7 @@ export class ChunkedUploadsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.uploadUrl,
'/files/',
'/2.0/files/',
toString(fileId) as string,
'/upload_sessions'
) as string,
Expand Down Expand Up @@ -520,7 +520,7 @@ export class ChunkedUploadsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.uploadUrl,
'/files/upload_sessions/',
'/2.0/files/upload_sessions/',
toString(uploadSessionId) as string
) as string,
{
Expand Down Expand Up @@ -561,7 +561,7 @@ export class ChunkedUploadsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.uploadUrl,
'/files/upload_sessions/',
'/2.0/files/upload_sessions/',
toString(uploadSessionId) as string
) as string,
{
Expand Down Expand Up @@ -594,7 +594,7 @@ export class ChunkedUploadsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.uploadUrl,
'/files/upload_sessions/',
'/2.0/files/upload_sessions/',
toString(uploadSessionId) as string
) as string,
{
Expand Down Expand Up @@ -633,7 +633,7 @@ export class ChunkedUploadsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.uploadUrl,
'/files/upload_sessions/',
'/2.0/files/upload_sessions/',
toString(uploadSessionId) as string,
'/parts'
) as string,
Expand Down Expand Up @@ -680,7 +680,7 @@ export class ChunkedUploadsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.uploadUrl,
'/files/upload_sessions/',
'/2.0/files/upload_sessions/',
toString(uploadSessionId) as string,
'/commit'
) as string,
Expand Down
8 changes: 4 additions & 4 deletions src/managers/classifications.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ export class ClassificationsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema'
'/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema'
) as string,
{
method: 'GET',
Expand Down Expand Up @@ -441,7 +441,7 @@ export class ClassificationsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#add'
'/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#add'
) as string,
{
method: 'PUT',
Expand Down Expand Up @@ -475,7 +475,7 @@ export class ClassificationsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#update'
'/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#update'
) as string,
{
method: 'PUT',
Expand Down Expand Up @@ -518,7 +518,7 @@ export class ClassificationsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/metadata_templates/schema#classifications'
'/2.0/metadata_templates/schema#classifications'
) as string,
{
method: 'POST',
Expand Down
8 changes: 4 additions & 4 deletions src/managers/collaborationAllowlistEntries.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export class CollaborationAllowlistEntriesManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collaboration_whitelist_entries'
'/2.0/collaboration_whitelist_entries'
) as string,
{
method: 'GET',
Expand Down Expand Up @@ -278,7 +278,7 @@ export class CollaborationAllowlistEntriesManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collaboration_whitelist_entries'
'/2.0/collaboration_whitelist_entries'
) as string,
{
method: 'POST',
Expand Down Expand Up @@ -312,7 +312,7 @@ export class CollaborationAllowlistEntriesManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collaboration_whitelist_entries/',
'/2.0/collaboration_whitelist_entries/',
toString(collaborationWhitelistEntryId) as string
) as string,
{
Expand Down Expand Up @@ -343,7 +343,7 @@ export class CollaborationAllowlistEntriesManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collaboration_whitelist_entries/',
'/2.0/collaboration_whitelist_entries/',
toString(collaborationWhitelistEntryId) as string
) as string,
{
Expand Down
8 changes: 4 additions & 4 deletions src/managers/collaborationAllowlistExemptTargets.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class CollaborationAllowlistExemptTargetsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collaboration_whitelist_exempt_targets'
'/2.0/collaboration_whitelist_exempt_targets'
) as string,
{
method: 'GET',
Expand Down Expand Up @@ -299,7 +299,7 @@ export class CollaborationAllowlistExemptTargetsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collaboration_whitelist_exempt_targets'
'/2.0/collaboration_whitelist_exempt_targets'
) as string,
{
method: 'POST',
Expand Down Expand Up @@ -333,7 +333,7 @@ export class CollaborationAllowlistExemptTargetsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collaboration_whitelist_exempt_targets/',
'/2.0/collaboration_whitelist_exempt_targets/',
toString(collaborationWhitelistExemptTargetId) as string
) as string,
{
Expand Down Expand Up @@ -364,7 +364,7 @@ export class CollaborationAllowlistExemptTargetsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collaboration_whitelist_exempt_targets/',
'/2.0/collaboration_whitelist_exempt_targets/',
toString(collaborationWhitelistExemptTargetId) as string
) as string,
{
Expand Down
7 changes: 5 additions & 2 deletions src/managers/collections.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ export class CollectionsManager {
readonly [key: string]: string;
} = prepareParams({ ...{}, ...headers.extraHeaders });
const response: FetchResponse = (await fetch(
''.concat(this.networkSession.baseUrls.baseUrl, '/collections') as string,
''.concat(
this.networkSession.baseUrls.baseUrl,
'/2.0/collections'
) as string,
{
method: 'GET',
params: queryParamsMap,
Expand Down Expand Up @@ -188,7 +191,7 @@ export class CollectionsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/collections/',
'/2.0/collections/',
toString(collectionId) as string,
'/items'
) as string,
Expand Down
13 changes: 8 additions & 5 deletions src/managers/comments.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export class CommentsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/files/',
'/2.0/files/',
toString(fileId) as string,
'/comments'
) as string,
Expand Down Expand Up @@ -399,7 +399,7 @@ export class CommentsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/comments/',
'/2.0/comments/',
toString(commentId) as string
) as string,
{
Expand Down Expand Up @@ -442,7 +442,7 @@ export class CommentsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/comments/',
'/2.0/comments/',
toString(commentId) as string
) as string,
{
Expand Down Expand Up @@ -476,7 +476,7 @@ export class CommentsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/comments/',
'/2.0/comments/',
toString(commentId) as string
) as string,
{
Expand Down Expand Up @@ -513,7 +513,10 @@ export class CommentsManager {
readonly [key: string]: string;
} = prepareParams({ ...{}, ...headers.extraHeaders });
const response: FetchResponse = (await fetch(
''.concat(this.networkSession.baseUrls.baseUrl, '/comments') as string,
''.concat(
this.networkSession.baseUrls.baseUrl,
'/2.0/comments'
) as string,
{
method: 'POST',
params: queryParamsMap,
Expand Down
6 changes: 3 additions & 3 deletions src/managers/devicePinners.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class DevicePinnersManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/device_pinners/',
'/2.0/device_pinners/',
toString(devicePinnerId) as string
) as string,
{
Expand Down Expand Up @@ -246,7 +246,7 @@ export class DevicePinnersManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/device_pinners/',
'/2.0/device_pinners/',
toString(devicePinnerId) as string
) as string,
{
Expand Down Expand Up @@ -286,7 +286,7 @@ export class DevicePinnersManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/enterprises/',
'/2.0/enterprises/',
toString(enterpriseId) as string,
'/device_pinners'
) as string,
Expand Down
2 changes: 1 addition & 1 deletion src/managers/downloads.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class DownloadsManager {
const response: FetchResponse = (await fetch(
''.concat(
this.networkSession.baseUrls.baseUrl,
'/files/',
'/2.0/files/',
toString(fileId) as string,
'/content'
) as string,
Expand Down
Loading
Loading