@texturehq/device 1.18.0 → 2.0.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.
Files changed (61) hide show
  1. package/dist/common/constants.d.ts +1 -1
  2. package/dist/common/constants.d.ts.map +1 -1
  3. package/dist/common/constants.js +1 -1
  4. package/dist/common/constants.js.map +1 -1
  5. package/dist/common/fetch.d.ts +10 -0
  6. package/dist/common/fetch.d.ts.map +1 -0
  7. package/dist/common/fetch.js +39 -0
  8. package/dist/common/fetch.js.map +1 -0
  9. package/dist/deviceModel/getDeviceModel/index.d.ts +5 -10
  10. package/dist/deviceModel/getDeviceModel/index.d.ts.map +1 -1
  11. package/dist/deviceModel/getDeviceModel/index.js +29 -21
  12. package/dist/deviceModel/getDeviceModel/index.js.map +1 -1
  13. package/dist/deviceModel/getDeviceModel/response.interfaces.d.ts +5 -94
  14. package/dist/deviceModel/getDeviceModel/response.interfaces.d.ts.map +1 -1
  15. package/dist/deviceModel/getDeviceModel/response.interfaces.js +0 -249
  16. package/dist/deviceModel/getDeviceModel/response.interfaces.js.map +1 -1
  17. package/dist/deviceModel/getDeviceModelByManufacturerSlug/index.d.ts +6 -11
  18. package/dist/deviceModel/getDeviceModelByManufacturerSlug/index.d.ts.map +1 -1
  19. package/dist/deviceModel/getDeviceModelByManufacturerSlug/index.js +30 -29
  20. package/dist/deviceModel/getDeviceModelByManufacturerSlug/index.js.map +1 -1
  21. package/dist/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.d.ts +5 -52
  22. package/dist/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.d.ts.map +1 -1
  23. package/dist/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.js +0 -207
  24. package/dist/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.js.map +1 -1
  25. package/dist/deviceModel/getDeviceModels/index.d.ts +5 -10
  26. package/dist/deviceModel/getDeviceModels/index.d.ts.map +1 -1
  27. package/dist/deviceModel/getDeviceModels/index.js +40 -27
  28. package/dist/deviceModel/getDeviceModels/index.js.map +1 -1
  29. package/dist/deviceModel/getDeviceModels/response.interfaces.d.ts +15 -84
  30. package/dist/deviceModel/getDeviceModels/response.interfaces.d.ts.map +1 -1
  31. package/dist/deviceModel/getDeviceModels/response.interfaces.js +0 -249
  32. package/dist/deviceModel/getDeviceModels/response.interfaces.js.map +1 -1
  33. package/dist/deviceModel/getDeviceModels/test.success.js +0 -1
  34. package/dist/deviceModel/getDeviceModels/test.success.js.map +1 -1
  35. package/dist/manufacturer/getManufacturer/index.d.ts +7 -16
  36. package/dist/manufacturer/getManufacturer/index.d.ts.map +1 -1
  37. package/dist/manufacturer/getManufacturer/index.js +17 -19
  38. package/dist/manufacturer/getManufacturer/index.js.map +1 -1
  39. package/dist/manufacturer/getManufacturer/response.interfaces.d.ts +6 -76
  40. package/dist/manufacturer/getManufacturer/response.interfaces.d.ts.map +1 -1
  41. package/dist/manufacturer/getManufacturer/response.interfaces.js +0 -231
  42. package/dist/manufacturer/getManufacturer/response.interfaces.js.map +1 -1
  43. package/dist/manufacturer/getManufacturers/index.d.ts +4 -10
  44. package/dist/manufacturer/getManufacturers/index.d.ts.map +1 -1
  45. package/dist/manufacturer/getManufacturers/index.js +29 -18
  46. package/dist/manufacturer/getManufacturers/index.js.map +1 -1
  47. package/dist/manufacturer/getManufacturers/response.interfaces.d.ts +12 -74
  48. package/dist/manufacturer/getManufacturers/response.interfaces.d.ts.map +1 -1
  49. package/dist/manufacturer/getManufacturers/response.interfaces.js +0 -239
  50. package/dist/manufacturer/getManufacturers/response.interfaces.js.map +1 -1
  51. package/dist/manufacturer/getManufacturers/test.success.js +1 -1
  52. package/dist/manufacturer/getManufacturers/test.success.js.map +1 -1
  53. package/dist/manufacturer/parseManufacturer/index.d.ts +5 -2
  54. package/dist/manufacturer/parseManufacturer/index.d.ts.map +1 -1
  55. package/dist/manufacturer/parseManufacturer/index.js +18 -23
  56. package/dist/manufacturer/parseManufacturer/index.js.map +1 -1
  57. package/package.json +1 -7
  58. package/dist/common/axios.d.ts +0 -3
  59. package/dist/common/axios.d.ts.map +0 -1
  60. package/dist/common/axios.js +0 -29
  61. package/dist/common/axios.js.map +0 -1
