@aptly-as/types 3.12.4 → 3.13.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
@@ -50,6 +50,7 @@ export declare enum AptlyScopes {
50
50
  OrganizationBooking = "organizationBooking",
51
51
  OrganizationCategories = "organizationCategories",
52
52
  OrganizationClients = "organizationClients",
53
+ OrganizationCompanies = "organizationCompanies",
53
54
  OrganizationCustomers = "organizationCustomers",
54
55
  OrganizationDepartments = "organizationDepartments",
55
56
  OrganizationDocuments = "organizationDocuments",
@@ -122,6 +123,7 @@ export declare enum AptlyOrganizationRoles {
122
123
  Admin = "admin",
123
124
  Content = "content",
124
125
  Default = "default",
126
+ Offers = "offers",
125
127
  Orders = "orders",
126
128
  OrganizationContent = "organizationContent",
127
129
  ProjectAdmin = "projectAdmin",
package/core/scope.js CHANGED
@@ -52,6 +52,7 @@ export var AptlyScopes;
52
52
  AptlyScopes["OrganizationBooking"] = "organizationBooking";
53
53
  AptlyScopes["OrganizationCategories"] = "organizationCategories";
54
54
  AptlyScopes["OrganizationClients"] = "organizationClients";
55
+ AptlyScopes["OrganizationCompanies"] = "organizationCompanies";
55
56
  AptlyScopes["OrganizationCustomers"] = "organizationCustomers";
56
57
  AptlyScopes["OrganizationDepartments"] = "organizationDepartments";
57
58
  AptlyScopes["OrganizationDocuments"] = "organizationDocuments";
@@ -126,6 +127,7 @@ export var AptlyOrganizationRoles;
126
127
  AptlyOrganizationRoles["Admin"] = "admin";
127
128
  AptlyOrganizationRoles["Content"] = "content";
128
129
  AptlyOrganizationRoles["Default"] = "default";
130
+ AptlyOrganizationRoles["Offers"] = "offers";
129
131
  AptlyOrganizationRoles["Orders"] = "orders";
130
132
  AptlyOrganizationRoles["OrganizationContent"] = "organizationContent";
131
133
  AptlyOrganizationRoles["ProjectAdmin"] = "projectAdmin";
@@ -13,8 +13,8 @@ export declare namespace AptlyWebhookEventData {
13
13
  export type Payment = PaymentSchema<string, string>;
14
14
  export interface PaymentSchema<ID, DATE> {
15
15
  organization: Organization<ID, DATE>;
16
- project: Project<ID, DATE>;
17
- unit: Unit<ID, DATE>;
16
+ project: Project<ID, DATE> | null;
17
+ unit: Unit<ID, DATE> | null;
18
18
  payment: AptlyPaymentSchema<ID, DATE>;
19
19
  order: Pick<AptlyOrderSchema<ID, DATE>, '_id' | 'orderNumber'>;
20
20
  offer?: Pick<AptlyOfferSchema<ID, DATE>, '_id' | 'name' | 'number' | 'description'>;
@@ -30,8 +30,8 @@ export declare namespace AptlyWebhookEventData {
30
30
  export type Order = OrderSchema<string, string>;
31
31
  export interface OrderSchema<ID, DATE> {
32
32
  organization: Organization<ID, DATE>;
33
- project: Project<ID, DATE>;
34
- unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name' | 'shipping' | 'users'>;
33
+ project: Project<ID, DATE> | null;
34
+ unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name' | 'shipping' | 'users'> | null;
35
35
  order: AptlyOrderSchema<ID, DATE>;
36
36
  offer?: Pick<AptlyOfferSchema<ID, DATE>, '_id' | 'name' | 'number' | 'description'>;
37
37
  receiptUrl?: string;
package/enums/index.d.ts CHANGED
@@ -41,6 +41,10 @@ export declare enum AptlyUnitStatus {
41
41
  Payed = "payed",
42
42
  Completed = "completed"
43
43
  }
44
+ export declare enum AptlyIntegration {
45
+ CheckD = "checkd",
46
+ Boligmappa = "boligmappa"
47
+ }
44
48
  export declare enum AptlyIntegrationLevel {
45
49
  Base = "base",
46
50
  Organization = "organization",
@@ -153,6 +157,7 @@ export declare enum AptlyEmailType {
153
157
  OrderPayed = "order-payed",
154
158
  OrderReceipt = "order-receipt",
155
159
  OrderCompleted = "order-completed",
160
+ PaymentReceipt = "payment-receipt",
156
161
  PeriodOpen = "period-open",
157
162
  PeriodClose = "period-close"
158
163
  }
package/enums/index.js CHANGED
@@ -45,6 +45,11 @@ export var AptlyUnitStatus;
45
45
  AptlyUnitStatus["Payed"] = "payed";
46
46
  AptlyUnitStatus["Completed"] = "completed";
47
47
  })(AptlyUnitStatus || (AptlyUnitStatus = {}));
48
+ export var AptlyIntegration;
49
+ (function (AptlyIntegration) {
50
+ AptlyIntegration["CheckD"] = "checkd";
51
+ AptlyIntegration["Boligmappa"] = "boligmappa";
52
+ })(AptlyIntegration || (AptlyIntegration = {}));
48
53
  export var AptlyIntegrationLevel;
49
54
  (function (AptlyIntegrationLevel) {
50
55
  AptlyIntegrationLevel["Base"] = "base";
@@ -171,6 +176,7 @@ export var AptlyEmailType;
171
176
  AptlyEmailType["OrderPayed"] = "order-payed";
172
177
  AptlyEmailType["OrderReceipt"] = "order-receipt";
173
178
  AptlyEmailType["OrderCompleted"] = "order-completed";
179
+ AptlyEmailType["PaymentReceipt"] = "payment-receipt";
174
180
  AptlyEmailType["PeriodOpen"] = "period-open";
175
181
  AptlyEmailType["PeriodClose"] = "period-close";
176
182
  })(AptlyEmailType || (AptlyEmailType = {}));
@@ -1,20 +1,31 @@
1
1
  export declare enum AptlyWebhookType {
2
+ OrganizationAppUpdated = "aptly.organization.app.updated",
3
+ OrganizationAppDeleted = "aptly.organization.app.deleted",
2
4
  ProjectCreated = "aptly.project.created",
3
5
  ProjectUpdated = "aptly.project.updated",
4
6
  UnitCreated = "aptly.unit.created",
5
7
  UnitUpdated = "aptly.unit.updated",
8
+ OrderCreated = "aptly.order.created",
9
+ OrderSigned = "aptly.order.signed",
10
+ OrderCompleted = "aptly.order.completed",
11
+ OrderReceipt = "aptly.order.receipt",
12
+ OrderReport = "aptly.order.report",
13
+ PaymentCreated = "aptly.payment.created",
14
+ PaymentCaptured = "aptly.payment.captured",
15
+ PaymentReceipt = "aptly.payment.receipt",
16
+ PaymentReport = "aptly.payment.report",
6
17
  UnitMessageNew = "aptly.unit.message.new",
7
18
  UnitMessageReply = "aptly.unit.message.reply",
19
+ UnitReportFinal = "aptly.unit.report.final",
8
20
  UnitOrderCreated = "aptly.unit.order.created",
9
21
  UnitOrderSigned = "aptly.unit.order.signed",
10
22
  UnitOrderCompleted = "aptly.unit.order.completed",
23
+ UnitOrderReceipt = "aptly.unit.order.receipt",
24
+ UnitOrderReport = "aptly.unit.order.report",
11
25
  UnitPaymentCreated = "aptly.unit.payment.created",
12
26
  UnitPaymentCaptured = "aptly.unit.payment.captured",
13
27
  UnitPaymentReceipt = "aptly.unit.payment.receipt",
14
- UnitPaymentReport = "aptly.unit.payment.report",
15
- UnitReportFinal = "aptly.unit.report.final",
16
- OrganizationAppUpdated = "aptly.organization.app.updated",
17
- OrganizationAppDeleted = "aptly.organization.app.deleted"
28
+ UnitPaymentReport = "aptly.unit.payment.report"
18
29
  }
19
30
  export declare enum AptlyWebhookStatus {
20
31
  Active = "active",
package/enums/webhook.js CHANGED
@@ -1,21 +1,32 @@
1
1
  export var AptlyWebhookType;
2
2
  (function (AptlyWebhookType) {
3
+ AptlyWebhookType["OrganizationAppUpdated"] = "aptly.organization.app.updated";
4
+ AptlyWebhookType["OrganizationAppDeleted"] = "aptly.organization.app.deleted";
3
5
  AptlyWebhookType["ProjectCreated"] = "aptly.project.created";
4
6
  AptlyWebhookType["ProjectUpdated"] = "aptly.project.updated";
5
7
  AptlyWebhookType["UnitCreated"] = "aptly.unit.created";
6
8
  AptlyWebhookType["UnitUpdated"] = "aptly.unit.updated";
9
+ AptlyWebhookType["OrderCreated"] = "aptly.order.created";
10
+ AptlyWebhookType["OrderSigned"] = "aptly.order.signed";
11
+ AptlyWebhookType["OrderCompleted"] = "aptly.order.completed";
12
+ AptlyWebhookType["OrderReceipt"] = "aptly.order.receipt";
13
+ AptlyWebhookType["OrderReport"] = "aptly.order.report";
14
+ AptlyWebhookType["PaymentCreated"] = "aptly.payment.created";
15
+ AptlyWebhookType["PaymentCaptured"] = "aptly.payment.captured";
16
+ AptlyWebhookType["PaymentReceipt"] = "aptly.payment.receipt";
17
+ AptlyWebhookType["PaymentReport"] = "aptly.payment.report";
7
18
  AptlyWebhookType["UnitMessageNew"] = "aptly.unit.message.new";
8
19
  AptlyWebhookType["UnitMessageReply"] = "aptly.unit.message.reply";
20
+ AptlyWebhookType["UnitReportFinal"] = "aptly.unit.report.final";
9
21
  AptlyWebhookType["UnitOrderCreated"] = "aptly.unit.order.created";
10
22
  AptlyWebhookType["UnitOrderSigned"] = "aptly.unit.order.signed";
11
23
  AptlyWebhookType["UnitOrderCompleted"] = "aptly.unit.order.completed";
24
+ AptlyWebhookType["UnitOrderReceipt"] = "aptly.unit.order.receipt";
25
+ AptlyWebhookType["UnitOrderReport"] = "aptly.unit.order.report";
12
26
  AptlyWebhookType["UnitPaymentCreated"] = "aptly.unit.payment.created";
13
27
  AptlyWebhookType["UnitPaymentCaptured"] = "aptly.unit.payment.captured";
14
28
  AptlyWebhookType["UnitPaymentReceipt"] = "aptly.unit.payment.receipt";
15
29
  AptlyWebhookType["UnitPaymentReport"] = "aptly.unit.payment.report";
16
- AptlyWebhookType["UnitReportFinal"] = "aptly.unit.report.final";
17
- AptlyWebhookType["OrganizationAppUpdated"] = "aptly.organization.app.updated";
18
- AptlyWebhookType["OrganizationAppDeleted"] = "aptly.organization.app.deleted";
19
30
  })(AptlyWebhookType || (AptlyWebhookType = {}));
20
31
  export var AptlyWebhookStatus;
21
32
  (function (AptlyWebhookStatus) {
@@ -7,8 +7,19 @@ export interface AptlyAddress {
7
7
  city?: string;
8
8
  county?: string;
9
9
  country?: string;
10
+ number?: number;
11
+ letter?: string;
12
+ unitNumber?: string;
13
+ cadastre?: AptlyAddressCadastre | null;
10
14
  location?: AptlyAddressLocation | null;
11
15
  }
16
+ export interface AptlyAddressCadastre {
17
+ knr?: string;
18
+ gnr?: number;
19
+ bnr?: number;
20
+ fnr?: number;
21
+ snr?: number;
22
+ }
12
23
  export interface AptlyAddressLocation {
13
24
  type: 'Point';
14
25
  coordinates: [lng: number, lat: number];
@@ -19,7 +30,7 @@ export interface AptlyAddressSearchQuery {
19
30
  lng?: number;
20
31
  }
21
32
  export type AptlySearchAddress = AptlySearchAddressSchema<string, string>;
22
- export interface AptlySearchAddressSchema<ID, DATE> extends Pick<AptlyUnitSchema<ID, DATE>, 'shipping' | 'houseNumber' | 'entrance' | 'countyNumber' | 'holdingNumber' | 'subHoldingNumber' | 'leaseNumber' | 'sectionNumber' | 'unitNumber'> {
33
+ export interface AptlySearchAddressSchema<ID, DATE> extends Pick<AptlyUnitSchema<ID, DATE>, 'shipping' | 'houseNumber' | 'entrance' | 'unitNumber' | 'countyNumber' | 'holdingNumber' | 'subHoldingNumber' | 'leaseNumber' | 'sectionNumber'> {
23
34
  _id: string;
24
35
  name: string;
25
36
  unitNumbers?: string[];
package/models/app.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AptlyBaseSchema } from './extends.js';
2
- import { AptlyWebhookType } from '../enums/index.js';
3
- import { AptlyAppSandbox, AptlyField, AptlyScopes } from '../core/index.js';
2
+ import { AptlySlugLevel, AptlyWebhookType } from '../enums/index.js';
3
+ import { AptlyAppSandbox, AptlyAppScope, AptlyField, AptlyScopes } from '../core/index.js';
4
4
  import { AptlyMediaSrcSchema } from './media.js';
5
5
  export type AptlyApp = AptlyAppSchema<string, string>;
6
6
  export interface AptlyAppSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
@@ -17,6 +17,7 @@ export interface AptlyAppSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
17
17
  menus: AptlyAppMenuSchema<ID, DATE>[];
18
18
  actions: AptlyAppActionSchema<ID>[];
19
19
  cost?: number;
20
+ scopes: AptlyAppScope[];
20
21
  implements: AptlyAppImplementation[];
21
22
  sign?: {
22
23
  orderUrl: string;
@@ -82,6 +83,7 @@ export declare enum AptlyProjectInjection {
82
83
  AdminOptions = "admin-options",
83
84
  AdminReports = "admin-reports",
84
85
  AdminSettings = "admin-settings",
86
+ AdminIntegrations = "admin-integrations",
85
87
  AdminBeta = "admin-beta"
86
88
  }
87
89
  export declare enum AptlyUnitInjection {
@@ -100,6 +102,8 @@ export type AptlyAppMenu = AptlyAppMenuSchema<string, string>;
100
102
  export interface AptlyAppMenuSchema<ID, DATE> {
101
103
  _id: ID;
102
104
  type: AptlyAppInjectionType;
105
+ level: AptlySlugLevel;
106
+ scope: AptlyScopes;
103
107
  menu: AptlyAppInjectionMenu[];
104
108
  model: AptlyScopes;
105
109
  label: string;
package/models/app.js CHANGED
@@ -41,6 +41,7 @@ export var AptlyProjectInjection;
41
41
  AptlyProjectInjection["AdminOptions"] = "admin-options";
42
42
  AptlyProjectInjection["AdminReports"] = "admin-reports";
43
43
  AptlyProjectInjection["AdminSettings"] = "admin-settings";
44
+ AptlyProjectInjection["AdminIntegrations"] = "admin-integrations";
44
45
  AptlyProjectInjection["AdminBeta"] = "admin-beta";
45
46
  })(AptlyProjectInjection || (AptlyProjectInjection = {}));
46
47
  export var AptlyUnitInjection;
@@ -0,0 +1,11 @@
1
+ import { AptlyAddress } from './address.js';
2
+ import { AptlyCustomerSchema } from './customer.js';
3
+ import { AptlyBaseSchema } from './extends.js';
4
+ export type AptlyCompany = AptlyCompanySchema<string, string>;
5
+ export interface AptlyCompanySchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
6
+ organization: ID;
7
+ vat: string;
8
+ shipping: AptlyAddress | null;
9
+ billing: AptlyAddress | null;
10
+ customers: (ID | AptlyCustomerSchema<ID, DATE>)[];
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare enum AptlyCounterModel {
2
+ Offer = "offers",
3
+ Payment = "payments"
4
+ }
5
+ export interface AptlyCounterSchema<ID, DATE> {
6
+ _id: ID;
7
+ organization: ID;
8
+ model: AptlyCounterModel;
9
+ sequence: number;
10
+ updatedAt: DATE;
11
+ createdAt: DATE;
12
+ }
@@ -0,0 +1,5 @@
1
+ export var AptlyCounterModel;
2
+ (function (AptlyCounterModel) {
3
+ AptlyCounterModel["Offer"] = "offers";
4
+ AptlyCounterModel["Payment"] = "payments";
5
+ })(AptlyCounterModel || (AptlyCounterModel = {}));
@@ -14,11 +14,12 @@ export interface AptlyCustomerSchema<ID, DATE> extends Pick<AptlyBaseSchema<ID,
14
14
  }
15
15
  export type AptlyCustomerData = AptlyCustomerDataSchema<string, string>;
16
16
  export interface AptlyCustomerDataSchema<ID, DATE> {
17
+ customer?: ID | null;
17
18
  user?: ID | AptlyUserSchema<ID, DATE> | null;
18
19
  email: string;
19
- fullName: string;
20
20
  firstName: string;
21
21
  lastName: string;
22
+ fullName?: string;
22
23
  phone?: string;
23
24
  companyName?: string;
24
25
  companyVat?: string;
package/models/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export * from './algorithm.js';
3
3
  export * from './app.js';
4
4
  export * from './booking.js';
5
5
  export * from './client.js';
6
+ export * from './company.js';
7
+ export * from './counter.js';
6
8
  export * from './customer.js';
7
9
  export * from './department.js';
8
10
  export * from './document.js';
package/models/index.js CHANGED
@@ -3,6 +3,8 @@ export * from './algorithm.js';
3
3
  export * from './app.js';
4
4
  export * from './booking.js';
5
5
  export * from './client.js';
6
+ export * from './company.js';
7
+ export * from './counter.js';
6
8
  export * from './customer.js';
7
9
  export * from './department.js';
8
10
  export * from './document.js';
@@ -1,6 +1,9 @@
1
1
  import { AptlyInquiryParticipantRole, AptlyInquiryStatus, AptlyInquiryType } from '../enums/index.js';
2
2
  import { AptlySchemaFile } from '../core/index.js';
3
+ import { AptlyCustomerSchema } from './customer.js';
3
4
  import { AptlyBaseSchema } from './extends.js';
5
+ import { AptlyOfferSchema } from './offer.js';
6
+ import { AptlyOrderSchema } from './order.js';
4
7
  import { AptlyProductSchema } from './product.js';
5
8
  import { AptlyUnitSchema } from './unit.js';
6
9
  import { AptlyOrganizationSchema } from './organization.js';
@@ -10,11 +13,12 @@ export type AptlyInquiry = AptlyInquirySchema<string, string>;
10
13
  export interface AptlyInquirySchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE>, '_id' | 'archived'> {
11
14
  _type: AptlyInquiryType;
12
15
  title: string;
13
- project: ID | AptlyProjectSchema<ID, DATE>;
14
16
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
15
- unit: ID | AptlyUnitSchema<ID, DATE>;
16
- offer?: ID | null;
17
- order?: ID | null;
17
+ project: ID | AptlyProjectSchema<ID, DATE> | null;
18
+ unit: ID | AptlyUnitSchema<ID, DATE> | null;
19
+ customer: ID | AptlyCustomerSchema<ID, DATE> | null;
20
+ offer?: ID | AptlyOfferSchema<ID, DATE> | null;
21
+ order?: ID | AptlyOrderSchema<ID, DATE> | null;
18
22
  product?: ID | AptlyProductSchema<ID, DATE>;
19
23
  variant?: ID;
20
24
  producer?: ID;
@@ -49,6 +53,7 @@ export interface AptlyInquiryMessageSchema<ID, DATE> {
49
53
  images?: string[];
50
54
  files: AptlySchemaFile<ID>[];
51
55
  author?: ID | AptlyUserSchema<ID, DATE>;
56
+ customer?: ID | AptlyCustomerSchema<ID, DATE> | null;
52
57
  email?: string;
53
58
  sentTime: DATE;
54
59
  read: {
package/models/offer.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Populated } from '../core/mongoose.js';
2
2
  import { AptlyAddress, AptlySearchAddress } from './address.js';
3
3
  import { AptlyAllowance, AptlyAllowanceChargeSchema, AptlyExtensionAmount, AptlyLegalMonetaryTotal } from './algorithm.js';
4
+ import { AptlyCompanySchema } from './company.js';
4
5
  import { AptlyCustomerData, AptlyCustomerDataSchema } from './customer.js';
5
6
  import { AptlyDocumentSchema } from './document.js';
6
7
  import { AptlyBaseSchema } from './extends.js';
@@ -16,12 +17,14 @@ import { AptlyApp, AptlyAppSchema } from './app';
16
17
  export type AptlyOffer = AptlyOfferSchema<string, string>;
17
18
  export interface AptlyOfferSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, Omit<AptlyExtensionAmount, 'currency'> {
18
19
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
19
- project: ID | AptlyProjectSchema<ID, DATE>;
20
+ project: ID | AptlyProjectSchema<ID, DATE> | null;
20
21
  unit: ID | AptlyUnitSchema<ID, DATE> | null;
21
22
  order: ID | AptlyOrderSchema<ID, DATE> | null;
23
+ company: ID | AptlyCompanySchema<ID, DATE> | null;
22
24
  document: ID | AptlyDocumentSchema<ID, DATE> | null;
23
25
  categories: (ID | AptlyCategorySchema<ID, DATE>)[];
24
- app: ID | AptlyAppSchema<ID, DATE> | null;
26
+ invoice: boolean;
27
+ apps: (ID | AptlyAppSchema<ID, DATE>)[];
25
28
  createdBy: Populated<AptlyUserSchema<ID, DATE>> | null;
26
29
  expiresAt: DATE | null;
27
30
  sentAt: DATE | null;
@@ -54,38 +57,52 @@ export interface AptlyOfferItemSchema<ID, DATE> {
54
57
  allowance?: AptlyAllowance | null;
55
58
  }
56
59
  export type AptlyUserOffer = AptlyUserOfferSchema<string, string>;
57
- export interface AptlyUserOfferSchema<ID, DATE> extends Omit<AptlyOfferSchema<ID, DATE>, 'amount' | 'items'> {
60
+ export interface AptlyUserOfferSchema<ID, DATE> extends Omit<AptlyOfferSchema<ID, DATE>, 'amount' | 'items' | 'apps'> {
61
+ apps: Pick<AptlyAppSchema<ID, DATE>, '_id' | 'name' | 'implements'>[];
58
62
  options: AptlyOptionPopulatedSchema<ID, DATE>[];
59
63
  picks?: AptlyPickSchema<ID, DATE>[];
60
64
  }
61
- export interface AptlyOfferSendUnitBody {
65
+ export interface AptlyOfferSendInvoiceBody {
66
+ invoice?: boolean;
67
+ apps?: (string | AptlyApp)[];
68
+ __hr?: undefined;
69
+ }
70
+ export interface AptlyOfferSendLinkBody {
71
+ email: string;
72
+ }
73
+ export interface AptlyOfferSendUnitBody extends AptlyOfferSendInvoiceBody {
62
74
  unit: string;
63
75
  address: AptlySearchAddress | null;
64
76
  email?: string;
65
77
  firstName?: string;
66
78
  lastName?: string;
67
79
  phone?: string;
68
- app?: AptlyApp | string | null;
69
80
  }
70
- export interface AptlyOfferSendPrivateBody extends Omit<AptlyCustomerData, 'fullName' | 'user'> {
81
+ export interface AptlyOfferSendPrivateBody extends AptlyOfferSendInvoiceBody, Omit<AptlyCustomerData, 'fullName' | 'user'> {
71
82
  unit: string | null;
72
83
  address: AptlySearchAddress | null;
73
- app?: AptlyApp | string | null;
74
84
  }
75
- export interface AptlyOfferSendCompanyBody extends Omit<AptlyCustomerData, 'fullName' | 'user'> {
85
+ export interface AptlyOfferSendCustomerBody extends AptlyOfferSendInvoiceBody, Omit<AptlyCustomerData, 'companyVat' | 'companyName' | 'user'> {
86
+ customer: string | null;
87
+ address: AptlySearchAddress | null;
88
+ }
89
+ export interface AptlyOfferSendCompanyBody extends AptlyOfferSendInvoiceBody, Omit<AptlyCustomerData, 'fullName' | 'user'> {
76
90
  company: Pick<AptlyOrganization, 'name' | 'vat' | 'address'>;
77
91
  address: AptlyAddress;
78
- app?: AptlyApp | string | null;
92
+ }
93
+ export interface AptlyOfferQRBody {
94
+ src: string;
95
+ href: string;
79
96
  }
80
97
  export type AptlyPublicOfferCheckout = AptlyPublicOfferCheckoutSchema<string, string>;
81
98
  export interface AptlyPublicOfferCheckoutSchema<ID, DATE> extends AptlyExtensionAmount {
82
99
  status: AptlyOrderPaymentStatus;
83
100
  offer: Omit<AptlyUserOfferSchema<ID, DATE>, 'options'>;
84
101
  options: AptlyOptionPopulatedSchema<ID, DATE>[];
85
- organization: Pick<AptlyOrganizationSchema<ID, DATE>, 'name'>;
86
- project: Pick<AptlyProjectSchema<ID, DATE>, 'name' | 'paymentApp' | 'signApp'>;
102
+ organization: Pick<AptlyOrganizationSchema<ID, DATE>, 'name' | 'logoMedia'>;
103
+ project: Pick<AptlyProjectSchema<ID, DATE>, 'name' | 'paymentApp' | 'signApp'> | null;
87
104
  unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name'> | null;
88
- order?: Pick<AptlyOrderSchema<ID, DATE>, '_id' | 'status' | 'paymentSession'>;
105
+ order?: Pick<AptlyOrderSchema<ID, DATE>, '_id' | 'status' | 'paymentSession' | 'billing' | 'shippingDate'>;
89
106
  app: Pick<AptlyAppSchema<ID, DATE>, '_id' | 'name' | 'implements'> | null;
90
107
  actions: {
91
108
  payment?: {
package/models/order.d.ts CHANGED
@@ -2,6 +2,7 @@ import { AptlyOrderStatus } from '../enums/index.js';
2
2
  import { AptlyAddress } from './address.js';
3
3
  import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal } from './algorithm.js';
4
4
  import { AptlyAppImplementationSetting, AptlyAppSchema } from './app.js';
5
+ import { AptlyCompanySchema } from './company.js';
5
6
  import { AptlyCustomerDataSchema } from './customer.js';
6
7
  import { AptlyDocumentSchema } from './document.js';
7
8
  import { AptlyEmailSchema } from './email.js';
@@ -27,14 +28,16 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
27
28
  orderNumber: string;
28
29
  invoiceNumber?: number;
29
30
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
30
- project: ID | AptlyProjectSchema<ID, DATE>;
31
+ project: ID | AptlyProjectSchema<ID, DATE> | null;
32
+ unit: ID | AptlyUnitSchema<ID, DATE> | null;
31
33
  period?: ID | AptlyProjectPeriodSchema<ID, DATE>;
32
- unit: ID | AptlyUnitSchema<ID, DATE>;
33
34
  offer: ID | AptlyOfferSchema<ID, DATE> | null;
35
+ company: ID | AptlyCompanySchema<ID, DATE> | null;
34
36
  signers: (ID | AptlyUserSchema<ID, DATE>)[];
35
37
  status: AptlyOrderStatus;
36
- receipt: ID | AptlyDocumentSchema<ID, DATE>;
37
- signedReceipt?: ID | AptlyDocumentSchema<ID, DATE>;
38
+ receipt: ID | AptlyDocumentSchema<ID, DATE> | null;
39
+ signedReceipt?: ID | AptlyDocumentSchema<ID, DATE> | null;
40
+ reportDocument?: ID | AptlyDocumentSchema<ID, DATE> | null;
38
41
  attachments: ID[];
39
42
  signage: AptlyOrderSignageSchema<ID, DATE>;
40
43
  items: AptlyOrderItemSchema<ID, DATE>[];
@@ -1,4 +1,4 @@
1
- import { AptlyModules } from '../core/index.js';
1
+ import { AptlyModules, AptlyScopeSchema } from '../core/index.js';
2
2
  import { AptlyOrganizationRoles, AptlyAppScope, AptlySignageSchema } from '../core/index.js';
3
3
  import { AptlyOrganizationStatus, AptlyOrganizationType } from '../enums/index.js';
4
4
  import { AptlyAddress } from './address.js';
@@ -38,6 +38,7 @@ export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, D
38
38
  members: AptlyOrganizationMemberSchema<ID, DATE>[];
39
39
  modules: AptlyModules[];
40
40
  contractSign?: AptlySignageSchema<ID, DATE>;
41
+ integrations: AptlyOrganizationIntegrationsSchema<ID>[];
41
42
  invites: AptlyOrganizationInviteSchema<ID, DATE>[];
42
43
  apps: AptlyOrganizationAppConfigSchema<ID, DATE>[];
43
44
  storageId?: string;
@@ -61,9 +62,17 @@ export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, D
61
62
  databases: string[];
62
63
  producers: ID[];
63
64
  wholesalers: ID[];
65
+ scope?: AptlyScopeSchema;
64
66
  created: DATE;
65
67
  fixedVariants?: boolean;
66
68
  }
69
+ export type AptlyOrganizationIntegrations = AptlyOrganizationIntegrationsSchema<string>;
70
+ export interface AptlyOrganizationIntegrationsSchema<ID> {
71
+ _id: ID;
72
+ integration: string;
73
+ apiKey: string;
74
+ organization: string;
75
+ }
67
76
  export type AptlyOrganizationMember = AptlyOrganizationMemberSchema<string, string>;
68
77
  export interface AptlyOrganizationMemberSchema<ID, DATE> {
69
78
  _id: ID;
@@ -4,7 +4,7 @@ import { AptlyAppSchema } from './app.js';
4
4
  import { AptlyCustomerData, AptlyCustomerDataSchema } from './customer.js';
5
5
  import { AptlyDocumentSchema } from './document.js';
6
6
  import { AptlyBaseSchema } from './extends.js';
7
- import { AptlyOrder, AptlyOrderSchema } from './order.js';
7
+ import { AptlyOrder, AptlyOrderPaymentStatus, AptlyOrderSchema } from './order.js';
8
8
  import { AptlyOrganizationContent, AptlyOrganizationSchema } from './organization.js';
9
9
  import { AptlyPickConfirmedSchema } from './pick.js';
10
10
  import { AptlyProjectContent, AptlyProjectSchema } from './project.js';
@@ -15,8 +15,8 @@ import { Populated } from '../core';
15
15
  export type AptlyPayment = AptlyPaymentSchema<string, string>;
16
16
  export interface AptlyPaymentSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
17
17
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
18
- project: ID | AptlyProjectSchema<ID, DATE>;
19
- unit: ID | AptlyUnitSchema<ID, DATE>;
18
+ project: ID | AptlyProjectSchema<ID, DATE> | null;
19
+ unit: ID | AptlyUnitSchema<ID, DATE> | null;
20
20
  order: ID | AptlyOrderSchema<ID, DATE>;
21
21
  offer: ID | AptlyOfferSchema<ID, DATE> | null;
22
22
  app: ID | AptlyAppSchema<ID, DATE>;
@@ -97,8 +97,8 @@ export interface AptlyPaymentItemSchema<ID> {
97
97
  }
98
98
  export interface AptlyPaymentInitPaymentBody {
99
99
  organization: AptlyOrganizationContent;
100
- project: AptlyProjectContent;
101
- unit: AptlyUnitContent;
100
+ project?: AptlyProjectContent;
101
+ unit?: AptlyUnitContent;
102
102
  order: AptlyOrder;
103
103
  customer: AptlyCustomerData;
104
104
  shipping: AptlyAddress;
@@ -109,13 +109,7 @@ export interface AptlyPaymentTransactionBody {
109
109
  app: string;
110
110
  id: string;
111
111
  at: string;
112
- customer: {
113
- user?: string;
114
- firstName: string;
115
- lastName: string;
116
- email: string;
117
- phone?: string;
118
- };
112
+ customer: AptlyCustomerData;
119
113
  card: AptlyPayment['card'];
120
114
  shipping: AptlyAddress;
121
115
  billing?: AptlyAddress;
@@ -125,3 +119,10 @@ export interface AptlyPaymentCaptureBody {
125
119
  terms: boolean;
126
120
  description?: string;
127
121
  }
122
+ export interface AptlyPaymentCaptureResponse {
123
+ id: string;
124
+ capturedAmount: number;
125
+ status: AptlyOrderPaymentStatus;
126
+ totalCost: number;
127
+ at: string;
128
+ }
package/models/pick.d.ts CHANGED
@@ -14,8 +14,8 @@ import { AptlyDocumentSchema } from './document';
14
14
  export type AptlyPick = AptlyPickSchema<string, string>;
15
15
  export interface AptlyPickSchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE>, '_id' | 'archived' | 'createdAt' | 'updatedAt'> {
16
16
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
17
- project: ID | AptlyProjectSchema<ID, DATE>;
18
- unit: ID | AptlyUnitSchema<ID, DATE>;
17
+ project: ID | AptlyProjectSchema<ID, DATE> | null;
18
+ unit: ID | AptlyUnitSchema<ID, DATE> | null;
19
19
  option: ID | AptlyOptionSchema<ID, DATE>;
20
20
  category: ID | AptlyCategorySchema<ID, DATE> | null;
21
21
  producer: ID | AptlyProducerSchema<ID, DATE> | null;
@@ -28,4 +28,5 @@ export interface AptlyPriceFileSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE
28
28
  modifiedAt: DATE | null;
29
29
  username?: string;
30
30
  password?: string;
31
+ discountFileName?: string;
31
32
  }
@@ -3,7 +3,7 @@ import { AptlyAddress } from './address.js';
3
3
  import { AptlyAlgorithm, AptlyAlgorithmPipeline, AptlyAlgorithmPipelineSchema, AptlyAlgorithmSchema } from './algorithm.js';
4
4
  import { AptlyAppSchema } from './app.js';
5
5
  import { AptlyOrganizationSchema } from './organization.js';
6
- import { AptlyModules } from '../core/index.js';
6
+ import { AptlyModules, AptlyScopeSchema } from '../core/index.js';
7
7
  import { AptlyPageSchema } from './page.js';
8
8
  import { AptlyPeriod, AptlyPeriodSchema } from './period.js';
9
9
  import { AptlyUserSchema } from './user.js';
@@ -16,15 +16,17 @@ export type AptlyProjectContentSchema<ID, DATE> = Pick<AptlyProjectSchema<ID, DA
16
16
  export type AptlyProject = AptlyProjectSchema<string, string>;
17
17
  export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
18
18
  organization: AptlyOrganizationSchema<ID, DATE> | ID;
19
+ type?: AptlyProjectType;
19
20
  template?: ID | null;
20
21
  customers: ID[];
21
22
  periods: AptlyPeriodSchema<ID, DATE>[];
22
- documents: AptlyDocumentSchema<ID, DATE>[];
23
+ documents: (ID | AptlyDocumentSchema<ID, DATE>)[];
23
24
  pages: (ID | AptlyPageSchema<ID, DATE>)[];
24
25
  myPageText?: string;
25
26
  inviteText?: string;
26
27
  notify: AptlyProjectNotifySchema<ID, DATE>[];
27
28
  theme: AptlyProjectTheme;
29
+ integrations: AptlyProjectIntegrationSchema<ID>[];
28
30
  disabledModules?: AptlyModules[];
29
31
  extraOptions?: AptlyUnitOptionExtraItemSchema<ID, DATE>[];
30
32
  gdprActive?: boolean;
@@ -42,8 +44,13 @@ export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>,
42
44
  invites?: AptlyProjectInviteSchema<ID, DATE>[];
43
45
  signApp?: ID | AptlyAppSchema<ID, DATE> | null;
44
46
  signMembers?: (ID | AptlyUserSchema<ID, DATE>)[];
47
+ scope?: AptlyScopeSchema;
45
48
  created: DATE;
46
49
  }
50
+ export declare enum AptlyProjectType {
51
+ Options = 0,
52
+ Offers = 1
53
+ }
47
54
  export type AptlyProjectPeriod = AptlyPeriod;
48
55
  export type AptlyProjectPeriodSchema<ID, DATE> = AptlyPeriodSchema<ID, DATE>;
49
56
  export type AptlyProjectAlgorithm = AptlyAlgorithm;
@@ -96,6 +103,18 @@ export interface AptlyProjectThemePalette {
96
103
  disabled?: string;
97
104
  lightContrast?: string;
98
105
  }
106
+ export type AptlyProjectIntegration = AptlyProjectIntegrationSchema<string>;
107
+ export interface AptlyProjectIntegrationSchema<ID> {
108
+ _id: ID;
109
+ integration: ID;
110
+ integrationName: string;
111
+ project: string;
112
+ failures: {
113
+ _id: string;
114
+ error: string;
115
+ name: string;
116
+ }[];
117
+ }
99
118
  export type AptlyProjectNotify = AptlyProjectNotifySchema<string, string>;
100
119
  export interface AptlyProjectNotifySchema<ID, DATE> {
101
120
  _id: ID;
package/models/project.js CHANGED
@@ -1 +1,5 @@
1
- export {};
1
+ export var AptlyProjectType;
2
+ (function (AptlyProjectType) {
3
+ AptlyProjectType[AptlyProjectType["Options"] = 0] = "Options";
4
+ AptlyProjectType[AptlyProjectType["Offers"] = 1] = "Offers";
5
+ })(AptlyProjectType || (AptlyProjectType = {}));
@@ -1,7 +1,9 @@
1
1
  import { AptlyEmailType } from '../enums/index.js';
2
2
  import { AptlyBookingSchema } from './booking.js';
3
+ import { AptlyCustomerSchema } from './customer.js';
3
4
  import { AptlyBaseSchema } from './extends.js';
4
5
  import { AptlyInquirySchema } from './inquiry.js';
6
+ import { AptlyOfferSchema } from './offer.js';
5
7
  import { AptlyOrganizationSchema } from './organization.js';
6
8
  import { AptlyProjectSchema } from './project.js';
7
9
  import { AptlyUnitSchema } from './unit.js';
@@ -18,7 +20,8 @@ export interface AptlyUnitEmailSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID,
18
20
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
19
21
  project: ID | AptlyProjectSchema<ID, DATE>;
20
22
  unit: ID | AptlyUnitSchema<ID, DATE>;
21
- offer?: ID | AptlyOrderSchema<ID, DATE> | null;
23
+ customer: ID | AptlyCustomerSchema<ID, DATE> | null;
24
+ offer?: ID | AptlyOfferSchema<ID, DATE> | null;
22
25
  order?: ID | AptlyOrderSchema<ID, DATE> | null;
23
26
  inquiry?: ID | AptlyInquirySchema<ID, DATE>;
24
27
  booking?: ID | AptlyBookingSchema<ID, DATE>;
package/models/unit.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AptlyScopeSchema } from '../core/index.js';
1
2
  import { AptlyAddress } from './address.js';
2
3
  import { AptlyCategorySchema } from './category.js';
3
4
  import { AptlyDocumentSchema } from './document.js';
@@ -9,7 +10,7 @@ import { AptlyProductSchema } from './product.js';
9
10
  import { AptlyProjectSchema } from './project.js';
10
11
  import { AptlyHistorySchema } from './extends.js';
11
12
  import { AptlyUnitTemplateBaseSchema, AptlyUnitTemplateCategorySchema, AptlyUnitTemplateCategorySectionSchema, AptlyUnitTemplateSchema } from './unit-template';
12
- import { AptlyUnitItemParamKey, AptlyUnitStatus } from '../enums/index.js';
13
+ import { AptlyIntegration, AptlyUnitItemParamKey, AptlyUnitStatus } from '../enums/index.js';
13
14
  import { AptlyUserSchema } from './user.js';
14
15
  import { AptlyOrganizationSchema } from './organization.js';
15
16
  import { AptlyCustomerSchema } from './customer.js';
@@ -51,8 +52,10 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
51
52
  invitesQueue: AptlyUnitInviteQueueSchema[];
52
53
  overridePeriod?: ID;
53
54
  overridePeriods?: AptlyUnitOverridePeriodSchema<ID, DATE>[];
55
+ integrations: AptlyUnitIntegrationSchema<ID>[];
54
56
  gdpr?: AptlyUnitGDPRSchema<DATE, ID>;
55
57
  tree: any[];
58
+ scope?: AptlyScopeSchema;
56
59
  activatedAt: DATE | null;
57
60
  created: DATE;
58
61
  }
@@ -196,6 +199,14 @@ export interface AptlyUnitConfirmedPeriodSchema<ID, DATE> {
196
199
  confirmed?: DATE;
197
200
  order?: ID | AptlyOrderSchema<ID, DATE>;
198
201
  }
202
+ export type AptlyUnitIntegration = AptlyUnitIntegrationSchema<string>;
203
+ export interface AptlyUnitIntegrationSchema<ID> {
204
+ _id: ID;
205
+ integration: AptlyIntegration;
206
+ unit?: string;
207
+ plantId?: string;
208
+ tags?: string[];
209
+ }
199
210
  interface AptlyUnitEditData<DATE> {
200
211
  address?: string;
201
212
  zipCode?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "3.12.4",
3
+ "version": "3.13.0",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",