@aptly-as/types 2.2.10 → 2.3.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.
@@ -1,9 +1,12 @@
1
1
  export declare enum AptlyRedirectAction {
2
- Sign = "sign"
2
+ Sign = "sign",
3
+ Payment = "payment"
3
4
  }
4
5
  export declare enum AptlyRedirectActionError {
5
6
  SignCancel = "signCancel",
6
- SignError = "signError"
7
+ SignError = "signError",
8
+ Cancel = "cancel",
9
+ Error = "error"
7
10
  }
8
11
  export type AptlyRedirectOptions = {
9
12
  action: AptlyRedirectAction;
package/core/redirect.js CHANGED
@@ -1,9 +1,12 @@
1
1
  export var AptlyRedirectAction;
2
2
  (function (AptlyRedirectAction) {
3
3
  AptlyRedirectAction["Sign"] = "sign";
4
+ AptlyRedirectAction["Payment"] = "payment";
4
5
  })(AptlyRedirectAction || (AptlyRedirectAction = {}));
5
6
  export var AptlyRedirectActionError;
6
7
  (function (AptlyRedirectActionError) {
7
8
  AptlyRedirectActionError["SignCancel"] = "signCancel";
8
9
  AptlyRedirectActionError["SignError"] = "signError";
10
+ AptlyRedirectActionError["Cancel"] = "cancel";
11
+ AptlyRedirectActionError["Error"] = "error";
9
12
  })(AptlyRedirectActionError || (AptlyRedirectActionError = {}));
package/core/scope.d.ts CHANGED
@@ -6,14 +6,15 @@ export declare enum AptlyModules {
6
6
  Departments = "departments",
7
7
  OptionLabels = "optionLabels",
8
8
  Pages = "pages",
9
+ Payment = "payment",
9
10
  ProductsExtended = "productsExtended",
10
11
  Recommendations = "recommendations",
11
12
  Subcontractor = "subcontractor",
12
- ThirdParty = "thirdParty",
13
13
  Sign = "sign",
14
14
  Support = "support",
15
15
  SupportComplaint = "supportComplaint",
16
16
  Testing = "testing",
17
+ ThirdParty = "thirdParty",
17
18
  UnitExtraOptions = "unitExtraOptions",
18
19
  UnitExtraFields = "unitExtraFields"
19
20
  }
@@ -41,6 +42,7 @@ export declare enum AptlyScopes {
41
42
  OrganizationMembers = "organizationMembers",
42
43
  OrganizationOptionLabels = "organizationOptionLabels",
43
44
  OrganizationOrders = "organizationOrders",
45
+ OrganizationPayment = "organizationPayment",
44
46
  OrganizationPages = "organizationPages",
45
47
  OrganizationProducts = "organizationProducts",
46
48
  OrganizationProductsExtended = "organizationProductsExtended",
package/core/scope.js CHANGED
@@ -7,14 +7,15 @@ export var AptlyModules;
7
7
  AptlyModules["Departments"] = "departments";
8
8
  AptlyModules["OptionLabels"] = "optionLabels";
9
9
  AptlyModules["Pages"] = "pages";
10
+ AptlyModules["Payment"] = "payment";
10
11
  AptlyModules["ProductsExtended"] = "productsExtended";
11
12
  AptlyModules["Recommendations"] = "recommendations";
12
13
  AptlyModules["Subcontractor"] = "subcontractor";
13
- AptlyModules["ThirdParty"] = "thirdParty";
14
14
  AptlyModules["Sign"] = "sign";
15
15
  AptlyModules["Support"] = "support";
16
16
  AptlyModules["SupportComplaint"] = "supportComplaint";
17
17
  AptlyModules["Testing"] = "testing";
18
+ AptlyModules["ThirdParty"] = "thirdParty";
18
19
  AptlyModules["UnitExtraOptions"] = "unitExtraOptions";
19
20
  AptlyModules["UnitExtraFields"] = "unitExtraFields";
20
21
  })(AptlyModules || (AptlyModules = {}));
@@ -43,6 +44,7 @@ export var AptlyScopes;
43
44
  AptlyScopes["OrganizationMembers"] = "organizationMembers";
44
45
  AptlyScopes["OrganizationOptionLabels"] = "organizationOptionLabels";
45
46
  AptlyScopes["OrganizationOrders"] = "organizationOrders";
47
+ AptlyScopes["OrganizationPayment"] = "organizationPayment";
46
48
  AptlyScopes["OrganizationPages"] = "organizationPages";
47
49
  AptlyScopes["OrganizationProducts"] = "organizationProducts";
48
50
  AptlyScopes["OrganizationProductsExtended"] = "organizationProductsExtended";
