@aptly-as/types 2.4.6 → 2.5.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.
package/core/scope.d.ts CHANGED
@@ -60,6 +60,7 @@ export declare enum AptlyScopes {
60
60
  ProjectInquiry = "projectInquiry",
61
61
  ProjectInquiryComplaint = "projectInquiryComplaint",
62
62
  ProjectOrders = "projectOrders",
63
+ ProjectPayment = "projectPayment",
63
64
  ProjectPages = "projectPages",
64
65
  ProjectPeriods = "projectPeriods",
65
66
  ProjectProducts = "projectProducts",
@@ -96,12 +97,13 @@ export declare enum AptlyUserRoles {
96
97
  export declare enum AptlyOrganizationRoles {
97
98
  Admin = "admin",
98
99
  Content = "content",
99
- OrganizationContent = "organizationContent",
100
100
  Default = "default",
101
+ Orders = "orders",
102
+ OrganizationContent = "organizationContent",
101
103
  ProjectAdmin = "projectAdmin",
102
- TestingAdmin = "testingAdmin",
103
104
  Reports = "reports",
104
105
  Support = "support",
106
+ TestingAdmin = "testingAdmin",
105
107
  ThirdParty = "thirdParty"
106
108
  }
107
109
  export type AptlyScopeCrud = 'C' | 'R' | 'U' | 'D';
package/core/scope.js CHANGED
@@ -62,6 +62,7 @@ export var AptlyScopes;
62
62
  AptlyScopes["ProjectInquiry"] = "projectInquiry";
63
63
  AptlyScopes["ProjectInquiryComplaint"] = "projectInquiryComplaint";
64
64
  AptlyScopes["ProjectOrders"] = "projectOrders";
65
+ AptlyScopes["ProjectPayment"] = "projectPayment";
65
66
  AptlyScopes["ProjectPages"] = "projectPages";
66
67
  AptlyScopes["ProjectPeriods"] = "projectPeriods";
67
68
  AptlyScopes["ProjectProducts"] = "projectProducts";
@@ -100,12 +101,13 @@ export var AptlyOrganizationRoles;
100
101
  (function (AptlyOrganizationRoles) {
101
102
  AptlyOrganizationRoles["Admin"] = "admin";
102
103
  AptlyOrganizationRoles["Content"] = "content";
103
- AptlyOrganizationRoles["OrganizationContent"] = "organizationContent";
104
104
  AptlyOrganizationRoles["Default"] = "default";
105
+ AptlyOrganizationRoles["Orders"] = "orders";
106
+ AptlyOrganizationRoles["OrganizationContent"] = "organizationContent";
105
107
  AptlyOrganizationRoles["ProjectAdmin"] = "projectAdmin";
106
- AptlyOrganizationRoles["TestingAdmin"] = "testingAdmin";
107
108
  AptlyOrganizationRoles["Reports"] = "reports";
108
109
  AptlyOrganizationRoles["Support"] = "support";
110
+ AptlyOrganizationRoles["TestingAdmin"] = "testingAdmin";
109
111
  AptlyOrganizationRoles["ThirdParty"] = "thirdParty";
110
112
  })(AptlyOrganizationRoles || (AptlyOrganizationRoles = {}));
111
113
  export var AptlyScopeAction;
package/enums/fields.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare enum AptlyFieldType {
10
10
  Email = "email",
11
11
  File = "file",
12
12
  Files = "files",
13
+ GooglePlace = "google-place",
13
14
  Hidden = "hidden",
14
15
  Images = "images",
15
16
  Image = "image",
@@ -24,5 +25,6 @@ export declare enum AptlyFieldType {
24
25
  Sort = "sort",
25
26
  Switch = "switch",
26
27
  Text = "text",
27
- TextArea = "text-area"
28
+ TextArea = "text-area",
29
+ Time = "time"
28
30
  }
package/enums/fields.js CHANGED
@@ -11,6 +11,7 @@ export var AptlyFieldType;
11
11
  AptlyFieldType["Email"] = "email";
12
12
  AptlyFieldType["File"] = "file";
13
13
  AptlyFieldType["Files"] = "files";
14
+ AptlyFieldType["GooglePlace"] = "google-place";
14
15
  AptlyFieldType["Hidden"] = "hidden";
15
16
  AptlyFieldType["Images"] = "images";
16
17
  AptlyFieldType["Image"] = "image";
@@ -26,4 +27,5 @@ export var AptlyFieldType;
26
27
  AptlyFieldType["Switch"] = "switch";
27
28
  AptlyFieldType["Text"] = "text";
28
29
  AptlyFieldType["TextArea"] = "text-area";
30
+ AptlyFieldType["Time"] = "time";
29
31
  })(AptlyFieldType || (AptlyFieldType = {}));
package/enums/index.d.ts CHANGED
@@ -22,7 +22,8 @@ export declare enum AptlyPageSectionType {
22
22
  Text = "text",
23
23
  Card = "card",
24
24
  Links = "links",
25
- Spacer = "spacer"
25
+ Spacer = "spacer",
26
+ Iframe = "iframe"
26
27
  }
27
28
  export declare enum AptlyCloudinaryResourceType {
28
29
  Video = "video",
package/enums/index.js CHANGED
@@ -25,6 +25,7 @@ export var AptlyPageSectionType;
25
25
  AptlyPageSectionType["Card"] = "card";
26
26
  AptlyPageSectionType["Links"] = "links";
27
27
  AptlyPageSectionType["Spacer"] = "spacer";
28
+ AptlyPageSectionType["Iframe"] = "iframe";
28
29
  })(AptlyPageSectionType || (AptlyPageSectionType = {}));
