@aptly-as/types 1.10.9 → 1.11.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/app.d.ts CHANGED
@@ -25,6 +25,8 @@ export interface AptlyAppAuthorizeToken {
25
25
  }
26
26
  export interface AptlyAppWebContext<S extends object> {
27
27
  organization: Pick<AptlyOrganization, '_id' | 'slug' | 'name'>;
28
+ project?: string;
29
+ unit?: string;
28
30
  app: AptlyApp;
29
31
  config: AptlyOrganizationAppConfig<S>;
30
32
  theme: any;
package/core/error.d.ts CHANGED
@@ -27,3 +27,17 @@ export interface AptlyErrorLink {
27
27
  count: number;
28
28
  };
29
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 CHANGED
@@ -1 +1,13 @@
1
- export {};
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/enums/index.d.ts CHANGED
@@ -80,6 +80,7 @@ export declare enum AptlySignageSignerRef {
80
80
  Admin = "admin"
81
81
  }
82
82
  export declare enum AptlyErrorCode {
83
+ Default = "default",
83
84
  InvalidFields = "invalid-fields",
84
85
  SessionExpired = "session-expired"
85
86
  }
package/enums/index.js CHANGED
@@ -93,6 +93,7 @@ export var AptlySignageSignerRef;
93
93
  })(AptlySignageSignerRef || (AptlySignageSignerRef = {}));
94
94
  export var AptlyErrorCode;
95
95
  (function (AptlyErrorCode) {
96
+ AptlyErrorCode["Default"] = "default";
96
97
  AptlyErrorCode["InvalidFields"] = "invalid-fields";
97
98
  AptlyErrorCode["SessionExpired"] = "session-expired";
98
99
  })(AptlyErrorCode || (AptlyErrorCode = {}));
package/models/app.d.ts CHANGED
@@ -44,7 +44,13 @@ export declare enum AptlyProjectInjection {
44
44
  Support = "support",
45
45
  Admin = "admin"
46
46
  }
47
- export type AptlyAppInjectionMenu = `organization-${AptlyOrganizationInjection}` | `project-${AptlyProjectInjection}`;
47
+ export declare enum AptlyUnitInjection {
48
+ Base = "",
49
+ Options = "options",
50
+ Support = "support",
51
+ Admin = "admin"
52
+ }
53
+ export type AptlyAppInjectionMenu = `organization-${AptlyOrganizationInjection}` | `project-${AptlyProjectInjection}` | `unit-${AptlyUnitInjection}`;
48
54
  export declare enum AptlyAppInjectionType {
49
55
  Iframe = "iframe"
50
56
  }
package/models/app.js CHANGED
@@ -17,6 +17,13 @@ export var AptlyProjectInjection;
17
17
  AptlyProjectInjection["Support"] = "support";
18
18
  AptlyProjectInjection["Admin"] = "admin";
19
19
  })(AptlyProjectInjection || (AptlyProjectInjection = {}));
20
+ export var AptlyUnitInjection;
21
+ (function (AptlyUnitInjection) {
22
+ AptlyUnitInjection["Base"] = "";
23
+ AptlyUnitInjection["Options"] = "options";
24
+ AptlyUnitInjection["Support"] = "support";
25
+ AptlyUnitInjection["Admin"] = "admin";
26
+ })(AptlyUnitInjection || (AptlyUnitInjection = {}));
20
27
  export var AptlyAppInjectionType;
21
28
  (function (AptlyAppInjectionType) {
22
29
  AptlyAppInjectionType["Iframe"] = "iframe";
@@ -11,6 +11,8 @@ export interface AptlyOrganizationSchema<ID, DATE> extends AptlyBaseSchema<ID, D
11
11
  slug: string;
12
12
  logo?: string | null;
13
13
  logoMedia?: AptlyMediaSrc | null;
14
+ negativeLogoMedia?: AptlyMediaSrc | null;
15
+ projectLogoMedia?: AptlyMediaSrc | null;
14
16
  address: {
15
17
  visit: {
16
18
  street: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "1.10.9",
3
+ "version": "1.11.1",
4
4
  "description": "Aptly types and enums",
5
5
  "type": "module",
6
6
  "main": "./index.js",