Skip to content

Commit 30d474a

Browse files
Merge pull request #11 from RusticiSoftware/v3.0-release
Updated library to work with `X-Total-Count` header and new GetApplications endpoint
2 parents cd59680 + f22bbd3 commit 30d474a

File tree

152 files changed

+303
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+303
-210
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ JavaScript client for @rusticisoftware/scormcloud-api-v2-client-javascript
55
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
66

77
- API version: 2.0
8-
- Package version: 2.1.0
8+
- Package version: 3.0.0
99
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
1010

1111
## Installation

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rusticisoftware/scormcloud-api-v2-client-javascript",
3-
"version": "2.1.0",
3+
"version": "3.0.0",
44
"description": "Swagger Generated JavaScript Client for SCORM Cloud API v2",
55
"main": "src/rustici-software-cloud-v2/index.js",
66
"repository": {

src/rustici-software-cloud-v2/ApiClient.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/**
3434
* @module rustici-software-cloud-v2/ApiClient
35-
* @version 2.1.0
35+
* @version 3.0.0
3636
*/
3737

3838
/**
@@ -57,8 +57,7 @@
5757
this.authentications = {
5858
'APP_MANAGEMENT': {type: 'basic'},
5959
'APP_NORMAL': {type: 'basic'},
60-
'OAUTH': {type: 'oauth2'},
61-
'UNSECURED': {type: 'basic'}
60+
'OAUTH': {type: 'oauth2'}
6261
};
6362
/**
6463
* The default HTTP headers to be included for all API calls.

src/rustici-software-cloud-v2/index.js

+13-4
Large diffs are not rendered by default.

src/rustici-software-cloud-v2/rustici-software-cloud-v2-api/AboutApi.js

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
/**
3434
* About service.
3535
* @module rustici-software-cloud-v2/rustici-software-cloud-v2-api/AboutApi
36-
* @version 2.1.0
3736
*/
3837

3938
/**

src/rustici-software-cloud-v2/rustici-software-cloud-v2-api/ApplicationManagementApi.js

+70-7
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,23 @@
1616
(function(root, factory) {
1717
if (typeof define === 'function' && define.amd) {
1818
// AMD. Register as an anonymous module.
19-
define(['rustici-software-cloud-v2/ApiClient', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationInfoSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationListSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationRequestSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/CredentialCreatedSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/CredentialListSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/CredentialRequestSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/MessageSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/SettingListSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/SettingsPostSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/StringResultSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/TokenRequestSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/UpdateApplicationSchema'], factory);
19+
define(['rustici-software-cloud-v2/ApiClient', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationInfoListSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationInfoSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationListSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationRequestSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/CredentialCreatedSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/CredentialListSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/CredentialRequestSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/MessageSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/SettingListSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/SettingsPostSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/StringResultSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/TokenRequestSchema', 'rustici-software-cloud-v2/rustici-software-cloud-v2-model/UpdateApplicationSchema'], factory);
2020
} else if (typeof module === 'object' && module.exports) {
2121
// CommonJS-like environments that support module.exports, like Node.
22-
module.exports = factory(require('../ApiClient'), require('../rustici-software-cloud-v2-model/ApplicationInfoSchema'), require('../rustici-software-cloud-v2-model/ApplicationListSchema'), require('../rustici-software-cloud-v2-model/ApplicationRequestSchema'), require('../rustici-software-cloud-v2-model/ApplicationSchema'), require('../rustici-software-cloud-v2-model/CredentialCreatedSchema'), require('../rustici-software-cloud-v2-model/CredentialListSchema'), require('../rustici-software-cloud-v2-model/CredentialRequestSchema'), require('../rustici-software-cloud-v2-model/MessageSchema'), require('../rustici-software-cloud-v2-model/SettingListSchema'), require('../rustici-software-cloud-v2-model/SettingsPostSchema'), require('../rustici-software-cloud-v2-model/StringResultSchema'), require('../rustici-software-cloud-v2-model/TokenRequestSchema'), require('../rustici-software-cloud-v2-model/UpdateApplicationSchema'));
22+
module.exports = factory(require('../ApiClient'), require('../rustici-software-cloud-v2-model/ApplicationInfoListSchema'), require('../rustici-software-cloud-v2-model/ApplicationInfoSchema'), require('../rustici-software-cloud-v2-model/ApplicationListSchema'), require('../rustici-software-cloud-v2-model/ApplicationRequestSchema'), require('../rustici-software-cloud-v2-model/ApplicationSchema'), require('../rustici-software-cloud-v2-model/CredentialCreatedSchema'), require('../rustici-software-cloud-v2-model/CredentialListSchema'), require('../rustici-software-cloud-v2-model/CredentialRequestSchema'), require('../rustici-software-cloud-v2-model/MessageSchema'), require('../rustici-software-cloud-v2-model/SettingListSchema'), require('../rustici-software-cloud-v2-model/SettingsPostSchema'), require('../rustici-software-cloud-v2-model/StringResultSchema'), require('../rustici-software-cloud-v2-model/TokenRequestSchema'), require('../rustici-software-cloud-v2-model/UpdateApplicationSchema'));
2323
} else {
2424
// Browser globals (root is window)
2525
if (!root.RusticiSoftwareCloudV2) {
2626
root.RusticiSoftwareCloudV2 = {};
2727
}
28-
root.RusticiSoftwareCloudV2.ApplicationManagementApi = factory(root.RusticiSoftwareCloudV2.ApiClient, root.RusticiSoftwareCloudV2.ApplicationInfoSchema, root.RusticiSoftwareCloudV2.ApplicationListSchema, root.RusticiSoftwareCloudV2.ApplicationRequestSchema, root.RusticiSoftwareCloudV2.ApplicationSchema, root.RusticiSoftwareCloudV2.CredentialCreatedSchema, root.RusticiSoftwareCloudV2.CredentialListSchema, root.RusticiSoftwareCloudV2.CredentialRequestSchema, root.RusticiSoftwareCloudV2.MessageSchema, root.RusticiSoftwareCloudV2.SettingListSchema, root.RusticiSoftwareCloudV2.SettingsPostSchema, root.RusticiSoftwareCloudV2.StringResultSchema, root.RusticiSoftwareCloudV2.TokenRequestSchema, root.RusticiSoftwareCloudV2.UpdateApplicationSchema);
28+
root.RusticiSoftwareCloudV2.ApplicationManagementApi = factory(root.RusticiSoftwareCloudV2.ApiClient, root.RusticiSoftwareCloudV2.ApplicationInfoListSchema, root.RusticiSoftwareCloudV2.ApplicationInfoSchema, root.RusticiSoftwareCloudV2.ApplicationListSchema, root.RusticiSoftwareCloudV2.ApplicationRequestSchema, root.RusticiSoftwareCloudV2.ApplicationSchema, root.RusticiSoftwareCloudV2.CredentialCreatedSchema, root.RusticiSoftwareCloudV2.CredentialListSchema, root.RusticiSoftwareCloudV2.CredentialRequestSchema, root.RusticiSoftwareCloudV2.MessageSchema, root.RusticiSoftwareCloudV2.SettingListSchema, root.RusticiSoftwareCloudV2.SettingsPostSchema, root.RusticiSoftwareCloudV2.StringResultSchema, root.RusticiSoftwareCloudV2.TokenRequestSchema, root.RusticiSoftwareCloudV2.UpdateApplicationSchema);
2929
}
30-
}(this, function(ApiClient, ApplicationInfoSchema, ApplicationListSchema, ApplicationRequestSchema, ApplicationSchema, CredentialCreatedSchema, CredentialListSchema, CredentialRequestSchema, MessageSchema, SettingListSchema, SettingsPostSchema, StringResultSchema, TokenRequestSchema, UpdateApplicationSchema) {
30+
}(this, function(ApiClient, ApplicationInfoListSchema, ApplicationInfoSchema, ApplicationListSchema, ApplicationRequestSchema, ApplicationSchema, CredentialCreatedSchema, CredentialListSchema, CredentialRequestSchema, MessageSchema, SettingListSchema, SettingsPostSchema, StringResultSchema, TokenRequestSchema, UpdateApplicationSchema) {
3131
'use strict';
3232

3333
/**
3434
* ApplicationManagement service.
3535
* @module rustici-software-cloud-v2/rustici-software-cloud-v2-api/ApplicationManagementApi
36-
* @version 2.1.0
3736
*/
3837

3938
/**
@@ -461,10 +460,11 @@
461460
*/
462461

463462
/**
464-
* Use the Application Management App to get a list of Applications
465-
* Returns a list of all applications which are in this Realm. >**Note:** >Each Realm has a special application called the **Application Management Application**. When using this special application's credentials to authenticate with the API, you are able to perform actions on all the other applications within that Realm (and only those actions, this isn't a general purpose credential). You can list, add, update, and delete both applications and credentials with this API resource.
463+
* (Deprecated) Use the Application Management App to get basic data about all Applications in a Realm
464+
* Returns a list of all applications which are in this Realm. >**Deprecated:** >It is advised to use GetApplications instead of this endpoint, as this one now exists for backwards compatibility. This endpoint returns very limited data about **all** applications in a Realm and is not paginated. Because of this, this endpoint can run into issues and have very slow performance when attempting to pull data for accounts with many applications. The GetApplications endpoint alleviates this problem by using pagination to return a limited amount of applications at once, while also providing much more detail about every application present in a Realm. >**Note:** >Each Realm has a special application called the **Application Management Application**. When using this special application's credentials to authenticate with the API, you are able to perform actions on all the other applications within that Realm (and only those actions, this isn't a general purpose credential). You can list, add, update, and delete both applications and credentials with this API resource.
466465
* @param {module:rustici-software-cloud-v2/rustici-software-cloud-v2-api/ApplicationManagementApi~getApplicationListCallback} callback The callback function, accepting three arguments: error, data, response
467466
* data is of type: {@link module:rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationListSchema}
467+
* @deprecated Use GetApplications instead.
468468
*/
469469
this.getApplicationList = function(callback) {
470470
var postBody = null;
@@ -493,6 +493,69 @@
493493
);
494494
}
495495

