@aptly-as/types 2.1.11 → 2.2.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/index.d.ts +2 -1
- package/core/index.js +2 -1
- package/core/job.d.ts +20 -0
- package/core/job.js +11 -0
- package/core/redirect.d.ts +14 -0
- package/core/redirect.js +9 -0
- package/core/scope.d.ts +2 -0
- package/core/scope.js +2 -0
- package/enums/index.d.ts +2 -0
- package/enums/index.js +2 -0
- package/error/error.d.ts +28 -0
- package/error/error.js +50 -0
- package/error/index.d.ts +1 -0
- package/error/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/models/app.d.ts +11 -6
- package/models/app.js +8 -0
- package/models/order.d.ts +44 -5
- package/models/order.js +11 -1
- package/models/unit-email.d.ts +2 -1
- package/models/unit-email.js +1 -0
- package/models/unit.d.ts +5 -4
- package/models/user.d.ts +6 -0
- package/models/user.js +6 -1
- package/package.json +1 -1
- package/core/error.d.ts +0 -43
- package/core/error.js +0 -13
- package/core/permission.d.ts +0 -101
- package/core/permission.js +0 -100
package/core/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { AptlyCloudinaryFile } from './cloudinary.js';
|
|
|
3
3
|
export * from './api.js';
|
|
4
4
|
export * from './app.js';
|
|
5
5
|
export * from './cloudinary.js';
|
|
6
|
+
export * from './job.js';
|
|
7
|
+
export * from './redirect.js';
|
|
6
8
|
export * from './scope.js';
|
|
7
|
-
export * from './error.js';
|
|
8
9
|
export * from './fields.js';
|
|
9
10
|
export * from './signage.js';
|
|
10
11
|
export * from './webhook-event-data.js';
|
package/core/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './api.js';
|
|
2
2
|
export * from './app.js';
|
|
3
3
|
export * from './cloudinary.js';
|
|
4
|
+
export * from './job.js';
|
|
5
|
+
export * from './redirect.js';
|
|
4
6
|
export * from './scope.js';
|
|
5
|
-
export * from './error.js';
|
|
6
7
|
export * from './fields.js';
|
|
7
8
|
export * from './signage.js';
|
|
8
9
|
export * from './webhook-event-data.js';
|
package/core/job.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AptlyOrder } from '../models/index.js';
|
|
2
|
+
export declare enum AptlyJobQueue {
|
|
3
|
+
Documents = "documents",
|
|
4
|
+
Orders = "orders",
|
|
5
|
+
Units = "units"
|
|
6
|
+
}
|
|
7
|
+
export declare enum AptlyJobName {
|
|
8
|
+
ZipDocuments = "zip-documents",
|
|
9
|
+
Create = "create"
|
|
10
|
+
}
|
|
11
|
+
export interface AptlyJob<DATA = any, RETURN = any> {
|
|
12
|
+
id: string;
|
|
13
|
+
name: AptlyJobName;
|
|
14
|
+
progress: number;
|
|
15
|
+
data: DATA;
|
|
16
|
+
returnvalue: RETURN;
|
|
17
|
+
}
|
|
18
|
+
export type AptlyJobOrder = AptlyJob<any, {
|
|
19
|
+
order: AptlyOrder;
|
|
20
|
+
}>;
|
package/core/job.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var AptlyJobQueue;
|
|
2
|
+
(function (AptlyJobQueue) {
|
|
3
|
+
AptlyJobQueue["Documents"] = "documents";
|
|
4
|
+
AptlyJobQueue["Orders"] = "orders";
|
|
5
|
+
AptlyJobQueue["Units"] = "units";
|
|
6
|
+
})(AptlyJobQueue || (AptlyJobQueue = {}));
|
|
7
|
+
export var AptlyJobName;
|
|
8
|
+
(function (AptlyJobName) {
|
|
9
|
+
AptlyJobName["ZipDocuments"] = "zip-documents";
|
|
10
|
+
AptlyJobName["Create"] = "create";
|
|
11
|
+
})(AptlyJobName || (AptlyJobName = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum AptlyRedirectAction {
|
|
2
|
+
Sign = "sign"
|
|
3
|
+
}
|
|
4
|
+
export declare enum AptlyRedirectActionError {
|
|
5
|
+
SignCancel = "signCancel",
|
|
6
|
+
SignError = "signError"
|
|
7
|
+
}
|
|
8
|
+
export type AptlyRedirectOptions = {
|
|
9
|
+
action: AptlyRedirectAction;
|
|
10
|
+
error?: AptlyRedirectActionError;
|
|
11
|
+
error_description?: string;
|
|
12
|
+
};
|
|
13
|
+
export type AptlyClientRedirectOptions = Record<'unit', string> & Partial<Record<'period', string>> & AptlyRedirectOptions;
|
|
14
|
+
export type AptlyDashboardRedirectOptions = Record<'organization' | 'project', string> & AptlyRedirectOptions;
|
package/core/redirect.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var AptlyRedirectAction;
|
|
2
|
+
(function (AptlyRedirectAction) {
|
|
3
|
+
AptlyRedirectAction["Sign"] = "sign";
|
|
4
|
+
})(AptlyRedirectAction || (AptlyRedirectAction = {}));
|
|
5
|
+
export var AptlyRedirectActionError;
|
|
6
|
+
(function (AptlyRedirectActionError) {
|
|
7
|
+
AptlyRedirectActionError["SignCancel"] = "signCancel";
|
|
8
|
+
AptlyRedirectActionError["SignError"] = "signError";
|
|
9
|
+
})(AptlyRedirectActionError || (AptlyRedirectActionError = {}));
|
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/error/error.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface AptlyErrorBody {
|
|
2
|
+
name: 'AptlyError';
|
|
3
|
+
status: number;
|
|
4
|
+
title: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
code?: number;
|
|
7
|
+
detail?: string;
|
|
8
|
+
errors?: AptlyErrorBodySimple[];
|
|
9
|
+
link?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export type AptlyErrorBodySimple = Pick<AptlyErrorBody, 'status' | 'title' | 'detail' | 'link'>;
|
|
13
|
+
export declare class AptlyError extends Error {
|
|
14
|
+
readonly data: Omit<AptlyErrorBody, 'name'>;
|
|
15
|
+
readonly error?: Error | undefined;
|
|
16
|
+
readonly name = "AptlyError";
|
|
17
|
+
id: string;
|
|
18
|
+
constructor(data: Omit<AptlyErrorBody, 'name'>, error?: Error | undefined);
|
|
19
|
+
static fromFetchResponse(response: Response): Promise<AptlyError>;
|
|
20
|
+
get status(): number;
|
|
21
|
+
get title(): string;
|
|
22
|
+
get code(): number | undefined;
|
|
23
|
+
get detail(): string | undefined;
|
|
24
|
+
get link(): string | undefined;
|
|
25
|
+
get errors(): AptlyErrorBodySimple[];
|
|
26
|
+
toJSON(): AptlyErrorBody;
|
|
27
|
+
toString(): string;
|
|
28
|
+
}
|
package/error/error.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export class AptlyError extends Error {
|
|
2
|
+
constructor(data, error) {
|
|
3
|
+
super(`${data.status}: ${data.title}`);
|
|
4
|
+
this.data = data;
|
|
5
|
+
this.error = error;
|
|
6
|
+
this.name = 'AptlyError';
|
|
7
|
+
this.id = data.id || '';
|
|
8
|
+
}
|
|
9
|
+
static async fromFetchResponse(response) {
|
|
10
|
+
if (response.headers.get('content-type') !== 'application/json') {
|
|
11
|
+
const body = await response.json();
|
|
12
|
+
if (body.name === AptlyError.name) {
|
|
13
|
+
return new AptlyError(body);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
throw new AptlyError({
|
|
17
|
+
id: 'unknown',
|
|
18
|
+
status: response.status,
|
|
19
|
+
title: response.statusText,
|
|
20
|
+
detail: `Failed to fetch from url: ${response.url}`,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
get status() {
|
|
24
|
+
return this.data.status;
|
|
25
|
+
}
|
|
26
|
+
get title() {
|
|
27
|
+
return this.data.title;
|
|
28
|
+
}
|
|
29
|
+
get code() {
|
|
30
|
+
return this.data.code;
|
|
31
|
+
}
|
|
32
|
+
get detail() {
|
|
33
|
+
return this.data.detail;
|
|
34
|
+
}
|
|
35
|
+
get link() {
|
|
36
|
+
return this.data.link;
|
|
37
|
+
}
|
|
38
|
+
get errors() {
|
|
39
|
+
return this.data.errors || [];
|
|
40
|
+
}
|
|
41
|
+
toJSON() {
|
|
42
|
+
return {
|
|
43
|
+
name: this.name,
|
|
44
|
+
...this.data,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
toString() {
|
|
48
|
+
return this.message;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/error/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './error.js';
|
package/error/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './error.js';
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
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
|
-
import { AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.js';
|
|
4
|
-
import { AptlyUnitItemParamSchema, AptlyUnitSchema } from './unit.js';
|
|
5
|
+
import { AptlyProject, AptlyProjectPeriodSchema, AptlyProjectSchema } from './project.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,29 @@ 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 | AptlyDocumentSchema<ID, DATE>;
|
|
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>[];
|
|
26
|
+
emailText?: string;
|
|
22
27
|
created: DATE;
|
|
23
28
|
}
|
|
29
|
+
export type AptlyOrderSignee = AptlyOrderSigneeSchema<string, string>;
|
|
30
|
+
export interface AptlyOrderSigneeSchema<ID, DATE> {
|
|
31
|
+
_id: ID;
|
|
32
|
+
user: ID;
|
|
33
|
+
type: AptlyOrderSigneeType;
|
|
34
|
+
url: string;
|
|
35
|
+
signedAt?: DATE;
|
|
36
|
+
}
|
|
37
|
+
export declare enum AptlyOrderSigneeType {
|
|
38
|
+
Unit = 0,
|
|
39
|
+
Admin = 1
|
|
40
|
+
}
|
|
24
41
|
export type AptlyOrderPricePipelineItem = AptlyOrderPricePipelineItemSchema<string>;
|
|
25
42
|
export interface AptlyOrderPricePipelineItemSchema<ID> {
|
|
26
43
|
_id: ID;
|
|
@@ -32,7 +49,7 @@ export interface AptlyOrderSignageSchema<ID, DATE> {
|
|
|
32
49
|
hasReceivedFile: boolean;
|
|
33
50
|
signed: boolean;
|
|
34
51
|
documentId?: ID;
|
|
35
|
-
signedFile?: ID
|
|
52
|
+
signedFile?: ID | AptlyDocumentSchema<ID, DATE>;
|
|
36
53
|
documentCreationDate?: DATE;
|
|
37
54
|
expireDate?: DATE;
|
|
38
55
|
customerSignerId?: string;
|
|
@@ -58,3 +75,25 @@ export interface AptlyOrderItemPricePipelineSchema<ID> {
|
|
|
58
75
|
label: string;
|
|
59
76
|
value: number;
|
|
60
77
|
}
|
|
78
|
+
export declare enum AptlyOrderAction {
|
|
79
|
+
Complete = "complete",
|
|
80
|
+
SignManually = "sign-manually",
|
|
81
|
+
Sign = "sign"
|
|
82
|
+
}
|
|
83
|
+
export type AptlyOrderActionItem = AptlyOrderActionItemSchema<string, string>;
|
|
84
|
+
export interface AptlyOrderActionItemSchema<ID, DATE> {
|
|
85
|
+
action: AptlyOrderAction;
|
|
86
|
+
path: string;
|
|
87
|
+
app?: Pick<AptlyAppSchema<ID, DATE>, '_id' | 'name' | 'sign'>;
|
|
88
|
+
costPerSign?: number;
|
|
89
|
+
}
|
|
90
|
+
export interface AptlyOrderActionSignData {
|
|
91
|
+
project: Pick<AptlyProject, '_id' | 'name'> & {
|
|
92
|
+
theme: Pick<AptlyProject['theme'], 'contact'>;
|
|
93
|
+
};
|
|
94
|
+
unit: Pick<AptlyUnit, '_id' | 'name'>;
|
|
95
|
+
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;
|
|
99
|
+
}
|
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 = {}));
|
package/models/unit-email.d.ts
CHANGED
package/models/unit-email.js
CHANGED
|
@@ -9,4 +9,5 @@ export var AptlyUnitEmailType;
|
|
|
9
9
|
AptlyUnitEmailType["BookingCancel"] = "booking-cancel";
|
|
10
10
|
AptlyUnitEmailType["OrderCreated"] = "order-created";
|
|
11
11
|
AptlyUnitEmailType["OrderSigned"] = "order-signed";
|
|
12
|
+
AptlyUnitEmailType["OrderCompleted"] = "order-completed";
|
|
12
13
|
})(AptlyUnitEmailType || (AptlyUnitEmailType = {}));
|
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
|
|
177
|
+
order?: ID | AptlyOrderSchema<ID, DATE>;
|
|
177
178
|
}
|
|
178
179
|
export type AptlyUnitIntegration = AptlyUnitIntegrationSchema<string>;
|
|
179
180
|
export interface AptlyUnitIntegrationSchema<ID> {
|
package/models/user.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { AptlyUserRoles } from '../core/index.js';
|
|
2
2
|
import { AptlyBaseSchema } from './extends.js';
|
|
3
|
+
export declare enum AptlyLanguage {
|
|
4
|
+
English = "en",
|
|
5
|
+
Norwegian = "no",
|
|
6
|
+
NorwegianBokmal = "nb"
|
|
7
|
+
}
|
|
3
8
|
export type AptlyUser = AptlyUserSchema<string, string>;
|
|
4
9
|
export interface AptlyUserSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'archived' | 'name'> {
|
|
5
10
|
email: string;
|
|
@@ -9,6 +14,7 @@ export interface AptlyUserSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE
|
|
|
9
14
|
profileImage: string | null;
|
|
10
15
|
permissions: AptlyUserRoles[];
|
|
11
16
|
roles: AptlyUserRoles[];
|
|
17
|
+
language?: AptlyLanguage;
|
|
12
18
|
gdpr: boolean;
|
|
13
19
|
phone: string;
|
|
14
20
|
synced: DATE;
|
package/models/user.js
CHANGED
package/package.json
CHANGED
package/core/error.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AptlyErrorCode } from '../enums/index.js';
|
|
2
|
-
export type AptlyErrorSimple = Pick<AptlyError, 'status' | 'title' | 'detail' | 'link'>;
|
|
3
|
-
export interface AptlyError {
|
|
4
|
-
id: string;
|
|
5
|
-
status: string;
|
|
6
|
-
code: AptlyErrorCode;
|
|
7
|
-
title: string;
|
|
8
|
-
detail?: string;
|
|
9
|
-
errors?: AptlyErrorSimple[];
|
|
10
|
-
link?: string;
|
|
11
|
-
links?: {
|
|
12
|
-
self?: AptlyErrorLink | string;
|
|
13
|
-
};
|
|
14
|
-
source?: {
|
|
15
|
-
pointer?: string;
|
|
16
|
-
parameter?: string;
|
|
17
|
-
header?: string;
|
|
18
|
-
body?: string;
|
|
19
|
-
};
|
|
20
|
-
meta?: object;
|
|
21
|
-
}
|
|
22
|
-
export interface AptlyErrorLink {
|
|
23
|
-
href: string;
|
|
24
|
-
title?: string;
|
|
25
|
-
describedBy?: string;
|
|
26
|
-
meta: {
|
|
27
|
-
count: number;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export declare class AptlyApiError<R> extends Error {
|
|
31
|
-
readonly id: string;
|
|
32
|
-
readonly status: string;
|
|
33
|
-
readonly detail: string;
|
|
34
|
-
readonly link: string;
|
|
35
|
-
readonly code: AptlyErrorCode;
|
|
36
|
-
readonly error?: Error;
|
|
37
|
-
readonly errors?: AptlyErrorSimple[];
|
|
38
|
-
readonly response?: R;
|
|
39
|
-
constructor(error: AptlyError & {
|
|
40
|
-
error?: Error;
|
|
41
|
-
response?: R;
|
|
42
|
-
});
|
|
43
|
-
}
|
package/core/error.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class AptlyApiError extends Error {
|
|
2
|
-
constructor(error) {
|
|
3
|
-
super(error.title);
|
|
4
|
-
this.id = error.id;
|
|
5
|
-
this.status = error.status;
|
|
6
|
-
this.detail = error.detail || '';
|
|
7
|
-
this.link = error.link || '';
|
|
8
|
-
this.code = error.code;
|
|
9
|
-
this.error = error.error;
|
|
10
|
-
this.errors = error.errors;
|
|
11
|
-
this.response = error.response;
|
|
12
|
-
}
|
|
13
|
-
}
|
package/core/permission.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
export declare enum AptlyModule {
|
|
2
|
-
Algorithms = "algorithms",
|
|
3
|
-
Booking = "booking",
|
|
4
|
-
Core = "core",
|
|
5
|
-
Default = "default",
|
|
6
|
-
Departments = "departments",
|
|
7
|
-
OptionLabels = "optionLabels",
|
|
8
|
-
Pages = "pages",
|
|
9
|
-
ProductsExtended = "productsExtended",
|
|
10
|
-
Recommendations = "recommendations",
|
|
11
|
-
Subcontractor = "subcontractor",
|
|
12
|
-
Support = "support",
|
|
13
|
-
Testing = "testing",
|
|
14
|
-
UnitExtraOptions = "unitExtraOptions",
|
|
15
|
-
UnitExtraFields = "unitExtraFields"
|
|
16
|
-
}
|
|
17
|
-
export declare enum AptlyScope {
|
|
18
|
-
Admin = "admin",
|
|
19
|
-
AdminBilling = "adminBilling",
|
|
20
|
-
AdminProducers = "adminProducers",
|
|
21
|
-
AdminProducts = "adminProducts",
|
|
22
|
-
AdminReport = "adminReport",
|
|
23
|
-
AdminStats = "adminStats",
|
|
24
|
-
AdminSuppliers = "adminSuppliers",
|
|
25
|
-
AdminTags = "adminTags",
|
|
26
|
-
AdminTesting = "adminTesting",
|
|
27
|
-
AdminUsers = "adminUsers",
|
|
28
|
-
AdminOrganizations = "adminOrganizations",
|
|
29
|
-
Beta = "beta",
|
|
30
|
-
Organization = "organization",
|
|
31
|
-
OrganizationAlgorithms = "organizationAlgorithms",
|
|
32
|
-
OrganizationBooking = "organizationBooking",
|
|
33
|
-
OrganizationClients = "organizationClients",
|
|
34
|
-
OrganizationDepartments = "organizationDepartments",
|
|
35
|
-
OrganizationLogo = "organizationLogo",
|
|
36
|
-
OrganizationMembers = "organizationMembers",
|
|
37
|
-
OrganizationOptionLabels = "organizationOptionLabels",
|
|
38
|
-
OrganizationOrders = "organizationOrders",
|
|
39
|
-
OrganizationPages = "organizationPages",
|
|
40
|
-
OrganizationProducts = "organizationProducts",
|
|
41
|
-
OrganizationProductsExtended = "organizationProductsExtended",
|
|
42
|
-
OrganizationRecommendations = "organizationRecommendations",
|
|
43
|
-
OrganizationReport = "organizationReport",
|
|
44
|
-
OrganizationStats = "organizationStats",
|
|
45
|
-
OrganizationUnitTemplates = "organizationUnitTemplates",
|
|
46
|
-
OrganizationUpsellTemplates = "organizationUpsellTemplates",
|
|
47
|
-
OrganizationWebhooks = "organizationWebhooks",
|
|
48
|
-
Project = "project",
|
|
49
|
-
ProjectAlgorithms = "projectAlgorithms",
|
|
50
|
-
ProjectBooking = "projectBooking",
|
|
51
|
-
ProjectDocuments = "projectDocuments",
|
|
52
|
-
ProjectInquiry = "projectInquiry",
|
|
53
|
-
ProjectOrders = "projectOrders",
|
|
54
|
-
ProjectPages = "projectPages",
|
|
55
|
-
ProjectPeriods = "projectPeriods",
|
|
56
|
-
ProjectProducts = "projectProducts",
|
|
57
|
-
ProjectRecommendations = "projectRecommendations",
|
|
58
|
-
ProjectReport = "projectReport",
|
|
59
|
-
ProjectReportPrice = "projectReportPrice",
|
|
60
|
-
ProjectTheme = "projectTheme",
|
|
61
|
-
ProjectSigning = "projectSigning",
|
|
62
|
-
ProjectSubcontractor = "projectSubcontractor",
|
|
63
|
-
ProjectUnits = "projectUnits",
|
|
64
|
-
ProjectUnitInvites = "projectUnitInvites",
|
|
65
|
-
ProjectUnitExtraFields = "projectUnitExtraFields",
|
|
66
|
-
ProjectUnitExtraOptions = "projectUnitExtraOptions",
|
|
67
|
-
ProjectUnitTemplates = "projectUnitTemplates",
|
|
68
|
-
ProjectUnitTemplatesAlgorithms = "projectUnitTemplatesAlgorithms",
|
|
69
|
-
ProjectUnitTemplatesPrices = "projectUnitTemplatesPrices",
|
|
70
|
-
ProjectUpsellTemplates = "projectUpsellTemplates",
|
|
71
|
-
Unit = "unit",
|
|
72
|
-
UnitBooking = "unitBooking",
|
|
73
|
-
UnitInquiry = "unitInquiry",
|
|
74
|
-
UnitNotes = "unitNotes",
|
|
75
|
-
UnitOrders = "unitOrders",
|
|
76
|
-
UnitPages = "unitPages",
|
|
77
|
-
UnitProducts = "unitProducts",
|
|
78
|
-
UnitReport = "unitReport"
|
|
79
|
-
}
|
|
80
|
-
export declare enum AptlyUserRole {
|
|
81
|
-
Admin = "admin",
|
|
82
|
-
Beta = "beta",
|
|
83
|
-
Default = "default",
|
|
84
|
-
SuperAdmin = "superAdmin"
|
|
85
|
-
}
|
|
86
|
-
export declare enum AptlyOrganizationRole {
|
|
87
|
-
Admin = "admin",
|
|
88
|
-
Content = "content",
|
|
89
|
-
OrganizationContent = "organizationContent",
|
|
90
|
-
Default = "default",
|
|
91
|
-
ProjectAdmin = "projectAdmin",
|
|
92
|
-
TestingAdmin = "testingAdmin",
|
|
93
|
-
Reports = "reports",
|
|
94
|
-
Support = "support",
|
|
95
|
-
ThirdParty = "thirdParty"
|
|
96
|
-
}
|
|
97
|
-
export type AptlyScopeCrud = 'C' | 'R' | 'U' | 'D';
|
|
98
|
-
export type AptlyScopeSchemaValue = 'C' | 'CR' | 'CRU' | 'CRUD' | 'R' | 'RU' | 'RUD' | 'U' | 'UD' | 'D';
|
|
99
|
-
export type AptlyScopeSchema = {
|
|
100
|
-
[key in AptlyScope]: AptlyScopeSchemaValue;
|
|
101
|
-
};
|
package/core/permission.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
export var AptlyModule;
|
|
2
|
-
(function (AptlyModule) {
|
|
3
|
-
AptlyModule["Algorithms"] = "algorithms";
|
|
4
|
-
AptlyModule["Booking"] = "booking";
|
|
5
|
-
AptlyModule["Core"] = "core";
|
|
6
|
-
AptlyModule["Default"] = "default";
|
|
7
|
-
AptlyModule["Departments"] = "departments";
|
|
8
|
-
AptlyModule["OptionLabels"] = "optionLabels";
|
|
9
|
-
AptlyModule["Pages"] = "pages";
|
|
10
|
-
AptlyModule["ProductsExtended"] = "productsExtended";
|
|
11
|
-
AptlyModule["Recommendations"] = "recommendations";
|
|
12
|
-
AptlyModule["Subcontractor"] = "subcontractor";
|
|
13
|
-
AptlyModule["Support"] = "support";
|
|
14
|
-
AptlyModule["Testing"] = "testing";
|
|
15
|
-
AptlyModule["UnitExtraOptions"] = "unitExtraOptions";
|
|
16
|
-
AptlyModule["UnitExtraFields"] = "unitExtraFields";
|
|
17
|
-
})(AptlyModule || (AptlyModule = {}));
|
|
18
|
-
export var AptlyScope;
|
|
19
|
-
(function (AptlyScope) {
|
|
20
|
-
AptlyScope["Admin"] = "admin";
|
|
21
|
-
AptlyScope["AdminBilling"] = "adminBilling";
|
|
22
|
-
AptlyScope["AdminProducers"] = "adminProducers";
|
|
23
|
-
AptlyScope["AdminProducts"] = "adminProducts";
|
|
24
|
-
AptlyScope["AdminReport"] = "adminReport";
|
|
25
|
-
AptlyScope["AdminStats"] = "adminStats";
|
|
26
|
-
AptlyScope["AdminSuppliers"] = "adminSuppliers";
|
|
27
|
-
AptlyScope["AdminTags"] = "adminTags";
|
|
28
|
-
AptlyScope["AdminTesting"] = "adminTesting";
|
|
29
|
-
AptlyScope["AdminUsers"] = "adminUsers";
|
|
30
|
-
AptlyScope["AdminOrganizations"] = "adminOrganizations";
|
|
31
|
-
AptlyScope["Beta"] = "beta";
|
|
32
|
-
AptlyScope["Organization"] = "organization";
|
|
33
|
-
AptlyScope["OrganizationAlgorithms"] = "organizationAlgorithms";
|
|
34
|
-
AptlyScope["OrganizationBooking"] = "organizationBooking";
|
|
35
|
-
AptlyScope["OrganizationClients"] = "organizationClients";
|
|
36
|
-
AptlyScope["OrganizationDepartments"] = "organizationDepartments";
|
|
37
|
-
AptlyScope["OrganizationLogo"] = "organizationLogo";
|
|
38
|
-
AptlyScope["OrganizationMembers"] = "organizationMembers";
|
|
39
|
-
AptlyScope["OrganizationOptionLabels"] = "organizationOptionLabels";
|
|
40
|
-
AptlyScope["OrganizationOrders"] = "organizationOrders";
|
|
41
|
-
AptlyScope["OrganizationPages"] = "organizationPages";
|
|
42
|
-
AptlyScope["OrganizationProducts"] = "organizationProducts";
|
|
43
|
-
AptlyScope["OrganizationProductsExtended"] = "organizationProductsExtended";
|
|
44
|
-
AptlyScope["OrganizationRecommendations"] = "organizationRecommendations";
|
|
45
|
-
AptlyScope["OrganizationReport"] = "organizationReport";
|
|
46
|
-
AptlyScope["OrganizationStats"] = "organizationStats";
|
|
47
|
-
AptlyScope["OrganizationUnitTemplates"] = "organizationUnitTemplates";
|
|
48
|
-
AptlyScope["OrganizationUpsellTemplates"] = "organizationUpsellTemplates";
|
|
49
|
-
AptlyScope["OrganizationWebhooks"] = "organizationWebhooks";
|
|
50
|
-
AptlyScope["Project"] = "project";
|
|
51
|
-
AptlyScope["ProjectAlgorithms"] = "projectAlgorithms";
|
|
52
|
-
AptlyScope["ProjectBooking"] = "projectBooking";
|
|
53
|
-
AptlyScope["ProjectDocuments"] = "projectDocuments";
|
|
54
|
-
AptlyScope["ProjectInquiry"] = "projectInquiry";
|
|
55
|
-
AptlyScope["ProjectOrders"] = "projectOrders";
|
|
56
|
-
AptlyScope["ProjectPages"] = "projectPages";
|
|
57
|
-
AptlyScope["ProjectPeriods"] = "projectPeriods";
|
|
58
|
-
AptlyScope["ProjectProducts"] = "projectProducts";
|
|
59
|
-
AptlyScope["ProjectRecommendations"] = "projectRecommendations";
|
|
60
|
-
AptlyScope["ProjectReport"] = "projectReport";
|
|
61
|
-
AptlyScope["ProjectReportPrice"] = "projectReportPrice";
|
|
62
|
-
AptlyScope["ProjectTheme"] = "projectTheme";
|
|
63
|
-
AptlyScope["ProjectSigning"] = "projectSigning";
|
|
64
|
-
AptlyScope["ProjectSubcontractor"] = "projectSubcontractor";
|
|
65
|
-
AptlyScope["ProjectUnits"] = "projectUnits";
|
|
66
|
-
AptlyScope["ProjectUnitInvites"] = "projectUnitInvites";
|
|
67
|
-
AptlyScope["ProjectUnitExtraFields"] = "projectUnitExtraFields";
|
|
68
|
-
AptlyScope["ProjectUnitExtraOptions"] = "projectUnitExtraOptions";
|
|
69
|
-
AptlyScope["ProjectUnitTemplates"] = "projectUnitTemplates";
|
|
70
|
-
AptlyScope["ProjectUnitTemplatesAlgorithms"] = "projectUnitTemplatesAlgorithms";
|
|
71
|
-
AptlyScope["ProjectUnitTemplatesPrices"] = "projectUnitTemplatesPrices";
|
|
72
|
-
AptlyScope["ProjectUpsellTemplates"] = "projectUpsellTemplates";
|
|
73
|
-
AptlyScope["Unit"] = "unit";
|
|
74
|
-
AptlyScope["UnitBooking"] = "unitBooking";
|
|
75
|
-
AptlyScope["UnitInquiry"] = "unitInquiry";
|
|
76
|
-
AptlyScope["UnitNotes"] = "unitNotes";
|
|
77
|
-
AptlyScope["UnitOrders"] = "unitOrders";
|
|
78
|
-
AptlyScope["UnitPages"] = "unitPages";
|
|
79
|
-
AptlyScope["UnitProducts"] = "unitProducts";
|
|
80
|
-
AptlyScope["UnitReport"] = "unitReport";
|
|
81
|
-
})(AptlyScope || (AptlyScope = {}));
|
|
82
|
-
export var AptlyUserRole;
|
|
83
|
-
(function (AptlyUserRole) {
|
|
84
|
-
AptlyUserRole["Admin"] = "admin";
|
|
85
|
-
AptlyUserRole["Beta"] = "beta";
|
|
86
|
-
AptlyUserRole["Default"] = "default";
|
|
87
|
-
AptlyUserRole["SuperAdmin"] = "superAdmin";
|
|
88
|
-
})(AptlyUserRole || (AptlyUserRole = {}));
|
|
89
|
-
export var AptlyOrganizationRole;
|
|
90
|
-
(function (AptlyOrganizationRole) {
|
|
91
|
-
AptlyOrganizationRole["Admin"] = "admin";
|
|
92
|
-
AptlyOrganizationRole["Content"] = "content";
|
|
93
|
-
AptlyOrganizationRole["OrganizationContent"] = "organizationContent";
|
|
94
|
-
AptlyOrganizationRole["Default"] = "default";
|
|
95
|
-
AptlyOrganizationRole["ProjectAdmin"] = "projectAdmin";
|
|
96
|
-
AptlyOrganizationRole["TestingAdmin"] = "testingAdmin";
|
|
97
|
-
AptlyOrganizationRole["Reports"] = "reports";
|
|
98
|
-
AptlyOrganizationRole["Support"] = "support";
|
|
99
|
-
AptlyOrganizationRole["ThirdParty"] = "thirdParty";
|
|
100
|
-
})(AptlyOrganizationRole || (AptlyOrganizationRole = {}));
|