@aptly-as/types 1.7.3 → 1.7.4

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 (53) hide show
  1. package/.idea/aptly-types.iml +12 -0
  2. package/.idea/codeStyles/Project.xml +62 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/models/product.d.ts +1 -0
  7. package/package.json +1 -10
  8. package/core/api.ts +0 -15
  9. package/core/app.ts +0 -41
  10. package/core/cloudinary.ts +0 -11
  11. package/core/error.ts +0 -28
  12. package/core/fields.ts +0 -19
  13. package/core/index.ts +0 -16
  14. package/core/permission.ts +0 -212
  15. package/core/scope.ts +0 -12
  16. package/core/signage.ts +0 -21
  17. package/core/webhook-event-data.ts +0 -15
  18. package/enums/document.ts +0 -31
  19. package/enums/fields.ts +0 -26
  20. package/enums/index.ts +0 -120
  21. package/enums/unit-template.ts +0 -11
  22. package/enums/webhook.ts +0 -24
  23. package/index.ts +0 -3
  24. package/models/algorithm.ts +0 -31
  25. package/models/app.ts +0 -75
  26. package/models/booking.ts +0 -57
  27. package/models/client.ts +0 -15
  28. package/models/department.ts +0 -31
  29. package/models/document.ts +0 -35
  30. package/models/extends.ts +0 -39
  31. package/models/index.ts +0 -30
  32. package/models/inquiry.ts +0 -57
  33. package/models/media.ts +0 -71
  34. package/models/notification-trigger.ts +0 -10
  35. package/models/option-label.ts +0 -12
  36. package/models/order.ts +0 -66
  37. package/models/organization.ts +0 -91
  38. package/models/page.ts +0 -34
  39. package/models/producer.ts +0 -22
  40. package/models/product-stats.ts +0 -19
  41. package/models/product.ts +0 -78
  42. package/models/project.ts +0 -139
  43. package/models/queue-download.ts +0 -21
  44. package/models/recommendation.ts +0 -13
  45. package/models/supplier.ts +0 -17
  46. package/models/tag.ts +0 -9
  47. package/models/unit-email.ts +0 -39
  48. package/models/unit-template.ts +0 -140
  49. package/models/unit.ts +0 -242
  50. package/models/upsell-template.ts +0 -21
  51. package/models/user.ts +0 -19
  52. package/models/webhook-event.ts +0 -50
  53. package/models/webhook.ts +0 -21
