Giter Club home page Giter Club logo

scormcloud-api-v2-client-php's People

Contributors

cojohnson1999 avatar dillgromble avatar jtennies10 avatar mjschuetze102 avatar tedwards avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scormcloud-api-v2-client-php's Issues

Cannot update the new version of the package

Method CourseApi::createUploadAndImportCourseJobWithHttpInfo() accepts bool param $may_create_new_version but ApiClient::callApi() method converts 'true' bool value to int '1'. API method only accepts boolean values. It does not recognizes mayCreateNewVersion passed as int.

Here is an example of the request:

[DEBUG] HTTP Request body BEGIN
Array
(
[file] => CURLFile Object
(
[name] => /tmp/phpxNLAFV
[mime] =>
[postname] =>
)

)

END

  • Trying 54.230.31.111:443...
  • TCP_NODELAY set
  • Connected to cloud.scorm.com (54.230.31.111) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/certs/ca-certificates.crt
    CApath: /etc/ssl/certs
  • SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
  • ALPN, server accepted to use h2
  • Server certificate:
  • subject: CN=cloud.scorm.com
  • start date: Jan 8 00:00:00 2021 GMT
  • expire date: Feb 5 23:59:59 2022 GMT
  • subjectAltName: host "cloud.scorm.com" matched cert's "cloud.scorm.com"
  • issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
  • SSL certificate verify ok.
  • Using HTTP2, server supports multi-use
  • Connection state changed (HTTP/2 confirmed)
  • Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  • Using Stream ID: 1 (easy handle 0x55e2ab9d9150)

POST /api/v2//courses/importJobs/upload?courseId=any_course_id&mayCreateNewVersion=1 HTTP/2
Host: cloud.scorm.com
user-agent: Swagger-Codegen/1.0.0/php
accept: application/json
authorization: Basic basic_token_auth
content-length: 411332
content-type: multipart/form-data; boundary=------------------------6fcc904db869c4fd

  • Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
  • We are completely uploaded and fine
    < HTTP/2 409
    < content-type: application/json
    < content-length: 115
    < date: Mon, 18 Oct 2021 20:47:25 GMT
    < server: Apache
    < cache-control: no-cache, no-store
    < pragma: no-cache
    < expires: -1
    < access-control-allow-origin: *
    < access-control-allow-credentials: true
    < access-control-allow-headers: origin, content-type, accept, authorization, uploadedContentType
    < access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
    < x-xss-protection: 1; mode=block
    < x-cache: Error from cloudfront
    < via: 1.1 4d912df0fbfee070703a7e2b8fa4ff68.cloudfront.net (CloudFront)
    < x-amz-cf-pop: ATL56-C3
    < x-amz-cf-id: Lsfsdfwv 23g==
    <
  • Connection #0 to host cloud.scorm.com left intact
    [DEBUG] HTTP Response body BEGIN
    {"error":"Course [any_course_id] already exists in app [app_id] and new version creation was not requested."}
    END

cannot install with composer

Hello,

I created a totally new project to test this and my composer.json looks like this:

{
    "name": "hese/composer-test",
    "authors": [
        {
            "name": "Hesesses",
        }
    ],
    "repositories": [
	    {
	      "type": "git",
	      "url": "https://github.com/RusticiSoftware/scormcloud-api-v2-client-php.git"
	    }
	  ],
	  "require": {
	    "RusticiSoftware/scormcloud-api-v2-client-php": "*@dev"
	  }
}

and running composer install gives:

composer install
Deprecation warning: require.RusticiSoftware/scormcloud-api-v2-client-php is invalid, it should not contain uppercase characters. Please use rusticisoftware/scormcloud-api-v2-client-php instead. Make sure you fix this as Composer 2.0 will error.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package rusticisoftware/scormcloud-api-v2-client-php could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

I had this working week ago, but I tried to update the package. Update didnt work and I tried to delete the whole package and install it again, but it wont install.

Any ideas?

Boolean query parameters converting to integer value, API not returning desired response

The SCORM Cloud API seems to not accept integer values where it expects a true/false value.

Take the /courses endpoint for example. Requesting a list of all courses using the getCourses method, there are 2 parameters include_registration_count and include_course_metadata that have the parameter values set as boolean.