package/enums/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare enum AptlyOrderStatus {
9
9
  SignedByCustomer = "signedByCustomer",
10
10
  SignedByOrganization = "signedByOrganization",
11
11
  Signed = "signed",
12
+ Payment = "payment",
12
13
  FileReceived = "fileReceived",
13
14
  Completed = "completed",
14
15
  AllPeriodsSigned = "allPeriodsSigned",
@@ -110,3 +111,16 @@ export declare enum AptlyProjectStatus {
110
111
  Started = "started",
111
112
  Completed = "completed"
112
113
  }
114
+ export declare enum AptlyOrganizationType {
115
+ Carpenter = "carpenter",
116
+ Contractor = "contractor",
117
+ Electrician = "electrician",
118
+ Plumber = "plumber"
119
+ }
120
+ export declare enum AptlyOrganizationStatus {
121
+ NewBusiness = 0,
122
+ Active = 1,
123
+ Inactive = 2,
124
+ Paused = 3,
125
+ Closed = 4
126
+ }
package/enums/index.js CHANGED
@@ -10,6 +10,7 @@ export var AptlyOrderStatus;
10
10
  AptlyOrderStatus["SignedByCustomer"] = "signedByCustomer";
11
11
  AptlyOrderStatus["SignedByOrganization"] = "signedByOrganization";
12
12
  AptlyOrderStatus["Signed"] = "signed";
13
+ AptlyOrderStatus["Payment"] = "payment";
13
14
  AptlyOrderStatus["FileReceived"] = "fileReceived";
14
15
  AptlyOrderStatus["Completed"] = "completed";
15
16
  AptlyOrderStatus["AllPeriodsSigned"] = "allPeriodsSigned";
@@ -127,3 +128,18 @@ export var AptlyProjectStatus;
127
128
  AptlyProjectStatus["Started"] = "started";
128
129
  AptlyProjectStatus["Completed"] = "completed";
129
130
  })(AptlyProjectStatus || (AptlyProjectStatus = {}));
131
+ export var AptlyOrganizationType;
132
+ (function (AptlyOrganizationType) {
133
+ AptlyOrganizationType["Carpenter"] = "carpenter";
134
+ AptlyOrganizationType["Contractor"] = "contractor";
135
+ AptlyOrganizationType["Electrician"] = "electrician";
136
+ AptlyOrganizationType["Plumber"] = "plumber";
137
+ })(AptlyOrganizationType || (AptlyOrganizationType = {}));
138
+ export var AptlyOrganizationStatus;
139
+ (function (AptlyOrganizationStatus) {
140
+ AptlyOrganizationStatus[AptlyOrganizationStatus["NewBusiness"] = 0] = "NewBusiness";
141
+ AptlyOrganizationStatus[AptlyOrganizationStatus["Active"] = 1] = "Active";
142
+ AptlyOrganizationStatus[AptlyOrganizationStatus["Inactive"] = 2] = "Inactive";
143
+ AptlyOrganizationStatus[AptlyOrganizationStatus["Paused"] = 3] = "Paused";
144
+ AptlyOrganizationStatus[AptlyOrganizationStatus["Closed"] = 4] = "Closed";
145
+ })(AptlyOrganizationStatus || (AptlyOrganizationStatus = {}));
package/models/app.d.ts CHANGED
@@ -15,17 +15,25 @@ 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
+ cost?: number;
18
19
  implements: AptlyAppImplementation[];
19
20
  sign?: {
20
21
  orderUrl: string;
21
22
  };
23
+ payment?: {
24
+ orderUrl: string;
25
+ cancelUrl: string;
26
+ captureUrl: string;
27
+ voidUrl: string;
28
+ };
22
29
  }
23
30
  export interface AptlyAppSignMethod {
24
31
  value: string;
25
32
  label: string;
26
33
  }
27
34
  export declare enum AptlyAppImplementation {
28
- Sign = "sign"
35
+ Sign = "sign",
36
+ Payment = "payment"
29
37
  }
