@aptly-as/types 1.6.0 → 1.6.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/app.d.ts CHANGED
@@ -1,5 +1,13 @@
1
1
  import { AptlyScope } from './scope';
2
2
  import { AptlyApp, AptlyOrganization, AptlyOrganizationAppConfig } from '../models';
3
+ export declare enum AptlyAppSandbox {
4
+ AllowForms = "allow-forms",
5
+ AllowPopups = "allow-popups",
6
+ AllowScripts = "allow-scripts",
7
+ AllowSameOrigin = "allow-same-origin",
8
+ AllowPointerLock = "allow-pointer-lock",
9
+ AllowTopNavigation = "allow-top-navigation"
10
+ }
3
11
  export interface AptlyAppJWT {
4
12
  exp: number;
5
13
  }
@@ -15,10 +23,10 @@ export interface AptlyAppAuthorizeToken {
15
23
  aud: string;
16
24
  sub: string;
17
25
  }
18
- export interface AptlyAppWebContext {
26
+ export interface AptlyAppWebContext<S extends object> {
19
27
  organization: Pick<AptlyOrganization, '_id' | 'slug' | 'name'>;
20
28
  app: AptlyApp;
21
- config: AptlyOrganizationAppConfig;
29
+ config: AptlyOrganizationAppConfig<S>;
22
30
  theme: any;
23
31
  media: AptlyAppWebContextMedia;
24
32
  }
package/core/app.js CHANGED
@@ -1,3 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AptlyAppSandbox = void 0;
4
+ var AptlyAppSandbox;
5
+ (function (AptlyAppSandbox) {
6
+ AptlyAppSandbox["AllowForms"] = "allow-forms";
7
+ AptlyAppSandbox["AllowPopups"] = "allow-popups";
8
+ AptlyAppSandbox["AllowScripts"] = "allow-scripts";
9
+ AptlyAppSandbox["AllowSameOrigin"] = "allow-same-origin";
10
+ AptlyAppSandbox["AllowPointerLock"] = "allow-pointer-lock";
11
+ AptlyAppSandbox["AllowTopNavigation"] = "allow-top-navigation";
12
+ })(AptlyAppSandbox = exports.AptlyAppSandbox || (exports.AptlyAppSandbox = {}));
3
13
  //# sourceMappingURL=app.js.map
package/core/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";;;AAGA,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,6CAA0B,CAAA;IAC1B,+CAA4B,CAAA;IAC5B,iDAA8B,CAAA;IAC9B,wDAAqC,CAAA;IACrC,0DAAuC,CAAA;IACvC,8DAA2C,CAAA;AAC7C,CAAC,EAPW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAO1B"}
package/core/app.ts CHANGED
@@ -1,6 +1,15 @@
1
1
  import { AptlyScope } from './scope';
2
2
  import { AptlyApp, AptlyOrganization, AptlyOrganizationAppConfig } from '../models';
3
3
 
4
+ export enum AptlyAppSandbox {
5
+ AllowForms = 'allow-forms',
6
+ AllowPopups = 'allow-popups',
7
+ AllowScripts = 'allow-scripts',
8
+ AllowSameOrigin = 'allow-same-origin',
9
+ AllowPointerLock = 'allow-pointer-lock',
10
+ AllowTopNavigation = 'allow-top-navigation',
11
+ }
12
+
4
13
  export interface AptlyAppJWT {
5
14
  exp: number;
6
15
  }
@@ -19,10 +28,10 @@ export interface AptlyAppAuthorizeToken {
19
28
  sub: string; // app_id
20
29
  }
21
30
 
