Skip to content

Commit

Permalink
fix(uploads): removing private (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
boxman0617 authored Feb 5, 2021
1 parent 5f49058 commit 4503284
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
2 changes: 0 additions & 2 deletions docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@ See the [corresponding HTTP service documentation][218].
Limited to 32 characters (only `-` and `_` special characters allowed; limit does not include username).
- `config.url` **[string][201]** HTTPS URL of the S3 object provided by [`createUploadCredentials`][39]
- `config.name` **[string][201]?** The name of the tileset. Limited to 64 characters.
- `config.private` **[boolean][202]** A boolean that describes whether the tileset must be used with an access token from your Mapbox account. Default is true. (optional, default `true`)

#### Examples

Expand All @@ -683,7 +682,6 @@ uploadsClient.createUpload({
tileset: `${myUsername}.${myTileset}`,
url: credentials.url,
name: 'my uploads name',
private: true
})
.send()
.then(response => {
Expand Down
12 changes: 4 additions & 8 deletions services/__tests__/uploads.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ describe('createUpload', () => {
uploads.createUpload({
tileset: 'username.nameoftileset',
url: 'http://{bucket}.s3.amazonaws.com/{key}',
name: 'dusty_devote',
private: false
name: 'dusty_devote'
});

expect(tu.requestConfig(uploads)).toEqual({
Expand All @@ -45,8 +44,7 @@ describe('createUpload', () => {
body: {
tileset: 'username.nameoftileset',
url: 'http://{bucket}.s3.amazonaws.com/{key}',
name: 'dusty_devote',
private: false
name: 'dusty_devote'
}
});
});
Expand All @@ -63,8 +61,7 @@ describe('createUpload', () => {
body: {
tileset: 'username.nameoftileset',
url: 'http://{bucket}.s3.amazonaws.com/{key}',
name: 'disty_devote',
private: true
name: 'disty_devote'
}
});
});
Expand All @@ -82,8 +79,7 @@ describe('createUpload', () => {
body: {
tileset: 'tilted_towers',
url: 'http://{bucket}.s3.amazonaws.com/{key}',
name: 'dusty_devote',
private: true
name: 'dusty_devote'
}
});
});
Expand Down
9 changes: 1 addition & 8 deletions services/uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ Uploads.createUploadCredentials = function() {
* Limited to 32 characters (only `-` and `_` special characters allowed; limit does not include username).
* @param {string} config.url - HTTPS URL of the S3 object provided by [`createUploadCredentials`](#createuploadcredentials)
* @param {string} [config.name] - The name of the tileset. Limited to 64 characters.
* @param {boolean} [config.private=true] - A boolean that describes whether the tileset must be used with an access token from your Mapbox account. Default is true.
* @return {MapiRequest}
*
* @example
Expand All @@ -105,7 +104,6 @@ Uploads.createUploadCredentials = function() {
* tileset: `${myUsername}.${myTileset}`,
* url: credentials.url,
* name: 'my uploads name',
* private: true
* })
* .send()
* .then(response => {
Expand All @@ -117,7 +115,6 @@ Uploads.createUpload = function(config) {
url: v.required(v.string),
tileset: v.string,
name: v.string,
private: v.boolean,
mapId: v.string,
tilesetName: v.string
})(config);
Expand All @@ -140,14 +137,10 @@ Uploads.createUpload = function(config) {
config.name = config.tilesetName;
}

if (config.private !== false) {
config.private = true;
}

return this.client.createRequest({
method: 'POST',
path: '/uploads/v1/:ownerId',
body: pick(config, ['tileset', 'url', 'name', 'private'])
body: pick(config, ['tileset', 'url', 'name'])
});
};

Expand Down

0 comments on commit 4503284

Please sign in to comment.