29
30
  export var AptlyCloudinaryResourceType;
30
31
  (function (AptlyCloudinaryResourceType) {
package/models/app.d.ts CHANGED
@@ -51,6 +51,16 @@ export interface AptlyAppWebhookSchema<ID> {
51
51
  types: AptlyWebhookType[];
52
52
  url: string;
53
53
  }
54
+ export declare enum AptlyUserInjection {
55
+ Base = "",
56
+ Admin = "admin"
57
+ }
58
+ export declare enum AptlyAdminInjection {
59
+ Base = "",
60
+ Content = "content",
61
+ Modules = "modules",
62
+ Admin = "admin"
63
+ }
54
64
  export declare enum AptlyOrganizationInjection {
55
65
  Base = "",
56
66
  Project = "project",
package/models/app.js CHANGED
@@ -8,6 +8,18 @@ export var AptlyAppImplementationSetting;
8
8
  AptlyAppImplementationSetting["SignCostPer"] = "costPerSign";
9
9
  AptlyAppImplementationSetting["SignMethod"] = "signMethod";
10
10
  })(AptlyAppImplementationSetting || (AptlyAppImplementationSetting = {}));
11
+ export var AptlyUserInjection;
12
+ (function (AptlyUserInjection) {
13
+ AptlyUserInjection["Base"] = "";
14
+ AptlyUserInjection["Admin"] = "admin";
15
+ })(AptlyUserInjection || (AptlyUserInjection = {}));
16
+ export var AptlyAdminInjection;
17
+ (function (AptlyAdminInjection) {
18
+ AptlyAdminInjection["Base"] = "";
19
+ AptlyAdminInjection["Content"] = "content";
20
+ AptlyAdminInjection["Modules"] = "modules";
21
+ AptlyAdminInjection["Admin"] = "admin";
22
+ })(AptlyAdminInjection || (AptlyAdminInjection = {}));
11
23
  export var AptlyOrganizationInjection;
12
24
  (function (AptlyOrganizationInjection) {
13
25
  AptlyOrganizationInjection["Base"] = "";
@@ -22,8 +22,9 @@ export interface IAvailabilityCalendarSchema<ID, DATE> {
22
22
  };
23
23
  attendees: AptlyUserSchema<ID, DATE>[];
24
24
  userAvailability?: (ID | AptlyUserSchema<ID, DATE>)[];
25
- endAvailabilityAt?: Date;
25
+ endAvailabilityAt?: DATE | null;
26
26
  availableTimes: IAvailabilityCalendarAvailableTimeSchema<ID, DATE>[];
27
+ availability?: ID;
27
28
  }
28
29
  export interface IAvailabilityCalendarAvailableTimeSchema<ID, DATE> {
29
30
  user?: ID;
@@ -40,17 +40,17 @@ export interface AptlyAvailabilityCalendarSchema<ID, DATE> {
40
40
  };
41
41
  };
42
42
  attendees: (ID | AptlyUserSchema<ID, DATE>)[];
43
- availableTimes: AptlyAvailabilityCalendarAvailableTimesSchema<ID, DATE>[];
44
- endAvailabilityAt?: DATE;
43
+ availableTimes: AptlyAvailabilityCalendarAvailableTimeSchema<ID, DATE>[];
44
+ endAvailabilityAt?: DATE | null;
45
45
  userAvailability?: ID[];
46
46
  }
47
- export type AptlyAvailabilityCalendarAvailableTimes = AptlyAvailabilityCalendarAvailableTimesSchema<string, string>;
48
- export interface AptlyAvailabilityCalendarAvailableTimesSchema<ID, DATE> {
47
+ export type AptlyAvailabilityCalendarAvailableTime = AptlyAvailabilityCalendarAvailableTimeSchema<string, string>;
48
+ export interface AptlyAvailabilityCalendarAvailableTimeSchema<ID, DATE> {
49
49
  _id: ID;
50
50
  from: DATE;
51
51
  to: DATE;
52
52
  booked: boolean;
53
53
  booking: ID;
54
- user?: ID;
54
+ user?: ID | AptlyUserSchema<ID, DATE>;
55
55
  calendar?: ID;
56
56
  }
@@ -1,6 +1,7 @@
1
1
  import { AptlyInquiryParticipantRole, AptlyInquiryStatus, AptlyInquiryType } from '../enums/index.js';
2
2
  import { AptlySchemaFile } from '../core/index.js';
3
3
  import { AptlyBaseSchema } from './extends.js';
4
+ import { AptlyProductSchema } from './product.js';
4
5
  import { AptlyUnitSchema } from './unit.js';
5
6
  import { AptlyOrganizationSchema } from './organization.js';
6
7
  import { AptlyProjectSchema } from './project.js';
@@ -12,7 +13,8 @@ export interface AptlyInquirySchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, D
12
13
  project: ID | AptlyProjectSchema<ID, DATE>;
13
14
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
14
15
  unit: ID | AptlyUnitSchema<ID, DATE>;
15
- product?: ID;
16
+ product?: ID | AptlyProductSchema<ID, DATE>;
17
+ variant?: ID;
16
18
  producer?: ID;
17
19
  category?: ID;
18
20
  section?: ID;
@@ -22,6 +24,7 @@ export interface AptlyInquirySchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, D
22
24
  lastMessageId?: string;
23
25
  lastMessageEmail?: string;
24
26
  status: AptlyInquiryStatus;
27
+ caseNumber?: string;
25
28
  participants: AptlyInquiryParticipantSchema<ID, DATE>[];
26
29
  messages: AptlyInquiryMessageSchema<ID, DATE>[];
27
30
  references?: string;
@@ -43,7 +46,7 @@ export interface AptlyInquiryMessageSchema<ID, DATE> {
43
46
  bodyHtml?: string;
44
47
  images?: string[];
45
48
  files: AptlySchemaFile<ID>[];
46
- author?: ID;
49
+ author?: ID | AptlyUserSchema<ID, DATE>;
47
50
  email?: string;
48
51
  sentTime: DATE;
49
52
  read: {
package/models/page.d.ts CHANGED
@@ -8,13 +8,13 @@ export interface AptlyPageSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
8
8
  summary: string;
9
9
  icon?: string;
10
10
  upsellTemplate?: ID | null;
11
- sections: AptlyPageSectionSchema<ID, DATE>[];
11
+ sections: AptlyPageSectionSchema<ID, any>[];
12
12
  legacy?: string;
13
13
  image?: string;
14
14
  showInMenu: boolean;
15
15
  }
16
- export type AptlyPageSection = AptlyPageSectionSchema<string, string>;
17
- export interface AptlyPageSectionSchema<ID, VALUE = any> {
16
+ export type AptlyPageSection<VALUE = any> = AptlyPageSectionSchema<string, VALUE>;
17
+ export interface AptlyPageSectionSchema<ID, VALUE> {
18
18
  _id: ID;
19
19
  name: string;
20
20
  type: AptlyPageSectionType;
@@ -1,6 +1,8 @@
1
+ import { AptlyDocumentSchema } from './document.js';
1
2
  import { AptlyBaseSchema, AptlyDBCrawlerCleaner, AptlyHistorySchema } from './extends.js';
2
3
  import { AptlyMediaSrcSchema } from './media.js';
3
4
  import { AptlyProducerSchema } from './producer.js';
5
+ import { AptlyTagSchema } from './tag.js';
4
6
  export type AptlyProduct = AptlyProductSchema<string, string>;
5
7
  export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
6
8
  searchableName: string;
@@ -31,8 +33,8 @@ export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, Apt
31
33
  netCost?: number;
32
34
  producer?: ID | AptlyProducerSchema<ID, DATE> | null;
33
35
  supplier?: ID;
34
- tags: ID[];
35
- documents: ID[];
36
+ tags: (ID | AptlyTagSchema<ID, DATE>)[];
37
+ documents: (ID | AptlyDocumentSchema<ID, DATE>)[];
36
38
  createdBy: ID;
37
39
  stats?: any;
38
40
  importID?: ID;
@@ -55,7 +57,7 @@ export interface AptlyProductVariantSchema<ID, DATE> {
55
57
  _id: ID;
56
58
  title?: string;
57
59
  images: AptlyProductImageSchema<ID, DATE>[];
58
- documents: ID[];
60
+ documents: (ID | AptlyDocumentSchema<ID, DATE>)[];
59
61
  name?: string;
60
62
  description?: string;
61
63
  productNumber?: string;
@@ -67,6 +69,7 @@ export interface AptlyProductVariantSchema<ID, DATE> {
67
69
  width?: string;
68
70
  height?: string;
69
71
  length?: string;
72
+ unitCost?: number;
70
73
  }
71
74
  export type AptlyProductImport = AptlyProductImportSchema<string, string>;
72
75
  export interface AptlyProductImportSchema<ID, DATE> extends Partial<Omit<AptlyProductSchema<ID, DATE>, 'images' | 'documents'>> {
@@ -33,6 +33,7 @@ export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>,
33
33
  field?: string;
34
34
  address?: AptlyAddress;
35
35
  paymentApp?: ID | AptlyAppSchema<ID, DATE> | null;
36
+ invites?: AptlyProjectInviteSchema<ID, DATE>[];
36
37
  created: DATE;
37
38
  }
38
39
  export type AptlyProjectPeriod = AptlyPeriod;
@@ -89,12 +90,18 @@ export interface AptlyProjectThemePalette {
89
90
  }
90
91
  export type AptlyProjectIntegration = AptlyProjectIntegrationSchema<string>;
91
92
  export interface AptlyProjectIntegrationSchema<ID> {
93
+ _id: ID;
92
94
  integration: ID;
93
95
  integrationName: string;
94
96
  project: string;
97
+ failures: {
98
+ _id: string;
99
+ error: string;
100
+ name: string;
101
+ }[];
95
102
  }
96
103
  export type AptlyProjectNotify = AptlyProjectNotifySchema<string, string>;
97
- interface AptlyProjectNotifySchema<ID, DATE> {
104
+ export interface AptlyProjectNotifySchema<ID, DATE> {
98
105
  _id: ID;
99
106
  user: AptlyUserSchema<ID, DATE> | ID;
100
107
  types?: AptlyEmailType[];
@@ -107,4 +114,11 @@ interface AptlyProjectNotifySchema<ID, DATE> {
107
114
  'order-fileReceived'?: boolean;
108
115
  'unit-note-reminder'?: boolean;
109
116
  }
110
- export {};
117
+ export type AptlyProjectInvite = AptlyProjectInviteSchema<string, string>;
118
+ export interface AptlyProjectInviteSchema<ID, DATE> {
119
+ _id: ID;
120
+ unit: ID;
121
+ code: string;
122
+ createdAt: DATE;
123
+ createdBy: ID;
124
+ }
@@ -103,6 +103,7 @@ export interface AptlyUnitTemplateCategorySectionProductSchema<ID, DATE> {
103
103
  labels?: ID[];
104
104
  params: AptlyUnitTemplateCategorySectionProductParamSchema<ID>[];
105
105
  measureUnitType: AptlyUnitTemplateCategorySectionProductMeasureUnitType;
106
+ pick?: any;
106
107
  }
107
108
  export type AptlyUnitTemplateCategorySectionProductParam<VALUE> = AptlyUnitTemplateCategorySectionProductParamSchema<string, VALUE>;
108
109
  export interface AptlyUnitTemplateCategorySectionProductParamSchema<ID, VALUE = any> {
package/models/unit.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AptlyDocumentSchema } from './document.js';
1
2
  import { AptlyOrderSchema } from './order.js';
2
3
  import { AptlyProducerSchema } from './producer.js';
3
4
  import { AptlyProductSchema } from './product.js';
@@ -25,7 +26,7 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
25
26
  categoriesRead: ID[];
26
27
  spec: AptlyUnitSpec;
27
28
  buildStep: number;
28
- documents: ID[];
29
+ documents: (AptlyDocumentSchema<ID, DATE> | ID)[];
29
30
  unitPlans: {
30
31
  image: string;
31
32
  description?: string;
@@ -178,6 +179,7 @@ export type AptlyUnitConfirmedPeriod = AptlyUnitConfirmedPeriodSchema<string, st
178
179
  export interface AptlyUnitConfirmedPeriodSchema<ID, DATE> {
179
180
  _id: ID;
180
181
  period: ID;
182
+ confirmed?: DATE;
181
183
  order?: ID | AptlyOrderSchema<ID, DATE>;
182
184
  }
183
185
  export type AptlyUnitIntegration = AptlyUnitIntegrationSchema<string>;
@@ -214,7 +216,7 @@ interface AptlyUnitEditData<DATE> {
214
216
  remoteHeatID?: string;
215
217
  gasID?: string;
216
218
  powerCabinetID?: string;
217
- powerCabinetNumber?: string;
219
+ powerCabinetMeasureID?: string;
218
220
  unitKeys?: number;
219
221
  postboxKeys?: number;
220
222
  electricKeys?: number;
@@ -233,8 +235,8 @@ export interface AptlyUnitInviteSchema<ID, DATE> {
233
235
  email: string;
234
236
  fullName?: string;
235
237
  claimed: boolean;
236
- claimedBy: ID;
237
- claimTime: DATE;
238
+ claimedBy?: ID;
239
+ claimTime?: DATE;
238
240
  };
239
241
  }
240
242
  export {};
package/package.json CHANGED
@@ -1,43 +1,42 @@
1
- {
2
- "name": "@aptly-as/types",
3
- "version": "2.4.6",
4
- "description": "Aptly types and enums",
5
- "type": "module",
6
- "main": "./index.js",
7
- "types": "./index.d.ts",
8
- "module": "./index.js",
9
- "author": "Emil A. Olsen <emil@aptly.as>",
10
- "scripts": {
11
- "dev": "yarn start",
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
- "@aws-sdk/client-s3": "^3.295.0",
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
- }
1
+ {
2
+ "name": "@aptly-as/types",
3
+ "version": "2.5.0",
4
+ "description": "Aptly types and enums",
5
+ "type": "module",
6
+ "main": "./index.js",
7
+ "types": "./index.d.ts",
8
+ "module": "./index.js",
9
+ "author": "Emil A. Olsen <emil@aptly.as>",
10
+ "devDependencies": {
11
+ "@aws-sdk/client-s3": "^3.568.0",
12
+ "cloudinary": "^1.32.0",
13
+ "husky": "^9.0.11",
14
+ "lint-staged": "^15.2.2",
15
+ "prettier": "^3.2.5",
16
+ "typescript": "^5.4.5"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/aptly-as/types.git"
21
+ },
22
+ "keywords": [
23
+ "typescript",
24
+ "aptly",
25
+ "types"
26
+ ],
27
+ "bugs": {
28
+ "url": "https://github.com/aptly-as/types/issues"
29
+ },
30
+ "homepage": "https://github.com/aptly-as/types#readme",
31
+ "lint-staged": {
32
+ "**/*": "prettier --write --ignore-unknown"
33
+ },
34
+ "scripts": {
35
+ "dev": "pnpm start",
36
+ "start": "pnpm build:watch",
37
+ "build": "tsc",
38
+ "build:watch": "tsc --watch --incremental",
39
+ "postversion": "git push && git push --tags",
40
+ "prepublish": "npm run build"
41
+ }
42
+ }