@aptly-as/types 1.1.5 → 1.2.2

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/models/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './client';
3
3
  export * from './document';
4
4
  export * from './extends';
5
5
  export * from './inquiry';
6
+ export * from './media';
6
7
  export * from './notification-trigger';
7
8
  export * from './option-label';
8
9
  export * from './order';
package/models/index.js CHANGED
@@ -8,6 +8,7 @@ __export(require("./client"));
8
8
  __export(require("./document"));
9
9
  __export(require("./extends"));
10
10
  __export(require("./inquiry"));
11
+ __export(require("./media"));
11
12
  __export(require("./notification-trigger"));
12
13
  __export(require("./option-label"));
13
14
  __export(require("./order"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;AACA,+BAA0B;AAC1B,8BAAyB;AACzB,gCAA2B;AAC3B,+BAA0B;AAC1B,+BAA0B;AAC1B,4CAAuC;AACvC,oCAA+B;AAC/B,6BAAwB;AACxB,oCAA+B;AAC/B,4BAAuB;AACvB,gCAA2B;AAC3B,+BAA0B;AAC1B,qCAAgC;AAChC,+BAA0B;AAC1B,sCAAiC;AACjC,gCAA2B;AAC3B,2BAAsB;AACtB,4BAAuB;AACvB,qCAAgC;AAChC,kCAA6B;AAC7B,uCAAkC;AAClC,4BAAuB;AACvB,+BAA0B;AAC1B,qCAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;AACA,+BAA0B;AAC1B,8BAAyB;AACzB,gCAA2B;AAC3B,+BAA0B;AAC1B,+BAA0B;AAC1B,6BAAwB;AACxB,4CAAuC;AACvC,oCAA+B;AAC/B,6BAAwB;AACxB,oCAA+B;AAC/B,4BAAuB;AACvB,gCAA2B;AAC3B,+BAA0B;AAC1B,qCAAgC;AAChC,+BAA0B;AAC1B,sCAAiC;AACjC,gCAA2B;AAC3B,2BAAsB;AACtB,4BAAuB;AACvB,qCAAgC;AAChC,kCAA6B;AAC7B,uCAAkC;AAClC,4BAAuB;AACvB,+BAA0B;AAC1B,qCAAgC"}
package/models/index.ts CHANGED
@@ -4,6 +4,7 @@ export * from './client';
4
4
  export * from './document';
5
5
  export * from './extends';
6
6
  export * from './inquiry';
7
+ export * from './media';
7
8
  export * from './notification-trigger';
8
9
  export * from './option-label';
9
10
  export * from './order';
@@ -0,0 +1,51 @@
1
+ import { AptlyOrganizationSchema } from './organization';
2
+ export interface AptlyMediaSchema<ID, DATE> {
3
+ _id: ID;
4
+ archived: boolean;
5
+ created: DATE;
6
+ updated: DATE;
7
+ organization: ID | AptlyOrganizationSchema<ID, DATE>;
8
+ src: string;
9
+ name: string;
10
+ alt: string;
11
+ caption?: string;
12
+ title?: string;
13
+ mime: string;
14
+ tags: string[];
15
+ width: number;
16
+ height: number;
17
+ albums: string[];
18
+ public_id: string;
19
+ asset_id: string;
20
+ version: number;
21
+ version_id: string;
22
+ signature: string;
23
+ format: string;
24
+ resource_type: string;
25
+ created_at: string;
26
+ bytes: number;
27
+ type: string;
28
+ etag: string;
29
+ placeholder: boolean;
30
+ url: string;
31
+ original_filename: string;
32
+ srcUrl?: string;
33
+ uploadSignature?: string;
34
+ }
35
+ export interface AptlyMediaSrcArea {
36
+ width: number;
37
+ height: number;
38
+ x: number;
39
+ y: number;
40
+ }
41
+ export interface AptlyMediaSrcLocation {
42
+ x: number;
43
+ y: number;
44
+ }
45
+ export interface AptlyMediaSrcSchema<ID, DATE> extends Pick<AptlyMediaSchema<ID, DATE>, AptlyMediaSrcKeys> {
46
+ area?: AptlyMediaSrcArea;
47
+ location?: AptlyMediaSrcLocation;
48
+ }
49
+ export declare type AptlyMediaSrcKeys = '_id' | 'name' | 'src' | 'url' | 'alt' | 'title' | 'caption' | 'mime' | 'width' | 'height';
50
+ export declare type AptlyMediaSrc = AptlyMediaSrcSchema<string, string>;
51
+ export declare type AptlyMedia = AptlyMediaSchema<string, string>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.js","sourceRoot":"","sources":["media.ts"],"names":[],"mappings":""}
@@ -0,0 +1,61 @@
1
+ import { AptlyOrganizationSchema } from './organization';
2
+
3
+ export interface AptlyMediaSchema<ID, DATE> {
4
+ // Aptly data
5
+ _id: ID;
6
+ archived: boolean;
7
+ created: DATE;
8
+ updated: DATE;
9
+ organization: ID | AptlyOrganizationSchema<ID, DATE>;
10
+ src: string;
11
+ name: string;
12
+ alt: string;
13
+ caption?: string;
14
+ title?: string;
15
+ mime: string;
16
+ tags: string[];
17
+ width: number;
18
+ height: number;
19
+ albums: string[];
20
+
21
+ // Cloudinary datayarn sta
22
+ public_id: string;
23
+ asset_id: string;
24
+ version: number;
25
+ version_id: string;
26
+ signature: string;
27
+ format: string;
28
+ resource_type: string;
29
+ created_at: string;
30
+ bytes: number;
31
+ type: string;
32
+ etag: string;
33
+ placeholder: boolean;
34
+ url: string;
35
+ original_filename: string;
36
+
37
+ // Aptly recognize help values
38
+ srcUrl?: string; // Recognize image if uploaded with url.
39
+ uploadSignature?: string; // Recognize images with buffer content
40
+ }
41
+
42
+ export interface AptlyMediaSrcArea {
43
+ width: number;
44
+ height: number;
45
+ x: number;
46
+ y: number;
47
+ }
48
+
49
+ export interface AptlyMediaSrcLocation {
50
+ x: number;
51
+ y: number;
52
+ }
53
+
54
+ export interface AptlyMediaSrcSchema<ID, DATE> extends Pick<AptlyMediaSchema<ID, DATE>, AptlyMediaSrcKeys> {
55
+ area?: AptlyMediaSrcArea;
56
+ location?: AptlyMediaSrcLocation;
57
+ }
58
+
59
+ export type AptlyMediaSrcKeys = '_id' | 'name' | 'src' | 'url' | 'alt' | 'title' | 'caption' | 'mime' | 'width' | 'height';
60
+ export type AptlyMediaSrc = AptlyMediaSrcSchema<string, string>;
61
+ export type AptlyMedia = AptlyMediaSchema<string, string>;
@@ -3,6 +3,7 @@ export interface AptlyOptionLabelSchema<ID, DATE> {
3
3
  _id: ID;
4
4
  name: string;
5
5
  created: DATE;
6
- organization: string;
6
+ organization?: string;
7
7
  project?: string;
8
+ archived?: boolean;
8
9
  }
@@ -4,6 +4,7 @@ export interface AptlyOptionLabelSchema<ID, DATE> {
4
4
  _id: ID;
5
5
  name: string;
6
6
  created: DATE;
7
- organization: string;
7
+ organization?: string;
8
8
  project?: string;
9
+ archived?: boolean;
9
10
  }
@@ -1,12 +1,14 @@
1
1
  import { AptlyPermissionModulesModels, AptlyPermissionOrganizationModels } from '../core';
2
2
  import { AptlySignageSchema } from '../core/signage';
3
3
  import { AptlyUserSchema } from './user';
4
+ import { AptlyMediaSrc } from './media';
4
5
  export declare type AptlyOrganization = AptlyOrganizationSchema<string, string>;
5
6
  export interface AptlyOrganizationSchema<ID, DATE> {
6
7
  _id: ID;
7
8
  name: string;
8
9
  slug: string;
9
- logo: string;
10
+ logo?: string | null;
11
+ logoMedia?: AptlyMediaSrc | null;
10
12
  address: {
11
13
  visit: {
12
14
  street: string;
@@ -37,6 +39,7 @@ export interface AptlyOrganizationIntegrationsSchema<ID> {
37
39
  }
38
40
  export declare type AptlyOrganizationMember = AptlyOrganizationMemberSchema<string, string>;
39
41
  export interface AptlyOrganizationMemberSchema<ID, DATE> {
42
+ _id: ID;
40
43
  user: AptlyUserSchema<ID, DATE> | ID;
41
- permissions: number | AptlyPermissionOrganizationModels | AptlyPermissionOrganizationModels[];
44
+ permissions: AptlyPermissionOrganizationModels[];
42
45
  }
@@ -1,13 +1,15 @@
1
1
  import { AptlyPermissionModulesModels, AptlyPermissionOrganizationModels } from '../core';
2
2
  import { AptlySignageSchema } from '../core/signage';
3
3
  import { AptlyUserSchema } from './user';
4
+ import { AptlyMediaSrc } from './media';
4
5
 
5
6
  export type AptlyOrganization = AptlyOrganizationSchema<string, string>;
6
7
  export interface AptlyOrganizationSchema<ID, DATE> {
7
8
  _id: ID;
8
9
  name: string;
9
10
  slug: string;
10
- logo: string;
11
+ logo?: string | null;
12
+ logoMedia?: AptlyMediaSrc | null;
11
13
  address: {
12
14
  visit: {
13
15
  street: string;
@@ -40,6 +42,7 @@ export interface AptlyOrganizationIntegrationsSchema<ID> {
40
42
 
41
43
  export type AptlyOrganizationMember = AptlyOrganizationMemberSchema<string, string>;
42
44
  export interface AptlyOrganizationMemberSchema<ID, DATE> {
45
+ _id: ID;
43
46
  user: AptlyUserSchema<ID, DATE> | ID;
44
- permissions: number | AptlyPermissionOrganizationModels | AptlyPermissionOrganizationModels[];
47
+ permissions: AptlyPermissionOrganizationModels[];
45
48
  }
@@ -1,14 +1,20 @@
1
1
  import { AptlyHistorySchema } from './extends';
2
+ import { AptlyMediaSrc } from './media';
2
3
  export declare type AptlyProducer = AptlyProducerSchema<string, string>;
3
4
  export interface AptlyProducerSchema<ID, DATE> extends AptlyHistorySchema<ID, DATE> {
4
5
  _id: ID;
5
6
  name: string;
6
7
  email: string;
7
- logo: string;
8
+ logo: string | null;
9
+ logoMedia?: AptlyMediaSrc | null;
10
+ url?: string;
8
11
  created: DATE;
9
- organization: ID;
10
- extends: ID;
12
+ organization?: ID;
11
13
  archived: boolean;
12
14
  createdBy: ID;
13
15
  tags: ID[];
16
+ /**
17
+ * @deprecated not used
18
+ */
19
+ extends: ID;
14
20
  }
@@ -1,15 +1,21 @@
1
1
  import { AptlyHistorySchema } from './extends';
2
+ import { AptlyMediaSrc } from './media';
2
3
 
3
4
  export type AptlyProducer = AptlyProducerSchema<string, string>;
4
5
  export interface AptlyProducerSchema<ID, DATE> extends AptlyHistorySchema<ID, DATE> {
5
6
  _id: ID;
6
7
  name: string;
7
8
  email: string;
8
- logo: string;
9
+ logo: string | null;
10
+ logoMedia?: AptlyMediaSrc | null;
11
+ url?: string;
9
12
  created: DATE;
10
- organization: ID;
11
- extends: ID;
13
+ organization?: ID;
12
14
  archived: boolean;
13
15
  createdBy: ID;
14
16
  tags: ID[];
17
+ /**
18
+ * @deprecated not used
19
+ */
20
+ extends: ID;
15
21
  }
@@ -1,4 +1,5 @@
1
1
  import { AptlyDBCrawlerCleaner, AptlyHistorySchema } from './extends';
2
+ import { AptlyMediaSrcSchema } from './media';
2
3
  export declare type AptlyProduct = AptlyProductSchema<string, string>;
3
4
  export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, AptlyHistorySchema<ID, DATE> {
4
5
  _id: ID;
@@ -10,7 +11,7 @@ export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, Apt
10
11
  extends?: ID;
11
12
  productNumber: string;
12
13
  description: string;
13
- images: IProductImageSchema<ID>[];
14
+ images: AptlyProductImageSchema<ID, DATE>[];
14
15
  variants: AptlyProductVariantSchema<ID, DATE>[];
15
16
  color?: string;
16
17
  colorLabel?: string;
@@ -37,18 +38,18 @@ export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, Apt
37
38
  stats?: any;
38
39
  importID?: ID;
39
40
  }
40
- export declare type IProductImage = IProductImageSchema<string>;
41
- export interface IProductImageSchema<ID> {
42
- _id: ID;
41
+ export declare type AptlyProductImage = AptlyProductImageSchema<string, string>;
42
+ export interface AptlyProductImageSchema<ID, DATE> extends AptlyMediaSrcSchema<ID, DATE> {
43
43
  image: string;
44
- description: string;
45
- featured: boolean;
44
+ description?: string;
45
+ featured?: boolean;
46
46
  }
47
47
  export declare type AptlyProductVariant = AptlyProductVariantSchema<string, string>;
48
48
  export interface AptlyProductVariantSchema<ID, DATE> {
49
49
  _id: ID;
50
- images: IProductImageSchema<ID>[];
51
50
  title: string;
51
+ images: AptlyProductImageSchema<ID, DATE>[];
52
+ documents: ID[];
52
53
  name?: string;
53
54
  description?: string;
54
55
  productNumber?: string;
package/models/product.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { AptlyDBCrawlerCleaner, AptlyHistorySchema } from './extends';
2
+ import { AptlyMediaSrcSchema } from './media';
2
3
 
3
4
  export type AptlyProduct = AptlyProductSchema<string, string>;
4
5
  export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, AptlyHistorySchema<ID, DATE> {
@@ -11,7 +12,7 @@ export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, Apt
11
12
  extends?: ID;
12
13
  productNumber: string;
13
14
  description: string;
14
- images: IProductImageSchema<ID>[];
15
+ images: AptlyProductImageSchema<ID, DATE>[];
15
16
  variants: AptlyProductVariantSchema<ID, DATE>[];
16
17
  color?: string;
17
18
  colorLabel?: string;
@@ -39,19 +40,19 @@ export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, Apt
39
40
  importID?: ID;
40
41
  }
41
42
 
42
- export type IProductImage = IProductImageSchema<string>;
43
- export interface IProductImageSchema<ID> {
44
- _id: ID;
43
+ export type AptlyProductImage = AptlyProductImageSchema<string, string>;
44
+ export interface AptlyProductImageSchema<ID, DATE> extends AptlyMediaSrcSchema<ID, DATE> {
45
45
  image: string;
46
- description: string;
47
- featured: boolean;
46
+ description?: string;
47
+ featured?: boolean;
48
48
  }
49
49
 
50
50
  export type AptlyProductVariant = AptlyProductVariantSchema<string, string>;
51
51
  export interface AptlyProductVariantSchema<ID, DATE> {
52
52
  _id: ID;
53
- images: IProductImageSchema<ID>[];
54
53
  title: string;
54
+ images: AptlyProductImageSchema<ID, DATE>[];
55
+ documents: ID[];
55
56
 
56
57
  name?: string;
57
58
  description?: string;
@@ -4,6 +4,7 @@ import { AptlyUserSchema } from './user';
4
4
  import { AptlyHistorySchema } from './extends';
5
5
  import { AptlyDocumentSchema } from './document';
6
6
  import { AptlyUnitOptionExtraItemSchema } from './unit';
7
+ import { AptlyMediaSrc } from './media';
7
8
  export declare type AptlyProject = AptlyProjectSchema<string, string>;
8
9
  export interface AptlyProjectSchema<ID, DATE> extends AptlyHistorySchema<ID, DATE> {
9
10
  _id: ID;
@@ -69,13 +70,16 @@ export interface AptlyProjectTheme {
69
70
  tertiary?: string;
70
71
  links?: [string];
71
72
  };
72
- images?: {
73
- logo?: string;
74
- largeLogo?: string;
75
- hero?: string;
76
- fallback?: string;
73
+ images: {
74
+ logo?: string | null;
75
+ logoMedia?: AptlyMediaSrc | null;
76
+ largeLogo?: string | null;
77
+ hero?: string | null;
78
+ heroMedia?: AptlyMediaSrc | null;
79
+ fallback?: string | null;
80
+ fallbackMedia?: AptlyMediaSrc | null;
77
81
  };
78
- contact?: {
82
+ contact: {
79
83
  name?: string;
80
84
  phone?: string;
81
85
  mail?: string;
@@ -103,5 +107,9 @@ interface AptlyProjectNotifySchema<ID, DATE> {
103
107
  inquiry: boolean;
104
108
  booking: boolean;
105
109
  complaint: boolean;
110
+ order?: boolean;
111
+ 'order-created'?: boolean;
112
+ 'order-signed'?: boolean;
113
+ 'order-fileReceived'?: boolean;
106
114
  }
107
115
  export {};
package/models/project.ts CHANGED
@@ -4,6 +4,7 @@ import { AptlyUserSchema } from './user';
4
4
  import { AptlyHistorySchema } from './extends';
5
5
  import { AptlyDocumentSchema } from './document';
6
6
  import { AptlyUnitOptionExtraItemSchema } from './unit';
7
+ import { AptlyMediaSrc } from './media';
7
8
 
8
9
  export type AptlyProject = AptlyProjectSchema<string, string>;
9
10
  export interface AptlyProjectSchema<ID, DATE> extends AptlyHistorySchema<ID, DATE> {
@@ -74,13 +75,16 @@ export interface AptlyProjectTheme {
74
75
  tertiary?: string;
75
76
  links?: [string];
76
77
  };
77
- images?: {
78
- logo?: string;
79
- largeLogo?: string;
80
- hero?: string;
81
- fallback?: string;
78
+ images: {
79
+ logo?: string | null;
80
+ logoMedia?: AptlyMediaSrc | null;
81
+ largeLogo?: string | null;
82
+ hero?: string | null;
83
+ heroMedia?: AptlyMediaSrc | null;
84
+ fallback?: string | null;
85
+ fallbackMedia?: AptlyMediaSrc | null;
82
86
  };
83
- contact?: {
87
+ contact: {
84
88
  name?: string;
85
89
  phone?: string;
86
90
  mail?: string;
@@ -112,4 +116,8 @@ interface AptlyProjectNotifySchema<ID, DATE> {
112
116
  inquiry: boolean;
113
117
  booking: boolean;
114
118
  complaint: boolean;
119
+ order?: boolean;
120
+ 'order-created'?: boolean;
121
+ 'order-signed'?: boolean;
122
+ 'order-fileReceived'?: boolean;
115
123
  }
@@ -1,9 +1,11 @@
1
+ import { AptlyMediaSrc } from './media';
1
2
  export declare type AptlySupplier = AptlySupplierSchema<string, string>;
2
3
  export interface AptlySupplierSchema<ID, DATE> {
3
4
  _id: ID;
4
5
  name: string;
5
6
  email?: string;
6
7
  logo: string | null;
8
+ logoMedia?: AptlyMediaSrc | null;
7
9
  created: DATE;
8
10
  archived: boolean;
9
11
  createdBy: ID;
@@ -1,3 +1,4 @@
1
+ import { AptlyMediaSrc } from './media';
1
2
 
2
3
  export type AptlySupplier = AptlySupplierSchema<string, string>;
3
4
  export interface AptlySupplierSchema<ID, DATE> {
@@ -5,6 +6,7 @@ export interface AptlySupplierSchema<ID, DATE> {
5
6
  name: string;
6
7
  email?: string;
7
8
  logo: string | null;
9
+ logoMedia?: AptlyMediaSrc | null;
8
10
  created: DATE;
9
11
  archived: boolean;
10
12
  createdBy: ID;
@@ -85,6 +85,7 @@ export interface AptlyUnitTemplateCategorySectionProductSchema<ID, DATE> {
85
85
  customTitle?: string;
86
86
  customDescription?: string;
87
87
  notifyWhenPicked?: boolean;
88
+ onlyShowInSelection?: boolean;
88
89
  recommendation?: ID;
89
90
  labels?: ID[];
90
91
  params: AptlyUnitTemplateCategorySectionProductParamSchema<ID>[];
@@ -97,6 +97,7 @@ export interface AptlyUnitTemplateCategorySectionProductSchema<ID, DATE> {
97
97
  customTitle?: string;
98
98
  customDescription?: string;
99
99
  notifyWhenPicked?: boolean;
100
+ onlyShowInSelection?: boolean;
100
101
  recommendation?: ID;
101
102
  labels?: ID[];
102
103
  params: AptlyUnitTemplateCategorySectionProductParamSchema<ID>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "1.1.5",
3
+ "version": "1.2.2",
4
4
  "description": "Aptly types and enums",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",