@glvnzn/web-sdk
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -0,0 +0,0 @@ import { Games } from './resources/games'; |
@@ -1,1 +0,1 @@ | ||
function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},e.apply(this,arguments)}function t(e,o){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t(e,o)}var o=[{id:1,name:"Mock Game 1",image:"mock_image_1.jpg",provider:"Mock Provider 1",type:"Mock Type 1"},{id:2,name:"Mock Game 2",image:"mock_image_2.jpg",provider:"Mock Provider 2",type:"Mock Type 2"},{id:3,name:"Mock Game 3",image:"mock_image_3.jpg",provider:"Mock Provider 3",type:"Mock Type 3"}],r=/*#__PURE__*/function(e){var r,i;function n(){return e.apply(this,arguments)||this}return i=e,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,t(r,i),n.prototype.get=function(){return Promise.resolve(o)},n}(/*#__PURE__*/function(){function t(e){this.apiKey=void 0,this.baseUrl=void 0,this.apiKey=e.apiKey,this.baseUrl=e.baseUrl||"https://api.scalecms.io"}return t.prototype.request=function(t,o){var r=""+this.baseUrl+t,i=e({},o,{headers:{"Content-Type":"application/json","api-key":this.apiKey}});return fetch(r,i).then(function(e){if(e.ok)return e.json();throw new Error(e.statusText)})},t}());exports.ScaleCMS=function(e){this.games=void 0,this.games=new r(e)}; | ||
function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},t.apply(this,arguments)}function e(t,r){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,r)}var r=/*#__PURE__*/function(t){var r,i;function o(){return t.apply(this,arguments)||this}return i=t,(r=o).prototype=Object.create(i.prototype),r.prototype.constructor=r,e(r,i),o.prototype.get=function(t){return this.request("/games",{method:"GET"},{first:""+t.first})},o}(/*#__PURE__*/function(){function e(t){this.apiKey=void 0,this.baseUrl=void 0,this.siteId=void 0,this.apiKey=t.apiKey,this.baseUrl=t.baseUrl||"http://site-api.opexacms.io/v1",this.siteId=t.siteId||"XubL48WAbKNdpyQ3h"}return e.prototype.request=function(e,r,i){var o=""+this.baseUrl+e,n={"Content-Type":"application/json","api-key":this.apiKey,site_id:this.siteId},s="";i&&(s=new URLSearchParams(i).toString());var a=t({},r,{headers:n});return fetch(o+(s?"?"+s:""),t({},a,{method:(null==r?void 0:r.method)||"GET"})).then(function(t){if(t.ok)return t.json();throw new Error(t.statusText)})},e}());exports.ScaleCMS=function(t){this.games=void 0,this.games=new r(t)}; |
@@ -1,1 +0,1 @@ | ||
function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},e.apply(this,arguments)}function t(e,o){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t(e,o)}var o=[{id:1,name:"Mock Game 1",image:"mock_image_1.jpg",provider:"Mock Provider 1",type:"Mock Type 1"},{id:2,name:"Mock Game 2",image:"mock_image_2.jpg",provider:"Mock Provider 2",type:"Mock Type 2"},{id:3,name:"Mock Game 3",image:"mock_image_3.jpg",provider:"Mock Provider 3",type:"Mock Type 3"}],r=/*#__PURE__*/function(e){var r,i;function n(){return e.apply(this,arguments)||this}return i=e,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,t(r,i),n.prototype.get=function(){return Promise.resolve(o)},n}(/*#__PURE__*/function(){function t(e){this.apiKey=void 0,this.baseUrl=void 0,this.apiKey=e.apiKey,this.baseUrl=e.baseUrl||"https://api.scalecms.io"}return t.prototype.request=function(t,o){var r=""+this.baseUrl+t,i=e({},o,{headers:{"Content-Type":"application/json","api-key":this.apiKey}});return fetch(r,i).then(function(e){if(e.ok)return e.json();throw new Error(e.statusText)})},t}()),i=function(e){this.games=void 0,this.games=new r(e)};export{i as ScaleCMS}; | ||
function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},t.apply(this,arguments)}function e(t,r){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,r)}var r=/*#__PURE__*/function(t){var r,i;function o(){return t.apply(this,arguments)||this}return i=t,(r=o).prototype=Object.create(i.prototype),r.prototype.constructor=r,e(r,i),o.prototype.get=function(t){return this.request("/games",{method:"GET"},{first:""+t.first})},o}(/*#__PURE__*/function(){function e(t){this.apiKey=void 0,this.baseUrl=void 0,this.siteId=void 0,this.apiKey=t.apiKey,this.baseUrl=t.baseUrl||"http://site-api.opexacms.io/v1",this.siteId=t.siteId||"XubL48WAbKNdpyQ3h"}return e.prototype.request=function(e,r,i){var o=""+this.baseUrl+e,n={"Content-Type":"application/json","api-key":this.apiKey,site_id:this.siteId},s="";i&&(s=new URLSearchParams(i).toString());var a=t({},r,{headers:n});return fetch(o+(s?"?"+s:""),t({},a,{method:(null==r?void 0:r.method)||"GET"})).then(function(t){if(t.ok)return t.json();throw new Error(t.statusText)})},e}()),i=function(t){this.games=void 0,this.games=new r(t)};export{i as ScaleCMS}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).webSdk={})}(this,function(e){function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},t.apply(this,arguments)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}var r=[{id:1,name:"Mock Game 1",image:"mock_image_1.jpg",provider:"Mock Provider 1",type:"Mock Type 1"},{id:2,name:"Mock Game 2",image:"mock_image_2.jpg",provider:"Mock Provider 2",type:"Mock Type 2"},{id:3,name:"Mock Game 3",image:"mock_image_3.jpg",provider:"Mock Provider 3",type:"Mock Type 3"}],i=/*#__PURE__*/function(e){var t,i;function n(){return e.apply(this,arguments)||this}return i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,o(t,i),n.prototype.get=function(){return Promise.resolve(r)},n}(/*#__PURE__*/function(){function e(e){this.apiKey=void 0,this.baseUrl=void 0,this.apiKey=e.apiKey,this.baseUrl=e.baseUrl||"https://api.scalecms.io"}return e.prototype.request=function(e,o){var r=""+this.baseUrl+e,i=t({},o,{headers:{"Content-Type":"application/json","api-key":this.apiKey}});return fetch(r,i).then(function(e){if(e.ok)return e.json();throw new Error(e.statusText)})},e}());e.ScaleCMS=function(e){this.games=void 0,this.games=new i(e)}}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t||self).webSdk={})}(this,function(t){function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},e.apply(this,arguments)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=/*#__PURE__*/function(t){var e,o;function n(){return t.apply(this,arguments)||this}return o=t,(e=n).prototype=Object.create(o.prototype),e.prototype.constructor=e,i(e,o),n.prototype.get=function(t){return this.request("/games",{method:"GET"},{first:""+t.first})},n}(/*#__PURE__*/function(){function t(t){this.apiKey=void 0,this.baseUrl=void 0,this.siteId=void 0,this.apiKey=t.apiKey,this.baseUrl=t.baseUrl||"http://site-api.opexacms.io/v1",this.siteId=t.siteId||"XubL48WAbKNdpyQ3h"}return t.prototype.request=function(t,i,o){var n=""+this.baseUrl+t,r={"Content-Type":"application/json","api-key":this.apiKey,site_id:this.siteId},s="";o&&(s=new URLSearchParams(o).toString());var a=e({},i,{headers:r});return fetch(n+(s?"?"+s:""),e({},a,{method:(null==i?void 0:i.method)||"GET"})).then(function(t){if(t.ok)return t.json();throw new Error(t.statusText)})},t}());t.ScaleCMS=function(t){this.games=void 0,this.games=new o(t)}}); |
type Config = { | ||
apiKey: string; | ||
baseUrl?: string; | ||
siteId?: string; | ||
}; | ||
@@ -8,5 +9,6 @@ export declare abstract class Base { | ||
private baseUrl; | ||
private siteId; | ||
constructor(config: Config); | ||
protected request<T>(endpoint: string, options?: RequestInit): Promise<T>; | ||
protected request<T>(endpoint: string, options?: RequestInit, queryParams?: Record<string, string>): Promise<T>; | ||
} | ||
export {}; |
import { Base } from '../base'; | ||
import { Game } from './types'; | ||
import { Game, QueryParams } from './types'; | ||
export declare class Games extends Base { | ||
get(): Promise<Game[]>; | ||
get(params: QueryParams): Promise<Game[]>; | ||
} |
@@ -12,1 +12,4 @@ export declare type Game = { | ||
}; | ||
export declare type QueryParams = { | ||
first: number; | ||
}; |
{ | ||
"name": "@glvnzn/web-sdk", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
60
6705