@aptly-as/types 2.2.2 → 2.2.3

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/job.d.ts CHANGED
@@ -14,6 +14,7 @@ export interface AptlyJob<DATA = any, RETURN = any> {
14
14
  progress: number;
15
15
  data: DATA;
16
16
  returnvalue: RETURN;
17
+ failedReason?: string;
17
18
  }
18
19
  export type AptlyJobOrder = AptlyJob<any, {
19
20
  order: AptlyOrder;
package/models/app.d.ts CHANGED
@@ -17,15 +17,19 @@ export interface AptlyAppSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>
17
17
  menus: AptlyAppMenuSchema<ID, DATE>[];
18
18
  implements: AptlyAppImplementation[];
19
19
  sign?: {
20
- costPer?: number;
21
- order: string;
20
+ orderUrl: string;
22
21
  };
23
22
  }
23
+ export interface AptlyAppSignMethod {
24
+ value: string;
25
+ label: string;
26
+ }
24
27
  export declare enum AptlyAppImplementation {
25
28
  Sign = "sign"
26
29
  }
27
30
  export declare enum AptlyAppImplementationSetting {
28
- SignCostPer = "costPerSign"
31
+ SignCostPer = "costPerSign",
32
+ SignMethod = "signMethod"
29
33
  }
30
34
  export type AptlyAppSetting = AptlyAppSettingSchema<string>;