@@ -5,55 +5,56 @@ const logger_1 = require("../../common/logger");
5
5
  const exceptions_1 = require("../../common/exceptions");
6
6
  const entities_1 = require("../entities");
7
7
  const constants_1 = require("../../common/constants");
8
- const manufacturer_1 = require("../../manufacturer");
9
- const axios_1 = require("../../common/axios");
8
+ const fetch_1 = require("../../common/fetch");
9
+ const parseManufacturer_1 = require("../../manufacturer/parseManufacturer");
10
10
  /**
11
- * Retrieves a device model from the Device CMS.
12
- * @param options The options to use during the getDeviceModel operation.
13
- * @returns {Promise<DeviceModel | null>} The device model retrieved from the CMS or null if no device model was found.
11
+ * Retrieves a device model from the Texture REST API by manufacturer:model slug.
12
+ * @param options The options to use during the getDeviceModelByManufacturerSlug operation.
13
+ * @returns {Promise<DeviceModel | null>} The device model retrieved from the API or null if not found.
14
14
  */
15
15
  const getDeviceModelByManufacturerSlug = async (options) => {
16
16
  const defaultLogger = logger_1.baseLogger.function("getDeviceModelByManufacturerSlug");
17
17
  const { slug, baseApiUrl = constants_1.PRODUCTION_BASE_URL, logger = defaultLogger } = options;
18
- const operation = logger.operation("get device model by manufacturer slug from Payload CMS API");
19
- const axios = (0, axios_1.getAxios)();
18
+ const operation = logger.operation("get device model by manufacturer slug from Texture REST API");
20
19
  try {
21
20
  operation.start({ options });
22
- const response = await axios.get(`${baseApiUrl}/api/manufacturer_slugs?where[slug][equals]=${slug}`);
23
- if (response.status !== 200) {
24
- const errorMessage = `Request to ${baseApiUrl}/api/manufacturer_slugs failed with status ${response.status}`;
25
- operation.fail({ slug: options.slug, status: response.status, errorMessage });
26
- throw new exceptions_1.NetworkError(errorMessage, response.status);
21
+ const modelsUrl = `${baseApiUrl}/v1/public/device-models?slug=${encodeURIComponent(slug)}`;
22
+ const modelsResponse = await (0, fetch_1.fetchWithRetry)(modelsUrl);
23
+ if (!modelsResponse.ok) {
24
+ const errorMessage = `Request to ${modelsUrl} failed with status ${modelsResponse.status}`;
25
+ operation.fail({ slug, status: modelsResponse.status, errorMessage });
26
+ throw new exceptions_1.NetworkError(errorMessage, modelsResponse.status);
27
27
  }
28
- if (response?.data?.docs?.length !== 1) {
29
- operation.fail({ response: response.data, slug });
28
+ const modelsData = (await modelsResponse.json());
29
+ if (!modelsData.data || modelsData.data.length === 0) {
30
+ operation.fail({ slug });
30
31
  return null;
31
32
  }
32
- if (response.data.totalDocs === 0) {
33
- return null;
33
+ const doc = modelsData.data[0];
34
+ const manufacturersUrl = `${baseApiUrl}/v1/public/manufacturers`;
35
+ const manufacturersResponse = await (0, fetch_1.fetchWithRetry)(manufacturersUrl);
36
+ if (!manufacturersResponse.ok) {
37
+ const errorMessage = `Request to ${manufacturersUrl} failed with status ${manufacturersResponse.status}`;
38
+ operation.fail({ slug, status: manufacturersResponse.status, errorMessage });
39
+ throw new exceptions_1.NetworkError(errorMessage, manufacturersResponse.status);
34
40
  }
35
- const result = response.data.docs[0].device_model;
36
- if (!result.manufacturer?.slug)
37
- throw new Error("Manufacturer slug not found in device model response.");
38
- const manufacturer = await (0, manufacturer_1.getManufacturer)({
39
- ...options,
40
- slug: result.manufacturer?.slug,
41
- });
41
+ const manufacturersData = (await manufacturersResponse.json());
42
+ const fullManufacturer = manufacturersData.find((m) => m.slug === doc.manufacturer.slug);
43
+ if (!fullManufacturer)
44
+ throw new Error(`Manufacturer not found for slug: ${doc.manufacturer.slug}`);
42
45
  const deviceModel = entities_1.DeviceModelSchema.parse({
43
- ...result,
44
- manufacturer,
46
+ ...doc,
47
+ manufacturer: (0, parseManufacturer_1.parseManufacturer)(fullManufacturer),
45
48
  });
46
- // @ts-expect-error Property 'cached' does not exist
47
- deviceModel.cached = response?.cached;
48
49
  operation.end({ deviceModel });
49
50
  return deviceModel;
50
51
  }
51
52
  catch (error) {
52
53
  operation.fail({
53
54
  error,
54
- slug: options.slug,
55
+ slug,
55
56
  baseApiUrl,
56
- message: "Unknown error occurred while fetching device model from Payload CMS API.",
57
+ message: "Unknown error occurred while fetching device model from Texture REST API.",
57
58
  });
58
59
  throw error;
59
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModelByManufacturerSlug/index.ts"],"names":[],"mappings":";;;AAAA,gDAAyD;AAEzD,wDAAuD;AACvD,0CAA6D;AAC7D,sDAA6D;AAC7D,qDAAqD;AACrD,8CAA8C;AA2B9C;;;;GAIG;AACI,MAAM,gCAAgC,GAAG,KAAK,EACnD,OAAgD,EACpB,EAAE;IAC9B,MAAM,aAAa,GAAG,mBAAU,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC;IAC9E,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,+BAAmB,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IACnF,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,4DAA4D,CAAC,CAAC;IAEjG,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAEzB,IAAI,CAAC;QACH,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAC9B,GAAG,UAAU,+CAA+C,IAAI,EAAE,CACnE,CAAC;QACF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,MAAM,YAAY,GAAG,cAAc,UAAU,8CAA8C,QAAQ,CAAC,MAAM,EAAE,CAAC;YAC7G,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YAC9E,MAAM,IAAI,yBAAY,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;QAED,IAAI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KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AArDW,QAAA,gCAAgC,oCAqD3C"}
@@ -1,53 +1,6 @@
1
- export interface ResponseInterfaces {
2
- docs: Doc[];
3
- totalDocs: number;
4
- limit: number;
5
- totalPages: number;
6
- page: number;
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
- device_model: DeviceModel;
17
- createdAt: Date;
18
- updatedAt: Date;
19
- }
20
- export interface DeviceModel {
21
- id: string;
22
- slug: string;
23
- name: string;
24
- manufacturer: Manufacturer;
25
- type: string;
26
- support_level: string;
27
- available_commands: AvailableCommand[];
28
- createdAt: Date;
29
- updatedAt: Date;
30
- }
31
- export interface AvailableCommand {
32
- id: string;
33
- slug: string;
34
- support_level: string;
35
- createdAt: Date;
36
- updatedAt: Date;
37
- }
38
- export interface Manufacturer {
39
- id: string;
40
- slug: string;
41
- name: string;
42
- logo: string;
43
- support_level: string;
44
- createdAt: Date;
45
- updatedAt: Date;
46
- icon: string;
47
- vector_icon: string;
48
- }
49
- export declare class Convert {
50
- static toResponseInterfaces(json: string): ResponseInterfaces;
51
- static responseInterfacesToJson(value: ResponseInterfaces): string;
52
- }
1
+ /**
2
+ * REST API response shape for GET /v1/public/device-models.
3
+ * Re-exported from the shared type for consistency.
4
+ */
5
+ export { DeviceModelsApiResponse, DeviceModelApiItem, DeviceModelApiCommand } from "../getDeviceModels/response.interfaces";
53
6
  //# sourceMappingURL=response.interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"response.interfaces.d.ts","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,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BAAkB;WAItD,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM;CAG5E"}
1
+ {"version":3,"file":"response.interfaces.d.ts","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC"}
@@ -1,210 +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: null },
180
- ], false),
181
- "Doc": o([
182
- { json: "id", js: "id", typ: "" },
183
- { json: "slug", js: "slug", typ: "" },
184
- { json: "device_model", js: "device_model", typ: r("DeviceModel") },
185
- { json: "createdAt", js: "createdAt", typ: Date },
186
- { json: "updatedAt", js: "updatedAt", typ: Date },
187
- ], false),
188
- "DeviceModel": o([
189
- { json: "id", js: "id", typ: "" },
190
- { json: "slug", js: "slug", typ: "" },
191
- { json: "name", js: "name", typ: "" },
192
- { json: "manufacturer", js: "manufacturer", typ: r("Manufacturer") },
193
- { json: "type", js: "type", typ: "" },
194
- { json: "support_level", js: "support_level", typ: "" },
195
- { json: "createdAt", js: "createdAt", typ: Date },
196
- { json: "updatedAt", js: "updatedAt", typ: Date },
197
- ], false),
198
- "Manufacturer": o([
199
- { json: "id", js: "id", typ: "" },
200
- { json: "slug", js: "slug", typ: "" },
201
- { json: "name", js: "name", typ: "" },
202
- { json: "logo", js: "logo", typ: "" },
203
- { json: "support_level", js: "support_level", typ: "" },
204
- { json: "createdAt", js: "createdAt", typ: Date },
205
- { json: "updatedAt", js: "updatedAt", typ: Date },
206
- { json: "icon", js: "icon", typ: "" },
207
- { json: "vector_icon", js: "vector_icon", typ: "" },
208
- ], false),
209
- };
210
3
  //# sourceMappingURL=response.interfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response.interfaces.js","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,EAAE;AACF,0DAA0D;AAC1D,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,0DAA0D;AAC1D,2DAA2D;;;AAuD3D,2CAA2C;AAC3C,mDAAmD;AACnD,MAAa,OAAO;IACT,MAAM,CAAC,oBAAoB,CAAC,IAAY;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CA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AG,EAAE,EAAE,EAAE;QACrC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;QACrC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;QACrC,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE;QACvD,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,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;QACrC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,EAAE;KACtD,EAAE,KAAK,CAAC;CACZ,CAAC"}
1
+ {"version":3,"file":"response.interfaces.js","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModelByManufacturerSlug/response.interfaces.ts"],"names":[],"mappings":""}
@@ -2,15 +2,10 @@ import { Logger } from "../../common/logger";
2
2
  import { DeviceModel } from "../entities";
