@aptly-as/types 1.7.7 → 1.8.1

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 (83) 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 +5 -2
  9. package/core/permission.d.ts +7 -7
  10. package/core/permission.js +0 -1
  11. package/core/scope.d.ts +2 -2
  12. package/core/scope.js +0 -1
  13. package/core/signage.d.ts +2 -2
  14. package/core/signage.js +0 -1
  15. package/core/webhook-event-data.js +0 -1
  16. package/enums/document.js +0 -1
  17. package/enums/fields.js +0 -1
  18. package/enums/index.js +5 -2
  19. package/enums/unit-template.js +0 -1
  20. package/enums/webhook.js +0 -1
  21. package/index.js +5 -2
  22. package/models/algorithm.d.ts +2 -2
  23. package/models/algorithm.js +0 -1
  24. package/models/app.d.ts +4 -4
  25. package/models/app.js +0 -1
  26. package/models/availability.d.ts +34 -0
  27. package/models/availability.js +2 -0
  28. package/models/booking.d.ts +12 -9
  29. package/models/booking.js +0 -1
  30. package/models/client.d.ts +1 -1
  31. package/models/client.js +0 -1
  32. package/models/department.d.ts +3 -3
  33. package/models/department.js +0 -1
  34. package/models/document.d.ts +11 -7
  35. package/models/document.js +0 -1
  36. package/models/extends.d.ts +2 -2
  37. package/models/extends.js +0 -1
  38. package/models/index.js +5 -2
  39. package/models/inquiry.d.ts +3 -3
  40. package/models/inquiry.js +0 -1
  41. package/models/media.d.ts +3 -3
  42. package/models/media.js +0 -1
  43. package/models/notification-trigger.d.ts +1 -1
  44. package/models/notification-trigger.js +0 -1
  45. package/models/option-label.d.ts +3 -3
  46. package/models/option-label.js +0 -1
  47. package/models/order.d.ts +14 -11
  48. package/models/order.js +0 -1
  49. package/models/organization.d.ts +7 -7
  50. package/models/organization.js +0 -1
  51. package/models/page.d.ts +2 -2
  52. package/models/page.js +0 -1
  53. package/models/producer.d.ts +4 -3
  54. package/models/producer.js +0 -1
  55. package/models/product-stats.d.ts +1 -1
  56. package/models/product-stats.js +0 -1
  57. package/models/product.d.ts +7 -7
  58. package/models/product.js +0 -1
  59. package/models/project.d.ts +8 -8
  60. package/models/project.js +0 -1
  61. package/models/queue-download.d.ts +1 -1
  62. package/models/queue-download.js +0 -1
  63. package/models/recommendation.d.ts +1 -1
  64. package/models/recommendation.js +0 -1
  65. package/models/supplier.d.ts +1 -1
  66. package/models/supplier.js +0 -1
  67. package/models/tag.d.ts +1 -1
  68. package/models/tag.js +0 -1
  69. package/models/unit-email.d.ts +1 -1
  70. package/models/unit-email.js +0 -1
  71. package/models/unit-template.d.ts +16 -13
  72. package/models/unit-template.js +0 -1
  73. package/models/unit.d.ts +53 -34
  74. package/models/unit.js +0 -1
  75. package/models/upsell-template.d.ts +3 -3
  76. package/models/upsell-template.js +0 -1
  77. package/models/user.d.ts +1 -1
  78. package/models/user.js +0 -1
  79. package/models/webhook-event.d.ts +3 -3
  80. package/models/webhook-event.js +0 -1
  81. package/models/webhook.d.ts +1 -1
  82. package/models/webhook.js +0 -1
  83. package/package.json +43 -41
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
- export declare type AptlyUnit = AptlyUnitSchema<string, string>;
8
- export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<ID, DATE>, AptlyUnitEditData, AptlyHistorySchema<ID, DATE> {
9
+ export type AptlyUnit = AptlyUnitSchema<string, string>;
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,27 +39,26 @@ 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
44
45
  */
45
46
  created: DATE;
46
47
  }
