From 7ea0cd0cbe2c665a6569e47e29864ab5321d1f93 Mon Sep 17 00:00:00 2001 From: aaronsinclair Date: Mon, 24 May 2021 12:38:52 +1200 Subject: [PATCH 1/6] Update composer.json update guzzle version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1e26202..194b7e9 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "woganmay/domo-php", "description": "Use Domo.com APIs with PHP", "require": { - "guzzlehttp/guzzle": "6.3.0", + "guzzlehttp/guzzle": "^6.3.0", "ext-curl": "*" }, "license": "MIT", From 4aaa227efb09752da6ed1ff9cb4bb58433eb8702 Mon Sep 17 00:00:00 2001 From: aaronsinclair Date: Mon, 24 May 2021 12:45:23 +1200 Subject: [PATCH 2/6] Update composer.json new package name --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 194b7e9..08c47ce 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "woganmay/domo-php", + "name": "aaronsinclair/domo-php-fork", "description": "Use Domo.com APIs with PHP", "require": { "guzzlehttp/guzzle": "^6.3.0", @@ -14,7 +14,7 @@ ], "autoload": { "psr-4": { - "WoganMay\\DomoPHP\\": "src/" + "aaronsinclair\\DomoPHP\\": "src/" } } } From aa0959d4d7d96b00acd0bab5321974ce3d7c665e Mon Sep 17 00:00:00 2001 From: aaronsinclair Date: Mon, 24 May 2021 12:48:40 +1200 Subject: [PATCH 3/6] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 08c47ce..41e3eb9 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "aaronsinclair/domo-php-fork", "description": "Use Domo.com APIs with PHP", "require": { - "guzzlehttp/guzzle": "^6.3.0", + "guzzlehttp/guzzle": "^7.0.1", "ext-curl": "*" }, "license": "MIT", From cbd5ca16ad09c0464f4eafc3a8644f71c23d786e Mon Sep 17 00:00:00 2001 From: aaronsinclair Date: Mon, 24 May 2021 12:55:05 +1200 Subject: [PATCH 4/6] Delete composer.lock --- composer.lock | 251 -------------------------------------------------- 1 file changed, 251 deletions(-) delete mode 100644 composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 71e6647..0000000 --- a/composer.lock +++ /dev/null @@ -1,251 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "1ede81c32d9b56c1c4c859f45e2d7d1e", - "packages": [ - { - "name": "guzzlehttp/guzzle", - "version": "6.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2017-06-22T18:50:49+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20T17:10:46+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "ext-curl": "*" - }, - "platform-dev": [] -} From b4a0e6736ed0b23dab7494ed84e656532c6707cc Mon Sep 17 00:00:00 2001 From: aaronsinclair Date: Mon, 24 May 2021 13:18:47 +1200 Subject: [PATCH 5/6] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 41e3eb9..1e17bb7 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ ], "autoload": { "psr-4": { - "aaronsinclair\\DomoPHP\\": "src/" + "WoganMay\\DomoPHP\\": "src/" } } } From 09ce01952d5be046cc8c5654631ccfe71fccf8a1 Mon Sep 17 00:00:00 2001 From: aaronsinclair Date: Wed, 21 Jul 2021 16:25:28 +1200 Subject: [PATCH 6/6] added getMetaData function --- src/API/DataSet.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/API/DataSet.php b/src/API/DataSet.php index 0c6c868..77494de 100644 --- a/src/API/DataSet.php +++ b/src/API/DataSet.php @@ -152,6 +152,41 @@ public function importDataSet($id, $csv) return $response->getStatusCode() == 204; } + + /** + * Get Meta Data. + * + * @param string $id The GUID to export + * + * @return string The metadata content + * @throws \Exception + * @throws \GuzzleHttp\Exception\GuzzleException + */ + public function getMetaData($id) + { + $url = "/v1/datasets/query/execute/$id"; + $body = [ + 'sql' => "SELECT * FROM table limit 1" + ]; + + try + { + $response = $this->Client->postJSON('/v1/datasets/query/execute/' . $id , $body); + unset($response->rows); + unset($response->numRows); + foreach ($response->columns as $key => $r) { + + $response->metadata[$key]->columnName = $r; + } + return $response->metadata; + } + catch(\GuzzleHttp\Exception\ClientException $ex) + { + throw new \Exception($ex->getMessage()); + } + + + } /** * @param $id string The DataSet GUID