@aptly-as/types 3.12.5 → 3.14.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
@@ -157,6 +157,7 @@ export declare enum AptlyEmailType {
157
157
  OrderPayed = "order-payed",
158
158
  OrderReceipt = "order-receipt",
159
159
  OrderCompleted = "order-completed",
160
+ PaymentReceipt = "payment-receipt",
160
161
  PeriodOpen = "period-open",
161
162
  PeriodClose = "period-close"
162
163
  }
package/enums/index.js CHANGED
@@ -176,6 +176,7 @@ export var AptlyEmailType;
176
176
  AptlyEmailType["OrderPayed"] = "order-payed";
177
177
  AptlyEmailType["OrderReceipt"] = "order-receipt";
178
178
  AptlyEmailType["OrderCompleted"] = "order-completed";
179
+ AptlyEmailType["PaymentReceipt"] = "payment-receipt";
179
180
  AptlyEmailType["PeriodOpen"] = "period-open";
180
181
  AptlyEmailType["PeriodClose"] = "period-close";
181
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,13 @@
1
+ export declare enum AptlyCounterModel {
2
+ Offer = "offers",
3
+ Order = "orders",
4
+ Payment = "payments"
5
+ }
6
+ export interface AptlyCounterSchema<ID, DATE> {
7
+ _id: ID;
8
+ organization: ID;
9
+ model: AptlyCounterModel;
10
+ sequence: number;
11
+ updatedAt: DATE;
12
+ createdAt: DATE;
13
+ }
@@ -0,0 +1,6 @@
1
+ export var AptlyCounterModel;
2
+ (function (AptlyCounterModel) {
3
+ AptlyCounterModel["Offer"] = "offers";
4
+ AptlyCounterModel["Order"] = "orders";
5
+ AptlyCounterModel["Payment"] = "payments";
6
+ })(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/item.d.ts CHANGED
@@ -21,7 +21,8 @@ export declare enum AptlyItemType {
21
21
  Resource = "resource",
22
22
  Material = "material",
23
23
  Category = "category",
24
- Package = "package"
24
+ Package = "package",
25
+ PackageEnd = "package-end"
25
26
  }
26
27
  export interface AptlyItemStandardIdentification {
27
28
  scheme: AptlyInternationalCodeDesignator;
package/models/item.js CHANGED
@@ -7,4 +7,5 @@ export var AptlyItemType;
7
7
  AptlyItemType["Material"] = "material";
8
8
  AptlyItemType["Category"] = "category";
9
9
  AptlyItemType["Package"] = "package";
10
+ AptlyItemType["PackageEnd"] = "package-end";
10
11
  })(AptlyItemType || (AptlyItemType = {}));
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?: {
@@ -16,8 +16,8 @@ import { AptlyDatabase } from '../enums';
16
16
  import { AptlyWholesalerSchema } from './wholesaler.js';
17
17
  export type AptlyOption = AptlyOptionSchema<string, string>;
18
18
  export interface AptlyOptionSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
19
- organization: ID | AptlyOrganizationSchema<ID, DATE>;
20
- project: ID | AptlyProjectSchema<ID, DATE>;
19
+ organization: ID | AptlyOrganizationSchema<ID, DATE> | null;
20
+ project: ID | AptlyProjectSchema<ID, DATE> | null;
21
21
  unit: ID | AptlyUnitSchema<ID, DATE> | null;
22
22
  product: ID | AptlyProductSchema<ID, DATE> | null;
23
23
  offer: ID | AptlyOfferSchema<ID, DATE> | null;
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';
@@ -23,18 +24,21 @@ export declare enum AptlyOrderPaymentStatus {
23
24
  Expired = "EXPIRED"
24
25
  }
25
26
  export type AptlyOrder = AptlyOrderSchema<string, string>;
26
- export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name'> {
27
+ export interface AptlyOrderSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
28
+ number: number;
27
29
  orderNumber: string;
28
30
  invoiceNumber?: number;
29
31
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
30
- project: ID | AptlyProjectSchema<ID, DATE>;
32
+ project: ID | AptlyProjectSchema<ID, DATE> | null;
33
+ unit: ID | AptlyUnitSchema<ID, DATE> | null;
31
34
  period?: ID | AptlyProjectPeriodSchema<ID, DATE>;
32
- unit: ID | AptlyUnitSchema<ID, DATE>;
33
35
  offer: ID | AptlyOfferSchema<ID, DATE> | null;
36
+ company: ID | AptlyCompanySchema<ID, DATE> | null;
34
37
  signers: (ID | AptlyUserSchema<ID, DATE>)[];
35
38
  status: AptlyOrderStatus;
36
- receipt: ID | AptlyDocumentSchema<ID, DATE>;
37
- signedReceipt?: ID | AptlyDocumentSchema<ID, DATE>;
39
+ receipt: ID | AptlyDocumentSchema<ID, DATE> | null;
40
+ signedReceipt?: ID | AptlyDocumentSchema<ID, DATE> | null;
41
+ reportDocument?: ID | AptlyDocumentSchema<ID, DATE> | null;
38
42
  attachments: ID[];
39
43
  signage: AptlyOrderSignageSchema<ID, DATE>;
40
44
  items: AptlyOrderItemSchema<ID, DATE>[];
@@ -50,7 +54,7 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
50
54
  shipping?: AptlyAddress;
51
55
  billing?: AptlyAddress;
52
56
  pricePipeline: AptlyOrderPricePipelineItemSchema<ID>[];
53
- signees?: AptlyOrderSigneeSchema<ID, DATE>[];
57
+ signees: AptlyOrderSigneeSchema<ID, DATE>[];
54
58
  emailText?: string;
55
59
  approved?: {
56
60
  action?: AptlyOrderAction;
@@ -58,7 +62,7 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
58
62
  at?: DATE;
59
63
  };
60
64
  paymentSession?: AptlyOrderPaymentSessionSchema<ID, DATE> | null;
61
- payment?: ID | AptlyPaymentSchema<ID, DATE>;
65
+ payment?: ID | AptlyPaymentSchema<ID, DATE> | null;
62
66
  shippingDate?: DATE;
63
67
  shippingDescription?: string;
64
68
  signedAt?: DATE | null;
@@ -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';
@@ -19,7 +19,7 @@ export type AptlyOrganizationContentSchema<ID, DATE> = Pick<AptlyOrganizationSch
19
19
  export type AptlyOrganization = AptlyOrganizationSchema<string, string>;
20
20
  export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
21
21
  slug: string;
22
- number?: string;
22
+ number: string;
23
23
  vat?: string;
24
24
  logo?: string | null;
25
25
  logoMedia?: AptlyMediaSrcSchema<ID, DATE> | null;
@@ -62,6 +62,7 @@ export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, D
62
62
  databases: string[];
63
63
  producers: ID[];
64
64
  wholesalers: ID[];
65
+ scope?: AptlyScopeSchema;
65
66
  created: DATE;
66
67
  fixedVariants?: boolean;
67
68
  }