496+
/**
497+
* Callback function to receive the result of the getApplications operation.
498+
* @callback module:rustici-software-cloud-v2/rustici-software-cloud-v2-api/ApplicationManagementApi~getApplicationsCallback
499+
* @param {String} error Error message, if any.
500+
* @param {module:rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationInfoListSchema} data The data returned by the service call.
501+
* @param {String} response The complete HTTP response.
502+
*/
503+
504+
/**
505+
* Use the Application Management App to get a detailed list of Applications
506+
* Returns a list of applications. Can be filtered using the request parameters to provide a subset of results. This endpoint caches the course and registration counts of an application for 24 hours if either `includeCourseCount` or `includeRegistrationCount` parameters, respectively, are set to `true`. Since these values are cached for an extended period, any changes made to the number of courses or registrations in an application will not be reflected in the results of this endpoint until the caching period has passed. >**Note:** >This request is paginated and will only provide a limited amount of resources at a time. If there are more results to be collected, a `more` token provided with the response which can be passed to get the next page of results. When passing this token, no other filter parameters can be sent as part of the request. The resources will continue to respect the filters passed in by the original request. >**Note:** >Each Realm has a special application called the **Application Management Application**. When using this special application's credentials to authenticate with the API, you are able to perform actions on all the other applications within that Realm (and only those actions, this isn't a general purpose credential). You can list, add, update, and delete both applications and credentials with this API resource. >**Info:** >If you want to get an up-to-date value of the course or registration count for a single application within the caching period, use the GetApplicationInfo endpoint with `includeCourseCount` and/or `includeRegistrationCount` set to `true`. GetApplicationInfo *always* gathers the most up-to-date values and overwrites them in the cache, resetting the caching period for that application.
507+
* @param {Object} opts Optional parameters
508+
* @param {Date} opts.since Filter by ISO 8601 TimeStamp inclusive (defaults to UTC)
509+
* @param {Date} opts.until Filter by ISO 8601 TimeStamp inclusive (defaults to UTC)
510+
* @param {module:rustici-software-cloud-v2/rustici-software-cloud-v2-model/String} opts.datetimeFilter Specifies field that `since` and `until` parameters are applied against (default to updated)
511+
* @param {String} opts.filter Optional string which filters results by a specified field (described by filterBy).
512+
* @param {module:rustici-software-cloud-v2/rustici-software-cloud-v2-model/String} opts.filterBy Optional enum parameter for specifying the field on which to run the filter. (default to app_id)
513+
* @param {module:rustici-software-cloud-v2/rustici-software-cloud-v2-model/String} opts.orderBy Optional enum parameter for specifying the field and order by which to sort the results. (default to updated_asc)
514+
* @param {String} opts.more Pagination token returned as `more` property of multi page list requests
515+
* @param {Boolean} opts.includeCourseCount Include a count of courses for the application. (default to false)
516+
* @param {Boolean} opts.includeRegistrationCount Include a count of registrations created for the application during the current billing period. (default to false)
517+
* @param {Boolean} opts.includeTotalCount Include the total count of results matching the provided filters as a header on the initial request. The header will not be present on subsequent requests resulting from passing the `more` token. (default to false)
518+
* @param {module:rustici-software-cloud-v2/rustici-software-cloud-v2-api/ApplicationManagementApi~getApplicationsCallback} callback The callback function, accepting three arguments: error, data, response
519+
* data is of type: {@link module:rustici-software-cloud-v2/rustici-software-cloud-v2-model/ApplicationInfoListSchema}
520+
*/
521+
this.getApplications = function(opts, callback) {
522+
opts = opts || {};
523+
var postBody = null;
524+
525+
526+
var pathParams = {
527+
};
528+
var queryParams = {
529+
'since': opts['since'],
530+
'until': opts['until'],
531+
'datetimeFilter': opts['datetimeFilter'],
532+
'filter': opts['filter'],
533+
'filterBy': opts['filterBy'],
534+
'orderBy': opts['orderBy'],
535+
'more': opts['more'],
536+
'includeCourseCount': opts['includeCourseCount'],
537+
'includeRegistrationCount': opts['includeRegistrationCount'],
538+
'includeTotalCount': opts['includeTotalCount'],
539+
};
540+
var collectionQueryParams = {
541+
};
542+
var headerParams = {
543+
};
544+
var formParams = {
545+
};
546+
547+
var authNames = ['APP_MANAGEMENT', 'OAUTH'];
548+
var contentTypes = ['application/json'];
549+
var accepts = ['application/json'];
550+
var returnType = ApplicationInfoListSchema;
551+
552+
return this.apiClient.callApi(
553+
'/appManagement/applicationList', 'GET',
554+
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
555+
authNames, contentTypes, accepts, returnType, callback
556+
);
557+
}
558+
496559
/**
497560
* Callback function to receive the result of the getCredentials operation.
498561
* @callback module:rustici-software-cloud-v2/rustici-software-cloud-v2-api/ApplicationManagementApi~getCredentialsCallback

src/rustici-software-cloud-v2/rustici-software-cloud-v2-api/AuthenticationApi.js

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
/**
3434
* Authentication service.
3535
* @module rustici-software-cloud-v2/rustici-software-cloud-v2-api/AuthenticationApi
36-
* @version 2.1.0
3736
*/
3837

