Commit Graph

373 Commits

Author SHA1 Message Date
Sebastian Thiel
cc1bfd19c8 chore(api-versionup): to reflect recent changes
And to be sure we don't forget to publish new crates when the new CLI
hits the road.
2015-04-30 11:41:53 +02:00
Sebastian Thiel
d46c083975 fix(API): remove unused std_misc feature
Hopefully this will not trigger errors elsewhere, but we will
just find out I guess ;)
2015-04-30 11:18:58 +02:00
Sebastian Thiel
4115d50ca7 fix(API): adjust to latest hyper header macros 2015-04-30 11:15:48 +02:00
Sebastian Thiel
a2547b3321 Merge branch 'clap' 2015-04-30 10:21:51 +02:00
Sebastian Thiel
d0ce221ba3 fix(clap):re-introduce UploadProtocol,fix CallType
* CallType now represents either Upload or Standard calls, whereas
  the Upload variant is represented by the UploadProtocol enum.
  That way it's clear what happens, and we don't mix orthogonal concepts
  in one enumeration just for convenience.

All tested APIs seem to build, verified

* upload
* download
* request structures
* parameters
* scopes
* config-dir
* debug[-auth]

Fixes #81
2015-04-30 10:20:02 +02:00
Sebastian Thiel
b039b38244 fix(clap): update docs and fix calltype handling
* mkdoc docs grammar is now hierarchical, making the command structure
  more obvious and easier to understand. It's a nice addition to the
  auto-generated, hierachical usage of clap.
* UploadProtocol enum is now CallType, to ease handling the different
  ways the Call has to be executed. It looks quite clean, even though
  combining upload protocols and the calltype is a bit hacky.
2015-04-30 10:05:55 +02:00
Sebastian Thiel
7a38f7e4d5 fix(clap): various fixes and improvements
* `--version` now includes the API revision we embody
  (using crate_version())
* Allow multiple scopes to be specified, instead of just one. Previously
  this was problemantic due to argument parsing of docopt being greedy.
  However, this also means we have to specify the `-r` flag for each
  invocation. See https://github.com/kbknapp/clap-rs/issues/89 .
* Adapted to new signature of `Arg::possible_values()` and used the
  previously orphaned `UploadProtocol` enum.
* Deduplicated code a little by adding the new `opt_values()` generator
  function.

 Related to #81
2015-04-30 09:03:11 +02:00
Sebastian Thiel
63e23dd48f fix(clap): print usage if command is missing
Also, fixed config-dir substitution in flag's help message
2015-04-29 22:08:47 +02:00
Sebastian Thiel
5320a48e68 fix(clap): tweaks to make youtube3 work
Mainly minor cleanup, and handling of generator branches that
didn't show up in smaller APIs that were used during the first steps.

related to #81
2015-04-29 21:59:06 +02:00
Sebastian Thiel
bac4e1a82f fix(clap): adjust option usage to changed API
Discovery API now builds and seems to work even ! More testing
will have to be done though to be sure.

Related #81
2015-04-29 21:04:50 +02:00
Sebastian Thiel
feaa3a06ed fix(clap): handle apis without media upload
We are annotating the type of the optional protocols if that shall be
required.
2015-04-29 19:48:45 +02:00
Sebastian Thiel
02a4129662 fix(clap): call iter() directly
As IntoIter is only implemented for slices up a sice of 32.
DFAReporting though will reach 55, at least.

Also added dfareporting-cli code to show how stackoverflow issues can be
circumvented efficiently.
2015-04-29 19:32:04 +02:00
Sebastian Thiel
656fcae2b4 feat(clap): implement -u as good as possible
We can't have the `-u <mode> <file> <mime>` style yet, but
https://github.com/kbknapp/clap-rs/issues/88 might help with that
at some point.

Related to #92 and #81
2015-04-29 18:36:39 +02:00
Sebastian Thiel
1aff3135d9 fix(clap): commit before un-using UploadProtocol
We will try to wait for https://github.com/kbknapp/clap-rs/issues/87
to allow us to use the enumeration instead of strings, as well as
an iterator, which will look more idiomatic in the end.
2015-04-29 17:16:50 +02:00
Sebastian Thiel
db4624b467 feat(clap): parse structure and build App
We are currently setting everything up at runtime, and manage to get
nearly all information into it, except for the more complex
`-u (simple|resumable) <file> <mime>` flag.

