@aptly-as/types 1.7.6 → 1.8.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 (62) hide show
  1. package/README.md +1 -1
  2. package/core/api.js +0 -1
  3. package/core/app.js +0 -1
  4. package/core/cloudinary.d.ts +2 -10
  5. package/core/cloudinary.js +0 -1
  6. package/core/error.js +0 -1
  7. package/core/fields.js +0 -1
  8. package/core/index.js +0 -1
  9. package/core/permission.js +0 -1
  10. package/core/scope.js +0 -1
  11. package/core/signage.js +0 -1
  12. package/core/webhook-event-data.js +0 -1
  13. package/enums/document.js +0 -1
  14. package/enums/fields.js +0 -1
  15. package/enums/index.js +0 -1
  16. package/enums/unit-template.js +0 -1
  17. package/enums/webhook.js +0 -1
  18. package/index.js +0 -1
  19. package/models/algorithm.js +0 -1
  20. package/models/app.js +0 -1
  21. package/models/availability.d.ts +34 -0
  22. package/models/availability.js +2 -0
  23. package/models/booking.d.ts +8 -5
  24. package/models/booking.js +0 -1
  25. package/models/client.js +0 -1
  26. package/models/department.js +0 -1
  27. package/models/document.d.ts +9 -5
  28. package/models/document.js +0 -1
  29. package/models/extends.js +0 -1
  30. package/models/index.js +0 -1
  31. package/models/inquiry.js +0 -1
  32. package/models/media.js +0 -1
  33. package/models/notification-trigger.js +0 -1
  34. package/models/option-label.d.ts +2 -2
  35. package/models/option-label.js +0 -1
  36. package/models/order.d.ts +9 -6
  37. package/models/order.js +0 -1
  38. package/models/organization.d.ts +2 -2
  39. package/models/organization.js +0 -1
  40. package/models/page.js +0 -1
  41. package/models/producer.d.ts +3 -2
  42. package/models/producer.js +0 -1
  43. package/models/product-stats.js +0 -1
  44. package/models/product.d.ts +3 -3
  45. package/models/product.js +0 -1
  46. package/models/project.d.ts +3 -3
  47. package/models/project.js +0 -1
  48. package/models/queue-download.js +0 -1
  49. package/models/recommendation.js +0 -1
  50. package/models/supplier.js +0 -1
  51. package/models/tag.js +0 -1
  52. package/models/unit-email.js +0 -1
  53. package/models/unit-template.d.ts +6 -3
  54. package/models/unit-template.js +0 -1
  55. package/models/unit.d.ts +39 -20
  56. package/models/unit.js +0 -1
  57. package/models/upsell-template.d.ts +2 -2
  58. package/models/upsell-template.js +0 -1
  59. package/models/user.js +0 -1
  60. package/models/webhook-event.js +0 -1
  61. package/models/webhook.js +0 -1
  62. package/package.json +43 -41
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Aptly Types
1
+ # Aptly Types
2
2
 
3
3
  [Swagger API documentation](https://app.swaggerhub.com/apis-docs/Aptly-AS/aptly-api/1.0.0)
package/core/api.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=api.js.map
package/core/app.js CHANGED
@@ -10,4 +10,3 @@ var AptlyAppSandbox;
10
10
  AptlyAppSandbox["AllowPointerLock"] = "allow-pointer-lock";
11
11
  AptlyAppSandbox["AllowTopNavigation"] = "allow-top-navigation";
12
12
  })(AptlyAppSandbox = exports.AptlyAppSandbox || (exports.AptlyAppSandbox = {}));
13
- //# sourceMappingURL=app.js.map
@@ -1,10 +1,2 @@
1
- import { AptlyCloudinaryResourceType } from '../enums';
2
- export interface AptlyCloudinaryFile {
3
- public_id: string;
4
- url: string;
5
- secure_url: string;
6
- format: string;
7
- resource_type: AptlyCloudinaryResourceType;
8
- original_filename: string;
9
- bytes: number;
10
- }
1
+ import * as cloudinary from 'cloudinary';
2
+ export declare type AptlyCloudinaryFile = cloudinary.UploadApiResponse;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=cloudinary.js.map
package/core/error.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=error.js.map
package/core/fields.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=fields.js.map
package/core/index.js CHANGED
@@ -19,4 +19,3 @@ __exportStar(require("./fields"), exports);
19
19
  __exportStar(require("./scope"), exports);
