@apolitical/sdk 0.8.2 → 0.8.3-rc.1
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/CHANGELOG.md +3 -2
- package/build/index.js +1 -1
- package/package.json +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [0.8.
|
|
8
|
+
## [0.8.3] - 2022-04-07
|
|
9
9
|
### Added
|
|
10
|
-
-
|
|
10
|
+
- Create user lesson
|
|
11
|
+
- List user lesson
|
|
11
12
|
|
|
12
13
|
## [0.8.1] - 2022-03-28
|
|
13
14
|
### Added
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/auth"),require("axios"),require("http-status-codes"),require("buffer")):"function"==typeof define&&define.amd?define(["@apolitical/content","@apolitical/error-reporting","@apolitical/auth","axios","http-status-codes","buffer"],e):"object"==typeof exports?exports.ApoliticalSDK=e(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/auth"),require("axios"),require("http-status-codes"),require("buffer")):t.ApoliticalSDK=e(t["@apolitical/content"],t["@apolitical/error-reporting"],t["@apolitical/auth"],t.axios,t["http-status-codes"],t.buffer)}(this,(function(t,e,r,
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/auth"),require("axios"),require("http-status-codes"),require("buffer")):"function"==typeof define&&define.amd?define(["@apolitical/content","@apolitical/error-reporting","@apolitical/auth","axios","http-status-codes","buffer"],e):"object"==typeof exports?exports.ApoliticalSDK=e(require("@apolitical/content"),require("@apolitical/error-reporting"),require("@apolitical/auth"),require("axios"),require("http-status-codes"),require("buffer")):t.ApoliticalSDK=e(t["@apolitical/content"],t["@apolitical/error-reporting"],t["@apolitical/auth"],t.axios,t["http-status-codes"],t.buffer)}(this,(function(t,e,r,a,n,o){return function(){"use strict";var i={654:function(t){t.exports=r},809:function(e){e.exports=t},30:function(t){t.exports=e},300:function(t){t.exports=a},408:function(t){t.exports=o},25:function(t){t.exports=n}},s={};function c(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}};return i[t](r,r.exports,c),r.exports}c.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return c.d(e,{a:e}),e},c.d=function(t,e){for(var r in e)c.o(e,r)&&!c.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},c.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},c.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var u={};return function(){c.r(u),c.d(u,{assets:function(){return p},decodeBase64:function(){return H},default:function(){return J},getEntries:function(){return t.getEntries},getEntry:function(){return t.getEntry},management:function(){return d},passwordlessLogin:function(){return r.passwordlessLogin},people:function(){return M},peopleEngagement:function(){return K},reportError:function(){return e.reportError},sendVerificationEmail:function(){return r.sendVerificationEmail}});var t=c(809),e=c(30),r=c(654),a=c(300),n=c.n(a),o={APIS:{ASSETS_API:{BASE_URL:"/api/assets-api",ENDPOINTS:{USERS:"/users",CERTIFICATES:"/certificates"}},MANAGEMENT_API:{BASE_URL:"/api/management-api",ENDPOINTS:{ACCOUNTS:"/accounts"}},PEOPLE_API:{BASE_URL:"/api/people-api",ENDPOINTS:{USERS:"/users",USER_COURSES:"/courses",USER_LESSONS:"/lessons",REGISTRATIONS:"/registrations"}},PEOPLE_ENGAGEMENT_API:{BASE_URL:"/api/people-engagement-api",ENDPOINTS:{USERS:"/users",USER_PROPERTIES:"/properties"}}},USERS:{MYSELF_SLUG:"me"}};const i=async t=>{try{const{message:r,response:a,request:n}=t;let o=r;a?o+=` - The request was made and the server responded with ${JSON.stringify({status:a.status,data:a.data})}`:n&&(o+=" - The request was made but no response was received"),console.warn(o),await(0,e.reportError)(new Error(o))}catch(t){console.warn(`Cannot handle error: ${t.message}`)}},{APIS:{ASSETS_API:{BASE_URL:s,ENDPOINTS:{USERS:S,CERTIFICATES:E}}}}=o;var p={certificates:{create:async(t,e)=>{let r=[];try{const{data:a}=await n().post(`${s}${S}/${t}${E}`,e);a&&a.length&&(r=a)}catch(t){await i(t)}return r}}};const{APIS:{MANAGEMENT_API:{BASE_URL:l,ENDPOINTS:{ACCOUNTS:f}}}}=o;var d={accounts:{create:async t=>{try{await n().post(`${l}${f}`,t)}catch(t){throw await i(t),t}},read:async t=>{let e=null;try{({data:e}=await n().get(`${l}${f}/${encodeURIComponent(t)}`))}catch(t){await i(t)}return e},update:async(t,e)=>{try{await n().put(`${l}${f}/${encodeURIComponent(t)}`,e)}catch(t){throw await i(t),t}}}};const{APIS:{PEOPLE_API:{BASE_URL:P,ENDPOINTS:{REGISTRATIONS:A}}}}=o;var I={list:async t=>{let e=[];try{const{data:r}=await n().get(`${P}${A}`,{params:t});r&&r.length&&(e=r)}catch(t){await i(t)}return e}},R=c(25);const{OK:g,MULTIPLE_CHOICES:y,NOT_FOUND:O,FORBIDDEN:U}=R.StatusCodes,N=t=>t>=g&&t<y||t===U||t===O,{APIS:{PEOPLE_API:{BASE_URL:_,ENDPOINTS:{USERS:w}}}}=o;var h={read:async t=>{let e=null;try{const{data:r}=await n().get(`${_}${w}/${encodeURIComponent(t)}`,{validateStatus:N});r&&r.slug&&(e=r)}catch(t){await i(t)}return e}};const{APIS:{PEOPLE_API:{BASE_URL:T,ENDPOINTS:{USERS:$,USER_COURSES:L}}},USERS:{MYSELF_SLUG:m}}=o,x=`${T}${$}/${m}${L}`;var C={create:async t=>{try{await n().post(x,t)}catch(t){await i(t)}},list:async t=>{let e=[],r=t?{params:t}:{params:{}};try{const{data:t}=await n().get(x,r);t&&t.length&&(e=t)}catch(t){await i(t)}return e},update:async(t,e)=>{try{await n().put(`${x}/${t}`,e)}catch(t){await i(t)}}};const{APIS:{PEOPLE_API:{BASE_URL:b,ENDPOINTS:{USERS:v,USER_LESSONS:D}}},USERS:{MYSELF_SLUG:q}}=o,B=`${b}${v}/${q}${D}`;var M={registrations:I,users:h,userCourses:C,userLessons:{create:async t=>{try{await n().post(B,t)}catch(t){await i(t)}},list:async t=>{let e=[],r=t?{params:t}:{params:{}};try{const{data:t}=await n().get(B,r);t&&t.length&&(e=t)}catch(t){await i(t)}return e}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:G,ENDPOINTS:{USERS:j,USER_PROPERTIES:F}}},USERS:{MYSELF_SLUG:Y}}=o;var K={userProperties:{update:async(t,e)=>{try{await n().put(`${G}${j}/${Y}${F}/${t}`,e)}catch(t){await i(t)}}}},V=c(408);const H=t=>t&&V.Buffer.from(t,"base64").toString("ascii");function J({authContext:a=null,contentContext:n=null,errorsContext:o=null,origin:i}){a&&(0,r.setContext)(Object.assign({},a,{origin:i})),n&&(0,t.setContext)(Object.assign({},n,{origin:i})),o&&(0,e.setContext)(Object.assign({},o,{origin:i}))}}(),u}()}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apolitical/sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3-rc.1",
|
|
4
4
|
"description": "Browser library to interact with Apolitical's APIs",
|
|
5
5
|
"author": "Apolitical Group Limited <engineering@apolitical.co>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"@apolitical/auth": "0.0.2",
|
|
29
29
|
"@apolitical/content": "0.3.0",
|
|
30
30
|
"@apolitical/error-reporting": "0.1.0",
|
|
31
|
-
"@apolitical/gtm": "1.0.0",
|
|
32
31
|
"axios": "0.26.0",
|
|
33
32
|
"buffer": "6.0.3",
|
|
34
33
|
"http-status-codes": "2.2.0"
|
|
@@ -37,7 +36,6 @@
|
|
|
37
36
|
"@apolitical/auth": "0.0.2",
|
|
38
37
|
"@apolitical/content": "0.3.0",
|
|
39
38
|
"@apolitical/error-reporting": "0.1.0",
|
|
40
|
-
"@apolitical/gtm": "1.0.0",
|
|
41
39
|
"axios": "0.26.0",
|
|
42
40
|
"buffer": "6.0.3",
|
|
43
41
|
"http-status-codes": "2.2.0"
|