3
3
  export interface GetDeviceModelsOptions {
4
4
  /**
5
- * The base URL of the Payload CMS instance.
6
- * @default "https://device.cms.texture.energy"
5
+ * The base URL of the Texture REST API.
6
+ * @default "https://api.texturehq.com"
7
7
  */
8
8
  baseApiUrl?: string;
9
- /**
10
- * The base URL for images coming from Payload CMS.
11
- * @default "https://device.cms.texture.energy"
12
- */
13
- baseImageUrl?: string;
14
9
  /**
15
10
  * Limits the number of device models returned.
16
11
  * @default 10
@@ -43,9 +38,9 @@ export interface GetDeviceModelsResponse {
43
38
  cached?: boolean;
44
39
  }
45
40
  /**
46
- * Retrieves a collection of device models from the Device CMS.
47
- * @param options The options to use during the geDeviceModels operation.
48
- * @returns {Promise<GetDeviceModelsResponse>} The collection of device models retrieved from the CMS.
41
+ * Retrieves a collection of device models from the Texture REST API.
42
+ * @param options The options to use during the getDeviceModels operation.
43
+ * @returns {Promise<GetDeviceModelsResponse>} The collection of device models retrieved from the API.
49
44
  */
50
45
  export declare const getDeviceModels: (options?: GetDeviceModelsOptions) => Promise<GetDeviceModelsResponse>;
51
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModels/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAC;AAK7D,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAU,UAAS,sBAA2B,KAAG,OAAO,CAAC,uBAAuB,CAuD3G,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModels/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAC;AAM7D,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAU,UAAS,sBAA2B,KAAG,OAAO,CAAC,uBAAuB,CA4D3G,CAAC"}
@@ -5,54 +5,67 @@ const logger_1 = require("../../common/logger");
5
5
  const exceptions_1 = require("../../common/exceptions");
6
6
  const entities_1 = require("../entities");
7
7
  const constants_1 = require("../../common/constants");
8
- const manufacturer_1 = require("../../manufacturer");
9
- const axios_1 = require("../../common/axios");
8
+ const fetch_1 = require("../../common/fetch");
9
+ const parseManufacturer_1 = require("../../manufacturer/parseManufacturer");
10
10
  /**
11
- * Retrieves a collection of device models from the Device CMS.
12
- * @param options The options to use during the geDeviceModels operation.
13
- * @returns {Promise<GetDeviceModelsResponse>} The collection of device models retrieved from the CMS.
11
+ * Retrieves a collection of device models from the Texture REST API.
12
+ * @param options The options to use during the getDeviceModels operation.
13
+ * @returns {Promise<GetDeviceModelsResponse>} The collection of device models retrieved from the API.
14
14
  */
15
15
  const getDeviceModels = async (options = {}) => {
16
16
  const defaultLogger = logger_1.baseLogger.function("getDeviceModels");
17
- const { limit = 10, page = 1, baseApiUrl = constants_1.PRODUCTION_BASE_URL, baseImageUrl = constants_1.PRODUCTION_BASE_URL, logger = defaultLogger, slugs = [], } = options;
18
- const operation = logger.operation("get device models from Payload CMS API");
19
- const axios = (0, axios_1.getAxios)();
17
+ const { limit = 10, page = 1, baseApiUrl = constants_1.PRODUCTION_BASE_URL, logger = defaultLogger, slugs = [] } = options;
18
+ const operation = logger.operation("get device models from Texture REST API");
20
19
  try {
21
20
  operation.start({ options });
22
- let response;
21
+ const params = new URLSearchParams({ limit: String(limit), page: String(page) });
23
22
  if (options.manufacturer) {
24
- response = await axios.get(`${baseApiUrl}/api/device_models/filter_by_manufacturer?limit=${limit}&page=${page}&manufacturer=${options.manufacturer}`);
23
+ params.set("manufacturer", options.manufacturer);
25
24
  }
26
- else {
27
- const slugQuery = slugs.length ? `&where[slug][in]=${slugs.join(",")}` : "";
28
- response = await axios.get(`${baseApiUrl}/api/device_models?limit=${limit}&page=${page}${slugQuery}`);
25
+ else if (slugs.length === 1) {
26
+ params.set("slug", slugs[0]);
29
27
  }
30
- if (response.status !== 200) {
31
- const errorMessage = `Request to ${baseApiUrl}/api/device_models failed with status ${response.status}`;
28
+ const modelsUrl = `${baseApiUrl}/v1/public/device-models?${params.toString()}`;
29
+ const modelsResponse = await (0, fetch_1.fetchWithRetry)(modelsUrl);
30
+ if (!modelsResponse.ok) {
31
+ const errorMessage = `Request to ${modelsUrl} failed with status ${modelsResponse.status}`;
32
32
  operation.fail(errorMessage);
33
- throw new exceptions_1.NetworkError(errorMessage, response.status);
33
+ throw new exceptions_1.NetworkError(errorMessage, modelsResponse.status);
34
+ }
35
+ const modelsData = (await modelsResponse.json());
36
+ const manufacturersUrl = `${baseApiUrl}/v1/public/manufacturers`;
37
+ const manufacturersResponse = await (0, fetch_1.fetchWithRetry)(manufacturersUrl);
38
+ if (!manufacturersResponse.ok) {
39
+ const errorMessage = `Request to ${manufacturersUrl} failed with status ${manufacturersResponse.status}`;
40
+ operation.fail(errorMessage);
41
+ throw new exceptions_1.NetworkError(errorMessage, manufacturersResponse.status);
42
+ }
43
+ const manufacturersData = (await manufacturersResponse.json());
44
+ const manufacturersBySlug = new Map(manufacturersData.map((m) => [m.slug, m]));
45
+ let items = modelsData.data;
46
+ if (slugs.length > 1) {
47
+ items = items.filter((item) => slugs.includes(item.slug));
34
48
  }
35
49
  const result = {
36
- deviceModels: response.data.docs.map((doc) => {
37
- if (!doc.manufacturer)
38
- throw new Error("Missing device model manufacturer. Check CMS.");
50
+ deviceModels: items.map((doc) => {
51
+ const fullManufacturer = manufacturersBySlug.get(doc.manufacturer.slug);
52
+ if (!fullManufacturer)
53
+ throw new Error(`Manufacturer not found for slug: ${doc.manufacturer.slug}`);
39
54
  return entities_1.DeviceModelSchema.parse({
40
55
  ...doc,
41
- manufacturer: (0, manufacturer_1.parseManufacturer)(doc.manufacturer, baseImageUrl),
56
+ manufacturer: (0, parseManufacturer_1.parseManufacturer)(fullManufacturer),
42
57
  });
43
58
  }),
44
- count: response.data.totalDocs,
45
- limit: response.data.limit,
46
- page: response.data.page,
47
- pageCount: response.data.totalPages,
59
+ count: modelsData.total,
60
+ limit: modelsData.limit,
61
+ page: modelsData.page,
62
+ pageCount: modelsData.pageCount,
48
63
  };
49
- // @ts-expect-error Property 'cached' does not exist
50
- result.cached = response?.cached;
51
64
  operation.end({ result });
52
65
  return result;
53
66
  }
54
67
  catch (error) {
55
- operation.fail("Unknown error occurred while fetching manufacturers from Payload CMS API.");
68
+ operation.fail("Unknown error occurred while fetching device models from Texture REST API.");
56
69
  throw error;
57
70
  }
58
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/deviceModel/getDeviceModels/index.ts"],"names":[],"mappings":";;;AAAA,gDAAyD;AAEzD,wDAAuD;AACvD,0CAA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