20
20
  __exportStar(require("./signage"), exports);
21
21
  __exportStar(require("./webhook-event-data"), exports);
22
- //# sourceMappingURL=index.js.map
@@ -100,4 +100,3 @@ var AptlyPermissionModel;
100
100
  AptlyPermissionModel["UnitProducts"] = "unitProducts";
101
101
  AptlyPermissionModel["UnitReport"] = "unitReport";
102
102
  })(AptlyPermissionModel = exports.AptlyPermissionModel || (exports.AptlyPermissionModel = {}));
103
- //# sourceMappingURL=permission.js.map
package/core/scope.js CHANGED
@@ -6,4 +6,3 @@ var AptlyScopeAction;
6
6
  AptlyScopeAction["Read"] = "read";
7
7
  AptlyScopeAction["Write"] = "write";
8
8
  })(AptlyScopeAction = exports.AptlyScopeAction || (exports.AptlyScopeAction = {}));
9
- //# sourceMappingURL=scope.js.map
package/core/signage.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=signage.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=webhook-event-data.js.map
package/enums/document.js CHANGED
@@ -33,4 +33,3 @@ var AptlyHistoryType;
33
33
  AptlyHistoryType["Copied"] = "copied";
34
34
  AptlyHistoryType["Imported"] = "imported";
35
35
  })(AptlyHistoryType = exports.AptlyHistoryType || (exports.AptlyHistoryType = {}));
36
- //# sourceMappingURL=document.js.map
package/enums/fields.js CHANGED
@@ -27,4 +27,3 @@ var AptlyFieldType;
27
27
  AptlyFieldType["Switch"] = "switch";
28
28
  AptlyFieldType["Checkbox"] = "checkbox";
29
29
  })(AptlyFieldType = exports.AptlyFieldType || (exports.AptlyFieldType = {}));
30
- //# sourceMappingURL=fields.js.map
package/enums/index.js CHANGED
@@ -130,4 +130,3 @@ var AptlyIcon;
130
130
  AptlyIcon["Info"] = "info";
131
131
  AptlyIcon["Map"] = "map";
132
132
  })(AptlyIcon = exports.AptlyIcon || (exports.AptlyIcon = {}));
133
- //# sourceMappingURL=index.js.map
@@ -13,4 +13,3 @@ var AptlyUnitTemplateCategorySectionProductMeasureUnitType;
13
13
  AptlyUnitTemplateCategorySectionProductMeasureUnitType["KVM"] = "kvm";
14
14
  AptlyUnitTemplateCategorySectionProductMeasureUnitType["LM"] = "lm";
15
15
  })(AptlyUnitTemplateCategorySectionProductMeasureUnitType = exports.AptlyUnitTemplateCategorySectionProductMeasureUnitType || (exports.AptlyUnitTemplateCategorySectionProductMeasureUnitType = {}));
16
- //# sourceMappingURL=unit-template.js.map
package/enums/webhook.js CHANGED
@@ -25,4 +25,3 @@ var AptlyWebhookEventStatus;
25
25
  AptlyWebhookEventStatus["Retry"] = "retry";
26
26
  AptlyWebhookEventStatus["Failed"] = "failed";
27
27
  })(AptlyWebhookEventStatus = exports.AptlyWebhookEventStatus || (exports.AptlyWebhookEventStatus = {}));
28
- //# sourceMappingURL=webhook.js.map
package/index.js CHANGED
@@ -13,4 +13,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./core"), exports);
14
14
  __exportStar(require("./enums"), exports);
15
15
  __exportStar(require("./models"), exports);
16
- //# sourceMappingURL=index.js.map
@@ -14,4 +14,3 @@ var AptlyAlgorithmPipelineApplyTo;
14
14
  AptlyAlgorithmPipelineApplyTo["Root"] = "root";
15
15
  AptlyAlgorithmPipelineApplyTo["PreviousStep"] = "previousStep";
16
16
  })(AptlyAlgorithmPipelineApplyTo = exports.AptlyAlgorithmPipelineApplyTo || (exports.AptlyAlgorithmPipelineApplyTo = {}));
