@aptly-as/types 2.1.10 → 2.2.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
@@ -10,6 +10,7 @@ export declare enum AptlyModules {
10
10
  Recommendations = "recommendations",
11
11
  Subcontractor = "subcontractor",
12
12
  ThirdParty = "thirdParty",
13
+ Sign = "sign",
13
14
  Support = "support",
14
15
  SupportComplaint = "supportComplaint",
15
16
  Testing = "testing",
@@ -70,6 +71,7 @@ export declare enum AptlyScopes {
70
71
  ProjectUnitInvites = "projectUnitInvites",
71
72
  ProjectUnitExtraFields = "projectUnitExtraFields",
72
73
  ProjectUnitExtraOptions = "projectUnitExtraOptions",
74
+ ProjectUnitDocuments = "projectUnitDocuments",
73
75
  ProjectUnitTemplates = "projectUnitTemplates",
74
76
  ProjectUnitTemplatesAlgorithms = "projectUnitTemplatesAlgorithms",
75
77
  ProjectUnitTemplatesPrices = "projectUnitTemplatesPrices",
package/core/scope.js CHANGED
@@ -11,6 +11,7 @@ export var AptlyModules;
11
11
  AptlyModules["Recommendations"] = "recommendations";
12
12
  AptlyModules["Subcontractor"] = "subcontractor";
13
13
  AptlyModules["ThirdParty"] = "thirdParty";
14
+ AptlyModules["Sign"] = "sign";
14
15
  AptlyModules["Support"] = "support";
15
16
  AptlyModules["SupportComplaint"] = "supportComplaint";
16
17
  AptlyModules["Testing"] = "testing";
@@ -72,6 +73,7 @@ export var AptlyScopes;
72
73
  AptlyScopes["ProjectUnitInvites"] = "projectUnitInvites";
73
74
  AptlyScopes["ProjectUnitExtraFields"] = "projectUnitExtraFields";
74
75
  AptlyScopes["ProjectUnitExtraOptions"] = "projectUnitExtraOptions";
76
+ AptlyScopes["ProjectUnitDocuments"] = "projectUnitDocuments";
75
77
  AptlyScopes["ProjectUnitTemplates"] = "projectUnitTemplates";
76
78
  AptlyScopes["ProjectUnitTemplatesAlgorithms"] = "projectUnitTemplatesAlgorithms";
77
79
  AptlyScopes["ProjectUnitTemplatesPrices"] = "projectUnitTemplatesPrices";
package/enums/index.d.ts CHANGED
@@ -3,12 +3,14 @@ export * from './fields.js';
3
3
  export * from './unit-template.js';
4
4
  export * from './webhook.js';
5
5
  export declare enum AptlyOrderStatus {
6
+ New = "new",
6
7
  NotSigned = "notSigned",
7
8
  ReadyToSign = "readyToSign",
8
9
  SignedByCustomer = "signedByCustomer",
9
10
  SignedByOrganization = "signedByOrganization",
10
11
  Signed = "signed",
11
12
  FileReceived = "fileReceived",
13
+ Completed = "completed",
12
14
  AllPeriodsSigned = "allPeriodsSigned",
13
15
  Invalid = "invalid"
14
16
  }
package/enums/index.js CHANGED
@@ -4,12 +4,14 @@ export * from './unit-template.js';
4
4
  export * from './webhook.js';
5
5
  export var AptlyOrderStatus;
6
6
  (function (AptlyOrderStatus) {
7
+ AptlyOrderStatus["New"] = "new";
7
8
  AptlyOrderStatus["NotSigned"] = "notSigned";
8
9
  AptlyOrderStatus["ReadyToSign"] = "readyToSign";
9
10
  AptlyOrderStatus["SignedByCustomer"] = "signedByCustomer";
10
11
  AptlyOrderStatus["SignedByOrganization"] = "signedByOrganization";
11
12
  AptlyOrderStatus["Signed"] = "signed";
12
13
  AptlyOrderStatus["FileReceived"] = "fileReceived";
14
+ AptlyOrderStatus["Completed"] = "completed";
13
15
  AptlyOrderStatus["AllPeriodsSigned"] = "allPeriodsSigned";
14
16
  AptlyOrderStatus["Invalid"] = "invalid";
15
17
  })(AptlyOrderStatus || (AptlyOrderStatus = {}));
package/models/app.d.ts CHANGED
@@ -14,8 +14,18 @@ export interface AptlyAppSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>
14
14
  banner?: AptlyMediaSrcSchema<ID, DATE> | null;
15
15
  settings: AptlyAppSettingSchema<ID>[];
16
16
  webhooks: AptlyAppWebhookSchema<ID>[];
17
- proxies: AptlyAppProxySchema<ID>[];
18
17
  menus: AptlyAppMenuSchema<ID, DATE>[];
18
+ implements: AptlyAppImplementation[];
19
+ sign?: {
20
+ costPer?: number;
21
+ order: string;
22
+ };
23
+ }
24
+ export declare enum AptlyAppImplementation {
25
+ Sign = "sign"
26
+ }
27
+ export declare enum AptlyAppImplementationSetting {
28
+ SignCostPer = "costPerSign"
19
29
  }
20
30
  export type AptlyAppSetting = AptlyAppSettingSchema<string>;
21
31
  export interface AptlyAppSettingSchema<ID> extends AptlyField {
@@ -67,8 +77,3 @@ export interface AptlyAppMenuSchema<ID, DATE> {
67
77
  src: string;
68
78
  sandbox: AptlyAppSandbox[];
69
79
  }
70
- export interface AptlyAppProxySchema<ID> {
71
- _id: ID;
72
- path: string;
73
- url: string;
74
- }
package/models/app.js CHANGED
@@ -1,3 +1,11 @@
1
+ export var AptlyAppImplementation;
2
+ (function (AptlyAppImplementation) {
3
+ AptlyAppImplementation["Sign"] = "sign";
4
+ })(AptlyAppImplementation || (AptlyAppImplementation = {}));
5
+ export var AptlyAppImplementationSetting;
6
+ (function (AptlyAppImplementationSetting) {
7
+ AptlyAppImplementationSetting["SignCostPer"] = "costPerSign";
8
+ })(AptlyAppImplementationSetting || (AptlyAppImplementationSetting = {}));
1
9
  export var AptlyOrganizationInjection;
2
10
  (function (AptlyOrganizationInjection) {
3
11
  AptlyOrganizationInjection["Base"] = "";
package/models/order.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { AptlyOrderStatus } from '../enums/index.js';
2
+ import { AptlyAppSchema } from './app.js';
3
+ import { AptlyDocumentSchema } from './document.js';
2
4
  import { AptlyOrganizationSchema } from './organization.js';
3
5
  import { AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.js';
4
- import { AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit.js';
6
+ import { AptlyUnit, AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit.js';
5
7
  import { AptlyBaseSchema } from './extends.js';
6
- import { AptlyUserSchema } from './user.js';
8
+ import { AptlyUser, AptlyUserSchema } from './user.js';
7
9
  export type AptlyOrder = AptlyOrderSchema<string, string>;
8
10
  export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
9
11
  orderNumber: string;
@@ -13,14 +15,28 @@ export interface AptlyOrderSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DAT
13
15
  unit: ID | AptlyUnitSchema<ID, DATE>;
14
16
  signers: (ID | AptlyUserSchema<ID, DATE>)[];
15
17
  status: AptlyOrderStatus;
16
- receipt: ID;
18
+ receipt: ID | AptlyDocumentSchema<ID, DATE>;
19
+ signedReceipt?: ID;
17
20
  attachments: ID[];
18
21
  signage: AptlyOrderSignageSchema<ID, DATE>;
19
22
  items: AptlyOrderItemSchema<ID, DATE>[];
20
23
  totalCost: number;
21
24
  pricePipeline: AptlyOrderPricePipelineItemSchema<ID>[];
25
+ signees: AptlyOrderSigneeSchema<ID, DATE>[];
22
26
  created: DATE;
23
27
  }
28
+ export type AptlyOrderSignee = AptlyOrderSigneeSchema<string, string>;
29
+ export interface AptlyOrderSigneeSchema<ID, DATE> {
30
+ _id: ID;
31
+ user: ID;
32
+ type: AptlyOrderSigneeType;
33
+ url: string;
34
+ signedAt?: DATE;
35
+ }
36
+ export declare enum AptlyOrderSigneeType {
37
+ Unit = 0,
38
+ Admin = 1
39
+ }
24
40
  export type AptlyOrderPricePipelineItem = AptlyOrderPricePipelineItemSchema<string>;
25
41
  export interface AptlyOrderPricePipelineItemSchema<ID> {
26
42
  _id: ID;
@@ -32,7 +48,7 @@ export interface AptlyOrderSignageSchema<ID, DATE> {
32
48
  hasReceivedFile: boolean;
33
49
  signed: boolean;
34
50
  documentId?: ID;
35
- signedFile?: ID;
51
+ signedFile?: ID | AptlyDocumentSchema<ID, DATE>;
36
52
  documentCreationDate?: DATE;
37
53
  expireDate?: DATE;
38
54
  customerSignerId?: string;
@@ -58,3 +74,22 @@ export interface AptlyOrderItemPricePipelineSchema<ID> {
58
74
  label: string;
59
75
  value: number;
60
76
  }
77
+ export declare enum AptlyOrderAction {
78
+ Complete = "complete",
79
+ SignManually = "sign-manually",
80
+ Sign = "sign"
81
+ }
82
+ export type AptlyOrderActionItem = AptlyOrderActionItemSchema<string, string>;
83
+ export interface AptlyOrderActionItemSchema<ID, DATE> {
84
+ action: AptlyOrderAction;
85
+ path: string;
86
+ app?: Pick<AptlyAppSchema<ID, DATE>, '_id' | 'name' | 'sign'>;
87
+ costPerSign?: number;
88
+ }
89
+ export interface AptlyOrderActionSignData {
90
+ project: string;
91
+ unit: Pick<AptlyUnit, '_id' | 'name'>;
92
+ order: Pick<AptlyOrder, '_id' | 'orderNumber' | 'receipt'>;
93
+ users: Pick<AptlyUser, '_id' | 'firstName' | 'lastName' | 'fullName' | 'email' | 'phone'>[];
94
+ admins: Pick<AptlyUser, '_id' | 'firstName' | 'lastName' | 'fullName' | 'email' | 'phone'>[];
95
+ }
package/models/order.js CHANGED
@@ -1 +1,11 @@
1
- export {};
1
+ export var AptlyOrderSigneeType;
2
+ (function (AptlyOrderSigneeType) {
3
+ AptlyOrderSigneeType[AptlyOrderSigneeType["Unit"] = 0] = "Unit";
4
+ AptlyOrderSigneeType[AptlyOrderSigneeType["Admin"] = 1] = "Admin";
5
+ })(AptlyOrderSigneeType || (AptlyOrderSigneeType = {}));
6
+ export var AptlyOrderAction;
7
+ (function (AptlyOrderAction) {
8
+ AptlyOrderAction["Complete"] = "complete";
9
+ AptlyOrderAction["SignManually"] = "sign-manually";
10
+ AptlyOrderAction["Sign"] = "sign";
11
+ })(AptlyOrderAction || (AptlyOrderAction = {}));
@@ -11,6 +11,7 @@ import { AptlyAlgorithmSchema } from './algorithm.js';
11
11
  export type AptlyOrganization = AptlyOrganizationSchema<string, string>;
12
12
  export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
13
13
  slug: string;
14
+ number?: string;
14
15
  logo?: string | null;
15
16
  logoMedia?: AptlyMediaSrc | null;
16
17
  negativeLogoMedia?: AptlyMediaSrc | null;
package/models/unit.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AptlyOrderSchema } from './order.js';
1
2
  import { AptlyProducerSchema } from './producer.js';
2
3
  import { AptlyProductSchema } from './product.js';
3
4
  import { AptlyProjectSchema } from './project.js';
@@ -30,7 +31,7 @@ export interface AptlyUnitSchema<ID, DATE> extends AptlyUnitTemplateBaseSchema<I
30
31
  project: AptlyProjectSchema<ID, DATE> | ID;
31
32
  users: (AptlyUserSchema<ID, DATE> | ID)[];
32
33
  unitTemplate: ID | AptlyUnitTemplateSchema<ID, DATE>;
33
- confirmedPeriods: AptlyUnitConfirmedPeriodSchema<ID>[];
34
+ confirmedPeriods: AptlyUnitConfirmedPeriodSchema<ID, DATE>[];
34
35
  queueInvites: string[];
35
36
  invites: AptlyUnitInviteSchema<ID, DATE>[];
36
37
  overridePeriod?: ID;
@@ -169,11 +170,11 @@ export interface AptlyUnitSpec {
169
170
  }[];
170
171
  }[];
171
172
  }
172
- export type AptlyUnitConfirmedPeriod = AptlyUnitConfirmedPeriodSchema<string>;
173
- export interface AptlyUnitConfirmedPeriodSchema<ID> {
173
+ export type AptlyUnitConfirmedPeriod = AptlyUnitConfirmedPeriodSchema<string, string>;
174
+ export interface AptlyUnitConfirmedPeriodSchema<ID, DATE> {
174
175
  _id: ID;
175
176
  period: ID;
176
- order: ID;
177
+ order?: ID | AptlyOrderSchema<ID, DATE>;
177
178
  }
178
179
  export type AptlyUnitIntegration = AptlyUnitIntegrationSchema<string>;
179
180
  export interface AptlyUnitIntegrationSchema<ID> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "2.1.10",
3
+ "version": "2.2.0",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",