Fixes #87
Related to #81
2015-04-29 16:49:02 +02:00
Sebastian Thiel
8ac8d3b1cb fix(clap): generate command data structure
We do this in the hopes to circumvent a stack overflow.
This means we will setup the parser entirely at runtime, which actually
saves a little bit of code.
2015-04-29 10:56:10 +02:00
Sebastian Thiel
9a8ae4b7d6 fix(clap): upload some code to help debugging
We get a stack-overflow when trying to run the dfa-reporting program,
and right now I don't know how to workaround it.

This could be preventing us from using clap.
2015-04-29 09:07:14 +02:00
Sebastian Thiel
b39bc3a9cd feat(clap): initial version of command generation
It compiles and works, even though there are many things we want to
improve.

One big question is how to define multi-arguments, like -u foo bar baz.
2015-04-28 19:34:24 +02:00
Sebastian Thiel
988d37f0df feat(clap): setup infrastructure
This allows us to setup clap and see if it compiles, which is the prime
goal of the current workflow step.

Related to #81
2015-04-28 16:33:16 +02:00
Sebastian Thiel
57808cf92a fix(compat): make it work with latest hyper
This is known to work with the master of hyper. It's probably OK
to keep it, preparing for the next release and under the assupmtion
that I will not be releasing binaries for a while.
2015-04-28 10:10:45 +02:00
Sebastian Thiel
4f98fc175e docs(CLI): visual gap between cursor and kv
Previously, the space was barely visible, confusing even myself :).
Now it's clear, using 4 spaces, that there is a cursor invocation
followed by a key-value pair.
2015-04-27 16:14:34 +02:00
Sebastian Thiel
12743f543d docs(CLI): add link to general documentation
[skip ci]
2015-04-27 07:54:12 +02:00
Sebastian Thiel
36513f101e feat(deploy): simple linux deployment script
It's made for a linux machine, not for docker
2015-04-26 17:10:13 +00:00
Sebastian Thiel
6f5c159916 docs(API): request values are moved, not borrowed
[skip ci]
2015-04-26 19:08:35 +02:00
Sebastian Thiel
c248301951 feat(deploy): simple osx deploy script
* added simple script to build tar archive with all debug/release
  binaries.
* slightly improved docker script, even though it would need additional
  work. For now, I use the cloud VM anyway
2015-04-26 19:08:01 +02:00
Sebastian Thiel
de85fb43e5 fix(API): exclude cloudsearch from build
It doesn't have a single method, and thus is useless
2015-04-26 16:06:28 +02:00
Sebastian Thiel
c2dd9c7a02 fix(version-up): code updated to v0.1.6, latest CLI
* also includes publishing tag files
api-v0.1.6 cli-v0.1.0
2015-04-26 13:42:31 +02:00
Sebastian Thiel
4e275eaadd fix(version-up): CLI + API release preps 2015-04-26 11:22:56 +02:00
Sebastian Thiel
944e04bd12 docs(CLI): filled README.md
All possible documentation was added in a quality sufficient for
a first release. After all, everything there is is documented.

Fixes #50
2015-04-26 11:22:28 +02:00
Sebastian Thiel
607ba745d1 fix(lib): update changed url crate imports 2015-04-26 10:00:04 +02:00
Sebastian Thiel
fbec9bdbba docs(index): integrate different program types
* put program type inforamtion into shared.yaml to allow accessing it
  from the index.html.mako template.

Fixes #51
2015-04-26 09:42:01 +02:00
Sebastian Thiel
b6a48bdcd5 fix(CLI): request value cursor handling and docs
* now the cursor will only be set permanently if the -r flag is used in
  'cursor' mode. In 'cursor=value' mode, the cursor change doesn't
  persist among the flags. That way, one can easily distinguish
  between setting the cursor, and setting a field. However,
  '...sublevel.level=value' will still work as it did previously, yet
  the cursor change will not persist.
* Documentation was adjusted to represent the new cursor style.

Fixes #86
2015-04-26 07:58:59 +02:00
Sebastian Thiel
2f3b2d24ce fix(CLI): simple and resumable upload works
* fixed boundary syntax of multi-part message. Was --BOUNDARY, now is
  --BOUNDARY--
* Fixed ContentRange parsing and serialization. We actually managed
  to break it last time we tried to update it to match the Go
  implementation.
* fixed uploadType header parameter. It's based on chosen protocol and
  whether or not the method supports multipart operation for the given
  protocol.

Related to #76
2015-04-25 18:45:37 +02:00
Sebastian Thiel
0bb30da782 fix(CLI): use only one request structure
This works as we can just put all request-structure parsing to the top
of the function.
That way, we don't put the request struture twice.
2015-04-25 13:32:03 +02:00
Sebastian Thiel
be7ccb085c fix(CLI): set request value to call
Previously, even though the request was passed by reference, it was
copied and thus our changes never arrived in the call.