31
35
  export interface AptlyAppSettingSchema<ID> extends AptlyField {
package/models/app.js CHANGED
@@ -5,6 +5,7 @@ export var AptlyAppImplementation;
5
5
  export var AptlyAppImplementationSetting;
6
6
  (function (AptlyAppImplementationSetting) {
7
7
  AptlyAppImplementationSetting["SignCostPer"] = "costPerSign";
8
+ AptlyAppImplementationSetting["SignMethod"] = "signMethod";
8
9
  })(AptlyAppImplementationSetting || (AptlyAppImplementationSetting = {}));
9
10
  export var AptlyOrganizationInjection;
10
11
  (function (AptlyOrganizationInjection) {
package/models/order.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AptlyOrderStatus } from '../enums/index.js';
2
- import { AptlyAppSchema } from './app.js';
2
+ import { AptlyAppImplementationSetting, AptlyAppSchema } from './app.js';
3
3
  import { AptlyDocumentSchema } from './document.js';
4
- import { AptlyOrganizationSchema } from './organization.js';
4
+ import { AptlyOrganizationAppConfigSchema, AptlyOrganizationSchema } from './organization.js';
5
5
  import { AptlyProject, AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.js';
6
6
  import { AptlyUnit, AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit.js';
7
7
  import { AptlyBaseSchema } from './extends.js';
@@ -11,7 +11,7 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
11
11
  orderNumber: string;
12
12
  organization: ID | AptlyOrganizationSchema<ID, DATE>;
13
13
  project: ID | AptlyProjectSchema<ID, DATE>;
14
- period: ID | AptlyProjectPeriodSchema<ID, DATE>;
14
+ period?: ID | AptlyProjectPeriodSchema<ID, DATE>;
15
15
  unit: ID | AptlyUnitSchema<ID, DATE>;
16
16
  signers: (ID | AptlyUserSchema<ID, DATE>)[];
17
17
  status: AptlyOrderStatus;
@@ -24,12 +24,17 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
24
24
  pricePipeline: AptlyOrderPricePipelineItemSchema<ID>[];
25
25
  signees: AptlyOrderSigneeSchema<ID, DATE>[];
26
26
  emailText?: string;
27
+ approved?: {
28
+ action?: AptlyOrderAction;
29
+ user?: ID | AptlyUserSchema<ID, DATE>;
30
+ at?: DATE;
31
+ };
27
32
  created: DATE;
28
33
  }
29
34
  export type AptlyOrderSignee = AptlyOrderSigneeSchema<string, string>;
30
35
  export interface AptlyOrderSigneeSchema<ID, DATE> {
31
36
  _id: ID;
32
- user: ID;
37
+ user: ID | AptlyUserSchema<ID, DATE>;
33
38
  type: AptlyOrderSigneeType;
34
39
  url: string;
35
40
  signedAt?: DATE;
@@ -80,12 +85,30 @@ export declare enum AptlyOrderAction {
80
85
  SignManually = "sign-manually",
81
86
  Sign = "sign"
82
87
  }
83
- export type AptlyOrderActionItem = AptlyOrderActionItemSchema<string, string>;
84
- export interface AptlyOrderActionItemSchema<ID, DATE> {
88
+ export interface AptlyOrderActionPostBody {
89
+ action: AptlyOrderAction | null;
90
+ document?: string | null;
91
+ app?: string;
92
+ emailSubject: string;
93
+ emailText: string;
94
+ users: AptlyOrderActionPostBodyUser[];
95
+ deadlineInDays?: number;
96
+ }
97
+ export interface AptlyOrderActionPostBodyUser {
98
+ user: string;
99
+ signMethod?: string;
100
+ isAdmin?: boolean;
101
+ }
102
+ export type AptlyOrderActionItem<S extends object = object> = AptlyOrderActionItemSchema<string, string, S>;
103
+ export interface AptlyOrderActionItemSchema<ID, DATE, S extends object> {
85
104
  action: AptlyOrderAction;
86
105
  path: string;
87
- app?: Pick<AptlyAppSchema<ID, DATE>, '_id' | 'name' | 'sign'>;
88
- costPerSign?: number;
106
+ app?: Pick<AptlyAppSchema<ID, DATE>, '_id' | 'name' | 'sign' | 'logo' | 'settings'>;
107
+ appSettings?: AptlyOrganizationAppConfigSchema<ID, DATE, S>['settings'];
108
+ }
109
+ export interface AptlyOrderActionItemSignSettings {
110
+ [AptlyAppImplementationSetting.SignCostPer]: number;
111
+ [AptlyAppImplementationSetting.SignMethod]: string;
89
112
  }
90
113
  export interface AptlyOrderActionSignData {
91
114
  project: Pick<AptlyProject, '_id' | 'name'> & {
@@ -93,7 +116,11 @@ export interface AptlyOrderActionSignData {
93
116
  };
94
117
  unit: Pick<AptlyUnit, '_id' | 'name'>;
95
118
  order: Pick<AptlyOrder, '_id' | 'orderNumber' | 'receipt' | 'period'>;
96
- users: Pick<AptlyUser, '_id' | 'firstName' | 'lastName' | 'fullName' | 'email' | 'phone' | 'language' | 'profileImage'>[];
97
- admins: Pick<AptlyUser, '_id' | 'firstName' | 'lastName' | 'fullName' | 'email' | 'phone' | 'language' | 'profileImage'>[];
98
- emailText?: string;
119
+ signees: AptlyorderActionSignDataSignee[];
120
+ deadlineInDays?: number;
121
+ }
122
+ export interface AptlyorderActionSignDataSignee {
123
+ user: AptlyUser;
124
+ signMethod?: string;
125
+ isAdmin?: boolean;
99
126
  }
package/models/order.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { AptlyAppImplementationSetting } from './app.js';
1
2
  export var AptlyOrderSigneeType;
2
3
  (function (AptlyOrderSigneeType) {
3
4
  AptlyOrderSigneeType[AptlyOrderSigneeType["Unit"] = 0] = "Unit";
@@ -47,9 +47,16 @@ export interface AptlyOrganizationMemberSchema<ID, DATE> {
47
47
  _id: ID;
48
48
  user: AptlyUserSchema<ID, DATE> | ID;
49
49
  permissions: AptlyOrganizationRoles[];
50
+ position?: AptlyOrganizationMemberPosition;
50
51
  projects?: (ID | AptlyProducerSchema<ID, DATE>)[] | null;
51
52
  departments?: (ID | AptlyDepartmentGeneric<ID, DATE>)[] | null;
52
53
  }
54
+ export declare enum AptlyOrganizationMemberPosition {
55
+ Owner = 0,
56
+ Admin = 1,
57
+ Accounting = 2,
58
+ User = 10
59
+ }
53
60
  export type AptlyOrganizationInvite = AptlyOrganizationInviteSchema<string, string>;
54
61
  export interface AptlyOrganizationInviteSchema<ID, DATE> {
55
62
  _id: ID;
@@ -1 +1,7 @@
1
- export {};
1
+ export var AptlyOrganizationMemberPosition;
2
+ (function (AptlyOrganizationMemberPosition) {
3
+ AptlyOrganizationMemberPosition[AptlyOrganizationMemberPosition["Owner"] = 0] = "Owner";
4
+ AptlyOrganizationMemberPosition[AptlyOrganizationMemberPosition["Admin"] = 1] = "Admin";
5
+ AptlyOrganizationMemberPosition[AptlyOrganizationMemberPosition["Accounting"] = 2] = "Accounting";
6
+ AptlyOrganizationMemberPosition[AptlyOrganizationMemberPosition["User"] = 10] = "User";
7
+ })(AptlyOrganizationMemberPosition || (AptlyOrganizationMemberPosition = {}));
@@ -28,5 +28,6 @@ export declare enum AptlyUnitEmailType {
28
28
  BookingCancel = "booking-cancel",
29
29
  OrderCreated = "order-created",
30
30
  OrderSigned = "order-signed",
31
- OrderCompleted = "order-completed"
31
+ OrderCompleted = "order-completed",
32
+ ActionRecipients = "action_recipients"
32
33
  }
@@ -10,4 +10,5 @@ export var AptlyUnitEmailType;
10
10
  AptlyUnitEmailType["OrderCreated"] = "order-created";
11
11
  AptlyUnitEmailType["OrderSigned"] = "order-signed";
12
12
  AptlyUnitEmailType["OrderCompleted"] = "order-completed";
13
+ AptlyUnitEmailType["ActionRecipients"] = "action_recipients";
13
14
  })(AptlyUnitEmailType || (AptlyUnitEmailType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",