3938
/**

src/rustici-software-cloud-v2/rustici-software-cloud-v2-api/ContentConnectorsApi.js

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
/**
3434
* ContentConnectors service.
3535
* @module rustici-software-cloud-v2/rustici-software-cloud-v2-api/ContentConnectorsApi
36-
* @version 2.1.0
3736
*/
3837

3938
/**

src/rustici-software-cloud-v2/rustici-software-cloud-v2-api/CourseApi.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
/**
3434
* Course service.
3535
* @module rustici-software-cloud-v2/rustici-software-cloud-v2-api/CourseApi
36-
* @version 2.1.0
3736
*/
3837

3938
/**
@@ -1471,6 +1470,7 @@
14711470
* @param {String} opts.more Pagination token returned as `more` property of multi page list requests
14721471
* @param {Boolean} opts.includeCourseMetadata Include course metadata in the results. If the course has no metadata, adding this parameter has no effect. (default to false)
14731472
* @param {Boolean} opts.includeRegistrationCount Include the registration count in the results (default to false)
1473+
* @param {Boolean} opts.includeTotalCount Include the total count of results matching the provided filters as a header on the initial request. The header will not be present on subsequent requests resulting from passing the `more` token. (default to false)
14741474
* @param {module:rustici-software-cloud-v2/rustici-software-cloud-v2-api/CourseApi~getCoursesCallback} callback The callback function, accepting three arguments: error, data, response
14751475
* data is of type: {@link module:rustici-software-cloud-v2/rustici-software-cloud-v2-model/CourseListSchema}
14761476
*/
@@ -1491,6 +1491,7 @@
14911491
'more': opts['more'],
14921492
'includeCourseMetadata': opts['includeCourseMetadata'],
14931493
'includeRegistrationCount': opts['includeRegistrationCount'],
1494+
'includeTotalCount': opts['includeTotalCount'],
14941495
};
14951496
var collectionQueryParams = {
14961497
'tags': {

0 commit comments

Comments
 (0)