@texturehq/device 1.18.0 → 2.1.0
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/dist/common/cache.d.ts +20 -0
- package/dist/common/cache.d.ts.map +1 -0
- package/dist/common/cache.js +40 -0
- package/dist/common/cache.js.map +1 -0
- package/dist/common/constants.d.ts +1 -1
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +1 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/fetch.d.ts +10 -0
- package/dist/common/fetch.d.ts.map +1 -0
- package/dist/common/fetch.js +39 -0
- package/dist/common/fetch.js.map +1 -0
- package/dist/deviceModel/getDeviceModel/index.d.ts +5 -10
- package/dist/deviceModel/getDeviceModel/index.d.ts.map +1 -1
- package/dist/deviceModel/getDeviceModel/index.js +39 -22
- package/dist/deviceModel/getDeviceModel/index.js.map +1 -1
- package/dist/deviceModel/getDeviceModel/response.interfaces.d.ts +5 -94
- package/dist/deviceModel/getDeviceModel/response.interfaces.d.ts.map +1 -1
- package/dist/deviceModel/getDeviceModel/response.interfaces.js +0 -249
- package/dist/deviceModel/getDeviceModel/response.interfaces.js.map +1 -1
- package/dist/deviceModel/getDeviceModelByManufacturerSlug/index.d.ts +6 -11
- package/dist/deviceModel/getDeviceModelByManufacturerSlug/index.d.ts.map +1 -1
- package/dist/deviceModel/getDeviceModelByManufacturerSlug/index.js +39 -29
- package/dist/deviceModel/getDeviceModelByManufacturerSlug/index.js.map +1 -1
- package/dist/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.d.ts +5 -52
- package/dist/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.d.ts.map +1 -1
- package/dist/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.js +0 -207
- package/dist/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.js.map +1 -1
- package/dist/deviceModel/getDeviceModels/index.d.ts +5 -10
- package/dist/deviceModel/getDeviceModels/index.d.ts.map +1 -1
- package/dist/deviceModel/getDeviceModels/index.js +50 -28
- package/dist/deviceModel/getDeviceModels/index.js.map +1 -1
- package/dist/deviceModel/getDeviceModels/response.interfaces.d.ts +15 -84
- package/dist/deviceModel/getDeviceModels/response.interfaces.d.ts.map +1 -1
- package/dist/deviceModel/getDeviceModels/response.interfaces.js +0 -249
- package/dist/deviceModel/getDeviceModels/response.interfaces.js.map +1 -1
- package/dist/deviceModel/getDeviceModels/test.success.js +0 -1
- package/dist/deviceModel/getDeviceModels/test.success.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/manufacturer/getManufacturer/index.d.ts +7 -16
- package/dist/manufacturer/getManufacturer/index.d.ts.map +1 -1
- package/dist/manufacturer/getManufacturer/index.js +24 -21
- package/dist/manufacturer/getManufacturer/index.js.map +1 -1
- package/dist/manufacturer/getManufacturer/response.interfaces.d.ts +6 -76
- package/dist/manufacturer/getManufacturer/response.interfaces.d.ts.map +1 -1
- package/dist/manufacturer/getManufacturer/response.interfaces.js +0 -231
- package/dist/manufacturer/getManufacturer/response.interfaces.js.map +1 -1
- package/dist/manufacturer/getManufacturers/index.d.ts +4 -10
- package/dist/manufacturer/getManufacturers/index.d.ts.map +1 -1
- package/dist/manufacturer/getManufacturers/index.js +37 -20
- package/dist/manufacturer/getManufacturers/index.js.map +1 -1
- package/dist/manufacturer/getManufacturers/response.interfaces.d.ts +12 -74
- package/dist/manufacturer/getManufacturers/response.interfaces.d.ts.map +1 -1
- package/dist/manufacturer/getManufacturers/response.interfaces.js +0 -239
- package/dist/manufacturer/getManufacturers/response.interfaces.js.map +1 -1
- package/dist/manufacturer/getManufacturers/test.success.js +1 -1
- package/dist/manufacturer/getManufacturers/test.success.js.map +1 -1
- package/dist/manufacturer/parseManufacturer/index.d.ts +5 -2
- package/dist/manufacturer/parseManufacturer/index.d.ts.map +1 -1
- package/dist/manufacturer/parseManufacturer/index.js +18 -23
- package/dist/manufacturer/parseManufacturer/index.js.map +1 -1
- package/package.json +1 -7
- package/dist/common/axios.d.ts +0 -3
- package/dist/common/axios.d.ts.map +0 -1
- package/dist/common/axios.js +0 -29
- package/dist/common/axios.js.map +0 -1
|
@@ -1,252 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// To parse this data:
|
|
3
|
-
//
|
|
4
|
-
// import { Convert, ResponseInterfaces } from "./file";
|
|
5
|
-
//
|
|
6
|
-
// const responseInterfaces = Convert.toResponseInterfaces(json);
|
|
7
|
-
//
|
|
8
|
-
// These functions will throw an error if the JSON doesn't
|
|
9
|
-
// match the expected interface, even if the JSON is valid.
|
|
10
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.Convert = void 0;
|
|
12
|
-
// Converts JSON strings to/from your types
|
|
13
|
-
// and asserts the results of JSON.parse at runtime
|
|
14
|
-
class Convert {
|
|
15
|
-
static toResponseInterfaces(json) {
|
|
16
|
-
return cast(JSON.parse(json), r("ResponseInterfaces"));
|
|
17
|
-
}
|
|
18
|
-
static responseInterfacesToJson(value) {
|
|
19
|
-
return JSON.stringify(uncast(value, r("ResponseInterfaces")), null, 2);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.Convert = Convert;
|
|
23
|
-
function invalidValue(typ, val, key, parent = '') {
|
|
24
|
-
const prettyTyp = prettyTypeName(typ);
|
|
25
|
-
const parentText = parent ? ` on ${parent}` : '';
|
|
26
|
-
const keyText = key ? ` for key "${key}"` : '';
|
|
27
|
-
throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
|
|
28
|
-
}
|
|
29
|
-
function prettyTypeName(typ) {
|
|
30
|
-
if (Array.isArray(typ)) {
|
|
31
|
-
if (typ.length === 2 && typ[0] === undefined) {
|
|
32
|
-
return `an optional ${prettyTypeName(typ[1])}`;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
else if (typeof typ === "object" && typ.literal !== undefined) {
|
|
39
|
-
return typ.literal;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return typeof typ;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function jsonToJSProps(typ) {
|
|
46
|
-
if (typ.jsonToJS === undefined) {
|
|
47
|
-
const map = {};
|
|
48
|
-
typ.props.forEach((p) => map[p.json] = { key: p.js, typ: p.typ });
|
|
49
|
-
typ.jsonToJS = map;
|
|
50
|
-
}
|
|
51
|
-
return typ.jsonToJS;
|
|
52
|
-
}
|
|
53
|
-
function jsToJSONProps(typ) {
|
|
54
|
-
if (typ.jsToJSON === undefined) {
|
|
55
|
-
const map = {};
|
|
56
|
-
typ.props.forEach((p) => map[p.js] = { key: p.json, typ: p.typ });
|
|
57
|
-
typ.jsToJSON = map;
|
|
58
|
-
}
|
|
59
|
-
return typ.jsToJSON;
|
|
60
|
-
}
|
|
61
|
-
function transform(val, typ, getProps, key = '', parent = '') {
|
|
62
|
-
function transformPrimitive(typ, val) {
|
|
63
|
-
if (typeof typ === typeof val)
|
|
64
|
-
return val;
|
|
65
|
-
return invalidValue(typ, val, key, parent);
|
|
66
|
-
}
|
|
67
|
-
function transformUnion(typs, val) {
|
|
68
|
-
// val must validate against one typ in typs
|
|
69
|
-
const l = typs.length;
|
|
70
|
-
for (let i = 0; i < l; i++) {
|
|
71
|
-
const typ = typs[i];
|
|
72
|
-
try {
|
|
73
|
-
return transform(val, typ, getProps);
|
|
74
|
-
}
|
|
75
|
-
catch (_) { }
|
|
76
|
-
}
|
|
77
|
-
return invalidValue(typs, val, key, parent);
|
|
78
|
-
}
|
|
79
|
-
function transformEnum(cases, val) {
|
|
80
|
-
if (cases.indexOf(val) !== -1)
|
|
81
|
-
return val;
|
|
82
|
-
return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
|
|
83
|
-
}
|
|
84
|
-
function transformArray(typ, val) {
|
|
85
|
-
// val must be an array with no invalid elements
|
|
86
|
-
if (!Array.isArray(val))
|
|
87
|
-
return invalidValue(l("array"), val, key, parent);
|
|
88
|
-
return val.map(el => transform(el, typ, getProps));
|
|
89
|
-
}
|
|
90
|
-
function transformDate(val) {
|
|
91
|
-
if (val === null) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
const d = new Date(val);
|
|
95
|
-
if (isNaN(d.valueOf())) {
|
|
96
|
-
return invalidValue(l("Date"), val, key, parent);
|
|
97
|
-
}
|
|
98
|
-
return d;
|
|
99
|
-
}
|
|
100
|
-
function transformObject(props, additional, val) {
|
|
101
|
-
if (val === null || typeof val !== "object" || Array.isArray(val)) {
|
|
102
|
-
return invalidValue(l(ref || "object"), val, key, parent);
|
|
103
|
-
}
|
|
104
|
-
const result = {};
|
|
105
|
-
Object.getOwnPropertyNames(props).forEach(key => {
|
|
106
|
-
const prop = props[key];
|
|
107
|
-
const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
|
|
108
|
-
result[prop.key] = transform(v, prop.typ, getProps, key, ref);
|
|
109
|
-
});
|
|
110
|
-
Object.getOwnPropertyNames(val).forEach(key => {
|
|
111
|
-
if (!Object.prototype.hasOwnProperty.call(props, key)) {
|
|
112
|
-
result[key] = transform(val[key], additional, getProps, key, ref);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
return result;
|
|
116
|
-
}
|
|
117
|
-
if (typ === "any")
|
|
118
|
-
return val;
|
|
119
|
-
if (typ === null) {
|
|
120
|
-
if (val === null)
|
|
121
|
-
return val;
|
|
122
|
-
return invalidValue(typ, val, key, parent);
|
|
123
|
-
}
|
|
124
|
-
if (typ === false)
|
|
125
|
-
return invalidValue(typ, val, key, parent);
|
|
126
|
-
let ref = undefined;
|
|
127
|
-
while (typeof typ === "object" && typ.ref !== undefined) {
|
|
128
|
-
ref = typ.ref;
|
|
129
|
-
typ = typeMap[typ.ref];
|
|
130
|
-
}
|
|
131
|
-
if (Array.isArray(typ))
|
|
132
|
-
return transformEnum(typ, val);
|
|
133
|
-
if (typeof typ === "object") {
|
|
134
|
-
return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
|
|
135
|
-
: typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
|
|
136
|
-
: typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
|
|
137
|
-
: invalidValue(typ, val, key, parent);
|
|
138
|
-
}
|
|
139
|
-
// Numbers can be parsed by Date but shouldn't be.
|
|
140
|
-
if (typ === Date && typeof val !== "number")
|
|
141
|
-
return transformDate(val);
|
|
142
|
-
return transformPrimitive(typ, val);
|
|
143
|
-
}
|
|
144
|
-
function cast(val, typ) {
|
|
145
|
-
return transform(val, typ, jsonToJSProps);
|
|
146
|
-
}
|
|
147
|
-
function uncast(val, typ) {
|
|
148
|
-
return transform(val, typ, jsToJSONProps);
|
|
149
|
-
}
|
|
150
|
-
function l(typ) {
|
|
151
|
-
return { literal: typ };
|
|
152
|
-
}
|
|
153
|
-
function a(typ) {
|
|
154
|
-
return { arrayItems: typ };
|
|
155
|
-
}
|
|
156
|
-
function u(...typs) {
|
|
157
|
-
return { unionMembers: typs };
|
|
158
|
-
}
|
|
159
|
-
function o(props, additional) {
|
|
160
|
-
return { props, additional };
|
|
161
|
-
}
|
|
162
|
-
function m(additional) {
|
|
163
|
-
return { props: [], additional };
|
|
164
|
-
}
|
|
165
|
-
function r(name) {
|
|
166
|
-
return { ref: name };
|
|
167
|
-
}
|
|
168
|
-
const typeMap = {
|
|
169
|
-
"ResponseInterfaces": o([
|
|
170
|
-
{ json: "docs", js: "docs", typ: a(r("Doc")) },
|
|
171
|
-
{ json: "totalDocs", js: "totalDocs", typ: 0 },
|
|
172
|
-
{ json: "limit", js: "limit", typ: 0 },
|
|
173
|
-
{ json: "totalPages", js: "totalPages", typ: 0 },
|
|
174
|
-
{ json: "page", js: "page", typ: 0 },
|
|
175
|
-
{ json: "pagingCounter", js: "pagingCounter", typ: 0 },
|
|
176
|
-
{ json: "hasPrevPage", js: "hasPrevPage", typ: true },
|
|
177
|
-
{ json: "hasNextPage", js: "hasNextPage", typ: true },
|
|
178
|
-
{ json: "prevPage", js: "prevPage", typ: null },
|
|
179
|
-
{ json: "nextPage", js: "nextPage", typ: 0 },
|
|
180
|
-
], false),
|
|
181
|
-
"Doc": o([
|
|
182
|
-
{ json: "id", js: "id", typ: "" },
|
|
183
|
-
{ json: "slug", js: "slug", typ: "" },
|
|
184
|
-
{ json: "name", js: "name", typ: "" },
|
|
185
|
-
{ json: "manufacturer", js: "manufacturer", typ: r("Manufacturer") },
|
|
186
|
-
{ json: "type", js: "type", typ: "" },
|
|
187
|
-
{ json: "support_level", js: "support_level", typ: "" },
|
|
188
|
-
{ json: "createdAt", js: "createdAt", typ: Date },
|
|
189
|
-
{ json: "updatedAt", js: "updatedAt", typ: Date },
|
|
190
|
-
], false),
|
|
191
|
-
"Manufacturer": o([
|
|
192
|
-
{ json: "id", js: "id", typ: "" },
|
|
193
|
-
{ json: "slug", js: "slug", typ: "" },
|
|
194
|
-
{ json: "name", js: "name", typ: "" },
|
|
195
|
-
{ json: "logo", js: "logo", typ: r("Logo") },
|
|
196
|
-
{ json: "support_level", js: "support_level", typ: "" },
|
|
197
|
-
{ json: "createdAt", js: "createdAt", typ: Date },
|
|
198
|
-
{ json: "updatedAt", js: "updatedAt", typ: Date },
|
|
199
|
-
{ json: "icon", js: "icon", typ: r("Icon") },
|
|
200
|
-
{ json: "vector_icon", js: "vector_icon", typ: r("Logo") },
|
|
201
|
-
], false),
|
|
202
|
-
"Icon": o([
|
|
203
|
-
{ json: "id", js: "id", typ: "" },
|
|
204
|
-
{ json: "alt", js: "alt", typ: "" },
|
|
205
|
-
{ json: "filename", js: "filename", typ: "" },
|
|
206
|
-
{ json: "mimeType", js: "mimeType", typ: "" },
|
|
207
|
-
{ json: "filesize", js: "filesize", typ: 0 },
|
|
208
|
-
{ json: "width", js: "width", typ: 0 },
|
|
209
|
-
{ json: "height", js: "height", typ: 0 },
|
|
210
|
-
{ json: "focalX", js: "focalX", typ: 0 },
|
|
211
|
-
{ json: "focalY", js: "focalY", typ: 0 },
|
|
212
|
-
{ json: "sizes", js: "sizes", typ: r("IconSizes") },
|
|
213
|
-
{ json: "createdAt", js: "createdAt", typ: Date },
|
|
214
|
-
{ json: "updatedAt", js: "updatedAt", typ: Date },
|
|
215
|
-
{ json: "url", js: "url", typ: "" },
|
|
216
|
-
], false),
|
|
217
|
-
"IconSizes": o([
|
|
218
|
-
{ json: "thumbnail", js: "thumbnail", typ: r("PurpleCard") },
|
|
219
|
-
{ json: "card", js: "card", typ: r("PurpleCard") },
|
|
220
|
-
{ json: "tablet", js: "tablet", typ: r("PurpleCard") },
|
|
221
|
-
], false),
|
|
222
|
-
"PurpleCard": o([
|
|
223
|
-
{ json: "width", js: "width", typ: 0 },
|
|
224
|
-
{ json: "height", js: "height", typ: 0 },
|
|
225
|
-
{ json: "mimeType", js: "mimeType", typ: "" },
|
|
226
|
-
{ json: "filesize", js: "filesize", typ: 0 },
|
|
227
|
-
{ json: "filename", js: "filename", typ: "" },
|
|
228
|
-
{ json: "url", js: "url", typ: "" },
|
|
229
|
-
], false),
|
|
230
|
-
"Logo": o([
|
|
231
|
-
{ json: "id", js: "id", typ: "" },
|
|
232
|
-
{ json: "alt", js: "alt", typ: "" },
|
|
233
|
-
{ json: "filename", js: "filename", typ: "" },
|
|
234
|
-
{ json: "mimeType", js: "mimeType", typ: "" },
|
|
235
|
-
{ json: "filesize", js: "filesize", typ: 0 },
|
|
236
|
-
{ json: "width", js: "width", typ: 0 },
|
|
237
|
-
{ json: "height", js: "height", typ: 0 },
|
|
238
|
-
{ json: "sizes", js: "sizes", typ: r("LogoSizes") },
|
|
239
|
-
{ json: "createdAt", js: "createdAt", typ: Date },
|
|
240
|
-
{ json: "updatedAt", js: "updatedAt", typ: Date },
|
|
241
|
-
{ json: "url", js: "url", typ: "" },
|
|
242
|
-
], false),
|
|
243
|
-
"LogoSizes": o([
|
|
244
|
-
{ json: "thumbnail", js: "thumbnail", typ: r("FluffyCard") },
|
|
245
|
-
{ json: "card", js: "card", typ: r("FluffyCard") },
|
|
246
|
-
{ json: "tablet", js: "tablet", typ: r("FluffyCard") },
|
|
247
|
-
], false),
|
|
248
|
-
"FluffyCard": o([
|
|
249
|
-
{ json: "url", js: "url", typ: null },
|
|
250
|
-
], false),
|
|
251
|
-
};
|
|
252
3
|
//# sourceMappingURL=response.interfaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.interfaces.js","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModels/response.interfaces.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,EAAE;AACF,0DAA0D;AAC1D,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,0DAA0D;AAC1D,2DAA2D;;;AAsG3D,2CAA2C;AAC3C,mDAAmD;AACnD,MAAa,OAAO;IACT,MAAM,CAAC,oBAAoB,CAAC,IAAY;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3D,CAAC;IAEM,MAAM,CAAC,wBAAwB,CAAC,KAAyB;QAC5D,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,oBAAoB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;CACJ;AARD,0BAQC;AAED,SAAS,YAAY,CAAC,GAAQ,EAAE,GAAQ,EAAE,GAAQ,EAAE,SAAc,EAAE;IAChE,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,GAAG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E,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE;QACnD,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE;QACjD,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE;QACjD,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;KACtC,EAAE,KAAK,CAAC;IACT,WAAW,EAAE,CAAC,CAAC;QACX,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE;QAC5D,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE;QAClD,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE;KACzD,EAAE,KAAK,CAAC;IACT,YAAY,EAAE,CAAC,CAAC;QACZ,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE;KACxC,EAAE,KAAK,CAAC;CACZ,CAAC"}
|
|
1
|
+
{"version":3,"file":"response.interfaces.js","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModels/response.interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const _1 = require(".");
|
|
4
4
|
const main = async () => {
|
|
5
5
|
await (0, _1.getDeviceModels)({
|
|
6
|
-
baseImageUrl: "https://device.cms.texture.energy",
|
|
7
6
|
slugs: ["tesla:cybertruck", "chargepoint:express"],
|
|
8
7
|
});
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.success.js","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModels/test.success.ts"],"names":[],"mappings":";;AAAA,wBAAoC;AAEpC,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;IACtB,MAAM,IAAA,kBAAe,EAAC;QACpB,
|
|
1
|
+
{"version":3,"file":"test.success.js","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModels/test.success.ts"],"names":[],"mappings":";;AAAA,wBAAoC;AAEpC,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;IACtB,MAAM,IAAA,kBAAe,EAAC;QACpB,KAAK,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;KACnD,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,IAAI,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./common/cache"), exports);
|
|
17
18
|
__exportStar(require("./common/constants"), exports);
|
|
18
19
|
__exportStar(require("./common/exceptions"), exports);
|
|
19
20
|
__exportStar(require("./common/supportLevel"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC;AACpC,wDAAsC;AAEtC,gDAA8B;AAC9B,gDAA8B;AAC9B,+CAA6B;AAC7B,iDAA+B;AAC/B,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,wDAAsC;AAEtC,gDAA8B;AAC9B,gDAA8B;AAC9B,+CAA6B;AAC7B,iDAA+B;AAC/B,4CAA0B"}
|
|
@@ -2,32 +2,23 @@ import { Logger } from "../../common/logger";
|
|
|
2
2
|
import { Manufacturer } from "../entities";
|
|
3
3
|
export interface GetManufacturerOptions {
|
|
4
4
|
/**
|
|
5
|
-
* The slug of the manufacturer to retrieve
|
|
5
|
+
* The slug of the manufacturer to retrieve.
|
|
6
6
|
*/
|
|
7
7
|
slug: string;
|
|
8
8
|
/**
|
|
9
|
-
* The base URL of the
|
|
10
|
-
* @default "https://
|
|
9
|
+
* The base URL of the Texture REST API.
|
|
10
|
+
* @default "https://api.texturehq.com"
|
|
11
11
|
*/
|
|
12
12
|
baseApiUrl?: string;
|
|
13
13
|
/**
|
|
14
|
-
* The
|
|
15
|
-
* @default "https://device.cms.texture.energy"
|
|
16
|
-
*/
|
|
17
|
-
baseImageUrl?: string;
|
|
18
|
-
/**
|
|
19
|
-
* The logger instance to use during the getManufacturers operation.
|
|
14
|
+
* The logger instance to use during the getManufacturer operation.
|
|
20
15
|
*/
|
|
21
16
|
logger?: Logger;
|
|
22
17
|
}
|
|
23
|
-
type CachedManufacturer = (Manufacturer & {
|
|
24
|
-
cached?: boolean;
|
|
25
|
-
}) | null;
|
|
26
18
|
/**
|
|
27
|
-
* Retrieves a manufacturer from the
|
|
19
|
+
* Retrieves a manufacturer from the Texture REST API.
|
|
28
20
|
* @param options The options to use during the getManufacturer operation.
|
|
29
|
-
* @returns {Promise<Manufacturer | null>} The manufacturer retrieved from the
|
|
21
|
+
* @returns {Promise<Manufacturer | null>} The manufacturer retrieved from the API or null if not found.
|
|
30
22
|
*/
|
|
31
|
-
export declare const getManufacturer: (options: GetManufacturerOptions) => Promise<
|
|
32
|
-
export {};
|
|
23
|
+
export declare const getManufacturer: (options: GetManufacturerOptions) => Promise<Manufacturer | null>;
|
|
33
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/manufacturer/getManufacturer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/manufacturer/getManufacturer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,sBAAsB,KAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAwClG,CAAC"}
|
|
@@ -5,43 +5,46 @@ const logger_1 = require("../../common/logger");
|
|
|
5
5
|
const exceptions_1 = require("../../common/exceptions");
|
|
6
6
|
const constants_1 = require("../../common/constants");
|
|
7
7
|
const parseManufacturer_1 = require("../parseManufacturer");
|
|
8
|
-
const
|
|
8
|
+
const fetch_1 = require("../../common/fetch");
|
|
9
|
+
const cache_1 = require("../../common/cache");
|
|
9
10
|
/**
|
|
10
|
-
* Retrieves a manufacturer from the
|
|
11
|
+
* Retrieves a manufacturer from the Texture REST API.
|
|
11
12
|
* @param options The options to use during the getManufacturer operation.
|
|
12
|
-
* @returns {Promise<Manufacturer | null>} The manufacturer retrieved from the
|
|
13
|
+
* @returns {Promise<Manufacturer | null>} The manufacturer retrieved from the API or null if not found.
|
|
13
14
|
*/
|
|
14
15
|
const getManufacturer = async (options) => {
|
|
15
16
|
const defaultLogger = logger_1.baseLogger.function("getManufacturer");
|
|
16
|
-
const { slug, baseApiUrl = constants_1.PRODUCTION_BASE_URL,
|
|
17
|
-
const operation = logger.operation("get manufacturer from
|
|
18
|
-
const axios = (0, axios_1.getAxios)();
|
|
17
|
+
const { slug, baseApiUrl = constants_1.PRODUCTION_BASE_URL, logger = defaultLogger } = options;
|
|
18
|
+
const operation = logger.operation("get manufacturer from Texture REST API");
|
|
19
19
|
try {
|
|
20
|
+
const url = `${baseApiUrl}/v1/public/manufacturers`;
|
|
20
21
|
operation.start({ options });
|
|
21
|
-
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
let data = (0, cache_1.cacheGet)(url);
|
|
23
|
+
if (!data) {
|
|
24
|
+
const response = await (0, fetch_1.fetchWithRetry)(url);
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
const errorMessage = `Request to ${url} failed with status ${response.status}`;
|
|
27
|
+
operation.fail(errorMessage);
|
|
28
|
+
throw new exceptions_1.NetworkError(errorMessage, response.status);
|
|
29
|
+
}
|
|
30
|
+
data = (await response.json());
|
|
31
|
+
(0, cache_1.cacheSet)(url, data);
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
const match = data.find((m) => m.slug === slug);
|
|
34
|
+
if (!match) {
|
|
35
|
+
operation.fail({ slug });
|
|
29
36
|
return null;
|
|
30
37
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (!result.support_level) {
|
|
34
|
-
operation.fail("support_level is missing in the response data.");
|
|
38
|
+
if (!match.supportLevel) {
|
|
39
|
+
operation.fail("supportLevel is missing in the response data.");
|
|
35
40
|
return null;
|
|
36
41
|
}
|
|
37
|
-
const manufacturer = (0, parseManufacturer_1.parseManufacturer)(
|
|
38
|
-
// @ts-expect-error Property 'cached' does not exist
|
|
39
|
-
manufacturer.cached = response?.cached;
|
|
42
|
+
const manufacturer = (0, parseManufacturer_1.parseManufacturer)(match);
|
|
40
43
|
operation.end({ manufacturer });
|
|
41
44
|
return manufacturer;
|
|
42
45
|
}
|
|
43
46
|
catch (error) {
|
|
44
|
-
operation.fail("Unknown error occurred while fetching
|
|
47
|
+
operation.fail("Unknown error occurred while fetching manufacturer from Texture REST API.");
|
|
45
48
|
throw error;
|
|
46
49
|
}
|
|
47
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/manufacturer/getManufacturer/index.ts"],"names":[],"mappings":";;;AAAA,gDAAyD;AAEzD,wDAAuD;AAEvD,sDAA6D;AAC7D,4DAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/manufacturer/getManufacturer/index.ts"],"names":[],"mappings":";;;AAAA,gDAAyD;AAEzD,wDAAuD;AAEvD,sDAA6D;AAC7D,4DAAyD;AACzD,8CAAoD;AACpD,8CAAwD;AAkBxD;;;;GAIG;AACI,MAAM,eAAe,GAAG,KAAK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AC,KAAK,CAAC,YAAY,EAAE,CAAC;YACxB,SAAS,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,YAAY,GAAG,IAAA,qCAAiB,EAAC,KAAK,CAAC,CAAC;QAE9C,SAAS,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;QAChC,OAAO,YAAY,CAAC;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,SAAS,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;QAC5F,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAxCW,QAAA,eAAe,mBAwC1B"}
|
|
@@ -1,77 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
pagingCounter: number;
|
|
8
|
-
hasPrevPage: boolean;
|
|
9
|
-
hasNextPage: boolean;
|
|
10
|
-
prevPage: null;
|
|
11
|
-
nextPage: null;
|
|
12
|
-
}
|
|
13
|
-
export interface Doc {
|
|
14
|
-
id: string;
|
|
15
|
-
slug: string;
|
|
16
|
-
name: string;
|
|
17
|
-
logo: Logo;
|
|
18
|
-
createdAt: Date;
|
|
19
|
-
updatedAt: Date;
|
|
20
|
-
support_level: string;
|
|
21
|
-
icon: Icon;
|
|
22
|
-
vector_icon: Logo;
|
|
23
|
-
}
|
|
24
|
-
export interface Icon {
|
|
25
|
-
id: string;
|
|
26
|
-
alt: string;
|
|
27
|
-
filename: string;
|
|
28
|
-
mimeType: string;
|
|
29
|
-
filesize: number;
|
|
30
|
-
width: number;
|
|
31
|
-
height: number;
|
|
32
|
-
focalX: number;
|
|
33
|
-
focalY: number;
|
|
34
|
-
sizes: IconSizes;
|
|
35
|
-
createdAt: Date;
|
|
36
|
-
updatedAt: Date;
|
|
37
|
-
url: string;
|
|
38
|
-
}
|
|
39
|
-
export interface IconSizes {
|
|
40
|
-
thumbnail: PurpleCard;
|
|
41
|
-
card: PurpleCard;
|
|
42
|
-
tablet: PurpleCard;
|
|
43
|
-
}
|
|
44
|
-
export interface PurpleCard {
|
|
45
|
-
width: number;
|
|
46
|
-
height: number;
|
|
47
|
-
mimeType: string;
|
|
48
|
-
filesize: number;
|
|
49
|
-
filename: string;
|
|
50
|
-
url: string;
|
|
51
|
-
}
|
|
52
|
-
export interface Logo {
|
|
53
|
-
id: string;
|
|
54
|
-
filename: string;
|
|
55
|
-
mimeType: string;
|
|
56
|
-
filesize: number;
|
|
57
|
-
width: number;
|
|
58
|
-
height: number;
|
|
59
|
-
sizes: LogoSizes;
|
|
60
|
-
createdAt: Date;
|
|
61
|
-
updatedAt: Date;
|
|
62
|
-
url: string;
|
|
63
|
-
alt: string;
|
|
64
|
-
}
|
|
65
|
-
export interface LogoSizes {
|
|
66
|
-
thumbnail: FluffyCard;
|
|
67
|
-
card: FluffyCard;
|
|
68
|
-
tablet: FluffyCard;
|
|
69
|
-
}
|
|
70
|
-
export interface FluffyCard {
|
|
71
|
-
url: null;
|
|
72
|
-
}
|
|
73
|
-
export declare class Convert {
|
|
74
|
-
static toResponseInterfaces(json: string): ResponseInterfaces;
|
|
75
|
-
static responseInterfacesToJson(value: ResponseInterfaces): string;
|
|
76
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* REST API response shape for GET /v1/public/manufacturers.
|
|
3
|
+
* Returns a flat array of manufacturer objects (not paginated).
|
|
4
|
+
* Re-exported from the shared type for consistency.
|
|
5
|
+
*/
|
|
6
|
+
export { ManufacturerApiResponse } from "../getManufacturers/response.interfaces";
|
|
77
7
|
//# sourceMappingURL=response.interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.interfaces.d.ts","sourceRoot":"","sources":["../../../src/manufacturer/getManufacturer/response.interfaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response.interfaces.d.ts","sourceRoot":"","sources":["../../../src/manufacturer/getManufacturer/response.interfaces.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC"}
|