30
38
  export declare enum AptlyAppImplementationSetting {
31
39
  SignCostPer = "costPerSign",
package/models/app.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export var AptlyAppImplementation;
2
2
  (function (AptlyAppImplementation) {
3
3
  AptlyAppImplementation["Sign"] = "sign";
4
+ AptlyAppImplementation["Payment"] = "payment";
4
5
  })(AptlyAppImplementation || (AptlyAppImplementation = {}));
5
6
  export var AptlyAppImplementationSetting;
6
7
  (function (AptlyAppImplementationSetting) {
@@ -5,6 +5,7 @@ export interface AptlyModuleSchema<ID, DATE> {
5
5
  name: string;
6
6
  description: string;
7
7
  featuredWeight: number;
8
+ cost?: number;
8
9
  modules: AptlyModules[];
9
10
  createdAt: DATE;
10
11
  updatedAt: DATE;
package/models/order.d.ts CHANGED
@@ -2,12 +2,18 @@ import { AptlyOrderStatus } from '../enums/index.js';
2
2
  import { AptlyAppImplementationSetting, AptlyAppSchema } from './app.js';
3
3
  import { AptlyDocumentSchema } from './document.js';
4
4
  import { AptlyOrganizationAppConfigSchema, AptlyOrganizationSchema } from './organization.js';
5
+ import { AptlyProductSchema } from './product.js';
5
6
  import { AptlyProject, AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.js';
6
7
  import { AptlyUnit, AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit.js';
7
8
  import { AptlyBaseSchema } from './extends.js';
8
9
  import { AptlyUser, AptlyUserSchema } from './user.js';
10
+ export declare enum AptlyOrderPaymentStatus {
11
+ Pending = "PENDING",
12
+ Authorized = "AUTHORIZED",
13
+ Captured = "CAPTURED"
14
+ }
9
15
  export type AptlyOrder = AptlyOrderSchema<string, string>;
10
- export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
16
+ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name'> {
11
17
  orderNumber: string;
12
18
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
13
19
  project: ID | AptlyProjectSchema<ID, DATE>;
@@ -24,14 +30,31 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
24
30
  totalVat?: number;
25
31
  pricePipeline: AptlyOrderPricePipelineItemSchema<ID>[];
26
32
  signees?: AptlyOrderSigneeSchema<ID, DATE>[];
33
+ signedAt?: DATE | null;
27
34
  emailText?: string;
28
35
  approved?: {
29
36
  action?: AptlyOrderAction;
30
37
  user?: ID | AptlyUserSchema<ID, DATE>;
31
38
  at?: DATE;
32
39
  };
40
+ payment?: AptlyOrderPaymentSchema<DATE> | null;
33
41
  created: DATE;
34
42
  }
43
+ export type AptlyOrderPayment = AptlyOrderPaymentSchema<string>;
44
+ export interface AptlyOrderPaymentSchema<DATE> {
45
+ status: AptlyOrderPaymentStatus;
46
+ sessionId: string;
47
+ sessionAt: DATE | null;
48
+ url: string;
49
+ transactionId?: string;
50
+ transactionAt?: DATE;
51
+ captures: {
52
+ amount: number;
53
+ description?: string;
54
+ }[];
55
+ capturedAmount: number;
56
+ capturedAt?: DATE;
57
+ }
35
58
  export type AptlyOrderSignee = AptlyOrderSigneeSchema<string, string>;
36
59
  export interface AptlyOrderSigneeSchema<ID, DATE> {
37
60
  _id: ID;
@@ -67,7 +90,7 @@ export type AptlyOrderItem = AptlyOrderItemSchema<string, string>;
67
90
  export interface AptlyOrderItemSchema<ID, DATE> {
68
91
  _id: ID;
69
92
  text?: string;
70
- product: ID;
93
+ product: ID | AptlyProductSchema<ID, DATE>;
71
94
  variant: ID;
72
95
  producer: ID;
73
96
  params: AptlyUnitItemParamSchema<ID, DATE>[];
@@ -85,6 +108,7 @@ export interface AptlyOrderItemPricePipelineSchema<ID> {
85
108
  }
86
109
  export declare enum AptlyOrderAction {
87
110
  Complete = "complete",
111
+ Payment = "payment",
88
112
  SignManually = "sign-manually",
89
113
  Sign = "sign"
90
114
  }
package/models/order.js CHANGED
@@ -1,4 +1,10 @@
1
1
  import { AptlyAppImplementationSetting } from './app.js';
2
+ export var AptlyOrderPaymentStatus;
3
+ (function (AptlyOrderPaymentStatus) {
4
+ AptlyOrderPaymentStatus["Pending"] = "PENDING";
5
+ AptlyOrderPaymentStatus["Authorized"] = "AUTHORIZED";
6
+ AptlyOrderPaymentStatus["Captured"] = "CAPTURED";
7
+ })(AptlyOrderPaymentStatus || (AptlyOrderPaymentStatus = {}));
2
8
  export var AptlyOrderSigneeType;
3
9
  (function (AptlyOrderSigneeType) {
4
10
  AptlyOrderSigneeType[AptlyOrderSigneeType["Unit"] = 0] = "Unit";
@@ -7,6 +13,7 @@ export var AptlyOrderSigneeType;
7
13
  export var AptlyOrderAction;
8
14
  (function (AptlyOrderAction) {
9
15
  AptlyOrderAction["Complete"] = "complete";
16
+ AptlyOrderAction["Payment"] = "payment";
10
17
  AptlyOrderAction["SignManually"] = "sign-manually";
11
18
  AptlyOrderAction["Sign"] = "sign";
12
19
  })(AptlyOrderAction || (AptlyOrderAction = {}));
@@ -1,5 +1,6 @@
1
1
  import { AptlyModules } from '../core/index.js';
2
2
  import { AptlyOrganizationRoles, AptlyAppScope, AptlySignageSchema } from '../core/index.js';
3
+ import { AptlyOrganizationStatus, AptlyOrganizationType } from "../enums/index.js";
3
4
  import { AptlyModuleItemSchema } from './module.js';
4
5
  import { AptlyUserSchema } from './user.js';
5
6
  import { AptlyMediaSrc } from './media.js';
@@ -32,6 +33,8 @@ export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, D
32
33
  storageId?: string;
33
34
  producer?: ID | AptlyProducerSchema<ID, DATE> | null;
34
35
  installedModules: AptlyModuleItemSchema<ID, DATE>[];
36
+ status?: AptlyOrganizationStatus;
37
+ type?: AptlyOrganizationType[];
35
38
  created: DATE;
36
39
  fixedVariants?: boolean;
37
40
  }
@@ -65,6 +68,7 @@ export interface AptlyOrganizationInviteSchema<ID, DATE> {
65
68
  permissions?: AptlyOrganizationRoles[];
66
69
  projects?: ID[] | null;
67
70
  departments?: ID[] | null;
71
+ position?: AptlyOrganizationMemberPosition;
68
72
  claim: {
69
73
  email?: string;
70
74
  claimed: boolean;
@@ -1,5 +1,6 @@
1
1
  import { AptlyProjectStatus } from '../enums/index.js';
2
2
  import { AptlyAlgorithm, AptlyAlgorithmPipeline, AptlyAlgorithmPipelineSchema, AptlyAlgorithmSchema } from './algorithm.js';
3
+ import { AptlyAppSchema } from './app.js';
3
4
  import { AptlyOrganizationSchema } from './organization.js';
4
5
  import { AptlyModules } from '../core/index.js';
5
6
  import { AptlyPeriod, AptlyPeriodSchema } from './period.js';
@@ -31,6 +32,7 @@ export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>,
31
32
  developer?: string;
32
33
  field?: string;
33
34
  address?: AptlyAddress;
35
+ paymentApp?: ID | AptlyAppSchema<ID, DATE> | null;
34
36
  created: DATE;
35
37
  }
36
38
  export type AptlyProjectPeriod = AptlyPeriod;
@@ -1,9 +1,9 @@
1
+ import { AptlyBookingSchema } from './booking.js';
2
+ import { AptlyBaseSchema } from './extends.js';
3
+ import { AptlyInquirySchema } from './inquiry.js';
1
4
  import { AptlyOrganizationSchema } from './organization.js';
2
5
  import { AptlyProjectSchema } from './project.js';
3
6
  import { AptlyUnitSchema } from './unit.js';
4
- import { AptlyInquirySchema } from './inquiry.js';
5
- import { AptlyBookingSchema } from './booking.js';
6
- import { AptlyBaseSchema } from './extends.js';
7
7
  export type AptlyUnitEmail = AptlyUnitEmailSchema<string, string>;
8
8
  export interface AptlyUnitEmailSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
9
9
  type: AptlyUnitEmailType;
@@ -88,6 +88,7 @@ export interface AptlyUnitTemplateCategorySectionProductSchema<ID, DATE> {
88
88
  consequenceParam?: string;
89
89
  amount: number;
90
90
  unitCost?: number;
91
+ unitVat?: number;
91
92
  algorithm: ID | AptlyAlgorithmSchema<ID>;
92
93
  standard: boolean;
93
94
  standardVariant?: ID;
package/models/unit.d.ts CHANGED
@@ -95,6 +95,7 @@ export interface AptlyUnitSelectedOptionSchema<ID, DATE> {
95
95
  export type AptlyUnitOptionItem = AptlyUnitOptionItemSchema<string, string>;
96
96
  export interface AptlyUnitOptionItemSchema<ID, DATE> extends AptlyUnitSelectedOptionSchema<ID, DATE> {
97
97
  unitCost: number;
98
+ unitVat?: number;
98
99
  pickRef?: ID;
99
100
  }
100
101
  export type AptlyUnitOptionExtraItem = AptlyUnitOptionExtraItemSchema<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "2.2.10",
3
+ "version": "2.3.1",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",