@inventorai/sdk 1.3.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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +516 -0
  3. package/dist/client.d.ts +59 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +61 -0
  6. package/dist/errors/api-error.d.ts +12 -0
  7. package/dist/errors/api-error.d.ts.map +1 -0
  8. package/dist/errors/api-error.js +26 -0
  9. package/dist/http/client.d.ts +13 -0
  10. package/dist/http/client.d.ts.map +1 -0
  11. package/dist/http/client.js +89 -0
  12. package/dist/index.d.ts +31 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +72 -0
  15. package/dist/resources/address-lookup.d.ts +15 -0
  16. package/dist/resources/address-lookup.d.ts.map +1 -0
  17. package/dist/resources/address-lookup.js +21 -0
  18. package/dist/resources/asset-checks.d.ts +19 -0
  19. package/dist/resources/asset-checks.d.ts.map +1 -0
  20. package/dist/resources/asset-checks.js +15 -0
  21. package/dist/resources/branches.d.ts +11 -0
  22. package/dist/resources/branches.d.ts.map +1 -0
  23. package/dist/resources/branches.js +15 -0
  24. package/dist/resources/clients.d.ts +19 -0
  25. package/dist/resources/clients.d.ts.map +1 -0
  26. package/dist/resources/clients.js +27 -0
  27. package/dist/resources/compliance-forms.d.ts +8 -0
  28. package/dist/resources/compliance-forms.d.ts.map +1 -0
  29. package/dist/resources/compliance-forms.js +12 -0
  30. package/dist/resources/compliance.d.ts +28 -0
  31. package/dist/resources/compliance.d.ts.map +1 -0
  32. package/dist/resources/compliance.js +45 -0
  33. package/dist/resources/components.d.ts +8 -0
  34. package/dist/resources/components.d.ts.map +1 -0
  35. package/dist/resources/components.js +12 -0
  36. package/dist/resources/defects.d.ts +29 -0
  37. package/dist/resources/defects.d.ts.map +1 -0
  38. package/dist/resources/defects.js +39 -0
  39. package/dist/resources/hazards.d.ts +11 -0
  40. package/dist/resources/hazards.d.ts.map +1 -0
  41. package/dist/resources/hazards.js +12 -0
  42. package/dist/resources/hmo.d.ts +23 -0
  43. package/dist/resources/hmo.d.ts.map +1 -0
  44. package/dist/resources/hmo.js +21 -0
  45. package/dist/resources/inspection-ai.d.ts +16 -0
  46. package/dist/resources/inspection-ai.d.ts.map +1 -0
  47. package/dist/resources/inspection-ai.js +30 -0
  48. package/dist/resources/inspection-areas.d.ts +26 -0
  49. package/dist/resources/inspection-areas.d.ts.map +1 -0
  50. package/dist/resources/inspection-areas.js +39 -0
  51. package/dist/resources/inspection-elements.d.ts +22 -0
  52. package/dist/resources/inspection-elements.d.ts.map +1 -0
  53. package/dist/resources/inspection-elements.js +33 -0
  54. package/dist/resources/inspection-items.d.ts +25 -0
  55. package/dist/resources/inspection-items.d.ts.map +1 -0
  56. package/dist/resources/inspection-items.js +36 -0
  57. package/dist/resources/inspections.d.ts +42 -0
  58. package/dist/resources/inspections.d.ts.map +1 -0
  59. package/dist/resources/inspections.js +57 -0
  60. package/dist/resources/keys-fobs.d.ts +20 -0
  61. package/dist/resources/keys-fobs.d.ts.map +1 -0
  62. package/dist/resources/keys-fobs.js +30 -0
  63. package/dist/resources/meter-readings.d.ts +20 -0
  64. package/dist/resources/meter-readings.d.ts.map +1 -0
  65. package/dist/resources/meter-readings.js +30 -0
  66. package/dist/resources/modifiers.d.ts +41 -0
  67. package/dist/resources/modifiers.d.ts.map +1 -0
  68. package/dist/resources/modifiers.js +45 -0
  69. package/dist/resources/phrases.d.ts +27 -0
  70. package/dist/resources/phrases.d.ts.map +1 -0
  71. package/dist/resources/phrases.js +27 -0
  72. package/dist/resources/properties.d.ts +21 -0
  73. package/dist/resources/properties.d.ts.map +1 -0
  74. package/dist/resources/properties.js +30 -0
  75. package/dist/resources/property-templates.d.ts +11 -0
  76. package/dist/resources/property-templates.d.ts.map +1 -0
  77. package/dist/resources/property-templates.js +15 -0
  78. package/dist/resources/scheduler.d.ts +11 -0
  79. package/dist/resources/scheduler.d.ts.map +1 -0
  80. package/dist/resources/scheduler.js +24 -0
  81. package/dist/resources/stats.d.ts +10 -0
  82. package/dist/resources/stats.d.ts.map +1 -0
  83. package/dist/resources/stats.js +21 -0
  84. package/dist/resources/team.d.ts +18 -0
  85. package/dist/resources/team.d.ts.map +1 -0
  86. package/dist/resources/team.js +20 -0
  87. package/dist/resources/teams.d.ts +16 -0
  88. package/dist/resources/teams.d.ts.map +1 -0
  89. package/dist/resources/teams.js +18 -0
  90. package/dist/resources/user.d.ts +10 -0
  91. package/dist/resources/user.d.ts.map +1 -0
  92. package/dist/resources/user.js +12 -0
  93. package/dist/resources/vocabulary.d.ts +11 -0
  94. package/dist/resources/vocabulary.d.ts.map +1 -0
  95. package/dist/resources/vocabulary.js +12 -0
  96. package/dist/types/index.d.ts +887 -0
  97. package/dist/types/index.d.ts.map +1 -0
  98. package/dist/types/index.js +3 -0
  99. package/package.json +45 -0
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RateLimitError = exports.AuthenticationError = exports.ApiError = void 0;
4
+ class ApiError extends Error {
5
+ constructor(message, statusCode, response) {
6
+ super(message);
7
+ this.statusCode = statusCode;
8
+ this.response = response;
9
+ this.name = 'ApiError';
10
+ }
11
+ }
12
+ exports.ApiError = ApiError;
13
+ class AuthenticationError extends ApiError {
14
+ constructor(message, statusCode, response) {
15
+ super(message, statusCode, response);
16
+ this.name = 'AuthenticationError';
17
+ }
18
+ }
19
+ exports.AuthenticationError = AuthenticationError;
20
+ class RateLimitError extends ApiError {
21
+ constructor(message, statusCode, response) {
22
+ super(message, statusCode, response);
23
+ this.name = 'RateLimitError';
24
+ }
25
+ }
26
+ exports.RateLimitError = RateLimitError;
@@ -0,0 +1,13 @@
1
+ import { ListParams } from '../types';
2
+ export declare class HttpClient {
3
+ private client;
4
+ constructor(apiToken: string, baseURL?: string);
5
+ get<T>(endpoint: string, params?: Record<string, any>): Promise<T>;
6
+ post<T>(endpoint: string, data?: any): Promise<T>;
7
+ put<T>(endpoint: string, data?: any): Promise<T>;
8
+ patch<T>(endpoint: string, data?: any): Promise<T>;
9
+ delete<T>(endpoint: string): Promise<T>;
10
+ upload<T>(endpoint: string, file: File | Blob | Buffer, fieldName?: string): Promise<T>;
11
+ buildQuery(params: ListParams): Record<string, string>;
12
+ }
13
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAgB;gBAElB,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,MAA+C;IAiChF,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAKlE,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAKjD,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAKhD,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAKlD,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAKvC,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,EAAE,SAAS,GAAE,MAAe,GAAG,OAAO,CAAC,CAAC,CAAC;IASrG,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CA6BvD"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.HttpClient = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const api_error_1 = require("../errors/api-error");
9
+ class HttpClient {
10
+ constructor(apiToken, baseURL = 'https://api.inventorai.co.uk/v1/team') {
11
+ this.client = axios_1.default.create({
12
+ baseURL,
13
+ headers: {
14
+ 'Authorization': `Bearer ${apiToken}`,
15
+ 'Accept': 'application/json',
16
+ 'Content-Type': 'application/json',
17
+ },
18
+ timeout: 30000,
19
+ });
20
+ // Add response interceptor for error handling
21
+ this.client.interceptors.response.use((response) => response, (error) => {
22
+ if (error.response) {
23
+ const { status, data } = error.response;
24
+ const message = data?.message || error.message;
25
+ switch (status) {
26
+ case 401:
27
+ throw new api_error_1.AuthenticationError(message, status, data);
28
+ case 429:
29
+ throw new api_error_1.RateLimitError(message, status, data);
30
+ default:
31
+ throw new api_error_1.ApiError(message, status, data);
32
+ }
33
+ }
34
+ throw new api_error_1.ApiError(error.message);
35
+ });
36
+ }
37
+ async get(endpoint, params) {
38
+ const response = await this.client.get(endpoint, { params });
39
+ return response.data;
40
+ }
41
+ async post(endpoint, data) {
42
+ const response = await this.client.post(endpoint, data);
43
+ return response.data;
44
+ }
45
+ async put(endpoint, data) {
46
+ const response = await this.client.put(endpoint, data);
47
+ return response.data;
48
+ }
49
+ async patch(endpoint, data) {
50
+ const response = await this.client.patch(endpoint, data);
51
+ return response.data;
52
+ }
53
+ async delete(endpoint) {
54
+ const response = await this.client.delete(endpoint);
55
+ return response.data;
56
+ }
57
+ async upload(endpoint, file, fieldName = 'file') {
58
+ const formData = new FormData();
59
+ formData.append(fieldName, file);
60
+ const response = await this.client.post(endpoint, formData, {
61
+ headers: { 'Content-Type': 'multipart/form-data' },
62
+ });
63
+ return response.data;
64
+ }
65
+ buildQuery(params) {
66
+ const query = {};
67
+ if (params.filter) {
68
+ Object.entries(params.filter).forEach(([key, value]) => {
69
+ query[`filter[${key}]`] = value;
70
+ });
71
+ }
72
+ if (params.include) {
73
+ query.include = Array.isArray(params.include)
74
+ ? params.include.join(',')
75
+ : params.include;
76
+ }
77
+ if (params.sort) {
78
+ query.sort = params.sort;
79
+ }
80
+ if (params.per_page) {
81
+ query.per_page = params.per_page.toString();
82
+ }
83
+ if (params.page) {
84
+ query.page = params.page.toString();
85
+ }
86
+ return query;
87
+ }
88
+ }
89
+ exports.HttpClient = HttpClient;
@@ -0,0 +1,31 @@
1
+ export { InventoraiClient } from './client';
2
+ export type { InventoraiClientOptions } from './client';
3
+ export * from './types';
4
+ export * from './errors/api-error';
5
+ export { Properties } from './resources/properties';
6
+ export { Inspections } from './resources/inspections';
7
+ export { InspectionAreas } from './resources/inspection-areas';
8
+ export { InspectionItems } from './resources/inspection-items';
9
+ export { InspectionElements } from './resources/inspection-elements';
10
+ export { Defects } from './resources/defects';
11
+ export { MeterReadings } from './resources/meter-readings';
12
+ export { AssetChecks } from './resources/asset-checks';
13
+ export { KeysFobs } from './resources/keys-fobs';
14
+ export { Compliance } from './resources/compliance';
15
+ export { ComplianceForms } from './resources/compliance-forms';
16
+ export { InspectionAi } from './resources/inspection-ai';
17
+ export { PropertyTemplates } from './resources/property-templates';
18
+ export { Branches } from './resources/branches';
19
+ export { Hmo } from './resources/hmo';
20
+ export type { HmoTenantAssignment, HmoBulkAssignment } from './resources/hmo';
21
+ export { Components } from './resources/components';
22
+ export { AddressLookup } from './resources/address-lookup';
23
+ export { StatsResource } from './resources/stats';
24
+ export { Phrases } from './resources/phrases';
25
+ export { Modifiers } from './resources/modifiers';
26
+ export { Scheduler } from './resources/scheduler';
27
+ export { TeamResource } from './resources/team';
28
+ export { Clients } from './resources/clients';
29
+ export { Hazards } from './resources/hazards';
30
+ export { Vocabulary } from './resources/vocabulary';
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Vocabulary = exports.Hazards = exports.Clients = exports.TeamResource = exports.Scheduler = exports.Modifiers = exports.Phrases = exports.StatsResource = exports.AddressLookup = exports.Components = exports.Hmo = exports.Branches = exports.PropertyTemplates = exports.InspectionAi = exports.ComplianceForms = exports.Compliance = exports.KeysFobs = exports.AssetChecks = exports.MeterReadings = exports.Defects = exports.InspectionElements = exports.InspectionItems = exports.InspectionAreas = exports.Inspections = exports.Properties = exports.InventoraiClient = void 0;
18
+ var client_1 = require("./client");
19
+ Object.defineProperty(exports, "InventoraiClient", { enumerable: true, get: function () { return client_1.InventoraiClient; } });
20
+ __exportStar(require("./types"), exports);
21
+ __exportStar(require("./errors/api-error"), exports);
22
+ // Resource classes
23
+ var properties_1 = require("./resources/properties");
24
+ Object.defineProperty(exports, "Properties", { enumerable: true, get: function () { return properties_1.Properties; } });
25
+ var inspections_1 = require("./resources/inspections");
26
+ Object.defineProperty(exports, "Inspections", { enumerable: true, get: function () { return inspections_1.Inspections; } });
27
+ var inspection_areas_1 = require("./resources/inspection-areas");
28
+ Object.defineProperty(exports, "InspectionAreas", { enumerable: true, get: function () { return inspection_areas_1.InspectionAreas; } });
29
+ var inspection_items_1 = require("./resources/inspection-items");
30
+ Object.defineProperty(exports, "InspectionItems", { enumerable: true, get: function () { return inspection_items_1.InspectionItems; } });
31
+ var inspection_elements_1 = require("./resources/inspection-elements");
32
+ Object.defineProperty(exports, "InspectionElements", { enumerable: true, get: function () { return inspection_elements_1.InspectionElements; } });
33
+ var defects_1 = require("./resources/defects");
34
+ Object.defineProperty(exports, "Defects", { enumerable: true, get: function () { return defects_1.Defects; } });
35
+ var meter_readings_1 = require("./resources/meter-readings");
36
+ Object.defineProperty(exports, "MeterReadings", { enumerable: true, get: function () { return meter_readings_1.MeterReadings; } });
37
+ var asset_checks_1 = require("./resources/asset-checks");
38
+ Object.defineProperty(exports, "AssetChecks", { enumerable: true, get: function () { return asset_checks_1.AssetChecks; } });
39
+ var keys_fobs_1 = require("./resources/keys-fobs");
40
+ Object.defineProperty(exports, "KeysFobs", { enumerable: true, get: function () { return keys_fobs_1.KeysFobs; } });
41
+ var compliance_1 = require("./resources/compliance");
42
+ Object.defineProperty(exports, "Compliance", { enumerable: true, get: function () { return compliance_1.Compliance; } });
43
+ var compliance_forms_1 = require("./resources/compliance-forms");
44
+ Object.defineProperty(exports, "ComplianceForms", { enumerable: true, get: function () { return compliance_forms_1.ComplianceForms; } });
45
+ var inspection_ai_1 = require("./resources/inspection-ai");
46
+ Object.defineProperty(exports, "InspectionAi", { enumerable: true, get: function () { return inspection_ai_1.InspectionAi; } });
47
+ var property_templates_1 = require("./resources/property-templates");
48
+ Object.defineProperty(exports, "PropertyTemplates", { enumerable: true, get: function () { return property_templates_1.PropertyTemplates; } });
49
+ var branches_1 = require("./resources/branches");
50
+ Object.defineProperty(exports, "Branches", { enumerable: true, get: function () { return branches_1.Branches; } });
51
+ var hmo_1 = require("./resources/hmo");
52
+ Object.defineProperty(exports, "Hmo", { enumerable: true, get: function () { return hmo_1.Hmo; } });
53
+ var components_1 = require("./resources/components");
54
+ Object.defineProperty(exports, "Components", { enumerable: true, get: function () { return components_1.Components; } });
55
+ var address_lookup_1 = require("./resources/address-lookup");
56
+ Object.defineProperty(exports, "AddressLookup", { enumerable: true, get: function () { return address_lookup_1.AddressLookup; } });
57
+ var stats_1 = require("./resources/stats");
58
+ Object.defineProperty(exports, "StatsResource", { enumerable: true, get: function () { return stats_1.StatsResource; } });
59
+ var phrases_1 = require("./resources/phrases");
60
+ Object.defineProperty(exports, "Phrases", { enumerable: true, get: function () { return phrases_1.Phrases; } });
61
+ var modifiers_1 = require("./resources/modifiers");
62
+ Object.defineProperty(exports, "Modifiers", { enumerable: true, get: function () { return modifiers_1.Modifiers; } });
63
+ var scheduler_1 = require("./resources/scheduler");
64
+ Object.defineProperty(exports, "Scheduler", { enumerable: true, get: function () { return scheduler_1.Scheduler; } });
65
+ var team_1 = require("./resources/team");
66
+ Object.defineProperty(exports, "TeamResource", { enumerable: true, get: function () { return team_1.TeamResource; } });
67
+ var clients_1 = require("./resources/clients");
68
+ Object.defineProperty(exports, "Clients", { enumerable: true, get: function () { return clients_1.Clients; } });
69
+ var hazards_1 = require("./resources/hazards");
70
+ Object.defineProperty(exports, "Hazards", { enumerable: true, get: function () { return hazards_1.Hazards; } });
71
+ var vocabulary_1 = require("./resources/vocabulary");
72
+ Object.defineProperty(exports, "Vocabulary", { enumerable: true, get: function () { return vocabulary_1.Vocabulary; } });
@@ -0,0 +1,15 @@
1
+ import { HttpClient } from '../http/client';
2
+ import { AddressLookupResult, AddressResult } from '../types';
3
+ export declare class AddressLookup {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ lookup(postcode: string): Promise<{
7
+ data: AddressLookupResult;
8
+ }>;
9
+ bulkLookup(postcodes: string[]): Promise<any>;
10
+ getDetails(data: Record<string, any>): Promise<{
11
+ data: AddressResult;
12
+ }>;
13
+ usage(): Promise<any>;
14
+ }
15
+ //# sourceMappingURL=address-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-lookup.d.ts","sourceRoot":"","sources":["../../src/resources/address-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9D,qBAAa,aAAa;IACZ,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE9B,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,mBAAmB,CAAA;KAAE,CAAC;IAIhE,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAI7C,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,aAAa,CAAA;KAAE,CAAC;IAIvE,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC;CAG5B"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressLookup = void 0;
4
+ class AddressLookup {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async lookup(postcode) {
9
+ return this.http.post('/address-lookup/lookup', { postcode });
10
+ }
11
+ async bulkLookup(postcodes) {
12
+ return this.http.post('/address-lookup/bulk-lookup', { postcodes });
13
+ }
14
+ async getDetails(data) {
15
+ return this.http.post('/address-lookup/details', data);
16
+ }
17
+ async usage() {
18
+ return this.http.get('/address-lookup/usage');
19
+ }
20
+ }
21
+ exports.AddressLookup = AddressLookup;
@@ -0,0 +1,19 @@
1
+ import { HttpClient } from '../http/client';
2
+ export type AssetCheckTested = 'yes' | 'no' | 'not_accessible';
3
+ export type AssetCheckResult = 'pass' | 'fail' | 'na';
4
+ export type AssetCheckCondition = 'good' | 'fair' | 'poor' | 'replace';
5
+ export interface UpdateAssetCheckData {
6
+ tested?: AssetCheckTested | null;
7
+ test_result?: AssetCheckResult | null;
8
+ condition?: AssetCheckCondition | null;
9
+ notes?: string | null;
10
+ }
11
+ export declare class AssetChecks {
12
+ private http;
13
+ constructor(http: HttpClient);
14
+ update(inspectionId: number | string, assetCheckId: string, data: UpdateAssetCheckData): Promise<{
15
+ data: any;
16
+ }>;
17
+ uploadPhoto(inspectionId: number | string, assetCheckId: string, file: File | Blob | Buffer): Promise<any>;
18
+ }
19
+ //# sourceMappingURL=asset-checks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-checks.d.ts","sourceRoot":"","sources":["../../src/resources/asset-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,IAAI,GAAG,gBAAgB,CAAC;AAC/D,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AACtD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,qBAAa,WAAW;IACV,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE9B,MAAM,CACV,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC;QAAE,IAAI,EAAE,GAAG,CAAA;KAAE,CAAC;IAInB,WAAW,CACf,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GACzB,OAAO,CAAC,GAAG,CAAC;CAGhB"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssetChecks = void 0;
4
+ class AssetChecks {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async update(inspectionId, assetCheckId, data) {
9
+ return this.http.put(`/inspections/${inspectionId}/asset-checks/${assetCheckId}`, data);
10
+ }
11
+ async uploadPhoto(inspectionId, assetCheckId, file) {
12
+ return this.http.upload(`/inspections/${inspectionId}/asset-checks/${assetCheckId}/photos`, file, 'photo');
13
+ }
14
+ }
15
+ exports.AssetChecks = AssetChecks;
@@ -0,0 +1,11 @@
1
+ import { HttpClient } from '../http/client';
2
+ import { Branch, PaginatedResponse, ListParams } from '../types';
3
+ export declare class Branches {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ list(params?: ListParams): Promise<PaginatedResponse<Branch>>;
7
+ get(id: number | string): Promise<{
8
+ data: Branch;
9
+ }>;
10
+ }
11
+ //# sourceMappingURL=branches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branches.d.ts","sourceRoot":"","sources":["../../src/resources/branches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEjE,qBAAa,QAAQ;IACP,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE9B,IAAI,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAIjE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAG1D"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Branches = void 0;
4
+ class Branches {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async list(params = {}) {
9
+ return this.http.get('/branches', params);
10
+ }
11
+ async get(id) {
12
+ return this.http.get(`/branches/${id}`);
13
+ }
14
+ }
15
+ exports.Branches = Branches;
@@ -0,0 +1,19 @@
1
+ import { HttpClient } from '../http/client';
2
+ import { Client, ClientGroup, ClientListParams, ListParams, PaginatedResponse } from '../types';
3
+ export declare class Clients {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ list(params?: ClientListParams): Promise<PaginatedResponse<Client>>;
7
+ get(id: string, params?: {
8
+ include?: string | string[];
9
+ }): Promise<{
10
+ data: Client;
11
+ }>;
12
+ groups(params?: ListParams): Promise<PaginatedResponse<ClientGroup>>;
13
+ group(id: string, params?: {
14
+ include?: string | string[];
15
+ }): Promise<{
16
+ data: ClientGroup;
17
+ }>;
18
+ }
19
+ //# sourceMappingURL=clients.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../src/resources/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAShG,qBAAa,OAAO;IACN,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE9B,IAAI,CAAC,MAAM,GAAE,gBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAIvE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAO,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAIxF,MAAM,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAIxE,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAO,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;CAGtG"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Clients = void 0;
4
+ function withInclude(params) {
5
+ const { include, ...rest } = params;
6
+ return include === undefined
7
+ ? rest
8
+ : { ...rest, include: Array.isArray(include) ? include.join(',') : include };
9
+ }
10
+ class Clients {
11
+ constructor(http) {
12
+ this.http = http;
13
+ }
14
+ async list(params = {}) {
15
+ return this.http.get('/clients', withInclude(params));
16
+ }
17
+ async get(id, params = {}) {
18
+ return this.http.get(`/clients/${id}`, withInclude(params));
19
+ }
20
+ async groups(params = {}) {
21
+ return this.http.get('/clients/groups', withInclude(params));
22
+ }
23
+ async group(id, params = {}) {
24
+ return this.http.get(`/clients/groups/${id}`, withInclude(params));
25
+ }
26
+ }
27
+ exports.Clients = Clients;
@@ -0,0 +1,8 @@
1
+ import { HttpClient } from '../http/client';
2
+ import { ComplianceForm, PaginatedResponse, ListParams } from '../types';
3
+ export declare class ComplianceForms {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ list(params?: ListParams): Promise<PaginatedResponse<ComplianceForm>>;
7
+ }
8
+ //# sourceMappingURL=compliance-forms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compliance-forms.d.ts","sourceRoot":"","sources":["../../src/resources/compliance-forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEzE,qBAAa,eAAe;IACd,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE9B,IAAI,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;CAGhF"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComplianceForms = void 0;
4
+ class ComplianceForms {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async list(params = {}) {
9
+ return this.http.get('/compliance-forms', params);
10
+ }
11
+ }
12
+ exports.ComplianceForms = ComplianceForms;
@@ -0,0 +1,28 @@
1
+ import { HttpClient } from '../http/client';
2
+ import { ComplianceForm } from '../types';
3
+ export declare class Compliance {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ list(inspectionId: number | string): Promise<{
7
+ data: ComplianceForm[];
8
+ }>;
9
+ attach(inspectionId: number | string, formId: string | number): Promise<any>;
10
+ attachMultiple(inspectionId: number | string, formIds: (string | number)[]): Promise<any>;
11
+ updateResponse(inspectionId: number | string, fieldId: number | string, data: {
12
+ value?: any;
13
+ section_instance?: number | null;
14
+ notes?: string | null;
15
+ }): Promise<any>;
16
+ batchUpdateResponses(inspectionId: number | string, fields: Record<string, any>): Promise<any>;
17
+ uploadFile(inspectionId: number | string, file: File | Blob | Buffer): Promise<any>;
18
+ addSectionInstance(inspectionId: number | string, data: {
19
+ form_id: string;
20
+ section_id: string;
21
+ }): Promise<any>;
22
+ removeSectionInstance(inspectionId: number | string, instanceId: number | string): Promise<void>;
23
+ removeSectionCopy(inspectionId: number | string, fieldId: number | string, instanceNumber: number): Promise<void>;
24
+ summary(inspectionId: number | string): Promise<any>;
25
+ update(inspectionId: number | string, formId: number | string, data: any): Promise<any>;
26
+ detach(inspectionId: number | string, formId: number | string): Promise<void>;
27
+ }
28
+ //# sourceMappingURL=compliance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compliance.d.ts","sourceRoot":"","sources":["../../src/resources/compliance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,qBAAa,UAAU;IACT,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE9B,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;IAIxE,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAI5E,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzF,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAIrK,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAI9F,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAInF,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAI9G,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhG,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjH,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpD,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAIvF,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGpF"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Compliance = void 0;
4
+ class Compliance {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async list(inspectionId) {
9
+ return this.http.get(`/inspections/${inspectionId}/compliance`);
10
+ }
11
+ async attach(inspectionId, formId) {
12
+ return this.http.post(`/inspections/${inspectionId}/compliance/attach`, { form_id: formId });
13
+ }
14
+ async attachMultiple(inspectionId, formIds) {
15
+ return this.http.post(`/inspections/${inspectionId}/compliance/attach-multiple`, { form_ids: formIds });
16
+ }
17
+ async updateResponse(inspectionId, fieldId, data) {
18
+ return this.http.patch(`/inspections/${inspectionId}/compliance/fields/${fieldId}`, data);
19
+ }
20
+ async batchUpdateResponses(inspectionId, fields) {
21
+ return this.http.post(`/inspections/${inspectionId}/compliance/batch`, { fields });
22
+ }
23
+ async uploadFile(inspectionId, file) {
24
+ return this.http.upload(`/inspections/${inspectionId}/compliance/upload`, file, 'file');
25
+ }
26
+ async addSectionInstance(inspectionId, data) {
27
+ return this.http.post(`/inspections/${inspectionId}/compliance/section-instance`, data);
28
+ }
29
+ async removeSectionInstance(inspectionId, instanceId) {
30
+ return this.http.delete(`/inspections/${inspectionId}/compliance/section-instance/${instanceId}`);
31
+ }
32
+ async removeSectionCopy(inspectionId, fieldId, instanceNumber) {
33
+ return this.http.delete(`/inspections/${inspectionId}/compliance/fields/${fieldId}/instances/${instanceNumber}`);
34
+ }
35
+ async summary(inspectionId) {
36
+ return this.http.get(`/inspections/${inspectionId}/compliance/summary`);
37
+ }
38
+ async update(inspectionId, formId, data) {
39
+ return this.http.patch(`/inspections/${inspectionId}/compliance-forms/${formId}`, data);
40
+ }
41
+ async detach(inspectionId, formId) {
42
+ return this.http.delete(`/inspections/${inspectionId}/compliance-forms/${formId}`);
43
+ }
44
+ }
45
+ exports.Compliance = Compliance;
@@ -0,0 +1,8 @@
1
+ import { HttpClient } from '../http/client';
2
+ import { Component, PaginatedResponse, ListParams } from '../types';
3
+ export declare class Components {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ list(params?: ListParams): Promise<PaginatedResponse<Component>>;
7
+ }
8
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/resources/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEpE,qBAAa,UAAU;IACT,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE9B,IAAI,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;CAG3E"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Components = void 0;
4
+ class Components {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async list(params = {}) {
9
+ return this.http.get('/components', params);
10
+ }
11
+ }
12
+ exports.Components = Components;
@@ -0,0 +1,29 @@
1
+ import { HttpClient } from '../http/client';
2
+ import { Defect, CreateDefectData, UpdateDefectData, PaginatedResponse, ListParams } from '../types';
3
+ export declare class Defects {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ list(inspectionId: number | string, params?: ListParams): Promise<PaginatedResponse<Defect>>;
7
+ get(inspectionId: number | string, defectId: string): Promise<{
8
+ data: Defect;
9
+ }>;
10
+ create(inspectionId: number | string, data: CreateDefectData): Promise<{
11
+ data: Defect;
12
+ }>;
13
+ createForArea(inspectionId: number | string, areaId: string, data: Omit<CreateDefectData, 'defectable_type' | 'defectable_id'>): Promise<{
14
+ data: Defect;
15
+ }>;
16
+ createForItem(inspectionId: number | string, itemId: string, data: Omit<CreateDefectData, 'defectable_type' | 'defectable_id'>): Promise<{
17
+ data: Defect;
18
+ }>;
19
+ createForElement(inspectionId: number | string, elementId: string, data: Omit<CreateDefectData, 'defectable_type' | 'defectable_id'>): Promise<{
20
+ data: Defect;
21
+ }>;
22
+ update(inspectionId: number | string, defectId: string, data: UpdateDefectData): Promise<{
23
+ data: Defect;
24
+ }>;
25
+ delete(inspectionId: number | string, defectId: string): Promise<void>;
26
+ uploadPhoto(inspectionId: number | string, defectId: string, file: File | Blob | Buffer): Promise<any>;
27
+ deletePhoto(inspectionId: number | string, defectId: string, photoId: string): Promise<void>;
28
+ }
29
+ //# sourceMappingURL=defects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defects.d.ts","sourceRoot":"","sources":["../../src/resources/defects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAErG,qBAAa,OAAO;IACN,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE9B,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAIhG,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAI/E,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAIxF,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,eAAe,CAAC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAI1J,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,eAAe,CAAC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAI1J,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,eAAe,CAAC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAIhK,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAI1G,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAItG,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnG"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Defects = void 0;
4
+ class Defects {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async list(inspectionId, params = {}) {
9
+ return this.http.get(`/inspections/${inspectionId}/defects`, params);
10
+ }
11
+ async get(inspectionId, defectId) {
12
+ return this.http.get(`/inspections/${inspectionId}/defects/${defectId}`);
13
+ }
14
+ async create(inspectionId, data) {
15
+ return this.http.post(`/inspections/${inspectionId}/defects`, data);
16
+ }
17
+ async createForArea(inspectionId, areaId, data) {
18
+ return this.http.post(`/inspections/${inspectionId}/areas/${areaId}/defects`, data);
19
+ }
20
+ async createForItem(inspectionId, itemId, data) {
21
+ return this.http.post(`/inspections/${inspectionId}/items/${itemId}/defects`, data);
22
+ }
23
+ async createForElement(inspectionId, elementId, data) {
24
+ return this.http.post(`/inspections/${inspectionId}/elements/${elementId}/defects`, data);
25
+ }
26
+ async update(inspectionId, defectId, data) {
27
+ return this.http.patch(`/inspections/${inspectionId}/defects/${defectId}`, data);
28
+ }
29
+ async delete(inspectionId, defectId) {
30
+ return this.http.delete(`/inspections/${inspectionId}/defects/${defectId}`);
31
+ }
32
+ async uploadPhoto(inspectionId, defectId, file) {
33
+ return this.http.upload(`/inspections/${inspectionId}/defects/${defectId}/photos`, file, 'photo');
34
+ }
35
+ async deletePhoto(inspectionId, defectId, photoId) {
36
+ return this.http.delete(`/inspections/${inspectionId}/defects/${defectId}/photos/${photoId}`);
37
+ }
38
+ }
39
+ exports.Defects = Defects;