@jeraldj/client-services 8.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +330 -0
- package/__test__/setup.d.ts +2 -0
- package/blocs/group-addable/cs-group-addable-bloc.d.ts +20 -0
- package/blocs/index.d.ts +1 -0
- package/blocs/index.js +2 -0
- package/blocs/index.js.LICENSE.txt +14 -0
- package/core/cs-client-storage.d.ts +5 -0
- package/core/cs-error.d.ts +5 -0
- package/core/http-service/errors/cs-http-client-error.d.ts +8 -0
- package/core/http-service/errors/cs-http-server-error.d.ts +8 -0
- package/core/http-service/errors/cs-network-error.d.ts +6 -0
- package/core/http-service/errors/cs-request-builder-error.d.ts +4 -0
- package/core/http-service/errors/index.d.ts +5 -0
- package/core/http-service/implementation/http-client-adapters/http-client-browser-adapter.d.ts +20 -0
- package/core/http-service/implementation/http-client-adapters/http-client-cordova-adapter.d.ts +21 -0
- package/core/http-service/implementation/http-client-adapters/http-client.d.ts +14 -0
- package/core/http-service/implementation/http-service-impl.d.ts +36 -0
- package/core/http-service/implementation/interceptors/bearer-token-inject-request-interceptor.d.ts +8 -0
- package/core/http-service/implementation/interceptors/user-token-inject-request-interceptor.d.ts +8 -0
- package/core/http-service/index.d.ts +2 -0
- package/core/http-service/index.js +1 -0
- package/core/http-service/interface/cs-http-interceptor.d.ts +4 -0
- package/core/http-service/interface/cs-http-service.d.ts +11 -0
- package/core/http-service/interface/cs-request-interceptor.d.ts +5 -0
- package/core/http-service/interface/cs-request.d.ts +77 -0
- package/core/http-service/interface/cs-response-interceptor.d.ts +6 -0
- package/core/http-service/interface/cs-response.d.ts +23 -0
- package/core/http-service/interface/index.d.ts +6 -0
- package/core/http-service/utilities/interceptors/cs-request-logger-interceptor.d.ts +6 -0
- package/core/http-service/utilities/interceptors/cs-response-logger-Interceptor.d.ts +7 -0
- package/core/http-service/utilities/interceptors/index.d.ts +2 -0
- package/core/http-service/utilities/interceptors/index.js +2 -0
- package/core/http-service/utilities/interceptors/index.js.LICENSE.txt +14 -0
- package/core/index.d.ts +2 -0
- package/core/index.js +1 -0
- package/cs-module.d.ts +124 -0
- package/index.d.ts +3 -0
- package/index.js +2 -0
- package/index.js.LICENSE.txt +60 -0
- package/injection-tokens.d.ts +76 -0
- package/models/certificate/index.d.ts +68 -0
- package/models/channel/index.d.ts +57 -0
- package/models/channel/index.js +1 -0
- package/models/content/index.d.ts +122 -0
- package/models/content/index.js +1 -0
- package/models/course/index.d.ts +68 -0
- package/models/course/index.js +1 -0
- package/models/device/index.d.ts +10 -0
- package/models/device/index.js +1 -0
- package/models/faq/index.d.ts +7 -0
- package/models/faq/index.js +1 -0
- package/models/form/index.d.ts +15 -0
- package/models/form/index.js +1 -0
- package/models/group/index.d.ts +96 -0
- package/models/group/index.js +1 -0
- package/models/index.d.ts +12 -0
- package/models/index.js +1 -0
- package/models/location/index.d.ts +6 -0
- package/models/location/index.js +1 -0
- package/models/notification/index.d.ts +33 -0
- package/models/organisation/index.d.ts +17 -0
- package/models/organisation/index.js +1 -0
- package/models/page/index.d.ts +23 -0
- package/models/page/index.js +1 -0
- package/models/user/index.d.ts +109 -0
- package/models/user/index.js +1 -0
- package/package.json +100 -0
- package/services/certificate/implementation/certificate-service-impl.d.ts +29 -0
- package/services/certificate/index.d.ts +1 -0
- package/services/certificate/interface/cs-certificate-service.d.ts +81 -0
- package/services/certificate/interface/index.d.ts +1 -0
- package/services/content/implementation/content-service-impl.d.ts +13 -0
- package/services/content/index.d.ts +1 -0
- package/services/content/index.js +1 -0
- package/services/content/interface/cs-content-filter-criteria.d.ts +11 -0
- package/services/content/interface/cs-content-mime-type.d.ts +17 -0
- package/services/content/interface/cs-content-service.d.ts +13 -0
- package/services/content/interface/cs-content-sort-criteria.d.ts +17 -0
- package/services/content/interface/cs-content-type.d.ts +35 -0
- package/services/content/interface/cs-primary-category.d.ts +17 -0
- package/services/content/interface/cs-resource-type.d.ts +10 -0
- package/services/content/interface/index.d.ts +7 -0
- package/services/content/utilities/content-group-generator/cs-contents-group-generator.d.ts +44 -0
- package/services/content/utilities/content-group-generator/index.d.ts +1 -0
- package/services/content/utilities/content-group-generator/index.js +1 -0
- package/services/content/utilities/content-progress-calculator/cs-content-progress-calculator.d.ts +8 -0
- package/services/content/utilities/content-progress-calculator/index.d.ts +1 -0
- package/services/content/utilities/content-progress-calculator/index.js +1 -0
- package/services/content/utilities/mime-type-facet-to-mime-type-category-aggregator/cs-mime-type-facet-to-mime-type-category-aggregator.d.ts +15 -0
- package/services/content/utilities/mime-type-facet-to-mime-type-category-aggregator/index.d.ts +1 -0
- package/services/content/utilities/mime-type-facet-to-mime-type-category-aggregator/index.js +1 -0
- package/services/content/utilities/primary-category-mapper/cs-primary-category-mapper.d.ts +5 -0
- package/services/content/utilities/primary-category-mapper/index.d.ts +1 -0
- package/services/content/utilities/primary-category-mapper/index.js +1 -0
- package/services/course/implementation/course-service-impl.d.ts +15 -0
- package/services/course/index.d.ts +1 -0
- package/services/course/index.js +1 -0
- package/services/course/interface/cs-course-service.d.ts +68 -0
- package/services/course/interface/index.d.ts +1 -0
- package/services/discussion/implementation/discussion-service-impl.d.ts +108 -0
- package/services/discussion/index.d.ts +1 -0
- package/services/discussion/interface/cs-discussion-service.d.ts +82 -0
- package/services/discussion/interface/index.d.ts +1 -0
- package/services/form/implementation/form-service-impl.d.ts +11 -0
- package/services/form/index.d.ts +0 -0
- package/services/form/interface/cs-form-service.d.ts +14 -0
- package/services/framework/implementation/cs-framework-config-bloc.d.ts +11 -0
- package/services/framework/implementation/framework-service-impl.d.ts +21 -0
- package/services/framework/index.d.ts +1 -0
- package/services/framework/index.js +1 -0
- package/services/framework/interface/cs-framework-service.d.ts +21 -0
- package/services/framework/interface/index.d.ts +1 -0
- package/services/group/activity/implementation/group-activity-service-impl.d.ts +16 -0
- package/services/group/activity/index.d.ts +1 -0
- package/services/group/activity/index.js +1 -0
- package/services/group/activity/interface/cs-group-activity-service.d.ts +38 -0
- package/services/group/activity/interface/index.d.ts +1 -0
- package/services/group/implementation/group-service-impl.d.ts +43 -0
- package/services/group/index.d.ts +1 -0
- package/services/group/index.js +1 -0
- package/services/group/interface/cs-group-service.d.ts +175 -0
- package/services/group/interface/index.d.ts +1 -0
- package/services/location/implementation/location-service-impl.d.ts +11 -0
- package/services/location/index.d.ts +1 -0
- package/services/location/index.js +1 -0
- package/services/location/interface/cs-location-service.d.ts +16 -0
- package/services/location/interface/index.d.ts +1 -0
- package/services/notification/implementation/notification-service-impl.d.ts +12 -0
- package/services/notification/index.d.ts +1 -0
- package/services/notification/interface/cs-notification-service.d.ts +22 -0
- package/services/notification/interface/index.d.ts +1 -0
- package/services/system-settings/implementation/system-settings-service-impl.d.ts +10 -0
- package/services/system-settings/index.d.ts +1 -0
- package/services/system-settings/index.js +1 -0
- package/services/system-settings/interface/cs-system-settings-service.d.ts +5 -0
- package/services/system-settings/interface/index.d.ts +1 -0
- package/services/user/implementation/user-service-impl.d.ts +25 -0
- package/services/user/index.d.ts +1 -0
- package/services/user/index.js +1 -0
- package/services/user/interface/cs-user-service.d.ts +83 -0
- package/services/user/interface/index.d.ts +1 -0
- package/telemetry/cs-telemetry-module.d.ts +30 -0
- package/telemetry/errors/cs-telemetry-validation-error.d.ts +6 -0
- package/telemetry/errors/index.d.ts +1 -0
- package/telemetry/implementation/pdf-player-telemetry-service-impl.d.ts +6 -0
- package/telemetry/implementation/player-telemetry-service-impl.d.ts +9 -0
- package/telemetry/implementation/telemetry-service-Impl.d.ts +38 -0
- package/telemetry/index.d.ts +4 -0
- package/telemetry/index.js +2 -0
- package/telemetry/index.js.LICENSE.txt +14 -0
- package/telemetry/injection-tokens.d.ts +9 -0
- package/telemetry/interface/cs-player-telemetry-service.d.ts +6 -0
- package/telemetry/interface/cs-telemetry-request.d.ts +69 -0
- package/telemetry/interface/cs-telemetry-service.d.ts +27 -0
- package/telemetry/interface/index.d.ts +3 -0
- package/utilities/aggregator/aggregator.d.ts +23 -0
- package/utilities/aggregator/index.d.ts +1 -0
- package/utilities/aggregator/index.js +1 -0
- package/utilities/certificate/certificate-verifier.d.ts +11 -0
- package/utilities/certificate/credentials.d.ts +343 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { CsRequest } from './cs-request';
|
|
3
|
+
import { CsResponse } from './cs-response';
|
|
4
|
+
import { CsRequestInterceptor } from './cs-request-interceptor';
|
|
5
|
+
import { CsResponseInterceptor } from './cs-response-interceptor';
|
|
6
|
+
export interface CsHttpService {
|
|
7
|
+
requestInterceptors: CsRequestInterceptor[];
|
|
8
|
+
responseInterceptors: CsResponseInterceptor[];
|
|
9
|
+
fetch<T>(request: CsRequest): Observable<CsResponse<T>>;
|
|
10
|
+
init(): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CsResponseInterceptor } from './cs-response-interceptor';
|
|
2
|
+
import { CsRequestInterceptor } from './cs-request-interceptor';
|
|
3
|
+
export declare enum CsHttpSerializer {
|
|
4
|
+
JSON = "json",
|
|
5
|
+
URLENCODED = "urlencoded",
|
|
6
|
+
UTF8 = "utf8",
|
|
7
|
+
RAW = "raw"
|
|
8
|
+
}
|
|
9
|
+
export declare enum CsHttpRequestType {
|
|
10
|
+
GET = "GET",
|
|
11
|
+
POST = "POST",
|
|
12
|
+
PATCH = "PATCH",
|
|
13
|
+
DELETE = "DELETE",
|
|
14
|
+
PUT = "PUT"
|
|
15
|
+
}
|
|
16
|
+
export interface CsSerializedRequest {
|
|
17
|
+
type: CsHttpRequestType;
|
|
18
|
+
host: string | undefined;
|
|
19
|
+
path: string;
|
|
20
|
+
serializer: CsHttpSerializer;
|
|
21
|
+
withBearerToken: boolean;
|
|
22
|
+
withUserToken: boolean;
|
|
23
|
+
headers: {
|
|
24
|
+
[key: string]: string;
|
|
25
|
+
};
|
|
26
|
+
body: {
|
|
27
|
+
[key: string]: string;
|
|
28
|
+
} | string;
|
|
29
|
+
parameters: {
|
|
30
|
+
[key: string]: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export declare class CsRequest {
|
|
34
|
+
static fromJSON(json: Partial<CsSerializedRequest>): CsRequest;
|
|
35
|
+
static Builder: any;
|
|
36
|
+
private _host?;
|
|
37
|
+
private _serializer;
|
|
38
|
+
private _responseInterceptors;
|
|
39
|
+
private _withBearerToken;
|
|
40
|
+
private _path;
|
|
41
|
+
private _type;
|
|
42
|
+
get serializer(): CsHttpSerializer;
|
|
43
|
+
set serializer(value: CsHttpSerializer);
|
|
44
|
+
get withBearerToken(): boolean;
|
|
45
|
+
set withBearerToken(value: boolean);
|
|
46
|
+
private _headers?;
|
|
47
|
+
private _body?;
|
|
48
|
+
private _parameters?;
|
|
49
|
+
get body(): {};
|
|
50
|
+
protected constructor();
|
|
51
|
+
private _withUserToken;
|
|
52
|
+
set path(value: string);
|
|
53
|
+
get type(): CsHttpRequestType;
|
|
54
|
+
set responseInterceptors(value: Array<CsResponseInterceptor>);
|
|
55
|
+
set headers(value: {
|
|
56
|
+
[p: string]: string;
|
|
57
|
+
});
|
|
58
|
+
set body(value: {});
|
|
59
|
+
get path(): string;
|
|
60
|
+
set type(value: CsHttpRequestType);
|
|
61
|
+
get responseInterceptors(): Array<CsResponseInterceptor>;
|
|
62
|
+
get headers(): {
|
|
63
|
+
[p: string]: string;
|
|
64
|
+
};
|
|
65
|
+
get parameters(): {
|
|
66
|
+
[key: string]: string;
|
|
67
|
+
};
|
|
68
|
+
set parameters(value: {
|
|
69
|
+
[key: string]: string;
|
|
70
|
+
});
|
|
71
|
+
get withUserToken(): boolean;
|
|
72
|
+
set withUserToken(value: boolean);
|
|
73
|
+
private _requestInterceptors;
|
|
74
|
+
get requestInterceptors(): CsRequestInterceptor[];
|
|
75
|
+
get host(): string | undefined;
|
|
76
|
+
toJSON(): string;
|
|
77
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum CsHttpResponseCode {
|
|
2
|
+
HTTP_UNAUTHORISED = 401,
|
|
3
|
+
HTTP_FORBIDDEN = 403,
|
|
4
|
+
HTTP_SUCCESS = 200,
|
|
5
|
+
HTTP_BAD_REQUEST = 400,
|
|
6
|
+
HTTP_KONG_FAILURE = 447,
|
|
7
|
+
HTTP_INTERNAL_SERVER_ERROR = 500
|
|
8
|
+
}
|
|
9
|
+
export declare class CsResponse<T = any> {
|
|
10
|
+
private _responseCode;
|
|
11
|
+
private _errorMesg;
|
|
12
|
+
private _body;
|
|
13
|
+
private _headers;
|
|
14
|
+
get responseCode(): CsHttpResponseCode;
|
|
15
|
+
set responseCode(value: CsHttpResponseCode);
|
|
16
|
+
get errorMesg(): string;
|
|
17
|
+
set errorMesg(value: string);
|
|
18
|
+
get body(): T;
|
|
19
|
+
set body(value: T);
|
|
20
|
+
get headers(): any;
|
|
21
|
+
set headers(value: any);
|
|
22
|
+
toJSON(): string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CsRequestInterceptor } from '../../interface/cs-request-interceptor';
|
|
2
|
+
import { CsRequest } from '../../interface/cs-request';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
export declare class CsRequestLoggerInterceptor implements CsRequestInterceptor {
|
|
5
|
+
interceptRequest(request: CsRequest): Observable<CsRequest>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CsResponseInterceptor } from '../../interface/cs-response-interceptor';
|
|
2
|
+
import { CsResponse } from '../../interface/cs-response';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { CsRequest } from '../../interface/cs-request';
|
|
5
|
+
export declare class CsResponseLoggerInterceptor implements CsResponseInterceptor {
|
|
6
|
+
interceptResponse(request: CsRequest, response: CsResponse<any>): Observable<CsResponse>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
!function r(t,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e=n();for(var o in e)("object"==typeof exports?exports:t)[o]=e[o]}}(window,function(){return function(r){var t={};function n(e){if(t[e])return t[e].exports;var o=t[e]={i:e,l:!1,exports:{}};return r[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=r,n.c=t,n.d=function(r,t,e){n.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:e})},n.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,t){if(1&t&&(r=n(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)n.d(e,o,function(t){return r[t]}.bind(null,o));return e},n.n=function(r){var t=r&&r.__esModule?function t(){return r.default}:function t(){return r};return n.d(t,"a",t),t},n.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},n.p="",n(n.s=219)}({10:function(r,t,n){"use strict";n.d(t,"a",function(){return s});var e=function(){return Array.isArray||function(r){return r&&"number"==typeof r.length}}(),o=n(34),i=n(20),u,c=function(){function r(r){return Error.call(this),this.message=r?r.length+" errors occurred during unsubscription:\n"+r.map(function(r,t){return t+1+") "+r.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=r,this}return r.prototype=Object.create(Error.prototype),r}(),s=function(){function r(r){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,r&&(this._ctorUnsubscribe=!0,this._unsubscribe=r)}var t;return r.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,u=n._parentOrParents,s=n._ctorUnsubscribe,f=n._unsubscribe,l=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,u instanceof r)u.remove(this);else if(null!==u)for(var p=0;p<u.length;++p){var h;u[p].remove(this)}if(Object(i.a)(f)){s&&(this._unsubscribe=void 0);try{f.call(this)}catch(r){t=r instanceof c?a(r.errors):[r]}}if(e(l))for(var p=-1,b=l.length;++p<b;){var y=l[p];if(Object(o.a)(y))try{y.unsubscribe()}catch(r){t=t||[],r instanceof c?t=t.concat(a(r.errors)):t.push(r)}}if(t)throw new c(t)}},r.prototype.add=function(t){var n=t;if(!t)return r.EMPTY;switch(typeof t){case"function":n=new r(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof r)){var e=n;(n=new r)._subscriptions=[e]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof r){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},r.prototype.remove=function(r){var t=this._subscriptions;if(t){var n=t.indexOf(r);-1!==n&&t.splice(n,1)}},r.EMPTY=((t=new r).closed=!0,t),r}();function a(r){return r.reduce(function(r,t){return r.concat(t instanceof c?t.errors:t)},[])}},13:function(r,t,n){"use strict";function e(r){setTimeout(function(){throw r},0)}n.d(t,"a",function(){return e})},15:function(r,t,n){"use strict";n.d(t,"a",function(){return e});var e=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),o=e},169:function(r,t,n){"use strict";function e(r){return r&&"function"==typeof r.schedule}n.d(t,"a",function(){return s});var o=n(5),i=n(35),u=n(22);function c(r,t){return t?Object(u.a)(r,t):new o.a(Object(i.a)(r))}function s(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[r.length-1];return e(n)?(r.pop(),Object(u.a)(r,n)):c(r)}},17:function(r,t,n){"use strict";n.d(t,"a",function(){return i});var e=n(3),o=n(13),i={closed:!0,next:function(r){},error:function(r){if(e.a.useDeprecatedSynchronousErrorHandling)throw r;Object(o.a)(r)},complete:function(){}}},20:function(r,t,n){"use strict";function e(r){return"function"==typeof r}n.d(t,"a",function(){return e})},21:function(r,t,n){"use strict";n.d(t,"a",function(){return e});var e=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},219:function(r,t,n){"use strict";n.r(t),n.d(t,"CsRequestLoggerInterceptor",function(){return o}),n.d(t,"CsResponseLoggerInterceptor",function(){return i});var e=n(169),o=function(){function r(){}return r.prototype.interceptRequest=function(r){return console.log("CsRequestLoggerInterceptor: ","request:",r),Object(e.a)(r)},r}(),i=function(){function r(){}return r.prototype.interceptResponse=function(r,t){return console.log("CsResponseLoggerInterceptor: ","response:",t),Object(e.a)(t)},r}()},22:function(r,t,n){"use strict";n.d(t,"a",function(){return i});var e=n(5),o=n(10);function i(r,t){return new e.a(function(n){var e=new o.a,i=0;return e.add(t.schedule(function(){i!==r.length?(n.next(r[i++]),n.closed||e.add(this.schedule())):n.complete()})),e})}},3:function(r,t,n){"use strict";n.d(t,"a",function(){return o});var e=!1,o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(r){var t;r&&(new Error).stack;e=r},get useDeprecatedSynchronousErrorHandling(){return e}}},34:function(r,t,n){"use strict";function e(r){return null!==r&&"object"==typeof r}n.d(t,"a",function(){return e})},35:function(r,t,n){"use strict";n.d(t,"a",function(){return e});var e=function(r){return function(t){for(var n=0,e=r.length;n<e&&!t.closed;n++)t.next(r[n]);t.complete()}}},5:function(r,t,n){"use strict";n.d(t,"a",function(){return h});var e=n(9);function o(r){for(;r;){var t=r,n=t.closed,o=t.destination,i=t.isStopped;if(n||i)return!1;r=o&&o instanceof e.a?o:null}return!0}var i=n(15),u=n(17);function c(r,t,n){if(r){if(r instanceof e.a)return r;if(r[i.a])return r[i.a]()}return r||t||n?new e.a(r,t,n):new e.a(u.a)}var s=n(21);function a(r){return r}function f(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return l(r)}function l(r){return 0===r.length?a:1===r.length?r[0]:function t(n){return r.reduce(function(r,t){return t(r)},n)}}var p=n(3),h=function(){function r(r){this._isScalar=!1,r&&(this._subscribe=r)}return r.prototype.lift=function(t){var n=new r;return n.source=this,n.operator=t,n},r.prototype.subscribe=function(r,t,n){var e=this.operator,o=c(r,t,n);if(e?o.add(e.call(o,this.source)):o.add(this.source||p.a.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),p.a.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},r.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(t){p.a.useDeprecatedSynchronousErrorHandling&&(r.syncErrorThrown=!0,r.syncErrorValue=t),o(r)?r.error(t):console.warn(t)}},r.prototype.forEach=function(r,t){var n=this;return new(t=b(t))(function(t,e){var o;o=n.subscribe(function(t){try{r(t)}catch(r){e(r),o&&o.unsubscribe()}},e,t)})},r.prototype._subscribe=function(r){var t=this.source;return t&&t.subscribe(r)},r.prototype[s.a]=function(){return this},r.prototype.pipe=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return 0===r.length?this:l(r)(this)},r.prototype.toPromise=function(r){var t=this;return new(r=b(r))(function(r,n){var e;t.subscribe(function(r){return e=r},function(r){return n(r)},function(){return r(e)})})},r.create=function(t){return new r(t)},r}();function b(r){if(r||(r=p.a.Promise||Promise),!r)throw new Error("no Promise impl found");return r}},6:function(r,t,n){"use strict";n.d(t,"a",function(){return o});var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n])},e(r,t)};function o(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function r(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t},i.apply(this,arguments)};function u(r,t){var n={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&t.indexOf(e)<0&&(n[e]=r[e]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,e=Object.getOwnPropertySymbols(r);o<e.length;o++)t.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(r,e[o])&&(n[e[o]]=r[e[o]]);return n}function c(r,t,n,e){var o=arguments.length,i=o<3?t:null===e?e=Object.getOwnPropertyDescriptor(t,n):e,u;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(r,t,n,e);else for(var c=r.length-1;c>=0;c--)(u=r[c])&&(i=(o<3?u(i):o>3?u(t,n,i):u(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}function s(r,t){return function(n,e){t(n,e,r)}}function a(r,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(r,t)}function f(r,t,n,e){function o(r){return r instanceof n?r:new n(function(t){t(r)})}return new(n||(n=Promise))(function(n,i){function u(r){try{s(e.next(r))}catch(r){i(r)}}function c(r){try{s(e.throw(r))}catch(r){i(r)}}function s(r){r.done?n(r.value):o(r.value).then(u,c)}s((e=e.apply(r,t||[])).next())})}function l(r,t){var n={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},e,o,i,u;return u={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(r){return function(t){return s([r,t])}}function s(u){if(e)throw new TypeError("Generator is already executing.");for(;n;)try{if(e=1,o&&(i=2&u[0]?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(!(i=n.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){n=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(6===u[0]&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(r,n)}catch(r){u=[6,r],o=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function p(r,t,n,e){void 0===e&&(e=n),r[e]=t[n]}function h(r,t){for(var n in r)"default"===n||t.hasOwnProperty(n)||(t[n]=r[n])}function b(r){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&r[t],e=0;if(n)return n.call(r);if(r&&"number"==typeof r.length)return{next:function(){return r&&e>=r.length&&(r=void 0),{value:r&&r[e++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(r,t){var n="function"==typeof Symbol&&r[Symbol.iterator];if(!n)return r;var e=n.call(r),o,i=[],u;try{for(;(void 0===t||t-- >0)&&!(o=e.next()).done;)i.push(o.value)}catch(r){u={error:r}}finally{try{o&&!o.done&&(n=e.return)&&n.call(e)}finally{if(u)throw u.error}}return i}function d(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(y(arguments[t]));return r}function v(){for(var r=0,t=0,n=arguments.length;t<n;t++)r+=arguments[t].length;for(var e=Array(r),o=0,t=0;t<n;t++)for(var i=arguments[t],u=0,c=i.length;u<c;u++,o++)e[o]=i[u];return e}function w(r){return this instanceof w?(this.v=r,this):new w(r)}function _(r,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n.apply(r,t||[]),o,i=[];return o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o;function u(r){e[r]&&(o[r]=function(t){return new Promise(function(n,e){i.push([r,t,n,e])>1||c(r,t)})})}function c(r,t){try{s(e[r](t))}catch(r){l(i[0][3],r)}}function s(r){r.value instanceof w?Promise.resolve(r.value.v).then(a,f):l(i[0][2],r)}function a(r){c("next",r)}function f(r){c("throw",r)}function l(r,t){r(t),i.shift(),i.length&&c(i[0][0],i[0][1])}}function m(r){var t,n;return t={},e("next"),e("throw",function(r){throw r}),e("return"),t[Symbol.iterator]=function(){return this},t;function e(e,o){t[e]=r[e]?function(t){return(n=!n)?{value:w(r[e](t)),done:"return"===e}:o?o(t):t}:o}}function g(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],n;return t?t.call(r):(r=b(r),n={},e("next"),e("throw"),e("return"),n[Symbol.asyncIterator]=function(){return this},n);function e(t){n[t]=r[t]&&function(n){return new Promise(function(e,i){o(e,i,(n=r[t](n)).done,n.value)})}}function o(r,t,n,e){Promise.resolve(e).then(function(t){r({value:t,done:n})},t)}}function O(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}function S(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var n in r)Object.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t.default=r,t}function E(r){return r&&r.__esModule?r:{default:r}}function j(r,t){if(!t.has(r))throw new TypeError("attempted to get private field on non-instance");return t.get(r)}function x(r,t,n){if(!t.has(r))throw new TypeError("attempted to set private field on non-instance");return t.set(r,n),n}},9:function(r,t,n){"use strict";n.d(t,"a",function(){return f});var e=n(6),o=n(20),i=n(17),u=n(10),c=n(15),s=n(3),a=n(13),f=function(r){function t(n,e,o){var u=r.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=i.a;break;case 1:if(!n){u.destination=i.a;break}if("object"==typeof n){n instanceof t?(u.syncErrorThrowable=n.syncErrorThrowable,u.destination=n,n.add(u)):(u.syncErrorThrowable=!0,u.destination=new l(u,n));break}default:u.syncErrorThrowable=!0,u.destination=new l(u,n,e,o)}return u}return e.a(t,r),t.prototype[c.a]=function(){return this},t.create=function(r,n,e){var o=new t(r,n,e);return o.syncErrorThrowable=!1,o},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this))},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},t}(u.a),l=function(r){function t(t,n,e,u){var c=r.call(this)||this,s;c._parentSubscriber=t;var a=c;return Object(o.a)(n)?s=n:n&&(s=n.next,e=n.error,u=n.complete,n!==i.a&&(a=Object.create(n),Object(o.a)(a.unsubscribe)&&c.add(a.unsubscribe.bind(a)),a.unsubscribe=c.unsubscribe.bind(c))),c._context=a,c._next=s,c._error=e,c._complete=u,c}return e.a(t,r),t.prototype.next=function(r){if(!this.isStopped&&this._next){var t=this._parentSubscriber;s.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,r)&&this.unsubscribe():this.__tryOrUnsub(this._next,r)}},t.prototype.error=function(r){if(!this.isStopped){var t=this._parentSubscriber,n=s.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,r),this.unsubscribe()):(this.__tryOrUnsub(this._error,r),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=r,t.syncErrorThrown=!0):Object(a.a)(r),this.unsubscribe();else{if(this.unsubscribe(),n)throw r;Object(a.a)(r)}}},t.prototype.complete=function(){var r=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return r._complete.call(r._context)};s.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(r,t){try{r.call(this._context,t)}catch(r){if(this.unsubscribe(),s.a.useDeprecatedSynchronousErrorHandling)throw r;Object(a.a)(r)}},t.prototype.__tryOrSetError=function(r,t,n){if(!s.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return s.a.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=t,r.syncErrorThrown=!0,!0):(Object(a.a)(t),!0)}return!1},t.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},t}(f)}})});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
package/core/index.d.ts
ADDED
package/core/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function e(t,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var r=n();for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=205)}({12:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(e,t){this._code=t}return Object.defineProperty(e.prototype,"code",{get:function(){return this._code},enumerable:!1,configurable:!0}),e}()},205:function(e,t,n){"use strict";n.r(t);var r=n(12);n.d(t,"CsError",function(){return r.a});var o=n(50);n.d(t,"CsClientStorage",function(){return o.a})},50:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(){}return e.TRACE_ID="trace_id",e}()}})});
|
package/cs-module.d.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { CsHttpService } from './core/http-service/interface';
|
|
2
|
+
import { CsGroupService } from './services/group/interface';
|
|
3
|
+
import { CsContentService } from './services/content/interface';
|
|
4
|
+
import { CsFrameworkService } from './services/framework/interface';
|
|
5
|
+
import { CsLocationService } from './services/location/interface';
|
|
6
|
+
import { CsCourseService } from './services/course/interface';
|
|
7
|
+
import { CsUserService } from './services/user/interface';
|
|
8
|
+
import { CsFormService, FormParams } from './services/form/interface/cs-form-service';
|
|
9
|
+
import { CsSystemSettingsService } from './services/system-settings/interface';
|
|
10
|
+
import { CsClientStorage } from './core/cs-client-storage';
|
|
11
|
+
import { CsDiscussionService } from './services/discussion';
|
|
12
|
+
import { CsNotificationService } from './services/notification/interface/cs-notification-service';
|
|
13
|
+
import { CsCertificateService } from './services/certificate';
|
|
14
|
+
import { Framework } from './models';
|
|
15
|
+
export interface CsDiscussionServiceConfig {
|
|
16
|
+
apiPath: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CsSystemSettingsServiceConfig {
|
|
19
|
+
apiPath: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CsUserServiceConfig {
|
|
22
|
+
apiPath: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CsGroupServiceConfig {
|
|
25
|
+
apiPath: string;
|
|
26
|
+
dataApiPath: string;
|
|
27
|
+
updateGroupGuidelinesApiPath?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface CsContentServiceConfig {
|
|
30
|
+
hierarchyApiPath: string;
|
|
31
|
+
questionListApiPath: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CsFrameworkServiceConfig {
|
|
34
|
+
apiPath: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CsLocationServiceConfig {
|
|
37
|
+
apiPath: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CsCourseServiceConfig {
|
|
40
|
+
apiPath: string;
|
|
41
|
+
certRegistrationApiPath?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface CsFormServiceConfig {
|
|
44
|
+
apiPath: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CsNotificationServiceConfig {
|
|
47
|
+
apiPath: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CsCertificateServiceConfig {
|
|
50
|
+
apiPath: string;
|
|
51
|
+
apiPathLegacy?: string;
|
|
52
|
+
rcApiPath: string;
|
|
53
|
+
}
|
|
54
|
+
export interface CsCertificateServiceConfig {
|
|
55
|
+
apiPath: string;
|
|
56
|
+
apiPathLegacy?: string;
|
|
57
|
+
rcApiPath: string;
|
|
58
|
+
}
|
|
59
|
+
export interface CsFrameworkConfig {
|
|
60
|
+
apiPath: string;
|
|
61
|
+
framework?: Framework;
|
|
62
|
+
}
|
|
63
|
+
export interface CsFormConfig {
|
|
64
|
+
apiPath: string;
|
|
65
|
+
params?: FormParams;
|
|
66
|
+
}
|
|
67
|
+
export interface CsConfig {
|
|
68
|
+
core: {
|
|
69
|
+
httpAdapter?: 'HttpClientBrowserAdapter' | 'HttpClientCordovaAdapter';
|
|
70
|
+
global: {
|
|
71
|
+
channelId?: string;
|
|
72
|
+
producerId?: string;
|
|
73
|
+
deviceId?: string;
|
|
74
|
+
sessionId?: string;
|
|
75
|
+
appVersion?: string;
|
|
76
|
+
};
|
|
77
|
+
api: {
|
|
78
|
+
host: string;
|
|
79
|
+
authentication: {
|
|
80
|
+
userToken?: string;
|
|
81
|
+
managedUserToken?: string;
|
|
82
|
+
bearerToken?: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
services: {
|
|
87
|
+
userServiceConfig?: CsUserServiceConfig;
|
|
88
|
+
groupServiceConfig?: CsGroupServiceConfig;
|
|
89
|
+
frameworkServiceConfig?: CsFrameworkServiceConfig;
|
|
90
|
+
locationServiceConfig?: CsLocationServiceConfig;
|
|
91
|
+
courseServiceConfig?: CsCourseServiceConfig;
|
|
92
|
+
formServiceConfig?: CsFormServiceConfig;
|
|
93
|
+
systemSettingsServiceConfig?: CsSystemSettingsServiceConfig;
|
|
94
|
+
discussionServiceConfig?: CsDiscussionServiceConfig;
|
|
95
|
+
contentServiceConfig?: CsContentServiceConfig;
|
|
96
|
+
notificationServiceConfig?: CsNotificationServiceConfig;
|
|
97
|
+
certificateServiceConfig?: CsCertificateServiceConfig;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export declare class CsModule {
|
|
101
|
+
private _container;
|
|
102
|
+
private onUpdateConfigCallback?;
|
|
103
|
+
static _instance?: CsModule;
|
|
104
|
+
static get instance(): CsModule;
|
|
105
|
+
private _isInitialised;
|
|
106
|
+
get isInitialised(): boolean;
|
|
107
|
+
private _config;
|
|
108
|
+
get config(): CsConfig;
|
|
109
|
+
get httpService(): CsHttpService;
|
|
110
|
+
get groupService(): CsGroupService;
|
|
111
|
+
get contentService(): CsContentService;
|
|
112
|
+
get frameworkService(): CsFrameworkService;
|
|
113
|
+
get locationService(): CsLocationService;
|
|
114
|
+
get courseService(): CsCourseService;
|
|
115
|
+
get userService(): CsUserService;
|
|
116
|
+
get formService(): CsFormService;
|
|
117
|
+
get systemSettingsService(): CsSystemSettingsService;
|
|
118
|
+
get discussionService(): CsDiscussionService;
|
|
119
|
+
get notificationService(): CsNotificationService;
|
|
120
|
+
get certificateService(): CsCertificateService;
|
|
121
|
+
init(config: CsConfig, onConfigUpdate?: () => void, clientStorage?: CsClientStorage): Promise<void>;
|
|
122
|
+
updateConfig(config: CsConfig): void;
|
|
123
|
+
updateAuthTokenConfig(accessToken: string): void;
|
|
124
|
+
}
|
package/index.d.ts
ADDED