@aptly-as/types 2.8.3 → 2.9.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/core/scope.d.ts CHANGED
@@ -5,6 +5,7 @@ export declare enum AptlyModules {
5
5
  Default = "default",
6
6
  Departments = "departments",
7
7
  Emails = "emails",
8
+ Options = "options",
8
9
  OptionLabels = "optionLabels",
9
10
  Pages = "pages",
10
11
  Payment = "payment",
@@ -36,10 +37,12 @@ export declare enum AptlyScopes {
36
37
  Organization = "organization",
37
38
  OrganizationAlgorithms = "organizationAlgorithms",
38
39
  OrganizationBooking = "organizationBooking",
40
+ OrganizationCategories = "organizationCategories",
39
41
  OrganizationClients = "organizationClients",
40
42
  OrganizationDepartments = "organizationDepartments",
41
43
  OrganizationLogo = "organizationLogo",
42
44
  OrganizationMembers = "organizationMembers",
45
+ OrganizationOptions = "organizationOptions",
43
46
  OrganizationOptionLabels = "organizationOptionLabels",
44
47
  OrganizationOrders = "organizationOrders",
45
48
  OrganizationPayment = "organizationPayment",
@@ -55,11 +58,13 @@ export declare enum AptlyScopes {
55
58
  Project = "project",
56
59
  ProjectAlgorithms = "projectAlgorithms",
57
60
  ProjectBooking = "projectBooking",
61
+ ProjectCategories = "projectCategories",
58
62
  ProjectDocuments = "projectDocuments",
59
63
  ProjectEmails = "projectEmails",
60
64
  ProjectInquiry = "projectInquiry",
61
65
  ProjectInquiryComplaint = "projectInquiryComplaint",
62
66
  ProjectOrders = "projectOrders",
67
+ ProjectOptions = "projectOptions",
63
68
  ProjectPayment = "projectPayment",
64
69
  ProjectPages = "projectPages",
65
70
  ProjectPeriods = "projectPeriods",
@@ -75,6 +80,7 @@ export declare enum AptlyScopes {
75
80
  ProjectUnitExtraFields = "projectUnitExtraFields",
76
81
  ProjectUnitExtraOptions = "projectUnitExtraOptions",
77
82
  ProjectUnitDocuments = "projectUnitDocuments",
83
+ ProjectUnitOptions = "projectUnitOptions",
78
84
  ProjectUnitTemplates = "projectUnitTemplates",
79
85
  ProjectUnitTemplatesAlgorithms = "projectUnitTemplatesAlgorithms",
80
86
  ProjectUnitTemplatesPrices = "projectUnitTemplatesPrices",
package/core/scope.js CHANGED
@@ -6,6 +6,7 @@ export var AptlyModules;
6
6
  AptlyModules["Default"] = "default";
7
7
  AptlyModules["Departments"] = "departments";
8
8
  AptlyModules["Emails"] = "emails";
9
+ AptlyModules["Options"] = "options";
9
10
  AptlyModules["OptionLabels"] = "optionLabels";
10
11
  AptlyModules["Pages"] = "pages";
11
12
  AptlyModules["Payment"] = "payment";
@@ -38,10 +39,12 @@ export var AptlyScopes;
38
39
  AptlyScopes["Organization"] = "organization";
39
40
  AptlyScopes["OrganizationAlgorithms"] = "organizationAlgorithms";
40
41
  AptlyScopes["OrganizationBooking"] = "organizationBooking";
42
+ AptlyScopes["OrganizationCategories"] = "organizationCategories";
41
43
  AptlyScopes["OrganizationClients"] = "organizationClients";
42
44
  AptlyScopes["OrganizationDepartments"] = "organizationDepartments";
43
45
  AptlyScopes["OrganizationLogo"] = "organizationLogo";
44
46
  AptlyScopes["OrganizationMembers"] = "organizationMembers";
47
+ AptlyScopes["OrganizationOptions"] = "organizationOptions";
45
48
  AptlyScopes["OrganizationOptionLabels"] = "organizationOptionLabels";
46
49
  AptlyScopes["OrganizationOrders"] = "organizationOrders";
47
50
  AptlyScopes["OrganizationPayment"] = "organizationPayment";
@@ -57,11 +60,13 @@ export var AptlyScopes;
57
60
  AptlyScopes["Project"] = "project";
58
61
  AptlyScopes["ProjectAlgorithms"] = "projectAlgorithms";
59
62
  AptlyScopes["ProjectBooking"] = "projectBooking";
63
+ AptlyScopes["ProjectCategories"] = "projectCategories";
60
64
  AptlyScopes["ProjectDocuments"] = "projectDocuments";
61
65
  AptlyScopes["ProjectEmails"] = "projectEmails";
62
66
  AptlyScopes["ProjectInquiry"] = "projectInquiry";
63
67
  AptlyScopes["ProjectInquiryComplaint"] = "projectInquiryComplaint";
64
68
  AptlyScopes["ProjectOrders"] = "projectOrders";
69
+ AptlyScopes["ProjectOptions"] = "projectOptions";
65
70
  AptlyScopes["ProjectPayment"] = "projectPayment";
66
71
  AptlyScopes["ProjectPages"] = "projectPages";
67
72
  AptlyScopes["ProjectPeriods"] = "projectPeriods";
@@ -77,6 +82,7 @@ export var AptlyScopes;
77
82
  AptlyScopes["ProjectUnitExtraFields"] = "projectUnitExtraFields";
78
83
  AptlyScopes["ProjectUnitExtraOptions"] = "projectUnitExtraOptions";
79
84
  AptlyScopes["ProjectUnitDocuments"] = "projectUnitDocuments";
85
+ AptlyScopes["ProjectUnitOptions"] = "projectUnitOptions";
80
86
  AptlyScopes["ProjectUnitTemplates"] = "projectUnitTemplates";
81
87
  AptlyScopes["ProjectUnitTemplatesAlgorithms"] = "projectUnitTemplatesAlgorithms";
82
88
  AptlyScopes["ProjectUnitTemplatesPrices"] = "projectUnitTemplatesPrices";
@@ -17,6 +17,13 @@ export declare namespace AptlyWebhookEventData {
17
17
  interface NewUnitOrderSchema<ID, DATE> extends NewUnitDocumentSchema<ID, DATE> {
18
18
  order: Pick<AptlyOrderSchema<ID, DATE>, '_id' | 'orderNumber' | 'receipt' | 'period'>;
19
19
  }
20
+ type Order = OrderSchema<string, string>;
21
+ interface OrderSchema<ID, DATE> {
22
+ unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name' | 'shipping' | 'users'>;
23
+ order: AptlyOrderSchema<ID, DATE>;
24
+ receiptUrl?: string;
25
+ signedReceiptUrl?: string;
26
+ }
20
27
  }
21
28
  export declare namespace AptlyAppWebhookEventData {
22
29
  interface SettlementCreate extends Pick<AptlyPaymentSettlement, 'app' | 'at' | 'externalId' | 'externalRef' | 'destination'> {
package/enums/fields.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export declare enum AptlyFieldType {
2
2
  Autocomplete = "autocomplete",
3
3
  AutocompleteSearch = "autocomplete-search",
4
+ AutocompleteQuery = "autocomplete-query",
4
5
  BulkIds = "bulk-ids",
5
6
  Checkbox = "checkbox",
6
7
  Custom = "custom",
package/enums/fields.js CHANGED
@@ -2,6 +2,7 @@ export var AptlyFieldType;
2
2
  (function (AptlyFieldType) {
3
3
  AptlyFieldType["Autocomplete"] = "autocomplete";
4
4
  AptlyFieldType["AutocompleteSearch"] = "autocomplete-search";
5
+ AptlyFieldType["AutocompleteQuery"] = "autocomplete-query";
5
6
  AptlyFieldType["BulkIds"] = "bulk-ids";
6
7
  AptlyFieldType["Checkbox"] = "checkbox";
7
8
  AptlyFieldType["Custom"] = "custom";
package/enums/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './document.js';
2
2
  export * from './fields.js';
3
3
  export * from './unit-template.js';
4
4
  export * from './webhook.js';
5
+ export * from './standards.js';
5
6
  export declare enum AptlyOrderStatus {
6
7
  New = "new",
7
8
  NotSigned = "notSigned",
package/enums/index.js CHANGED
@@ -2,6 +2,7 @@ export * from './document.js';
2
2
  export * from './fields.js';
3
3
  export * from './unit-template.js';
4
4
  export * from './webhook.js';
5
+ export * from './standards.js';
5
6
  export var AptlyOrderStatus;
6
7
  (function (AptlyOrderStatus) {
7
8
  AptlyOrderStatus["New"] = "new";
@@ -0,0 +1,34 @@
1
+ export declare enum AptlyQuantityUnitCode {
2
+ One = "C62",
3
+ Piece = "H87",
4
+ Meter = "MTR",
5
+ SquareMeter = "MTK",
6
+ Hour = "HUR",
7
+ Day = "DAY"
8
+ }
9
+ export declare enum AptlyCurrency {
10
+ NorwegianKrone = "NOK"
11
+ }
12
+ export declare enum AptlyTaxCategoryScheme {
13
+ Vat = "VAT",
14
+ Tax = "TAX"
15
+ }
16
+ export declare enum AptlyVatCategoryCode {
17
+ StandardRate = "S",
18
+ ExemptFromTax = "E"
19
+ }
20
+ export declare enum AptlyCountryCode {
21
+ Norway = "NO"
22
+ }
23
+ export declare enum AptlyInternationalCodeDesignator {
24
+ Organisasjonsnummer = "0192",
25
+ GlobalTradeItemNumber = "0160"
26
+ }
27
+ export declare enum AptlyMediaTypesMIME {
28
+ pdf = "application/pdf",
29
+ png = "image/png",
30
+ jpeg = "image/jpeg",
31
+ csv = "text/csv",
32
+ openXmlSheet = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
33
+ openSpreadsheet = "application/vnd.oasis.opendocument.spreadsheet"
34
+ }
@@ -0,0 +1,41 @@
1
+ export var AptlyQuantityUnitCode;
2
+ (function (AptlyQuantityUnitCode) {
3
+ AptlyQuantityUnitCode["One"] = "C62";
4
+ AptlyQuantityUnitCode["Piece"] = "H87";
5
+ AptlyQuantityUnitCode["Meter"] = "MTR";
6
+ AptlyQuantityUnitCode["SquareMeter"] = "MTK";
7
+ AptlyQuantityUnitCode["Hour"] = "HUR";
8
+ AptlyQuantityUnitCode["Day"] = "DAY";
9
+ })(AptlyQuantityUnitCode || (AptlyQuantityUnitCode = {}));
10
+ export var AptlyCurrency;
11
+ (function (AptlyCurrency) {
12
+ AptlyCurrency["NorwegianKrone"] = "NOK";
13
+ })(AptlyCurrency || (AptlyCurrency = {}));
14
+ export var AptlyTaxCategoryScheme;
15
+ (function (AptlyTaxCategoryScheme) {
16
+ AptlyTaxCategoryScheme["Vat"] = "VAT";
17
+ AptlyTaxCategoryScheme["Tax"] = "TAX";
18
+ })(AptlyTaxCategoryScheme || (AptlyTaxCategoryScheme = {}));
19
+ export var AptlyVatCategoryCode;
20
+ (function (AptlyVatCategoryCode) {
21
+ AptlyVatCategoryCode["StandardRate"] = "S";
22
+ AptlyVatCategoryCode["ExemptFromTax"] = "E";
23
+ })(AptlyVatCategoryCode || (AptlyVatCategoryCode = {}));
24
+ export var AptlyCountryCode;
25
+ (function (AptlyCountryCode) {
26
+ AptlyCountryCode["Norway"] = "NO";
27
+ })(AptlyCountryCode || (AptlyCountryCode = {}));
28
+ export var AptlyInternationalCodeDesignator;
29
+ (function (AptlyInternationalCodeDesignator) {
30
+ AptlyInternationalCodeDesignator["Organisasjonsnummer"] = "0192";
31
+ AptlyInternationalCodeDesignator["GlobalTradeItemNumber"] = "0160";
32
+ })(AptlyInternationalCodeDesignator || (AptlyInternationalCodeDesignator = {}));
33
+ export var AptlyMediaTypesMIME;
34
+ (function (AptlyMediaTypesMIME) {
35
+ AptlyMediaTypesMIME["pdf"] = "application/pdf";
36
+ AptlyMediaTypesMIME["png"] = "image/png";
37
+ AptlyMediaTypesMIME["jpeg"] = "image/jpeg";
38
+ AptlyMediaTypesMIME["csv"] = "text/csv";
39
+ AptlyMediaTypesMIME["openXmlSheet"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
40
+ AptlyMediaTypesMIME["openSpreadsheet"] = "application/vnd.oasis.opendocument.spreadsheet";
41
+ })(AptlyMediaTypesMIME || (AptlyMediaTypesMIME = {}));
@@ -7,6 +7,7 @@ export declare enum AptlyWebhookType {
7
7
  UnitMessageReply = "aptly.unit.message.reply",
8
8
  UnitOrderCreated = "aptly.unit.order.created",
9
9
  UnitOrderSigned = "aptly.unit.order.signed",
10
+ UnitOrderCompleted = "aptly.unit.order.completed",
10
11
  UnitPaymentCreated = "aptly.unit.payment.created",
11
12
  UnitPaymentCaptured = "aptly.unit.payment.captured",
12
13
  UnitPaymentReceipt = "aptly.unit.payment.receipt",
package/enums/webhook.js CHANGED
@@ -8,6 +8,7 @@ export var AptlyWebhookType;
8
8
  AptlyWebhookType["UnitMessageReply"] = "aptly.unit.message.reply";
9
9
  AptlyWebhookType["UnitOrderCreated"] = "aptly.unit.order.created";
10
10
  AptlyWebhookType["UnitOrderSigned"] = "aptly.unit.order.signed";
11
+ AptlyWebhookType["UnitOrderCompleted"] = "aptly.unit.order.completed";
11
12
  AptlyWebhookType["UnitPaymentCreated"] = "aptly.unit.payment.created";
12
13
  AptlyWebhookType["UnitPaymentCaptured"] = "aptly.unit.payment.captured";
13
14
  AptlyWebhookType["UnitPaymentReceipt"] = "aptly.unit.payment.receipt";
package/error/error.d.ts CHANGED
@@ -17,7 +17,7 @@ export declare class AptlyError extends Error {
17
17
  readonly error?: Error | undefined;
18
18
  readonly name = "AptlyError";
19
19
  readonly _status: number;
20
- readonly id: string;
20
+ id: string;
21
21
  static fromFetchResponse(response: Response): Promise<AptlyError>;
22
22
  static fromResponse(response: Response): Promise<AptlyError>;
23
23
  constructor(data: Omit<AptlyErrorBody, 'name'>, error?: Error | undefined);
package/error/error.js CHANGED
@@ -4,8 +4,9 @@ export class AptlyError extends Error {
4
4
  }
5
5
  static async fromResponse(response) {
6
6
  const contentType = response.headers.get('content-type');
7
+ let body;
7
8
  if (contentType?.includes('application/json')) {
8
- const body = await response.json();
9
+ body = await response.json();
9
10
  if (!body.link) {
10
11
  body.link = response.url;
11
12
  }
@@ -13,11 +14,14 @@ export class AptlyError extends Error {
13
14
  return new AptlyError(body);
14
15
  }
15
16
  }
17
+ else {
18
+ body = await response.text();
19
+ }
16
20
  throw new AptlyError({
17
21
  id: 'unknown',
18
22
  status: response.status,
19
23
  message: response.statusText,
20
- detail: await response.text(),
24
+ detail: body,
21
25
  link: response.url,
22
26
  });
23
27
  }
@@ -0,0 +1,14 @@
1
+ {
2
+ "standards": {
3
+ "quantityUnitCode": {
4
+ "C62": "",
5
+ "H87": "PCS",
6
+ "MTR": "Meter",
7
+ "MTK": "m2",
8
+ "HUR_one": "Hour",
9
+ "HUR_other": "Hours",
10
+ "DAY_one": "Day",
11
+ "DAY_other": "Days"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "standards": {
3
+ "quantityUnitCode": {
4
+ "C62": "",
5
+ "H87": "STK",
6
+ "MTR": "Meter",
7
+ "MTK": "m2",
8
+ "HUR_one": "Time",
9
+ "HUR_other": "Timer",
10
+ "DAY_one": "Dag",
11
+ "DAY_other": "Dager"
12
+ }
13
+ }
14
+ }
@@ -30,3 +30,9 @@ export interface AptlyAlgorithmPipelineSchema<ID> {
30
30
  value: number;
31
31
  applyTo: AptlyAlgorithmPipelineApplyTo;
32
32
  }
33
+ export interface AptlyAlgorithmPipelineData {
34
+ operation: AptlyAlgorithmPipelineOperation;
35
+ label: string;
36
+ value: number;
37
+ diff: number;
38
+ }
package/models/app.d.ts CHANGED
@@ -15,6 +15,7 @@ export interface AptlyAppSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>
15
15
  settings: AptlyAppSettingSchema<ID>[];
16
16
  webhooks: AptlyAppWebhookSchema<ID>[];
17
17
  menus: AptlyAppMenuSchema<ID, DATE>[];
18
+ actions: AptlyAppActionSchema<ID>[];
18
19
  cost?: number;
19
20
  implements: AptlyAppImplementation[];
20
21
  sign?: {
@@ -101,3 +102,15 @@ export interface AptlyAppMenuSchema<ID, DATE> {
101
102
  src: string;
102
103
  sandbox: AptlyAppSandbox[];
103
104
  }
105
+ export type AptlyAppAction = AptlyAppActionSchema<string>;
106
+ export interface AptlyAppActionSchema<ID> {
107
+ _id: ID;
108
+ model: AptlyAppActionModel;
109
+ scope: AptlyScopes;
110
+ webhook: AptlyWebhookType;
111
+ label: string;
112
+ stateJSON: string;
113
+ }
114
+ export declare enum AptlyAppActionModel {
115
+ Order = "Order"
116
+ }
package/models/app.js CHANGED
@@ -52,3 +52,7 @@ export var AptlyAppInjectionType;
52
52
  (function (AptlyAppInjectionType) {
53
53
  AptlyAppInjectionType["Iframe"] = "iframe";
54
54
  })(AptlyAppInjectionType || (AptlyAppInjectionType = {}));
55
+ export var AptlyAppActionModel;
56
+ (function (AptlyAppActionModel) {
57
+ AptlyAppActionModel["Order"] = "Order";
58
+ })(AptlyAppActionModel || (AptlyAppActionModel = {}));
@@ -0,0 +1,8 @@
1
+ import { AptlyBaseSchema } from './extends.js';
2
+ import { AptlyOrganizationSchema } from './organization.js';
3
+ import { AptlyProjectSchema } from './project.js';
4
+ export type AptlyCategory = AptlyCategorySchema<string, string>;
5
+ export interface AptlyCategorySchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
6
+ organization: ID | null | AptlyOrganizationSchema<ID, DATE>;
7
+ project: ID | null | AptlyProjectSchema<ID, DATE>;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
package/models/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './media.js';
11
11
  export * from './module.js';
12
12
  export * from './note.js';
13
13
  export * from './notification-trigger.js';
14
+ export * from './option.js';
14
15
  export * from './option-label.js';
15
16
  export * from './order.js';
16
17
  export * from './organization.js';
@@ -18,12 +19,14 @@ export * from './page.js';
18
19
  export * from './payment.js';
19
20
  export * from './payment-settlement.js';
20
21
  export * from './period.js';
22
+ export * from './pick.js';
21
23
  export * from './producer.js';
22
24
  export * from './product.js';
23
25
  export * from './product-stats.js';
24
26
  export * from './project.js';
25
27
  export * from './queue-download.js';
26
28
  export * from './recommendation.js';
29
+ export * from './category.js';
27
30
  export * from './supplier.js';
28
31
  export * from './tag.js';
29
32
  export * from './unit.js';
package/models/index.js CHANGED
@@ -11,6 +11,7 @@ export * from './media.js';
11
11
  export * from './module.js';
12
12
  export * from './note.js';
13
13
  export * from './notification-trigger.js';
14
+ export * from './option.js';
14
15
  export * from './option-label.js';
15
16
  export * from './order.js';
16
17
  export * from './organization.js';
@@ -18,12 +19,14 @@ export * from './page.js';
18
19
  export * from './payment.js';
19
20
  export * from './payment-settlement.js';
20
21
  export * from './period.js';
22
+ export * from './pick.js';
21
23
  export * from './producer.js';
22
24
  export * from './product.js';
23
25
  export * from './product-stats.js';
24
26
  export * from './project.js';
25
27
  export * from './queue-download.js';
26
28
  export * from './recommendation.js';
29
+ export * from './category.js';
27
30
  export * from './supplier.js';
28
31
  export * from './tag.js';
29
32
  export * from './unit.js';
@@ -0,0 +1,43 @@
1
+ import { AptlyCurrency, AptlyVatCategoryCode, AptlyQuantityUnitCode } from '../enums/index.js';
2
+ import { AptlyAlgorithmPipelineData } from './algorithm.js';
3
+ import { AptlyBaseSchema } from './extends.js';
4
+ import { AptlyOrganizationSchema } from './organization.js';
5
+ import { AptlyPeriodSchema } from './period.js';
6
+ import { AptlyProductSchema } from './product.js';
7
+ import { AptlyProjectSchema } from './project.js';
8
+ import { AptlyCategorySchema } from './category.js';
9
+ import { AptlyUnitSchema } from './unit.js';
10
+ export type AptlyOption = AptlyOptionSchema<string, string>;
11
+ export interface AptlyOptionSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE> {
12
+ organization: ID | AptlyOrganizationSchema<ID, DATE>;
13
+ project: ID | AptlyProjectSchema<ID, DATE>;
14
+ unit: ID | AptlyUnitSchema<ID, DATE> | null;
15
+ product?: ID | AptlyProductSchema<ID, DATE> | null;
16
+ period?: ID | AptlyPeriodSchema<ID, DATE> | null;
17
+ algorithm?: ID | null;
18
+ description: string;
19
+ identification: string;
20
+ quantity: number;
21
+ quantityUnitCode: AptlyQuantityUnitCode;
22
+ quantityCategory: ID | AptlyCategorySchema<ID, DATE> | null;
23
+ quantityCategoryKey?: string;
24
+ amount: number;
25
+ amountCategory: ID | AptlyCategorySchema<ID, DATE> | null;
26
+ amountCategoryKey?: string;
27
+ currency: AptlyCurrency;
28
+ vatCategory: AptlyVatCategoryCode;
29
+ }
30
+ export type AptlyOptionPopulated = AptlyOptionPopulatedSchema<string, string>;
31
+ export interface AptlyOptionPopulatedSchema<ID, DATE> extends Omit<AptlyOptionSchema<ID, DATE>, 'product'> {
32
+ price: AptlyOptionPopulatedPrice;
33
+ quantityCategory: AptlyCategorySchema<ID, DATE> | null;
34
+ amountCategory: AptlyCategorySchema<ID, DATE> | null;
35
+ period?: AptlyPeriodSchema<ID, DATE> | null;
36
+ product?: AptlyProductSchema<ID, DATE> | null;
37
+ }
38
+ export interface AptlyOptionPopulatedPrice {
39
+ amount: number;
40
+ vat: number;
41
+ vatAmount: number;
42
+ pipeline: AptlyAlgorithmPipelineData[];
43
+ }
@@ -0,0 +1 @@
1
+ export {};
package/models/order.d.ts CHANGED
@@ -7,7 +7,7 @@ import { AptlyPaymentSchema } from './payment.js';
7
7
  import { AptlyProductSchema } from './product.js';
8
8
  import { AptlyProject, AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.js';
9
9
  import { AptlyUnit, AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit.js';
10
- import { AptlyBaseSchema } from './extends.js';
10
+ import { AptlyAddress, AptlyBaseSchema } from './extends.js';
11
11
  import { AptlyUser, AptlyUserSchema } from './user.js';
12
12
  export declare enum AptlyOrderPaymentStatus {
13
13
  Pending = "PENDING",
@@ -29,8 +29,14 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
29
29
  attachments: ID[];
30
30
  signage: AptlyOrderSignageSchema<ID, DATE>;
31
31
  items: AptlyOrderItemSchema<ID, DATE>[];
32
- totalCost: number;
32
+ picks: ID[];
33
+ amount?: number;
34
+ vatAmount?: number;
33
35
  totalVat?: number;
36
+ totalCost: number;
37
+ customer?: AptlyOrderCustomerSchema<ID, DATE>;
38
+ shipping?: AptlyAddress;
39
+ billing?: AptlyAddress;
34
40
  pricePipeline: AptlyOrderPricePipelineItemSchema<ID>[];
35
41
  signees?: AptlyOrderSigneeSchema<ID, DATE>[];
36
42
  signedAt?: DATE | null;
@@ -165,3 +171,11 @@ export interface AptlyOrderActionSignDataSignee {
165
171
  signMethod?: string;
166
172
  isAdmin?: boolean;
167
173
  }
174
+ export type AptlyOrderCustomer = AptlyOrderCustomerSchema<string, string>;
175
+ export interface AptlyOrderCustomerSchema<ID, DATE> {
176
+ user: ID | AptlyUserSchema<ID, DATE>;
177
+ firstName: string;
178
+ lastName: string;
179
+ email: string;
180
+ phone?: string;
181
+ }
@@ -0,0 +1,52 @@
1
+ import { AptlyCurrency, AptlyInternationalCodeDesignator, AptlyQuantityUnitCode, AptlyTaxCategoryScheme, AptlyVatCategoryCode } from '../enums/index.js';
2
+ import { AptlyBaseSchema } from './extends.js';
3
+ import { AptlyOptionSchema } from './option.js';
4
+ import { AptlyOrganizationSchema } from './organization.js';
5
+ import { AptlyProjectSchema } from './project.js';
6
+ import { AptlyCategorySchema } from './category.js';
7
+ import { AptlyUnitSchema } from './unit.js';
8
+ export interface AptlyPickSchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE>, '_id' | 'createdAt' | 'updatedAt'> {
9
+ organization: ID | AptlyOrganizationSchema<ID, DATE>;
10
+ project: ID | AptlyProjectSchema<ID, DATE>;
11
+ unit: ID | AptlyUnitSchema<ID, DATE>;
12
+ option: ID | AptlyOptionSchema<ID, DATE>;
13
+ category: ID | AptlyCategorySchema<ID, DATE> | null;
14
+ period?: ID | null;
15
+ quantity: number;
16
+ note: string;
17
+ item: AptlyPickItem | null;
18
+ price: AptlyPickPrice | null;
19
+ confirmedAt: DATE | null;
20
+ }
21
+ export interface AptlyPickConfirmedSchema<ID, DATE> extends AptlyPickSchema<ID, DATE> {
22
+ item: AptlyPickItem;
23
+ price: AptlyPickPrice;
24
+ confirmedAt: DATE;
25
+ }
26
+ export interface AptlyPickItem {
27
+ name: string;
28
+ description: string;
29
+ sellersIdentification?: string;
30
+ standardIdentification?: {
31
+ scheme: AptlyInternationalCodeDesignator;
32
+ value: string;
33
+ };
34
+ vatCategory: {
35
+ id: AptlyVatCategoryCode;
36
+ percent: number;
37
+ taxScheme: AptlyTaxCategoryScheme;
38
+ };
39
+ properties: AptlyPickItemProperty[];
40
+ }
41
+ interface AptlyPickItemProperty {
42
+ name: string;
43
+ value: string;
44
+ }
45
+ interface AptlyPickPrice {
46
+ quantity: number;
47
+ quantityUnitCode: AptlyQuantityUnitCode;
48
+ amount: number;
49
+ vatAmount: number;
50
+ currency: AptlyCurrency;
51
+ }
52
+ export {};
package/models/pick.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -34,6 +34,7 @@ export interface AptlyUnitTemplateCategorySchema<ID, DATE> {
34
34
  name: string;
35
35
  text?: string;
36
36
  isRoom: boolean;
37
+ category?: ID;
37
38
  size?: number;
38
39
  upsellTemplate?: AptlyUpsellTemplateSchema<ID, DATE> | ID | null;
39
40
  _order_sections: ID[];
package/models/unit.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AptlyCategorySchema } from './category.js';
1
2
  import { AptlyDocumentSchema } from './document.js';
2
3
  import { AptlyOrderSchema } from './order.js';
3
4
  import { AptlyPeriodSchema } from './period.js';
@@ -15,7 +16,7 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
15
16
  vat?: string;
16
17
  shipping?: AptlyAddress;
17
18
  billing?: AptlyAddress;
18
- rooms: AptlyUnitRoomSchema<ID>[];
19
+ rooms: AptlyUnitRoomSchema<ID, DATE>[];
19
20
  selectedOptions: AptlyUnitSelectedOptionSchema<ID, DATE>[];
20
21
  items: AptlyUnitOptionItemSchema<ID, DATE>[];
21
22
  revertedOptions?: AptlyUnitOptionItemSchema<ID, DATE>[];
@@ -133,9 +134,10 @@ export interface AptlyUnitItemParamSchema<ID, VALUE = any> {
133
134
  value: VALUE;
134
135
  downloadToken?: string;
135
136
  }
136
- export type AptlyUnitRoom = AptlyUnitRoomSchema<string>;
137
- export interface AptlyUnitRoomSchema<ID> {
137
+ export type AptlyUnitRoom = AptlyUnitRoomSchema<string, string>;
138
+ export interface AptlyUnitRoomSchema<ID, DATE> {
138
139
  _id: ID;
140
+ category?: ID | AptlyCategorySchema<ID, DATE> | null;
139
141
  name: string;
140
142
  sizeParams: AptlyUnitRoomSchemaSizeParamSchema<ID>[];
141
143
  }
@@ -17,7 +17,9 @@ export interface AptlyWebhookEventSchema<ID, DATE, DATA = unknown> extends Omit<
17
17
  organization: ID;
18
18
  project?: ID;
19
19
  unit?: ID;
20
+ order?: ID;
20
21
  app?: ID;
22
+ appWebhook?: ID;
21
23
  status: AptlyWebhookEventStatus;
22
24
  url: string;
23
25
  headers: AptlyWebhookEventHeaders;
@@ -4,6 +4,7 @@ export interface AptlyWebhookSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>
4
4
  organization: ID;
5
5
  user?: ID;
6
6
  app?: ID;
7
+ appWebhook?: ID;
7
8
  project?: ID;
8
9
  status: AptlyWebhookStatus;
9
10
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "2.8.3",
3
+ "version": "2.9.1",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",