22
- export interface AptlyAppWebContext {
31
+ export interface AptlyAppWebContext<S extends object> {
23
32
  organization: Pick<AptlyOrganization, '_id' | 'slug' | 'name'>;
24
33
  app: AptlyApp;
25
- config: AptlyOrganizationAppConfig;
34
+ config: AptlyOrganizationAppConfig<S>;
26
35
  theme: any;
27
36
  media: AptlyAppWebContextMedia;
28
37
  }
@@ -1,13 +1,13 @@
1
1
  export declare enum AptlyWebhookType {
2
- ProjectCreated = "as.aptly.project.created",
3
- ProjectUpdated = "as.aptly.project.updated",
4
- UnitCreated = "as.aptly.unit.created",
5
- UnitUpdated = "as.aptly.unit.updated",
6
- UnitMessageNew = "as.aptly.unit.message.new",
7
- UnitMessageReply = "as.aptly.unit.message.reply",
8
- UnitOrderSigned = "as.aptly.unit.order.signed",
9
- OrganizationAppUpdated = "as.aptly.organization.app.updated",
10
- OrganizationAppDeleted = "as.aptly.organization.app.deleted"
2
+ ProjectCreated = "aptly.project.created",
3
+ ProjectUpdated = "aptly.project.updated",
4
+ UnitCreated = "aptly.unit.created",
5
+ UnitUpdated = "aptly.unit.updated",
6
+ UnitMessageNew = "aptly.unit.message.new",
7
+ UnitMessageReply = "aptly.unit.message.reply",
8
+ UnitOrderSigned = "aptly.unit.order.signed",
9
+ OrganizationAppUpdated = "aptly.organization.app.updated",
10
+ OrganizationAppDeleted = "aptly.organization.app.deleted"
11
11
  }
12
12
  export declare enum AptlyWebhookStatus {
13
13
  Active = "active",
package/enums/webhook.js CHANGED
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AptlyWebhookEventStatus = exports.AptlyWebhookStatus = exports.AptlyWebhookType = void 0;
4
4
  var AptlyWebhookType;
5
5
  (function (AptlyWebhookType) {
6
- AptlyWebhookType["ProjectCreated"] = "as.aptly.project.created";
7
- AptlyWebhookType["ProjectUpdated"] = "as.aptly.project.updated";
8
- AptlyWebhookType["UnitCreated"] = "as.aptly.unit.created";
9
- AptlyWebhookType["UnitUpdated"] = "as.aptly.unit.updated";
10
- AptlyWebhookType["UnitMessageNew"] = "as.aptly.unit.message.new";
11
- AptlyWebhookType["UnitMessageReply"] = "as.aptly.unit.message.reply";
12
- AptlyWebhookType["UnitOrderSigned"] = "as.aptly.unit.order.signed";
13
- AptlyWebhookType["OrganizationAppUpdated"] = "as.aptly.organization.app.updated";
14
- AptlyWebhookType["OrganizationAppDeleted"] = "as.aptly.organization.app.deleted";
6
+ AptlyWebhookType["ProjectCreated"] = "aptly.project.created";
7
+ AptlyWebhookType["ProjectUpdated"] = "aptly.project.updated";
8
+ AptlyWebhookType["UnitCreated"] = "aptly.unit.created";
9
+ AptlyWebhookType["UnitUpdated"] = "aptly.unit.updated";
10
+ AptlyWebhookType["UnitMessageNew"] = "aptly.unit.message.new";
11
+ AptlyWebhookType["UnitMessageReply"] = "aptly.unit.message.reply";
12
+ AptlyWebhookType["UnitOrderSigned"] = "aptly.unit.order.signed";
13
+ AptlyWebhookType["OrganizationAppUpdated"] = "aptly.organization.app.updated";
14
+ AptlyWebhookType["OrganizationAppDeleted"] = "aptly.organization.app.deleted";
15
15
  })(AptlyWebhookType = exports.AptlyWebhookType || (exports.AptlyWebhookType = {}));
16
16
  var AptlyWebhookStatus;
17
17
  (function (AptlyWebhookStatus) {
@@ -1 +1 @@
1
- {"version":3,"file":"webhook.js","sourceRoot":"","sources":["webhook.ts"],"names":[],"mappings":";;;AACA,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,+DAA2C,CAAA;IAC3C,+DAA2C,CAAA;IAC3C,yDAAqC,CAAA;IACrC,yDAAqC,CAAA;IACrC,gEAA4C,CAAA;IAC5C,oEAAgD,CAAA;IAChD,kEAA8C,CAAA;IAC9C,gFAA4D,CAAA;IAC5D,gFAA4D,CAAA;AAC9D,CAAC,EAVW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAU3B;AAED,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;AACnB,CAAC,EAHW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAG7B;AAED,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,sCAAW,CAAA;IACX,kDAAuB,CAAA;IACvB,0CAAe,CAAA;IACf,4CAAiB,CAAA;AACnB,CAAC,EALW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAKlC"}
1
+ {"version":3,"file":"webhook.js","sourceRoot":"","sources":["webhook.ts"],"names":[],"mappings":";;;AACA,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,4DAAwC,CAAA;IACxC,4DAAwC,CAAA;IACxC,sDAAkC,CAAA;IAClC,sDAAkC,CAAA;IAClC,6DAAyC,CAAA;IACzC,iEAA6C,CAAA;IAC7C,+DAA2C,CAAA;IAC3C,6EAAyD,CAAA;IACzD,6EAAyD,CAAA;AAC3D,CAAC,EAVW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAU3B;AAED,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;AACnB,CAAC,EAHW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAG7B;AAED,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,sCAAW,CAAA;IACX,kDAAuB,CAAA;IACvB,0CAAe,CAAA;IACf,4CAAiB,CAAA;AACnB,CAAC,EALW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAKlC"}
package/enums/webhook.ts CHANGED
@@ -1,14 +1,14 @@
1
1
 
2
2
  export enum AptlyWebhookType {
3
- ProjectCreated = 'as.aptly.project.created',
4
- ProjectUpdated = 'as.aptly.project.updated',
5
- UnitCreated = 'as.aptly.unit.created',
6
- UnitUpdated = 'as.aptly.unit.updated',
7
- UnitMessageNew = 'as.aptly.unit.message.new',
8
- UnitMessageReply = 'as.aptly.unit.message.reply',
9
- UnitOrderSigned = 'as.aptly.unit.order.signed',
10
- OrganizationAppUpdated = 'as.aptly.organization.app.updated',
11
- OrganizationAppDeleted = 'as.aptly.organization.app.deleted',
3
+ ProjectCreated = 'aptly.project.created',
4
+ ProjectUpdated = 'aptly.project.updated',
5
+ UnitCreated = 'aptly.unit.created',
6
+ UnitUpdated = 'aptly.unit.updated',
7
+ UnitMessageNew = 'aptly.unit.message.new',
8
+ UnitMessageReply = 'aptly.unit.message.reply',
9
+ UnitOrderSigned = 'aptly.unit.order.signed',
10
+ OrganizationAppUpdated = 'aptly.organization.app.updated',
11
+ OrganizationAppDeleted = 'aptly.organization.app.deleted',
12
12
  }
13
13
 
14
14
  export enum AptlyWebhookStatus {
package/models/app.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AptlyBaseSchema } from './extends';
2
2
  import { AptlyWebhookType } from '../enums';
3
- import { AptlyField, AptlyPermissionModel } from '../core';
3
+ import { AptlyAppSandbox, AptlyField, AptlyPermissionModel } from '../core';
4
4
  import { AptlyMediaSrcSchema } from './media';
5
5
  export declare type AptlyApp = AptlyAppSchema<string, string>;
6
6
  export interface AptlyAppSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'archived'> {
@@ -14,7 +14,7 @@ export interface AptlyAppSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>
14
14
  settings: AptlyAppSettingSchema<ID>[];
15
15
  webhooks: AptlyAppWebhookSchema<ID>[];
16
16
  proxies: AptlyAppProxySchema<ID>[];
17
- injections: AptlyAppInjectionSchema<ID>[];
17
+ menus: AptlyAppMenuSchema<ID, DATE>[];
18
18
  }
19
19
  export declare type AptlyAppSetting = AptlyAppSettingSchema<string>;
20
20
  export interface AptlyAppSettingSchema<ID> extends AptlyField {
@@ -46,18 +46,18 @@ export declare enum AptlyProjectInjection {
46
46
  }
47
47
  export declare type AptlyAppInjectionMenu = `organization-${AptlyOrganizationInjection}` | `project-${AptlyProjectInjection}`;
48
48
  export declare enum AptlyAppInjectionType {
49
- Iframe = "iframe",
50
- Script = "script"
49
+ Iframe = "iframe"
51
50
  }
52
- export declare type AptlyAppInjection = AptlyAppInjectionSchema<string>;
53
- export interface AptlyAppInjectionSchema<ID> {
51
+ export declare type AptlyAppMenu = AptlyAppMenuSchema<string, string>;
52
+ export interface AptlyAppMenuSchema<ID, DATE> {
54
53
  _id: ID;
55
54
  type: AptlyAppInjectionType;
56
- menu: AptlyAppInjectionMenu;
55
+ menu: AptlyAppInjectionMenu[];
57
56
  model: AptlyPermissionModel;
58
57
  label: string;
59
- icon?: string;
58
+ icon?: AptlyMediaSrcSchema<ID, DATE>;
60
59
  src: string;
60
+ sandbox: AptlyAppSandbox[];
61
61
  }
62
62
  export interface AptlyAppProxySchema<ID> {
63
63
  _id: ID;
package/models/app.js CHANGED
@@ -23,6 +23,5 @@ var AptlyProjectInjection;
23
23
  var AptlyAppInjectionType;
24
24
  (function (AptlyAppInjectionType) {
25
25
  AptlyAppInjectionType["Iframe"] = "iframe";
26
- AptlyAppInjectionType["Script"] = "script";
27
26
  })(AptlyAppInjectionType = exports.AptlyAppInjectionType || (exports.AptlyAppInjectionType = {}));
28
27
  //# sourceMappingURL=app.js.map
package/models/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";;;AAiCA,IAAY,0BAOX;AAPD,WAAY,0BAA0B;IACpC,uCAAS,CAAA;IACT,iDAAmB,CAAA;IACnB,iDAAmB,CAAA;IACnB,mDAAqB,CAAA;IACrB,iDAAmB,CAAA;IACnB,6CAAe,CAAA;AACjB,CAAC,EAPW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAOrC;AAED,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,kCAAS,CAAA;IACT,4CAAmB,CAAA;IACnB,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;AACjB,CAAC,EARW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAQhC;AAID,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;AACnB,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC"}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";;;AAiCA,IAAY,0BAOX;AAPD,WAAY,0BAA0B;IACpC,uCAAS,CAAA;IACT,iDAAmB,CAAA;IACnB,iDAAmB,CAAA;IACnB,mDAAqB,CAAA;IACrB,iDAAmB,CAAA;IACnB,6CAAe,CAAA;AACjB,CAAC,EAPW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAOrC;AAED,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,kCAAS,CAAA;IACT,4CAAmB,CAAA;IACnB,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;AACjB,CAAC,EARW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAQhC;AAID,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAC/B,0CAAiB,CAAA;AACnB,CAAC,EAFW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAEhC"}
package/models/app.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AptlyBaseSchema } from './extends';
2
2
  import { AptlyWebhookType } from '../enums';
3
- import { AptlyField, AptlyPermissionModel } from '../core';
3
+ import { AptlyAppSandbox, AptlyField, AptlyPermissionModel } from '../core';
4
4
  import { AptlyMediaSrcSchema } from './media';
5
5
 
6
6
  export type AptlyApp = AptlyAppSchema<string, string>;
@@ -15,7 +15,7 @@ export interface AptlyAppSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>
15
15
  settings: AptlyAppSettingSchema<ID>[];
16
16
  webhooks: AptlyAppWebhookSchema<ID>[];
17
17
  proxies: AptlyAppProxySchema<ID>[];
18
- injections: AptlyAppInjectionSchema<ID>[]
18
+ menus: AptlyAppMenuSchema<ID, DATE>[]
19
19
  }
20
20
 
21
21
  export type AptlyAppSetting = AptlyAppSettingSchema<string>;
@@ -54,18 +54,18 @@ export type AptlyAppInjectionMenu = `organization-${AptlyOrganizationInjection}`
54
54
 
55
55
  export enum AptlyAppInjectionType {
56
56
  Iframe = 'iframe',
57
- Script = 'script',
58
57
  }
59
58
 
60
- export type AptlyAppInjection = AptlyAppInjectionSchema<string>;
61
- export interface AptlyAppInjectionSchema<ID> {
59
+ export type AptlyAppMenu = AptlyAppMenuSchema<string, string>;
60
+ export interface AptlyAppMenuSchema<ID, DATE> {
62
61
  _id: ID;
63
62
  type: AptlyAppInjectionType;
64
- menu: AptlyAppInjectionMenu;
63
+ menu: AptlyAppInjectionMenu[];
65
64
  model: AptlyPermissionModel;
66
65
  label: string;
67
- icon?: string;
66
+ icon?: AptlyMediaSrcSchema<ID, DATE>;
68
67
  src: string;
68
+ sandbox: AptlyAppSandbox[];
69
69
  }
70
70
 
71
71
  export interface AptlyAppProxySchema<ID> {
@@ -65,12 +65,9 @@ export interface AptlyOrganizationInviteSchema<ID, DATE> {
65
65
  claimTime?: DATE;
66
66
  };
67
67
  }
68
- export declare type AptlyOrganizationAppConfig = AptlyOrganizationAppConfigSchema<string, string>;
69
- export interface AptlyOrganizationAppConfigSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
68
+ export declare type AptlyOrganizationAppConfig<S extends object = object> = AptlyOrganizationAppConfigSchema<string, string, S>;
69
+ export interface AptlyOrganizationAppConfigSchema<ID, DATE, S extends object = object> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
70
70
  app: ID | AptlyAppSchema<ID, DATE>;
71
71
  scope: AptlyScope[];
72
- settings: AptlyOrganizationAppConfigSetting;
73
- }
74
- export interface AptlyOrganizationAppConfigSetting {
75
- [key: string]: string | number | boolean;
72
+ settings: S;
76
73
  }
@@ -80,14 +80,10 @@ export interface AptlyOrganizationInviteSchema<ID, DATE> {
80
80
  };
81
81
  }
82
82
 
83
- export type AptlyOrganizationAppConfig = AptlyOrganizationAppConfigSchema<string, string>;
83
+ export type AptlyOrganizationAppConfig<S extends object = object> = AptlyOrganizationAppConfigSchema<string, string, S>;
84
84
 
85
- export interface AptlyOrganizationAppConfigSchema<ID, DATE> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
85
+ export interface AptlyOrganizationAppConfigSchema<ID, DATE, S extends object = object> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
86
86
  app: ID | AptlyAppSchema<ID, DATE>;
87
87
  scope: AptlyScope[];
88
- settings: AptlyOrganizationAppConfigSetting;
88
+ settings: S;
89
89
  }
90
-
91
- export interface AptlyOrganizationAppConfigSetting {
92
- [key: string]: string | number | boolean;
93
- }
@@ -28,7 +28,7 @@ export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, Apt
28
28
  createdBy: ID;
29
29
  stats?: any;
30
30
  importID?: ID;
31
- thirdPartyUploader?: string;
31
+ source?: string;
32
32
  /**
33
33
  * @deprecated Use name
34
34
  */
@@ -69,3 +69,8 @@ export interface AptlyProductVariantSchema<ID, DATE> {
69
69
  height?: string;
70
70
  length?: string;
71
71
  }
72
+ export declare type AptlyProductImport = AptlyProductImportSchema<string, string>;
73
+ export interface AptlyProductImportSchema<ID, DATE> extends Partial<Omit<AptlyProductSchema<ID, DATE>, 'images' | 'documents'>> {
74
+ images: string[];
75
+ documents: string[];
76
+ }
package/models/product.ts CHANGED
@@ -29,7 +29,7 @@ export interface AptlyProductSchema<ID, DATE> extends AptlyDBCrawlerCleaner, Apt
29
29
  createdBy: ID;
30
30
  stats?: any;
31
31
  importID?: ID;
32
- thirdPartyUploader?: string;
32
+ source?: string;
33
33
 
34
34
  /**
35
35
  * @deprecated Use name
@@ -75,3 +75,8 @@ export interface AptlyProductVariantSchema<ID, DATE> {
75
75
  length?: string;
76
76
  }
77
77
 
78
+ export type AptlyProductImport = AptlyProductImportSchema<string, string>;
79
+ export interface AptlyProductImportSchema<ID, DATE> extends Partial<Omit<AptlyProductSchema<ID, DATE>, 'images' | 'documents'>> {
80
+ images: string[];
81
+ documents: string[];
82
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/types",
3
- "version": "1.6.0",
3
+ "version": "1.6.3",
4
4
  "description": "Aptly types and enums",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",