Skip to content

Commit dc20e59

Browse files
authored
Merge pull request #8 from gotchazipc/master
removed obsolute rename operation
2 parents 172f350 + 75a22d3 commit dc20e59

File tree

10 files changed

+14
-249
lines changed

10 files changed

+14
-249
lines changed

README-API.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This SDK Contains automatically generated sources & documents with the [Swagger
44

55
- API version: 0.3.0
66
- Package version: 0.3.0
7-
- Build date: 2016-07-10T23:35:06.325+09:00
7+
- Build date: 2016-07-11T14:35:38.260+09:00
88
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
99

1010
## Getting Started
@@ -58,7 +58,6 @@ Class | Method | HTTP request | Description
5858
*WebidaRestfulApi.WfsApi* | [**move**](docs/WfsApi.md#move) | **POST** /wfs/{wfsId}/any/{wfsPath} |
5959
*WebidaRestfulApi.WfsApi* | [**readFile**](docs/WfsApi.md#readFile) | **GET** /wfs/{wfsId}/file/{wfsPath} |
6060
*WebidaRestfulApi.WfsApi* | [**remove**](docs/WfsApi.md#remove) | **DELETE** /wfs/{wfsId}/any/{wfsPath} |
61-
*WebidaRestfulApi.WfsApi* | [**rename**](docs/WfsApi.md#rename) | **POST** /wfs/{wfsId}/file/{wfsPath} |
6261
*WebidaRestfulApi.WfsApi* | [**stat**](docs/WfsApi.md#stat) | **GET** /wfs/{wfsId}/any/{wfsPath} |
6362
*WebidaRestfulApi.WfsApi* | [**writeFile**](docs/WfsApi.md#writeFile) | **PUT** /wfs/{wfsId}/file/{wfsPath} |
6463
*WebidaRestfulApi.WorkspaceApi* | [**cancel**](docs/WorkspaceApi.md#cancel) | **DELETE** /workspaces/{workspaceId}/exec |

api-bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api-spec/swagger.json

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,9 @@
481481
"type" : "string",
482482
"pattern" : ".*"
483483
}, {
484-
"name" : "unrecursive",
484+
"name" : "noRecursive",
485485
"in" : "query",
486-
"description" : "if set, deleting non-empty directory will return error.",
486+
"description" : "if set, deleting non-empty directory will return 409 error.",
487487
"required" : false,
488488
"type" : "boolean",
489489
"default" : false
@@ -628,62 +628,6 @@
628628
} ],
629629
"x-handler" : "handlers/wfs/readFile.js"
630630
},
631-
"post" : {
632-
"tags" : [ "wfs" ],
633-
"description" : "Renames a file or directory to wfsPath. Unlike POSIX rename() call semantics, this operation\ndoes not overwrite anything. Renaming to any 'existing' source will return error except\nonly 1 case, with emulateMove option.\n",
634-
"operationId" : "rename",
635-
"parameters" : [ {
636-
"name" : "wfsId",
637-
"in" : "path",
638-
"description" : "webida file system id (same to workspace id) to access.",
639-
"required" : true,
640-
"type" : "string"
641-
}, {
642-
"name" : "wfsPath",
643-
"in" : "path",
644-
"description" : "webida file system path to access. without heading /. should be placed at the end of path arguments\n",
645-
"required" : true,
646-
"type" : "string",
647-
"pattern" : ".*"
648-
}, {
649-
"name" : "srcPath",
650-
"in" : "query",
651-
"description" : "source data path of some operations, with have heading /",
652-
"required" : true,
653-
"type" : "string"
654-
}, {
655-
"name" : "ensureParents",
656-
"in" : "query",
657-
"description" : "A flag to create all parent directories to create file or dir, like mkdir -p. This parameter\ndoes not create entire path, but creates to 'parent directory' of the path.\n",
658-
"required" : false,
659-
"type" : "boolean",
660-
"default" : false
661-
}, {
662-
"name" : "emulateMove",
663-
"in" : "query",
664-
"description" : "When rename file to existing dir, move file to the dir instead of returning error.\nThis option is provided for legacy, dummy clients only to emulate legacy server's\nmove behaviour. Newly written client app should not use this option & use move()\noperation to have clear behaviour.\n",
665-
"required" : false,
666-
"type" : "boolean"
667-
} ],
668-
"responses" : {
669-
"200" : {
670-
"description" : "OK",
671-
"schema" : {
672-
"$ref" : "#/definitions/RestOK"
673-
}
674-
},
675-
"default" : {
676-
"description" : "Error",
677-
"schema" : {
678-
"$ref" : "#/definitions/RestError"
679-
}
680-
}
681-
},
682-
"security" : [ {
683-
"webida-simple-auth" : [ ]
684-
} ],
685-
"x-handler" : "handlers/wfs/rename.js"
686-
},
687631
"put" : {
688632
"tags" : [ "wfs" ],
689633
"description" : "Creates / updates file with body data. Server should write the file in 'atomic' manner,\nand should not write down request body into final destination path directly. In other words,\nwheather writeFile() succeeds or not, the contents of the file should not be corrupted nor\nhalf-written.\n",

api-spec/swagger.yaml

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -227,42 +227,6 @@ paths:
227227
schema:
228228
$ref: "#/definitions/RestError"
229229

230-
# rename
231-
post:
232-
x-handler: handlers/wfs/rename.js
233-
tags: ["wfs"]
234-
description: |
235-
Renames a file or directory to wfsPath. Unlike POSIX rename() call semantics, this operation
236-
does not overwrite anything. Renaming to any 'existing' source will return error except
237-
only 1 case, with emulateMove option.
238-
operationId: rename
239-
security:
240-
- webida-simple-auth: []
241-
parameters:
242-
- $ref: "#/parameters/wfsId"
243-
- $ref: "#/parameters/wfsPath"
244-
- $ref: "#/parameters/srcPath"
245-
- $ref: "#/parameters/ensureParents"
246-
- name: emulateMove
247-
in: query
248-
description: |
249-
When rename file to existing dir, move file to the dir instead of returning error.
250-
This option is provided for legacy, dummy clients only to emulate legacy server's
251-
move behaviour. Newly written client app should not use this option & use move()
252-
operation to have clear behaviour.
253-
required: false
254-
type: boolean
255-
responses:
256-
"200":
257-
description: OK
258-
schema:
259-
$ref: "#/definitions/RestOK"
260-
default:
261-
description: Error
262-
schema:
263-
$ref: "#/definitions/RestError"
264-
265-
266230
/wfs/{wfsId}/dir/{wfsPath}:
267231
# dirTree
268232
get:
@@ -451,10 +415,10 @@ paths:
451415
parameters:
452416
- $ref: "#/parameters/wfsId"
453417
- $ref: "#/parameters/wfsPath"
454-
- name: unrecursive
418+
- name: noRecursive
455419
in: query
456420
required: false
457-
description: if set, deleting non-empty directory will return error.
421+
description: if set, deleting non-empty directory will return 409 error.
458422
type: boolean
459423
default: false
460424
responses:
@@ -467,7 +431,6 @@ paths:
467431
schema:
468432
$ref: "#/definitions/RestError"
469433

470-
471434
# search
472435
/wfs/{wfsId}/ops/search/{wfsPath}:
473436
get:

builder/templates/package.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webida-restful-api",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Webida Restful API Spec & generated clients",
55
"license": "Apache-2.0",
66
"main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js",

docs/WfsApi.md

Lines changed: 3 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Method | HTTP request | Description
1010
[**move**](WfsApi.md#move) | **POST** /wfs/{wfsId}/any/{wfsPath} |
1111
[**readFile**](WfsApi.md#readFile) | **GET** /wfs/{wfsId}/file/{wfsPath} |
1212
[**remove**](WfsApi.md#remove) | **DELETE** /wfs/{wfsId}/any/{wfsPath} |
13-
[**rename**](WfsApi.md#rename) | **POST** /wfs/{wfsId}/file/{wfsPath} |
1413
[**stat**](WfsApi.md#stat) | **GET** /wfs/{wfsId}/any/{wfsPath} |
1514
[**writeFile**](WfsApi.md#writeFile) | **PUT** /wfs/{wfsId}/file/{wfsPath} |
1615

@@ -342,7 +341,7 @@ var wfsId = "wfsId_example"; // String | webida file system id (same to workspac
342341
var wfsPath = "wfsPath_example"; // String | webida file system path to access. without heading /. should be placed at the end of path arguments
343342

344343
var opts = {
345-
'unrecursive': false // Boolean | if set, deleting non-empty directory will return error.
344+
'noRecursive': false // Boolean | if set, deleting non-empty directory will return 409 error.
346345
};
347346

348347
var callback = function(error, data, response) {
@@ -361,72 +360,7 @@ Name | Type | Description | Notes
361360
------------- | ------------- | ------------- | -------------
362361
**wfsId** | **String**| webida file system id (same to workspace id) to access. |
363362
**wfsPath** | **String**| webida file system path to access. without heading /. should be placed at the end of path arguments |
364-
**unrecursive** | **Boolean**| if set, deleting non-empty directory will return error. | [optional] [default to false]
365-
366-
### Return type
367-
368-
[**RestOK**](RestOK.md)
369-
370-
### Authorization
371-
372-
[webida-simple-auth](../README.md#webida-simple-auth)
373-
374-
### HTTP request headers
375-
376-
- **Content-Type**: application/json
377-
- **Accept**: application/json, application/octet-stream
378-
379-
<a name="rename"></a>
380-
# **rename**
381-
> RestOK rename(wfsId, wfsPath, srcPath, opts)
382-
383-
384-
385-
Renames a file or directory to wfsPath. Unlike POSIX rename() call semantics, this operation does not overwrite anything. Renaming to any &#39;existing&#39; source will return error except only 1 case, with emulateMove option.
386-
387-
### Example
388-
```javascript
389-
var WebidaRestfulApi = require('webida_restful_api');
390-
var defaultClient = WebidaRestfulApi.ApiClient.default;
391-
392-
// Configure API key authorization: webida-simple-auth
393-
var webida-simple-auth = defaultClient.authentications['webida-simple-auth'];
394-
webida-simple-auth.apiKey = 'YOUR API KEY';
395-
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
396-
//webida-simple-auth.apiKeyPrefix = 'Token';
397-
398-
var apiInstance = new WebidaRestfulApi.WfsApi();
399-
400-
var wfsId = "wfsId_example"; // String | webida file system id (same to workspace id) to access.
401-
402-
var wfsPath = "wfsPath_example"; // String | webida file system path to access. without heading /. should be placed at the end of path arguments
403-
404-
var srcPath = "srcPath_example"; // String | source data path of some operations, with have heading /
405-
406-
var opts = {
407-
'ensureParents': false, // Boolean | A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to 'parent directory' of the path.
408-
'emulateMove': true // Boolean | When rename file to existing dir, move file to the dir instead of returning error. This option is provided for legacy, dummy clients only to emulate legacy server's move behaviour. Newly written client app should not use this option & use move() operation to have clear behaviour.
409-
};
410-
411-
var callback = function(error, data, response) {
412-
if (error) {
413-
console.error(error);
414-
} else {
415-
console.log('API called successfully. Returned data: ' + data);
416-
}
417-
};
418-
apiInstance.rename(wfsId, wfsPath, srcPath, opts, callback);
419-
```
420-
421-
### Parameters
422-
423-
Name | Type | Description | Notes
424-
------------- | ------------- | ------------- | -------------
425-
**wfsId** | **String**| webida file system id (same to workspace id) to access. |
426-
**wfsPath** | **String**| webida file system path to access. without heading /. should be placed at the end of path arguments |
427-
**srcPath** | **String**| source data path of some operations, with have heading / |
428-
**ensureParents** | **Boolean**| A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to &#39;parent directory&#39; of the path. | [optional] [default to false]
429-
**emulateMove** | **Boolean**| When rename file to existing dir, move file to the dir instead of returning error. This option is provided for legacy, dummy clients only to emulate legacy server&#39;s move behaviour. Newly written client app should not use this option &amp; use move() operation to have clear behaviour. | [optional]
363+
**noRecursive** | **Boolean**| if set, deleting non-empty directory will return 409 error. | [optional] [default to false]
430364

431365
### Return type
432366

@@ -529,7 +463,7 @@ var wfsPath = "wfsPath_example"; // String | webida file system path to access.
529463
var data = "/path/to/file.txt"; // File | file contents to write.
530464

531465
var opts = {
532-
'ensureParents': false, // Boolean | A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to 'parent directory' of the path.
466+
'ensureParents': false // Boolean | A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to 'parent directory' of the path.
533467
};
534468

535469
var callback = function(error, data, response) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webida-restful-api",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Webida Restful API Spec & generated clients",
55
"license": "Apache-2.0",
66
"main": "src/index.js",

src/api/WfsApi.js

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@
362362
* @param {String} wfsId webida file system id (same to workspace id) to access.
363363
* @param {String} wfsPath webida file system path to access. without heading /. should be placed at the end of path arguments
364364
* @param {Object} opts Optional parameters
365-
* @param {Boolean} opts.unrecursive if set, deleting non-empty directory will return error. (default to false)
365+
* @param {Boolean} opts.noRecursive if set, deleting non-empty directory will return 409 error. (default to false)
366366
* @param {module:api/WfsApi~removeCallback} callback The callback function, accepting three arguments: error, data, response
367367
* data is of type: {module:model/RestOK}
368368
*/
@@ -386,7 +386,7 @@
386386
'wfsPath': wfsPath
387387
};
388388
var queryParams = {
389-
'unrecursive': opts['unrecursive']
389+
'noRecursive': opts['noRecursive']
390390
};
391391
var headerParams = {
392392
};
@@ -405,71 +405,6 @@
405405
);
406406
}
407407

408-
/**
409-
* Callback function to receive the result of the rename operation.
410-
* @callback module:api/WfsApi~renameCallback
411-
* @param {String} error Error message, if any.
412-
* @param {module:model/RestOK} data The data returned by the service call.
413-
* @param {String} response The complete HTTP response.
414-
*/
415-
416-
/**
417-
* Renames a file or directory to wfsPath. Unlike POSIX rename() call semantics, this operation does not overwrite anything. Renaming to any &#39;existing&#39; source will return error except only 1 case, with emulateMove option.
418-
* @param {String} wfsId webida file system id (same to workspace id) to access.
419-
* @param {String} wfsPath webida file system path to access. without heading /. should be placed at the end of path arguments
420-
* @param {String} srcPath source data path of some operations, with have heading /
421-
* @param {Object} opts Optional parameters
422-
* @param {Boolean} opts.ensureParents A flag to create all parent directories to create file or dir, like mkdir -p. This parameter does not create entire path, but creates to &#39;parent directory&#39; of the path. (default to false)
423-
* @param {Boolean} opts.emulateMove When rename file to existing dir, move file to the dir instead of returning error. This option is provided for legacy, dummy clients only to emulate legacy server&#39;s move behaviour. Newly written client app should not use this option &amp; use move() operation to have clear behaviour.
424-
* @param {module:api/WfsApi~renameCallback} callback The callback function, accepting three arguments: error, data, response
425-
* data is of type: {module:model/RestOK}
426-
*/
427-
this.rename = function(wfsId, wfsPath, srcPath, opts, callback) {
428-
opts = opts || {};
429-
var postBody = null;
430-
431-
// verify the required parameter 'wfsId' is set
432-
if (wfsId == undefined || wfsId == null) {
433-
throw "Missing the required parameter 'wfsId' when calling rename";
434-
}
435-
436-
// verify the required parameter 'wfsPath' is set
437-
if (wfsPath == undefined || wfsPath == null) {
438-
throw "Missing the required parameter 'wfsPath' when calling rename";
439-
}
440-
441-
// verify the required parameter 'srcPath' is set
442-
if (srcPath == undefined || srcPath == null) {
443-
throw "Missing the required parameter 'srcPath' when calling rename";
444-
}
445-
446-
447-
var pathParams = {
448-
'wfsId': wfsId,
449-
'wfsPath': wfsPath
450-
};
451-
var queryParams = {
452-
'srcPath': srcPath,
453-
'ensureParents': opts['ensureParents'],
454-
'emulateMove': opts['emulateMove']
455-
};
456-
var headerParams = {
457-
};
458-
var formParams = {
459-
};
460-
461-
var authNames = ['webida-simple-auth'];
462-
var contentTypes = ['application/json'];
463-
var accepts = ['application/json', 'application/octet-stream'];
464-
var returnType = RestOK;
465-
466-
return this.apiClient.callApi(
467-
'/wfs/{wfsId}/file/{wfsPath}', 'POST',
468-
pathParams, queryParams, headerParams, formParams, postBody,
469-
authNames, contentTypes, accepts, returnType, callback
470-
);
471-
}
472-
473408
/**
474409
* Callback function to receive the result of the stat operation.
475410
* @callback module:api/WfsApi~statCallback

test/api/WfsApi.spec.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,6 @@
119119
done();
120120
});
121121
});
122-
describe('rename', function() {
123-
it('should call rename successfully', function(done) {
124-
//uncomment below and update the code to test rename
125-
//instance.rename(pet, function(error) {
126-
// if (error) throw error;
127-
//expect().to.be();
128-
//});
129-
done();
130-
});
131-
});
132122
describe('stat', function() {
133123
it('should call stat successfully', function(done) {
134124
//uncomment below and update the code to test stat

0 commit comments

Comments
 (0)