47
- export declare type AptlyUnitOverridePeriod = AptlyUnitOverridePeriodSchema<string, string>;
48
+ export type AptlyUnitOverridePeriod = AptlyUnitOverridePeriodSchema<string, string>;
48
49
  export interface AptlyUnitOverridePeriodSchema<ID, DATE> {
49
50
  _id: ID;
50
51
  period: ID;
51
52
  close: DATE;
52
53
  }
53
- export declare type AptlyUnitItemBase = AptlyUnitItemBaseSchema<string, string>;
54
- interface AptlyUnitItemBaseSchema<ID, DATE> {
54
+ export type AptlyUnitItemBase = AptlyUnitItemBaseSchema<string, string>;
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 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 | AptlyProducerSchema<ID, DATE>;
90
+ baseCost?: number;
86
91
  }
87
- export declare type AptlyUnitOptionItem = AptlyUnitOptionItemSchema<string, string>;
88
- export interface AptlyUnitOptionItemSchema<ID, DATE> extends AptlyUnitOptionSchema<ID, DATE> {
92
+ export type AptlyUnitOptionItem = AptlyUnitOptionItemSchema<string, string>;
93
+ export interface AptlyUnitOptionItemSchema<ID, DATE> extends AptlyUnitSelectedOptionSchema<ID, DATE> {
89
94
  unitCost: number;
90
- standard?: boolean;
95
+ pickRef?: ID;
91
96
  }
92
- export declare type AptlyUnitOptionExtraItem = AptlyUnitOptionExtraItemSchema<string, string>;
93
- export interface AptlyUnitOptionExtraItemSchema<ID, DATE> extends Partial<AptlyUnitOptionItemSchema<ID, DATE>> {
97
+ export type AptlyUnitOptionExtraItem = AptlyUnitOptionExtraItemSchema<string, string>;
98
+ export interface AptlyUnitOptionExtraItemSchema<ID, DATE> extends AptlyUnitOptionItemSchema<ID, DATE> {
94
99
  _id: ID;
95
100
  unitCost: number;
96
101
  addToNextOrder?: boolean;
@@ -100,26 +105,39 @@ export interface AptlyUnitOptionExtraItemSchema<ID, DATE> extends Partial<AptlyU
100
105
  projectItemRef?: ID;
101
106
  revertedOption?: boolean;
102
107
  revertItemRef?: ID;
103
- }
104
- export declare type AptlyUnitItemParam<VALUE> = AptlyUnitItemParamSchema<string, VALUE>;
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;
120
+ }
121
+ export 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
- export declare type AptlyUnitRoom = AptlyUnitRoomSchema<string>;
128
+ export type AptlyUnitRoom = AptlyUnitRoomSchema<string>;
111
129
  export interface AptlyUnitRoomSchema<ID> {
112
130
  _id: ID;
113
131
  name: string;
114
132
  sizeParams: AptlyUnitRoomSchemaSizeParamSchema<ID>[];
115
133
  }
116
- export declare type AptlyUnitRoomSchemaSizeParam = AptlyUnitRoomSchemaSizeParamSchema<string>;
134
+ export type AptlyUnitRoomSchemaSizeParam = AptlyUnitRoomSchemaSizeParamSchema<string>;
117
135
  export interface AptlyUnitRoomSchemaSizeParamSchema<ID> {
118
136
  _id: ID;
119
137
  key: string;
120
138
  value: number;
121
139
  }
122
- export declare type AptlyUnitCategoryOverride = AptlyUnitCategoryOverrideSchema<string>;
140
+ export type AptlyUnitCategoryOverride = AptlyUnitCategoryOverrideSchema<string>;
123
141
  export interface AptlyUnitCategoryOverrideSchema<ID> {
124
142
  category: ID;
125
143
  /**
@@ -128,7 +146,7 @@ export interface AptlyUnitCategoryOverrideSchema<ID> {
128
146
  size: number;
129
147
  hide: boolean;
130
148
  }
131
- export declare type AptlyUnitProductOverride = AptlyUnitProductOverrideSchema<string>;
149
+ export type AptlyUnitProductOverride = AptlyUnitProductOverrideSchema<string>;
132
150
  export interface AptlyUnitProductOverrideSchema<ID> {
133
151
  sectionProductRef: ID;
134
152
  section: ID;
@@ -138,13 +156,13 @@ export interface AptlyUnitProductOverrideSchema<ID> {
138
156
  variantPrices?: AptlyUnitProductOverrideVariantPriceSchema<ID>[];
139
157
  hide?: boolean;
140
158
  }
141
- export declare type AptlyUnitProductOverrideVariantPrice = AptlyUnitProductOverrideVariantPriceSchema<string>;
159
+ export type AptlyUnitProductOverrideVariantPrice = AptlyUnitProductOverrideVariantPriceSchema<string>;
142
160
  export interface AptlyUnitProductOverrideVariantPriceSchema<ID> {
143
161
  _id: 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;
@@ -156,13 +174,13 @@ export interface IUnitSpec {
156
174
  }[];
157
175
  }[];
158
176
  }
159
- export declare type AptlyUnitConfirmedPeriod = AptlyUnitConfirmedPeriodSchema<string>;
177
+ export type AptlyUnitConfirmedPeriod = AptlyUnitConfirmedPeriodSchema<string>;
160
178
  export interface AptlyUnitConfirmedPeriodSchema<ID> {
161
179
  _id: ID;
162
180
  period: ID;
163
181
  order: ID;
164
182
  }
165
- export declare type AptlyUnitIntegration = AptlyUnitIntegrationSchema<string>;
183
+ export type AptlyUnitIntegration = AptlyUnitIntegrationSchema<string>;
166
184
  export interface AptlyUnitIntegrationSchema<ID> {
167
185
  _id: ID;
168
186
  integration: AptlyIntegration;
@@ -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';
2
- export declare type AptlyUpsellTemplate = AptlyUpsellTemplateSchema<string, string>;
3
- export interface AptlyUpsellTemplateSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
1
+ import { AptlyBaseSchema, AptlyHistorySchema } from './extends';
2
+ export type AptlyUpsellTemplate = AptlyUpsellTemplateSchema<string, string>;
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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AptlyBaseSchema } from './extends';
2
- export declare type AptlyUser = AptlyUserSchema<string, string>;
2
+ export type AptlyUser = AptlyUserSchema<string, string>;
3
3
  export interface AptlyUserSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'archived' | 'name'> {
4
4
  email: string;
5
5
  fullName: string;
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,7 +1,7 @@
1
1
  import { AptlyWebhookEventStatus, AptlyWebhookType } from '../enums';
2
2
  import { AptlyBaseSchema } from './extends';
3
- declare type ServerKeys = 'run' | 'organization' | 'project' | 'status' | 'url' | 'headers' | 'responses';
4
- export declare type AptlyWebhookEvent<T = unknown> = Omit<AptlyWebhookEventSchema<string, string, T>, ServerKeys>;
3
+ type ServerKeys = 'run' | 'organization' | 'project' | 'status' | 'url' | 'headers' | 'responses';
4
+ export type AptlyWebhookEvent<T = unknown> = Omit<AptlyWebhookEventSchema<string, string, T>, ServerKeys>;
5
5
  export interface AptlyWebhookEventSchema<ID, DATE, DATA = unknown> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
6
6
  specversion: string;
7
7
  type: AptlyWebhookType;
@@ -27,7 +27,7 @@ export interface AptlyWebhookEventSchema<ID, DATE, DATA = unknown> extends Omit<
27
27
  */
28
28
  created: DATE;
29
29
  }
30
- export declare type AptlyWebhookEventResponse<DATA = any> = AptlyWebhookEventResponseSchema<string, string, DATA>;
30
+ export type AptlyWebhookEventResponse<DATA = any> = AptlyWebhookEventResponseSchema<string, string, DATA>;
31
31
  export interface AptlyWebhookEventResponseSchema<ID, DATE, DATA = any> {
32
32
  _id: ID;
33
33
  time: DATE;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=webhook-event.js.map
@@ -15,4 +15,4 @@ export interface AptlyWebhookSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>
15
15
  */
16
16
  created: DATE;
17
17
  }
18
- export declare type AptlyWebhook = AptlyWebhookSchema<string, string>;
18
+ export type AptlyWebhook = AptlyWebhookSchema<string, string>;
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.7",
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.1",
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": "16.18"
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": "^8.0.2",
23
+ "lint-staged": "^13.0.4",
24
+ "prettier": "^2.8.0",
25
+ "typescript": "^4.9.3"
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
+ }