@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.
- package/README.md +1 -1
- package/core/api.js +0 -1
- package/core/app.js +0 -1
- package/core/cloudinary.d.ts +2 -10
- package/core/cloudinary.js +0 -1
- package/core/error.js +0 -1
- package/core/fields.js +0 -1
- package/core/index.js +5 -2
- package/core/permission.d.ts +7 -7
- package/core/permission.js +0 -1
- package/core/scope.d.ts +2 -2
- package/core/scope.js +0 -1
- package/core/signage.d.ts +2 -2
- package/core/signage.js +0 -1
- package/core/webhook-event-data.js +0 -1
- package/enums/document.js +0 -1
- package/enums/fields.js +0 -1
- package/enums/index.js +5 -2
- package/enums/unit-template.js +0 -1
- package/enums/webhook.js +0 -1
- package/index.js +5 -2
- package/models/algorithm.d.ts +2 -2
- package/models/algorithm.js +0 -1
- package/models/app.d.ts +4 -4
- package/models/app.js +0 -1
- package/models/availability.d.ts +34 -0
- package/models/availability.js +2 -0
- package/models/booking.d.ts +12 -9
- package/models/booking.js +0 -1
- package/models/client.d.ts +1 -1
- package/models/client.js +0 -1
- package/models/department.d.ts +3 -3
- package/models/department.js +0 -1
- package/models/document.d.ts +11 -7
- package/models/document.js +0 -1
- package/models/extends.d.ts +2 -2
- package/models/extends.js +0 -1
- package/models/index.js +5 -2
- package/models/inquiry.d.ts +3 -3
- package/models/inquiry.js +0 -1
- package/models/media.d.ts +3 -3
- package/models/media.js +0 -1
- package/models/notification-trigger.d.ts +1 -1
- package/models/notification-trigger.js +0 -1
- package/models/option-label.d.ts +3 -3
- package/models/option-label.js +0 -1
- package/models/order.d.ts +14 -11
- package/models/order.js +0 -1
- package/models/organization.d.ts +7 -7
- package/models/organization.js +0 -1
- package/models/page.d.ts +2 -2
- package/models/page.js +0 -1
- package/models/producer.d.ts +4 -3
- package/models/producer.js +0 -1
- package/models/product-stats.d.ts +1 -1
- package/models/product-stats.js +0 -1
- package/models/product.d.ts +7 -7
- package/models/product.js +0 -1
- package/models/project.d.ts +8 -8
- package/models/project.js +0 -1
- package/models/queue-download.d.ts +1 -1
- package/models/queue-download.js +0 -1
- package/models/recommendation.d.ts +1 -1
- package/models/recommendation.js +0 -1
- package/models/supplier.d.ts +1 -1
- package/models/supplier.js +0 -1
- package/models/tag.d.ts +1 -1
- package/models/tag.js +0 -1
- package/models/unit-email.d.ts +1 -1
- package/models/unit-email.js +0 -1
- package/models/unit-template.d.ts +16 -13
- package/models/unit-template.js +0 -1
- package/models/unit.d.ts +53 -34
- package/models/unit.js +0 -1
- package/models/upsell-template.d.ts +3 -3
- package/models/upsell-template.js +0 -1
- package/models/user.d.ts +1 -1
- package/models/user.js +0 -1
- package/models/webhook-event.d.ts +3 -3
- package/models/webhook-event.js +0 -1
- package/models/webhook.d.ts +1 -1
- package/models/webhook.js +0 -1
- 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
|
|
8
|
-
export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<ID, DATE>, AptlyUnitEditData
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
72
|
-
export interface
|
|
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
|
|
88
|
-
export interface AptlyUnitOptionItemSchema<ID, DATE> extends
|
|
92
|
+
export type AptlyUnitOptionItem = AptlyUnitOptionItemSchema<string, string>;
|
|
93
|
+
export interface AptlyUnitOptionItemSchema<ID, DATE> extends AptlyUnitSelectedOptionSchema<ID, DATE> {
|
|
89
94
|
unitCost: number;
|
|
90
|
-
|
|
95
|
+
pickRef?: ID;
|
|
91
96
|
}
|
|
92
|
-
export
|
|
93
|
-
export interface AptlyUnitOptionExtraItemSchema<ID, DATE> extends
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import { AptlyBaseSchema } from './extends';
|
|
2
|
-
export
|
|
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;
|
package/models/user.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AptlyBaseSchema } from './extends';
|
|
2
|
-
export
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import { AptlyWebhookEventStatus, AptlyWebhookType } from '../enums';
|
|
2
2
|
import { AptlyBaseSchema } from './extends';
|
|
3
|
-
|
|
4
|
-
export
|
|
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
|
|
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;
|
package/models/webhook-event.js
CHANGED
package/models/webhook.d.ts
CHANGED
package/models/webhook.js
CHANGED
package/package.json
CHANGED
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@aptly-as/types",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Aptly types and enums",
|
|
5
|
-
"main": "./index.js",
|
|
6
|
-
"types": "./index.d.ts",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"build
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
+
}
|