totalum-api-sdk 1.0.10 → 1.0.12

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.
Files changed (3) hide show
  1. package/index.js +6 -0
  2. package/index.ts +6 -3
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -75,6 +75,12 @@ class TotalumApiSdk {
75
75
  }
76
76
  return url;
77
77
  }
78
+ getItemById(itemType, id) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const url = this.getUrl(endpoints.crud.getObjectById, { typeId: itemType, id });
81
+ return axios_1.default.get(url, { headers: this.headers });
82
+ });
83
+ }
78
84
  getItems(itemType, query) {
79
85
  return __awaiter(this, void 0, void 0, function* () {
80
86
  const url = this.getUrl(endpoints.crud.getObjects, { typeId: itemType });
package/index.ts CHANGED
@@ -172,9 +172,7 @@ export interface DataValues {
172
172
  }
173
173
 
174
174
  export interface DataProperties {
175
- [key: string]: {
176
- value: fieldValuesEnabled,
177
- },
175
+ [key: string]: fieldValuesEnabled | {name: string, previousFilename: string},
178
176
  }
179
177
 
180
178
 
@@ -254,6 +252,11 @@ export class TotalumApiSdk {
254
252
  return url;
255
253
  }
256
254
 
255
+ public async getItemById(itemType: string, id: string) {
256
+ const url = this.getUrl(endpoints.crud.getObjectById, { typeId: itemType, id });
257
+ return axios.get(url, { headers: this.headers });
258
+ }
259
+
257
260
  public async getItems(itemType: string, query?: FilterSearchQueryI) {
258
261
  const url = this.getUrl(endpoints.crud.getObjects, { typeId: itemType });
259
262
  return axios.get(url, { params: query, headers: this.headers });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "totalum-api-sdk",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Totalum sdk wraper of totalum api",
5
5
  "main": "index.js",
6
6
  "scripts": {