Now the API makes this clear by taking ownership, and the CLI code
sets the Request value lateron, explicitly.

Related to #76
2015-04-25 13:25:00 +02:00
Sebastian Thiel
6befdbc6fa fix(CLI): verified download works
* implement custom scopes - previously they could be set, but were
  ignored during the API call
* api-overrides are not yaml files for convenience. Existing ones were
  updated as needed.

Fixes #75
2015-04-25 11:35:39 +02:00
Sebastian Thiel
a328942033 feat(API): improved error handling
We are now able to decode detailed errors and pass them on. This allows
the CLI to provide more useful error responses.
Additionally, the CLI will only print debug responses in --debug mode.

Fixes #82
2015-04-25 09:49:57 +02:00
Sebastian Thiel
f8689be451 fix(all): update all code to latest version
* add new APIs
* remove old ones
* add latest json files
2015-04-24 20:07:12 +02:00
Sebastian Thiel
845a568b25 fix(CLI): response value json decoding
* updated all json API descriptions
* enabled 'pretty' printing of response structures. However, currently
  there is no way to get rid of all the NULL fields without external
  filtering
* all structure fields are now optional - there seems to be no way
  around it.

Fixes #73
2015-04-24 16:00:27 +02:00
Sebastian Thiel
e42f6fbedb feat(CLI): per-API-credentials with default
That way, we can provide better service, as CLIs that consume a lot of
quota can easily have their own app credentials, and with it, their
own quota.

The fallback will be a project that allows to use all possible
google APIs.

The user can always put in his own application secret to use his own
quota or even paid services.

Fixes #80
2015-04-24 10:52:43 +02:00
Sebastian Thiel
6d84ef906e fix(token-storage): implement deletion of tokens
Previously this case was entirely uncovered.
Interesting note: when a token is revoked, existing auth-tokens will
still work. However, you may not refresh them in case permissions
have been revoked. It's good as there is only one code-path to deal
with (and we verified it to be working), and bad for the user as
malicious software can keep using an account for certain time until
the token expires.

Fixes #79
2015-04-24 09:37:48 +02:00
Sebastian Thiel
e523ddb6ec fix(API): adapt to changed yup-oauth2 API
The latter changed a lot, to the better, and we handle the new
return types accordingly.

Related to #74
2015-04-23 17:07:28 +02:00
Sebastian Thiel
797f289886 fix(CLI): resolve generator issues
* exclude dataflow API - it doesn't have a single method as long as
  it's in B4. See https://github.com/Byron/google-apis-rs/issues/78
* assure ARRAY branch can be hit

Fixes #77
2015-04-22 11:41:50 +02:00
Sebastian Thiel
b830c1c6de feat(CLI): hashmap handling
* with native support for type conversion and error handling
* improved hash-map key-value parsing to at least state that it knows
  it's dealing with a hashmap. Error text is still not what it should
  be because we don't know at runtime (initially) what type we handle.

Fixes #68
Related to #77
2015-04-22 11:09:50 +02:00
Sebastian Thiel
c14ef9afc8 feat(CLI): repeated required args
* Seem to work for docopt, mkdocs and code itself
* mkdocs now show type of required params
* some code which deals with converting elements to their
  target types is totally untested right now.

Related to #77
2015-04-22 10:28:13 +02:00
Sebastian Thiel
a4b73cc1c4 fix(travis): update make target
Also, generate CLI. Probably there is not enough time to build it.
2015-04-21 15:30:57 +02:00
Sebastian Thiel
03f35bd4f5 feat(CLI): --debug-auth flag
* Allow to see all authentication related communication, similar to
  --debug flag otherwise.
* fixed broken generator when handling request value parsing.

Fixes #70
2015-04-21 12:18:50 +02:00
Sebastian Thiel
159c65916f feat(CLI): --debug flag to output traffix
* If `--debug` is set, we will output all server communication to
  stderr. That way, we can compare our requests to what is expected by
  ush based on official docs.
* `discovery` now doesn't use the API key anymore - this is specified
   using a custom override.

Nice, we are totally ready to test and fix all API features.

Related to #70
2015-04-21 12:03:58 +02:00
Sebastian Thiel
f7740ad149 refactor(engine): request-value parsing;Default
* Default::default() optimized to use T::default() if possible
* deduplicated special type handling ('Count' strings -> int64)
* put request value parsing into own private function

Fixes #69
[skip ci]
2015-04-21 11:00:40 +02:00
Sebastian Thiel
52c8225b8f Merge branch 'docker' 2015-04-20 17:05:52 +02:00