@@ -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;
@@ -35,7 +35,7 @@ export interface AptlyPickSchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE
35
35
  price: AptlyPrice | null;
36
36
  algorithm: ID | null;
37
37
  documents: (ID | AptlyDocumentSchema<ID, DATE>)[];
38
- pipeline: AptlyAlgorithmPipelineDataItemSchema<ID>[];
38
+ pipeline?: AptlyAlgorithmPipelineDataItemSchema<ID>[];
39
39
  confirmedAt: DATE | null;
40
40
  }
41
41
  export type AptlyPickConfirmed = AptlyPickConfirmedSchema<string, string>;
@@ -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
  }
@@ -6,8 +6,8 @@ import { AptlyProducerSchema } from './producer.js';
6
6
  import { AptlyDatabase, AptlyQuantityUnitCode } from '../enums/index.js';
7
7
  export type AptlyProduct = AptlyProductSchema<string, string>;
8
8
  export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
9
- organization?: ID;
10
- project?: ID;
9
+ organization?: ID | null;
10
+ project?: ID | null;
11
11
  extends?: ID | AptlyProductSchema<ID, DATE>;
12
12
  status: AptlyProductStatus;
13
13
  database: AptlyDatabase;
@@ -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,10 +16,11 @@ 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;
@@ -42,9 +43,14 @@ export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>,
42
43
  paymentApp?: ID | AptlyAppSchema<ID, DATE> | null;
43
44
  invites?: AptlyProjectInviteSchema<ID, DATE>[];
44
45
  signApp?: ID | AptlyAppSchema<ID, DATE> | null;
45
- signMembers?: (ID | AptlyUserSchema<ID, DATE>)[];
46
+ signMembers: (ID | AptlyUserSchema<ID, DATE>)[];
47
+ scope?: AptlyScopeSchema;
46
48
  created: DATE;
47
49
  }
50
+ export declare enum AptlyProjectType {
51
+ Options = 0,
52
+ Offers = 1
53
+ }
48
54
  export type AptlyProjectPeriod = AptlyPeriod;
49
55
  export type AptlyProjectPeriodSchema<ID, DATE> = AptlyPeriodSchema<ID, DATE>;
50
56
  export type AptlyProjectAlgorithm = AptlyAlgorithm;
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';
@@ -14,11 +16,12 @@ export interface AptlyUnitEmailSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID,
14
16
  references: string;
15
17
  inReplyTo: string[];
16
18
  hasSendError: boolean;
17
- sendErrors?: AptlyUnitEmailSendErrorSchema<ID, DATE>[];
19
+ sendErrors: AptlyUnitEmailSendErrorSchema<ID, DATE>[];
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';
@@ -54,6 +55,7 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
54
55
  integrations: AptlyUnitIntegrationSchema<ID>[];
55
56
  gdpr?: AptlyUnitGDPRSchema<DATE, ID>;
56
57
  tree: any[];
58
+ scope?: AptlyScopeSchema;
57
59
  activatedAt: DATE | null;
58
60
  created: DATE;
59
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "3.12.5",
3
+ "version": "3.14.0",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -10,10 +10,10 @@
10
10
  "devDependencies": {
11
11
  "@aws-sdk/client-s3": "^3.598.0",
12
12
  "cloudinary": "^1.41.3",
13
- "husky": "^9.0.11",
14
- "lint-staged": "^15.2.7",
15
- "prettier": "^3.3.2",
16
- "typescript": "^5.4.5"
13
+ "husky": "^9.1.7",
14
+ "lint-staged": "^16.3.3",
15
+ "prettier": "^3.8.1",
16
+ "typescript": "^5.9.3"
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",