If I call the method

/**
 * 7th parameter is include registration count
 */
$course->getCourses( null, null, null, null, null, null, true, false );

I expect the registration count to be present in the response, however it is not. This is because when the query URL is built, it is using the PHP http_build_query function which converts boolean values to integer, thus making the request:

https://cloud.scorm.com/api/v2/courses?includeRegistrationCount=1

This will not return the registration count in the response.

Instead you must use the value true as a string:
$course->getCourses( null, null, null, null, null, null, 'true', false );

Which will then generate the request URL:

https://cloud.scorm.com/api/v2/courses?includeRegistrationCount=true

This has not been tested on other methods but one could assume this to be true across the board. This could be fixed by converting the boolean values to string before passing into http_build_query, however like I said this has not been tested on any other methods so I am not aware of any implications.

Getting authorization required error

I have used the sample code as it is with my app_id and secret and I get this error in the browser:

[401] Client error: POST https://cloud.scorm.com/api/v2//appManagement/token resulted in a 401 401 response: {"error":"Authorization Required."}

Using the same details in the web site the authorization works and the curl commands connect correctly too with those details encoded:
https://cloud.scorm.com/docs/v2/reference/swagger/

Am I missing anything?

Incorrect Namespacing

All the classes within directories seem to have their namespaces doubled.

the src/Api/ApplicationManagementApi.php class for example has it's namespace set to:

namespace RusticiSoftware\Cloud\V2\RusticiSoftware\Cloud\V2\Api;

If I change it to just namespace RusticiSoftware\Cloud\V2\Api;

Then it loads properly when attempting to "use" it.

This is consistent in all files within the Api directory and the Model directory.

Package forces minimum-stability down to dev

Hello

The unorthodox locking to *@dev requires composer.json minimum-stability to be downgraded from stable to dev. This has me very weary in a project that has dozens upon dozens of stable dependencies.

It also raises concerns that there is a lack of semantic versioning - though Swagger Codegen likely respects that.

Thoughts? Would you consider it ok to have to downgrade stability in order to use this package?

Thanks!

Serialization issue with ObjectSerializer

Hello,

Just FYI. In the current version I'm getting error as below

"Type error: DateTime::__construct() expects parameter 1 to be string, object given" at /var/www/html/vendor/rustici-software/scormcloud-api-v2-client-php/src/ObjectSerializer.php line 250

Reason behind this is different payload in the request according to CourseSchema

Payload fragment from import job request sent on postback url

      "created": {
        "offset": {
          "totalSeconds": 0,
          "id": "Z",
          "rules": {
            "fixedOffset": true,
            "transitions": [],
            "transitionRules": []
          }
        },
        "year": 2020,
        "month": "JANUARY",
        "monthValue": 1,
        "dayOfMonth": 29,
        "hour": 8,
        "minute": 50,
        "second": 26,
        "nano": 0,
        "dayOfWeek": "WEDNESDAY",
        "dayOfYear": 29
      },
      "updated": {
        "offset": {
          "totalSeconds": 0,
          "id": "Z",
          "rules": {
            "fixedOffset": true,
            "transitions": [],
            "transitionRules": []
          }
        },

\RusticiSoftware\Cloud\V2\ObjectSerializer::deserialize passes date objects from above value to \DateTime() but it should be string.

Cannot install with composer because of guzzle 6.x

Hello,

I cannot install and provide your solution to my customers because the library has required guzzle 6, as you know guzzle 7 has been release the past year : https://laravel-news.com/guzzle-7-released.

I think the PHP library should be updated in order to work in future PHP releases 7.x and 8.x because 5.x is not supported anymore.

  Problem 1
    - rustici-software/scormcloud-api-v2-client-php[1.1.0, ..., 1.1.1] require guzzlehttp/guzzle ~6.0 -> satisfiable by guzzlehttp/guzzle[6.0.0, ..., 6.5.5].
    - You can only install one version of a package, so only one of these can be installed: guzzlehttp/guzzle[6.0.0, ..., 6.5.5, 7.0.0, ..., 7.3.0].


Could you tell me if you have plans to upgrade you library ?

Best regards,
Isaac Flores

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.