package/models/unit.ts DELETED
@@ -1,242 +0,0 @@
1
- import { AptlyProjectSchema } from './project';
2
- import { AptlyHistorySchema } from './extends';
3
- import { AptlyUnitTemplateBaseSchema, AptlyUnitTemplateSchema } from './unit-template';
4
- import { AptlyIntegration, AptlyUnitItemParamKey, AptlyUnitStatus } from '../enums';
5
- import { AptlyUserSchema } from './user';
6
- import { AptlyOrganizationSchema } from './organization';
7
-
8
- export type AptlyUnit = AptlyUnitSchema<string, string>;
9
- export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<ID, DATE>, AptlyUnitEditData, AptlyHistorySchema<ID, DATE> {
10
- status: AptlyUnitStatus;
11
- rooms: AptlyUnitRoomSchema<ID>[];
12
- selectedOptions: AptlyUnitOptionSchema<ID, DATE>[];
13
- items: AptlyUnitOptionItemSchema<ID, DATE>[];
14
- revertedOptions?: AptlyUnitOptionItemSchema<ID, DATE>[];
15
- revertedItems?: AptlyUnitOptionItemSchema<ID, DATE>[];
16
- extraOptions: AptlyUnitOptionExtraItemSchema<ID, DATE>[];
17
-
18
- categoryOverrides: AptlyUnitCategoryOverrideSchema<ID>[];
19
- productOverrides: AptlyUnitProductOverrideSchema<ID>[];
20
- ordersToSign: ID[];
21
- categoriesRead: ID[];
22
- spec: IUnitSpec;
23
- buildStep: number;
24
- documents: ID[];
25
- unitPlans: {
26
- image: string;
27
- description?: string;
28
- }[];
29
- organization: AptlyOrganizationSchema<ID, DATE> | ID;
30
- project: AptlyProjectSchema<ID, DATE> | ID;
31
- users: (AptlyUserSchema<ID, DATE> | ID)[];
32
- unitTemplate: ID | AptlyUnitTemplateSchema<ID, DATE>;
33
- confirmedPeriods: AptlyUnitConfirmedPeriodSchema<ID>[];
34
- queueInvites: string[];
35
- invites: AptlyUnitInviteSchema<ID, DATE>[];
36
- /**
37
- * @deprecated use overridePeriods
38
- */
39
- overridePeriod?: ID;
40
- overridePeriods?: AptlyUnitOverridePeriodSchema<ID, DATE>[];
41
- integrations: AptlyUnitIntegrationSchema<ID>[];
42
- handoverDate?: DATE | null;
43
-
44
- tree: any[];
45
-
46
- /**
47
- * @deprecated use createdAt
48
- */
49
- created: DATE;
50
- }
51
-
52
- export type AptlyUnitOverridePeriod = AptlyUnitOverridePeriodSchema<string, string>;
53
- export interface AptlyUnitOverridePeriodSchema<ID, DATE> {
54
- _id: ID;
55
- period: ID;
56
- close: DATE;
57
- }
58
-
59
- export type AptlyUnitItemBase = AptlyUnitItemBaseSchema<string, string>;
60
- interface AptlyUnitItemBaseSchema<ID, DATE> {
61
- _id: ID;
62
- product: ID;
63
- variant: ID;
64
- producer: ID;
65
- category?: ID;
66
- section?: ID;
67
- period?: ID;
68
- quantity: number;
69
- standard?: boolean;
70
- pickDate: string;
71
- confirmDate?: DATE;
72
- pickedBy: ID;
73
- text?: string;
74
- params: AptlyUnitItemParamSchema<ID>[];
75
-
76
- baseCost?: number; // Used for order and creating base cost
77
- }
78
-
79
- export type AptlyUnitOption = AptlyUnitOptionSchema<string, string>;
80
- export interface AptlyUnitOptionSchema<ID, DATE> {
81
- _id: ID;
82
- category: ID;
83
- section: ID;
84
- sectionProductRef: ID;
85
- product: ID;
86
- variant: ID;
87
- period: ID;
88
- quantity: number;
89
- pickDate: DATE,
90
- pickedBy: ID;
91
- confirmDate?: DATE,
92
- params: AptlyUnitItemParamSchema<ID>[];
93
- package?: ID;
94
- }
95
-
96
- export type AptlyUnitOptionItem = AptlyUnitOptionItemSchema<string, string>;
97
- export interface AptlyUnitOptionItemSchema<ID, DATE> extends AptlyUnitOptionSchema<ID, DATE> {
98
- unitCost: number;
99
- standard?: boolean;
100
- }
101
-
102
- export type AptlyUnitOptionExtraItem = AptlyUnitOptionExtraItemSchema<string, string>;
103
- export interface AptlyUnitOptionExtraItemSchema<ID, DATE> extends Partial<AptlyUnitOptionItemSchema<ID, DATE>> {
104
- _id: ID;
105
- unitCost: number;
106
- addToNextOrder?: boolean;
107
- text?: string;
108
- customDescription?: string;
109
- algorithm?: ID;
110
- projectItemRef?: ID;
111
- revertedOption?: boolean;
112
- revertItemRef?: ID;
113
- }
114
-
115
- export type AptlyUnitItemParam<VALUE> = AptlyUnitItemParamSchema<string, VALUE>;
116
- export interface AptlyUnitItemParamSchema<ID, VALUE = any> {
117
- _id: ID;
118
- key: AptlyUnitItemParamKey;
119
- value: VALUE;
120
- }
121
-
122
- export type AptlyUnitRoom = AptlyUnitRoomSchema<string>;
123
- export interface AptlyUnitRoomSchema<ID> {
124
- _id: ID;
125
- name: string;
126
- sizeParams: AptlyUnitRoomSchemaSizeParamSchema<ID>[];
127
- }
128
-
129
- export type AptlyUnitRoomSchemaSizeParam = AptlyUnitRoomSchemaSizeParamSchema<string>;
130
- export interface AptlyUnitRoomSchemaSizeParamSchema<ID> {
131
- _id: ID;
132
- key: string;
133
- value: number;
134
- }
135
-
136
- export type AptlyUnitCategoryOverride = AptlyUnitCategoryOverrideSchema<string>;
137
- export interface AptlyUnitCategoryOverrideSchema<ID> {
138
- category: ID;
139
- /**
140
- * @deprecated Not used i think
141
- */
142
- size: number;
143
- hide: boolean;
144
- }
145
-
146
- export type AptlyUnitProductOverride = AptlyUnitProductOverrideSchema<string>;
147
- export interface AptlyUnitProductOverrideSchema<ID> {
148
- sectionProductRef: ID;
149
- section: ID;
150
- amount?: number;
151
- unitCost?: number;
152
- algorithm?: ID;
153
- variantPrices?: AptlyUnitProductOverrideVariantPriceSchema<ID>[];
154
- hide?: boolean;
155
- }
156
-
157
- export type AptlyUnitProductOverrideVariantPrice = AptlyUnitProductOverrideVariantPriceSchema<string>;
158
- export interface AptlyUnitProductOverrideVariantPriceSchema<ID> {
159
- _id: ID;
160
- variant: ID;
161
- price: number;
162
- }
163
-
164
- export interface IUnitSpec {
165
- categories: {
166
- name: string;
167
- isRoom: boolean;
168
- size: number;
169
- sections: {
170
- name: string;
171
- standard: boolean;
172
- displayType: 'default';
173
- }[];
174
- }[];
175
- }
176
-
177
- export type AptlyUnitConfirmedPeriod = AptlyUnitConfirmedPeriodSchema<string>;
178
- export interface AptlyUnitConfirmedPeriodSchema<ID> {
179
- _id: ID;
180
- period: ID;
181
- order: ID;
182
- }
183
-
184
- export type AptlyUnitIntegration = AptlyUnitIntegrationSchema<string>;
185
- export interface AptlyUnitIntegrationSchema<ID> {
186
- _id: ID;
187
- integration: AptlyIntegration;
188
- unit?: string;
189
- plantId?: string;
190
- tags?: string[];
191
- }
192
-
193
- interface AptlyUnitEditData {
194
- address?: string;
195
- zipCode?: string;
196
- city?: string;
197
- houseNumber?: string;
198
- entrance?: string;
199
- floor?: string;
200
- oldAddress?: string;
201
-
202
- storageNumber?: string;
203
- garageNumber?: string;
204
- garagePortNumber?: string;
205
- garagePowerID?: string;
206
- electricCar?: string;
207
-
208
- unitNumber?: number; // Leilighetsnummer Knr
209
- holdingNumber?: number; // Gårdsnumber Gnr
210
- subHoldingNumber?: number; // Bruksnummer Bnr
211
- leaseNumber?: number; // Festenummer Fnr
212
- sectionNumber?: number; // Seksjonsnummer Snr
213
- boligmappaNumber?: string;
214
-
215
- tapWaterID?: string;
216
- tapWaterID2?: string;
217
- hotWaterID?: string;
218
- hotWaterID2?: string;
219
- remoteHeatID?: string;
220
- gasID?: string;
221
- powerCabinetID?: string;
222
- powerCabinetNumber?: string;
223
-
224
- unitKeys?: number;
225
- postboxKeys?: number;
226
- electricKeys?: number;
227
- balconyKeys?: number;
228
- }
229
-
230
- export interface AptlyUnitInviteSchema<ID, DATE> {
231
- _id: ID;
232
- code: string;
233
- created: DATE;
234
- createdBy?: ID | AptlyUserSchema<ID, DATE>;
235
- newOwner: boolean;
236
- claim: {
237
- email: string;
238
- claimed: boolean;
239
- claimedBy: ID;
240
- claimTime: DATE;
241
- }
242
- }
@@ -1,21 +0,0 @@
1
- import { AptlyBaseSchema } from './extends';
2
-
3
- export type AptlyUpsellTemplate = AptlyUpsellTemplateSchema<string, string>;
4
- export interface AptlyUpsellTemplateSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
5
- image?: string | null;
6
- imageMedia?: string | null;
7
- videoEmbed?: string;
8
- text?: string;
9
- links: ID[];
10
- organization?: ID;
11
- project?: ID;
12
-
13
- /**
14
- * @deprecated use createdAt
15
- */
16
- created: DATE;
17
- /**
18
- * @deprecated not used.. Only for frontend
19
- */
20
- description: string;
21
- }
package/models/user.ts DELETED
@@ -1,19 +0,0 @@
1
- import { AptlyBaseSchema } from './extends';
2
-
3
- export type AptlyUser = AptlyUserSchema<string, string>;
4
- export interface AptlyUserSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'archived' | 'name'> {
5
- email: string;
6
- fullName: string;
7
- firstName?: string;
8
- lastName?: string;
9
- profileImage: string | null;
10
- permissions: number | string | string[];
11
- gdpr: boolean;
12
- phone: string;
13
- synced: DATE;
14
-
15
- /**
16
- * @deprecated use createdAt
17
- */
18
- created: DATE;
19
- }
@@ -1,50 +0,0 @@
1
- import { AptlyWebhookEventStatus, AptlyWebhookType } from '../enums';
2
- import { AptlyBaseSchema } from './extends';
3
-
4
- type ServerKeys = 'run' | 'organization' | 'project' | 'status' | 'url' | 'headers' | 'responses';
5
- export type AptlyWebhookEvent<T = unknown> = Omit<AptlyWebhookEventSchema<string, string, T>, ServerKeys>;
6
- export interface AptlyWebhookEventSchema<ID, DATE, DATA = unknown> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
7
- specversion: string;
8
- type: AptlyWebhookType;
9
- source: string;
10
- subject: string;
11
- time: DATE;
12
- datacontenttype: 'application/json';
13
- data?: DATA;
14
- state?: string;
15
- secret?: string;
16
-
17
- run: DATE;
18
- webhook: ID;
19
- organization: ID;
20
- project?: ID;
21
- unit?: ID;
22
- app?: ID;
23
- status: AptlyWebhookEventStatus;
24
- url: string;
25
- headers: AptlyWebhookEventHeaders;
26
- responses: AptlyWebhookEventResponseSchema<ID, DATE>[];
27
-
28
- /**
29
- * @deprecated use createdAt
30
- */
31
- created: DATE;
32
- }
33
-
34
- export type AptlyWebhookEventResponse<DATA = any> = AptlyWebhookEventResponseSchema<string, string, DATA>;
35
- export interface AptlyWebhookEventResponseSchema<ID, DATE, DATA = any> {
36
- _id: ID;
37
- time: DATE;
38
- data: DATA;
39
- headers: object;
40
- status: number;
41
- statusText: string;
42
- }
43
-
44
- export interface AptlyWebhookEventHeaders {
45
- 'x-aptly-url-sha256'?: string;
46
- 'x-aptly-content-sha256'?: string;
47
- 'x-aptly-organization': string;
48
- 'webhook-request-origin': string;
49
- 'content-type': 'application/json;charset=UTF-8';
50
- }
package/models/webhook.ts DELETED
@@ -1,21 +0,0 @@
1
- import { AptlyWebhookStatus, AptlyWebhookType } from '../enums';
2
- import { AptlyBaseSchema } from './extends';
3
-
4
- export interface AptlyWebhookSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
5
- organization: ID;
6
- user?: ID;
7
- app?: ID;
8
- project?: ID;
9
- status: AptlyWebhookStatus;
10
-
11
- url: string;
12
- types: AptlyWebhookType[];
13
- secret?: string;
14
- state?: string;
15
-
16
- /**
17
- * @deprecated use createdAt
18
- */
19
- created: DATE;
20
- }
21
- export type AptlyWebhook = AptlyWebhookSchema<string, string>;