17
- //# sourceMappingURL=algorithm.js.map
package/models/app.js CHANGED
@@ -24,4 +24,3 @@ var AptlyAppInjectionType;
24
24
  (function (AptlyAppInjectionType) {
25
25
  AptlyAppInjectionType["Iframe"] = "iframe";
26
26
  })(AptlyAppInjectionType = exports.AptlyAppInjectionType || (exports.AptlyAppInjectionType = {}));
27
- //# sourceMappingURL=app.js.map
@@ -0,0 +1,34 @@
1
+ import { AptlyUserSchema } from './user.js';
2
+ export interface IAvailabilitySchema<ID, DATE> {
3
+ organization?: ID;
4
+ project: ID;
5
+ archived?: boolean;
6
+ calendars: IAvailabilityCalendarSchema<ID, DATE>[];
7
+ }
8
+ export interface IAvailabilityCalendarSchema<ID, DATE> {
9
+ _id: ID;
10
+ name: string;
11
+ description: string;
12
+ fee?: number;
13
+ location: {
14
+ name: string;
15
+ formatted_address?: string;
16
+ geometry?: {
17
+ location: {
18
+ lat: number;
19
+ lng: number;
20
+ };
21
+ };
22
+ };
23
+ attendees: AptlyUserSchema<ID, DATE>[];
24
+ userAvailability?: (ID | AptlyUserSchema<ID, DATE>)[];
25
+ endAvailabilityAt?: Date;
26
+ availableTimes: IAvailabilityCalendarAvailableTimeSchema<ID, DATE>[];
27
+ }
28
+ export interface IAvailabilityCalendarAvailableTimeSchema<ID, DATE> {
29
+ user?: ID;
30
+ from: DATE;
31
+ to: DATE;
32
+ booked: boolean;
33
+ booking: ID;
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +1,11 @@
1
+ import { AptlyOrganizationSchema } from './organization.js';
2
+ import { AptlyProjectSchema } from './project.js';
3
+ import { AptlyUnitSchema } from './unit.js';
1
4
  export declare type AptlyBooking = AptlyBookingSchema<string, string>;
2
5
  export interface AptlyBookingSchema<ID, DATE> {
3
6
  _id: ID;
4
- project: ID;
5
- unit: ID;
7
+ project: ID | AptlyProjectSchema<ID, DATE>;
8
+ unit: ID | AptlyUnitSchema<ID, DATE>;
6
9
  user: ID;
7
10
  availability: ID;
8
11
  calendar: ID;
@@ -13,8 +16,8 @@ export interface AptlyBookingSchema<ID, DATE> {
13
16
  export declare type AptlyAvailability = AptlyAvailabilitySchema<string, string>;
14
17
  export interface AptlyAvailabilitySchema<ID, DATE> {
15
18
  _id: ID;
16
- organization?: ID;
17
- project: ID;
19
+ organization?: ID | AptlyOrganizationSchema<ID, DATE>;
20
+ project: ID | AptlyProjectSchema<ID, DATE>;
18
21
  archived?: boolean;
19
22
  calendars: AptlyAvailabilityCalendarSchema<ID, DATE>[];
20
23
  }
@@ -41,7 +44,7 @@ export interface AptlyAvailabilityCalendarSchema<ID, DATE> {
41
44
  }
42
45
  export declare type AptlyAvailabilityCalendarAvailableTimes = AptlyAvailabilityCalendarAvailableTimesSchema<string, string>;
43
46
  export interface AptlyAvailabilityCalendarAvailableTimesSchema<ID, DATE> {
44
- _ID: ID;
47
+ _id: ID;
45
48
  from: DATE;
46
49
  to: DATE;
47
50
  booked: boolean;
package/models/booking.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=booking.js.map
package/models/client.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=client.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=department.js.map
@@ -5,10 +5,10 @@ export interface AptlyDocumentSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID,
5
5
  mime: string;
6
6
  _type: AptlyDocumentType;
7
7
  data: string;
8
- organization?: string;
9
- project?: string;
10
- unit?: string;
11
- product?: string;
8
+ organization?: ID;
9
+ project?: ID;
10
+ unit?: ID;
11
+ product?: ID;
12
12
  text?: string;
13
13
  size: number;
14
14
  thirdPartyUploader: string | null;
@@ -16,8 +16,12 @@ export interface AptlyDocumentSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID,
16
16
  external_url?: string;
17
17
  public_id?: string;
18
18
  boligmappaStatus?: AptlyDocumentSchemaBoligmappaStatusSchema<ID>[];
19
- chunks?: ID[];
19
+ chunks?: (AptlyDocumentSchema<ID, DATE> | ID)[];
20
20
  isPasswordProtected?: boolean;
21
+ /**
22
+ * Used in frontend.
23
+ */
24
+ downloadToken?: string;
21
25
  /**
22
26
  * @deprecated use createdAt
23
27
  */
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=document.js.map
package/models/extends.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=extends.js.map
package/models/index.js CHANGED
@@ -39,4 +39,3 @@ __exportStar(require("./upsell-template"), exports);
39
39
  __exportStar(require("./user"), exports);
40
40
  __exportStar(require("./webhook"), exports);
41
41
  __exportStar(require("./webhook-event"), exports);
42
- //# sourceMappingURL=index.js.map
package/models/inquiry.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=inquiry.js.map
package/models/media.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=media.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=notification-trigger.js.map
@@ -1,8 +1,8 @@
1
1
  import { AptlyBaseSchema } from './extends';
2
2
  export declare type AptlyOptionLabel = AptlyOptionLabelSchema<string, string>;
3
3
  export interface AptlyOptionLabelSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
4
- organization?: string;
5
- project?: string;
4
+ organization?: ID;
5
+ project?: ID;
6
6
  /**
7
7
  * @deprecated use createdAt
8
8
  */
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=option-label.js.map
package/models/order.d.ts CHANGED
@@ -1,14 +1,17 @@
1
1
  import { AptlyOrderStatus } from '../enums';
2
- import { AptlyUnitItemParamSchema } from './unit';
2
+ import { AptlyOrganizationSchema } from './organization.js';
3
+ import { AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.js';
4
+ import { AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit';
3
5
  import { AptlyBaseSchema } from './extends';
6
+ import { AptlyUserSchema } from './user.js';
4
7
  export declare type AptlyOrder = AptlyOrderSchema<string, string>;
5
8
  export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
6
9
  orderNumber: string;
7
- organization: ID;
8
- project: ID;
9
- period: ID;
10
- unit: ID;
11
- signers: ID[];
10
+ organization: ID | AptlyOrganizationSchema<ID, DATE>;
11
+ project: ID | AptlyProjectSchema<ID, DATE>;
12
+ period: ID | AptlyProjectPeriodSchema<ID, DATE>;
13
+ unit: ID | AptlyUnitSchema<ID, DATE>;
14
+ signers: (ID | AptlyUserSchema<ID, DATE>)[];
12
15
  status: AptlyOrderStatus;
13
16
  receipt: ID;
14
17
  attachments: ID[];
package/models/order.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=order.js.map
@@ -1,13 +1,13 @@
1
1
  import { AptlyPermissionModulesModels, AptlyPermissionOrganizationModels, AptlyScope, AptlySignageSchema } from '../core';
2
2
  import { AptlyUserSchema } from './user';
3
3
  import { AptlyMediaSrc } from './media';
4
- import { AptlyBaseSchema } from './extends';
4
+ import { AptlyBaseSchema, AptlyHistorySchema } from './extends';
5
5
  import { AptlyDepartmentGeneric } from './department';
6
6
  import { AptlyProducerSchema } from './producer';
7
7
  import { AptlyAppSchema } from './app';
8
8
  import { AptlyAlgorithmSchema } from './algorithm';
9
9
  export declare type AptlyOrganization = AptlyOrganizationSchema<string, string>;
10
- export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
10
+ export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
11
11
  slug: string;
12
12
  logo?: string | null;
13
13
  logoMedia?: AptlyMediaSrc | null;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=organization.js.map
package/models/page.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=page.js.map
@@ -1,7 +1,7 @@
1
- import { AptlyBaseSchema } from './extends';
1
+ import { AptlyBaseSchema, AptlyHistorySchema } from './extends';
2
2
  import { AptlyMediaSrc } from './media';
3
3
  export declare type AptlyProducer = AptlyProducerSchema<string, string>;
4
- export interface AptlyProducerSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
4
+ export interface AptlyProducerSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
5
5
  email: string;
6
6
  logo: string | null;
7
7
  logoMedia?: AptlyMediaSrc | null;
@@ -9,6 +9,7 @@ export interface AptlyProducerSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>
9
9
  organization?: ID;
10
10
  createdBy: ID;
11
11
  tags: ID[];
12
+ featured: boolean;
12
13
  /**
13
14
  * @deprecated not used
14
15
  */
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=producer.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=product-stats.js.map
@@ -1,12 +1,12 @@
1
- import { AptlyBaseSchema, AptlyDBCrawlerCleaner } from './extends';
1
+ import { AptlyBaseSchema, AptlyDBCrawlerCleaner, AptlyHistorySchema } from './extends';
2
2
  import { AptlyMediaSrcSchema } from './media';
3
3
  import { AptlyProducerSchema } from './producer';
4
4
  export declare type AptlyProduct = AptlyProductSchema<string, string>;
5
- export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, AptlyBaseSchema<ID, DATE> {
5
+ export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
6
6
  searchableName: string;
7
7
  organization?: ID;
8
8
  project?: ID;
9
- extends?: ID;
9
+ extends?: ID | AptlyProductSchema<ID, DATE>;
10
10
  productNumber: string;
11
11
  description: string;
12
12
  images: AptlyProductImageSchema<ID, DATE>[];
package/models/product.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=product.js.map
@@ -1,14 +1,14 @@
1
1
  import { AptlyOrganizationSchema } from './organization';
2
2
  import { AptlyPermissionModulesModels } from '../core';
3
3
  import { AptlyUserSchema } from './user';
4
- import { AptlyBaseSchema } from './extends';
4
+ import { AptlyBaseSchema, AptlyHistorySchema } from './extends';
5
5
  import { AptlyDocumentSchema } from './document';
6
6
  import { AptlyUnitOptionExtraItemSchema } from './unit';
7
7
  import { AptlyMediaSrc } from './media';
8
8
  export declare type AptlyProject = AptlyProjectSchema<string, string>;
9
- export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
9
+ export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
10
10
  organization: AptlyOrganizationSchema<ID, DATE> | ID;
11
- template?: ID;
11
+ template?: ID | null;
12
12
  /**
13
13
  * @deprecated dont think this is used anymore
14
14
  */
package/models/project.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=project.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=queue-download.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=recommendation.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=supplier.js.map
package/models/tag.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=tag.js.map
@@ -13,4 +13,3 @@ var AptlyUnitEmailType;
13
13
  AptlyUnitEmailType["OrderCreated"] = "order-created";
14
14
  AptlyUnitEmailType["OrderSigned"] = "order-signed";
15
15
  })(AptlyUnitEmailType = exports.AptlyUnitEmailType || (exports.AptlyUnitEmailType = {}));
16
- //# sourceMappingURL=unit-email.js.map
@@ -80,8 +80,8 @@ export declare type AptlyUnitTemplateCategorySectionProduct = AptlyUnitTemplateC
80
80
  export interface AptlyUnitTemplateCategorySectionProductSchema<ID, DATE> {
81
81
  _id: ID;
82
82
  _orderID: ID;
83
- product?: ID | AptlyProductSchema<ID, DATE>;
84
- producer?: ID | AptlyProducerSchema<ID, DATE>;
83
+ product?: AptlyProductSchema<ID, DATE>;
84
+ producer?: AptlyProducerSchema<ID, DATE>;
85
85
  availableProducts: ID[];
86
86
  variantPrices: AptlyUnitTemplateCategorySectionProductVariantPriceSchema<ID>[];
87
87
  text?: string;
@@ -91,7 +91,7 @@ export interface AptlyUnitTemplateCategorySectionProductSchema<ID, DATE> {
91
91
  consequenceParam?: string;
92
92
  amount: number;
93
93
  unitCost?: number;
94
- algorithm: AptlyProjectAlgorithmSchema<ID> | ID;
94
+ algorithm: ID | AptlyProjectAlgorithmSchema<ID>;
95
95
  standard: boolean;
96
96
  standardVariant?: ID;
97
97
  partOfPackage?: ID;
@@ -114,6 +114,9 @@ export interface AptlyUnitTemplateCategorySectionProductParamSchema<ID, VALUE =
114
114
  _id: ID;
115
115
  key: AptlyUnitTemplateCategorySectionProductParamKey;
116
116
  value: VALUE;
117
+ categoryName?: string;
118
+ sectionNames?: string[];
119
+ sectionName?: string;
117
120
  }
118
121
  export declare type AptlyUnitTemplateCategorySectionProductVariantPrice = AptlyUnitTemplateCategorySectionProductVariantPriceSchema<string>;
119
122
  export interface AptlyUnitTemplateCategorySectionProductVariantPriceSchema<ID> {
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=unit-template.js.map
package/models/unit.d.ts CHANGED
@@ -1,14 +1,16 @@
1
+ import { AptlyProducerSchema } from './producer.js';
2
+ import { AptlyProductSchema } from './product.js';
1
3
  import { AptlyProjectSchema } from './project';
2
4
  import { AptlyHistorySchema } from './extends';
3
- import { AptlyUnitTemplateBaseSchema, AptlyUnitTemplateSchema } from './unit-template';
5
+ import { AptlyUnitTemplateBaseSchema, AptlyUnitTemplateCategorySchema, AptlyUnitTemplateCategorySectionSchema, AptlyUnitTemplateSchema } from './unit-template';
4
6
  import { AptlyIntegration, AptlyUnitItemParamKey, AptlyUnitStatus } from '../enums';
5
7
  import { AptlyUserSchema } from './user';
6
8
  import { AptlyOrganizationSchema } from './organization';
7
9
  export declare type AptlyUnit = AptlyUnitSchema<string, string>;
8
- export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<ID, DATE>, AptlyUnitEditData, AptlyHistorySchema<ID, DATE> {
10
+ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<ID, DATE>, AptlyUnitEditData<DATE>, AptlyHistorySchema<ID, DATE> {
9
11
  status: AptlyUnitStatus;
10
12
  rooms: AptlyUnitRoomSchema<ID>[];
11
- selectedOptions: AptlyUnitOptionSchema<ID, DATE>[];
13
+ selectedOptions: AptlyUnitSelectedOptionSchema<ID, DATE>[];
12
14
  items: AptlyUnitOptionItemSchema<ID, DATE>[];
13
15
  revertedOptions?: AptlyUnitOptionItemSchema<ID, DATE>[];
14
16
  revertedItems?: AptlyUnitOptionItemSchema<ID, DATE>[];
@@ -17,7 +19,7 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
17
19
  productOverrides: AptlyUnitProductOverrideSchema<ID>[];
18
20
  ordersToSign: ID[];
19
21
  categoriesRead: ID[];
20
- spec: IUnitSpec;
22
+ spec: AptlyUnitSpec;
21
23
  buildStep: number;
22
24
  documents: ID[];
23
25
  unitPlans: {
@@ -37,7 +39,6 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
37
39
  overridePeriod?: ID;
38
40
  overridePeriods?: AptlyUnitOverridePeriodSchema<ID, DATE>[];
39
41
  integrations: AptlyUnitIntegrationSchema<ID>[];
40
- handoverDate?: DATE | null;
41
42
  tree: any[];
42
43
  /**
43
44
  * @deprecated use createdAt
@@ -51,13 +52,13 @@ export interface AptlyUnitOverridePeriodSchema<ID, DATE> {
51
52
  close: DATE;
52
53
  }
53
54
  export declare type AptlyUnitItemBase = AptlyUnitItemBaseSchema<string, string>;
54
- interface AptlyUnitItemBaseSchema<ID, DATE> {
55
+ export interface AptlyUnitItemBaseSchema<ID, DATE> {
55
56
  _id: ID;
56
- product: ID;
57
+ product: ID | AptlyProductSchema<ID, DATE>;
57
58
  variant: ID;
58
- producer: ID;
59
- category?: ID;
60
- section?: ID;
59
+ producer: ID | AptlyProducerSchema<ID, DATE>;
60
+ category?: ID | AptlyUnitTemplateCategorySchema<ID, DATE>;
61
+ section?: ID | AptlyUnitTemplateCategorySectionSchema<ID, DATE>;
61
62
  period?: ID;
62
63
  quantity: number;
63
64
  standard?: boolean;
@@ -68,13 +69,13 @@ interface AptlyUnitItemBaseSchema<ID, DATE> {
68
69
  params: AptlyUnitItemParamSchema<ID>[];
69
70
  baseCost?: number;
70
71
  }
71
- export declare type AptlyUnitOption = AptlyUnitOptionSchema<string, string>;
72
- export interface AptlyUnitOptionSchema<ID, DATE> {
72
+ export declare type AptlyUnitOption = AptlyUnitSelectedOptionSchema<string, string>;
73
+ export interface AptlyUnitSelectedOptionSchema<ID, DATE> {
73
74
  _id: ID;
74
- category: ID;
75
- section: ID;
75
+ category: ID | AptlyUnitTemplateCategorySchema<ID, DATE>;
76
+ section: ID | AptlyUnitTemplateCategorySectionSchema<ID, DATE>;
76
77
  sectionProductRef: ID;
77
- product: ID;
78
+ product: ID | AptlyProductSchema<ID, DATE>;
78
79
  variant: ID;
79
80
  period: ID;
80
81
  quantity: number;
@@ -83,14 +84,18 @@ export interface AptlyUnitOptionSchema<ID, DATE> {
83
84
  confirmDate?: DATE;
84
85
  params: AptlyUnitItemParamSchema<ID>[];
85
86
  package?: ID;
87
+ standard?: boolean;
88
+ text?: string;
89
+ producer?: ID;
90
+ baseCost?: number;
86
91
  }
87
92
  export declare type AptlyUnitOptionItem = AptlyUnitOptionItemSchema<string, string>;
88
- export interface AptlyUnitOptionItemSchema<ID, DATE> extends AptlyUnitOptionSchema<ID, DATE> {
93
+ export interface AptlyUnitOptionItemSchema<ID, DATE> extends AptlyUnitSelectedOptionSchema<ID, DATE> {
89
94
  unitCost: number;
90
- standard?: boolean;
95
+ pickRef?: ID;
91
96
  }
92
97
  export declare type AptlyUnitOptionExtraItem = AptlyUnitOptionExtraItemSchema<string, string>;
93
- export interface AptlyUnitOptionExtraItemSchema<ID, DATE> extends Partial<AptlyUnitOptionItemSchema<ID, DATE>> {
98
+ export interface AptlyUnitOptionExtraItemSchema<ID, DATE> extends AptlyUnitOptionItemSchema<ID, DATE> {
94
99
  _id: ID;
95
100
  unitCost: number;
96
101
  addToNextOrder?: boolean;
@@ -100,12 +105,25 @@ export interface AptlyUnitOptionExtraItemSchema<ID, DATE> extends Partial<AptlyU
100
105
  projectItemRef?: ID;
101
106
  revertedOption?: boolean;
102
107
  revertItemRef?: ID;
108
+ /** @deprecated. Not sure this is used */
109
+ document?: ID;
110
+ /** @deprecated. Not sure this is used */
111
+ prerequisites?: {
112
+ totalCost?: number;
113
+ };
114
+ /** @deprecated. Not sure this is used */
115
+ thirdPartyUploader?: string;
116
+ /** @deprecated. Not sure this is used */
117
+ cost: number;
118
+ /** @deprecated. Cant se this is used anymore */
119
+ customTitle?: string;
103
120
  }
104
121
  export declare type AptlyUnitItemParam<VALUE> = AptlyUnitItemParamSchema<string, VALUE>;
105
122
  export interface AptlyUnitItemParamSchema<ID, VALUE = any> {
106
123
  _id: ID;
107
124
  key: AptlyUnitItemParamKey;
108
125
  value: VALUE;
126
+ downloadToken?: string;
109
127
  }
110
128
  export declare type AptlyUnitRoom = AptlyUnitRoomSchema<string>;
111
129
  export interface AptlyUnitRoomSchema<ID> {
@@ -144,7 +162,7 @@ export interface AptlyUnitProductOverrideVariantPriceSchema<ID> {
144
162
  variant: ID;
145
163
  price: number;
146
164
  }
147
- export interface IUnitSpec {
165
+ export interface AptlyUnitSpec {
148
166
  categories: {
149
167
  name: string;
150
168
  isRoom: boolean;
@@ -170,7 +188,7 @@ export interface AptlyUnitIntegrationSchema<ID> {
170
188
  plantId?: string;
171
189
  tags?: string[];
172
190
  }
173
- interface AptlyUnitEditData {
191
+ interface AptlyUnitEditData<DATE> {
174
192
  address?: string;
175
193
  zipCode?: string;
176
194
  city?: string;
@@ -201,6 +219,7 @@ interface AptlyUnitEditData {
201
219
  postboxKeys?: number;
202
220
  electricKeys?: number;
203
221
  balconyKeys?: number;
222
+ handoverDate?: DATE | null;
204
223
  }
205
224
  export interface AptlyUnitInviteSchema<ID, DATE> {
206
225
  _id: ID;
package/models/unit.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=unit.js.map
@@ -1,6 +1,6 @@
1
- import { AptlyBaseSchema } from './extends';
1
+ import { AptlyBaseSchema, AptlyHistorySchema } from './extends';
2
2
  export declare type AptlyUpsellTemplate = AptlyUpsellTemplateSchema<string, string>;
3
- export interface AptlyUpsellTemplateSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
3
+ export interface AptlyUpsellTemplateSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
4
4
  image?: string | null;
5
5
  imageMedia?: string | null;
6
6
  videoEmbed?: string;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=upsell-template.js.map
package/models/user.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=user.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=webhook-event.js.map
package/models/webhook.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=webhook.js.map
package/package.json CHANGED
@@ -1,41 +1,43 @@
1
- {
2
- "name": "@aptly-as/types",
3
- "version": "1.7.6",
4
- "description": "Aptly types and enums",
5
- "main": "./index.js",
6
- "types": "./index.d.ts",
7
- "author": "Emil A. Olsen <emil@aptly.as>",
8
- "engines": {
9
- "node": ">14.0.0"
10
- },
11
- "scripts": {
12
- "start": "yarn build:watch",
13
- "build": "tsc",
14
- "build:watch": "tsc --watch --incremental",
15
- "postversion": "git push && git push --tags",
16
- "prepublish": "npm run build"
17
- },
18
- "dependencies": {},
19
- "devDependencies": {
20
- "husky": "^7.0.4",
21
- "lint-staged": "^12.3.4",
22
- "prettier": "^2.5.1",
23
- "typescript": "^4.2.4"
24
- },
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/aptly-as/types.git"
28
- },
29
- "keywords": [
30
- "typescript",
31
- "aptly",
32
- "types"
33
- ],
34
- "bugs": {
35
- "url": "https://github.com/aptly-as/types/issues"
36
- },
37
- "homepage": "https://github.com/aptly-as/types#readme",
38
- "lint-staged": {
39
- "**/*": "prettier --write --ignore-unknown"
40
- }
41
- }
1
+ {
2
+ "name": "@aptly-as/types",
3
+ "version": "1.8.0",
4
+ "description": "Aptly types and enums",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "module": "./index.js",
8
+ "author": "Emil A. Olsen <emil@aptly.as>",
9
+ "engines": {
10
+ "node": ">14.0.0"
11
+ },
12
+ "scripts": {
13
+ "start": "yarn build:watch",
14
+ "build": "tsc",
15
+ "build:watch": "tsc --watch --incremental",
16
+ "postversion": "git push && git push --tags",
17
+ "prepublish": "npm run build"
18
+ },
19
+ "dependencies": {},
20
+ "devDependencies": {
21
+ "cloudinary": "^1.32.0",
22
+ "husky": "^7.0.4",
23
+ "lint-staged": "^12.3.4",
24
+ "prettier": "^2.5.1",
25
+ "typescript": "^4.2.4"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/aptly-as/types.git"
30
+ },
31
+ "keywords": [
32
+ "typescript",
33
+ "aptly",
34
+ "types"
35
+ ],
36
+ "bugs": {
37
+ "url": "https://github.com/aptly-as/types/issues"
38
+ },
39
+ "homepage": "https://github.com/aptly-as/types#readme",
40
+ "lint-staged": {
41
+ "**/*": "prettier --write --ignore-unknown"
42
+ }
43
+ }