@fy-stack/fullstack-construct 0.0.123 → 0.0.125

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.
@@ -1 +1 @@
1
- {"version":3,"file":"fullstack-construct.d.ts","sourceRoot":"","sources":["../../src/lib/fullstack-construct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAW,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAU3D,qBAAa,kBAAmB,SAAQ,SAAS;IACxC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,gBAAgB,CAAC;gBAEpB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB;CA4HzE"}
1
+ {"version":3,"file":"fullstack-construct.d.ts","sourceRoot":"","sources":["../../src/lib/fullstack-construct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EACL,KAAK,YAAY,EAKlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAW,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAS3D,qBAAa,kBAAmB,SAAQ,SAAS;IACxC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,gBAAgB,CAAC;gBAEpB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB;CAmGzE"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FullStackConstruct = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const apigateway_construct_1 = require("@fy-stack/apigateway-construct");
6
5
  const app_construct_1 = require("@fy-stack/app-construct");
7
6
  const auth_construct_1 = require("@fy-stack/auth-construct");
@@ -10,15 +9,13 @@ const database_construct_1 = require("@fy-stack/database-construct");
10
9
  const event_construct_1 = require("@fy-stack/event-construct");
11
10
  const secret_construct_1 = require("@fy-stack/secret-construct");
12
11
  const storage_construct_1 = require("@fy-stack/storage-construct");
13
- const cdk = tslib_1.__importStar(require("aws-cdk-lib"));
14
12
  const constructs_1 = require("constructs");
15
13
  const types_1 = require("./types");
16
- const deno_api_construct_1 = require("@fy-stack/app-construct/dist/lib/deno-api-construct");
17
14
  const AppBuilds = {
18
15
  [types_1.AppType.NEXT_APP_ROUTER]: app_construct_1.NextAppRouterConstruct,
19
- [types_1.AppType.NEST]: app_construct_1.NestConstruct,
20
- [types_1.AppType.NEST_API]: app_construct_1.NestApiConstruct,
21
- [types_1.AppType.DENO_API]: deno_api_construct_1.DenoApiConstruct,
16
+ [types_1.AppType.NODE_APP]: app_construct_1.NodeAppConstruct,
17
+ [types_1.AppType.NODE_API]: app_construct_1.NodeApiConstruct,
18
+ [types_1.AppType.IMAGE_APP]: app_construct_1.ImageAppConstruct,
22
19
  };
23
20
  class FullStackConstruct extends constructs_1.Construct {
24
21
  auth;
@@ -32,20 +29,16 @@ class FullStackConstruct extends constructs_1.Construct {
32
29
  constructor(scope, id, props) {
33
30
  super(scope, id);
34
31
  if (props.auth) {
35
- this.auth = new auth_construct_1.AuthConstruct(this, props.appId + 'AuthStack', {
32
+ this.auth = new auth_construct_1.AuthConstruct(this, props.appId + 'AuthConstruct', {
36
33
  groups: props.auth.groups,
37
34
  });
38
35
  }
39
36
  if (props.storage) {
40
- this.storage = new storage_construct_1.StorageConstruct(this, 'StorageStack', props.storage);
37
+ this.storage = new storage_construct_1.StorageConstruct(this, 'StorageConstruct', props.storage);
41
38
  }
42
39
  /* create secrets for test or production environments */
43
40
  if (props.database) {
44
- this.database = new database_construct_1.DatabaseConstruct(this, 'DatabaseStack');
45
- new cdk.CfnOutput(this, 'Database Secrets', {
46
- key: 'dbSecrets',
47
- value: this.database.dbSecrets.secretName,
48
- });
41
+ this.database = new database_construct_1.DatabaseConstruct(this, 'DatabaseConstruct');
49
42
  }
50
43
  if (props.apps) {
51
44
  const apps = {};
@@ -55,25 +48,20 @@ class FullStackConstruct extends constructs_1.Construct {
55
48
  key,
56
49
  new AppTypeConstruct(this, `${key}App`, {
57
50
  queue: app.attachment?.queue,
58
- output: app.path,
59
- buildPaths: {
60
- ...('clean' in AppTypeConstruct
61
- ? AppTypeConstruct.clean(app.path, key, app.command)
62
- : {}),
63
- ...app.buildPaths,
64
- },
51
+ output: app.output,
52
+ buildParams: app.buildParams,
65
53
  }),
66
54
  ];
67
55
  })));
68
56
  this.apps = apps;
69
57
  }
70
58
  if (props.events) {
71
- this.event = new event_construct_1.EventConstruct(this, 'EventStack', {
59
+ this.event = new event_construct_1.EventConstruct(this, 'EventConstruct', {
72
60
  resources: this.apps,
73
61
  events: props.events,
74
62
  });
75
63
  }
76
- this.secret = new secret_construct_1.SecretsConstruct(this, 'SecretsStack', {
64
+ this.secret = new secret_construct_1.SecretsConstruct(this, 'SecretConstruct', {
77
65
  resources: {
78
66
  auth: this.auth,
79
67
  database: this.database,
@@ -83,24 +71,16 @@ class FullStackConstruct extends constructs_1.Construct {
83
71
  secrets: props.secrets,
84
72
  });
85
73
  if (props.cdn) {
86
- this.cdn = new cdn_construct_1.CDNConstruct(this, 'CDNStack', {
74
+ this.cdn = new cdn_construct_1.CDNConstruct(this, 'CDNConstruct', {
87
75
  routes: props.cdn.routes,
88
76
  resources: { ...this.apps, uploads: this.storage },
89
77
  });
90
- new cdk.CfnOutput(this, 'CDN Url', {
91
- key: 'cdnUrl',
92
- value: 'https://' + this.cdn.distribution.domainName,
93
- });
94
78
  }
95
79
  if (props.api) {
96
- this.api = new apigateway_construct_1.ApiGatewayConstruct(this, 'CDNStack', {
80
+ this.api = new apigateway_construct_1.ApiGatewayConstruct(this, 'ApiConstruct', {
97
81
  routes: props.api.routes,
98
82
  resources: this.apps,
99
83
  });
100
- new cdk.CfnOutput(this, 'Api Url', {
101
- key: 'apiUrl',
102
- value: this.api.api.apiEndpoint,
103
- });
104
84
  }
105
85
  const resources = {
106
86
  storage: this.storage,
@@ -117,10 +97,6 @@ class FullStackConstruct extends constructs_1.Construct {
117
97
  ?.map((val) => resources[val])
118
98
  .filter((v) => !!v) ?? []));
119
99
  }
120
- new cdk.CfnOutput(this, 'App Secrets', {
121
- key: 'appSecrets',
122
- value: this.secret.secrets.secretName,
123
- });
124
100
  }
125
101
  }
126
102
  exports.FullStackConstruct = FullStackConstruct;
@@ -1,9 +1,9 @@
1
1
  import { ResourceRef } from '@fy-stack/types';
2
2
  import * as events from 'aws-cdk-lib/aws-events';
3
3
  export declare enum AppType {
4
- NEST = "nest",
5
- NEST_API = "nestApi",
6
- DENO_API = "denoApi",
4
+ NODE_APP = "nodeApp",
5
+ NODE_API = "nestApi",
6
+ IMAGE_APP = "imageApp",
7
7
  NEXT_APP_ROUTER = "nextAppRouter"
8
8
  }
9
9
  export type AppAttachment = {
@@ -24,11 +24,10 @@ export declare enum AppGrant {
24
24
  }
25
25
  export type App = {
26
26
  type: AppType;
27
- path: string;
27
+ output: string;
28
28
  attachment?: AppAttachment;
29
29
  grant?: AppGrant[];
30
- command: string;
31
- buildPaths?: Record<string, string>;
30
+ buildParams?: Record<string, string>;
32
31
  };
33
32
  export type AppRef = {
34
33
  $app: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAEjD,oBAAY,OAAO;IACjB,IAAI,SAAS;IACb,QAAQ,YAAY;IACpB,QAAQ,YAAY;IACpB,eAAe,kBAAkB;CAClC;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,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,CAAA;CACrC,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC7B,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;KAAE,CAAC;IAC9C,GAAG,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;KAAE,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9C,CAAC"}
package/dist/lib/types.js CHANGED
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppGrant = exports.AppType = void 0;
4
4
  var AppType;
5
5
  (function (AppType) {
6
- AppType["NEST"] = "nest";
7
- AppType["NEST_API"] = "nestApi";
8
- AppType["DENO_API"] = "denoApi";
6
+ AppType["NODE_APP"] = "nodeApp";
7
+ AppType["NODE_API"] = "nestApi";
8
+ AppType["IMAGE_APP"] = "imageApp";
9
9
  AppType["NEXT_APP_ROUTER"] = "nextAppRouter";
10
10
  })(AppType || (exports.AppType = AppType = {}));
11
11
  var AppGrant;
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@fy-stack/fullstack-construct",
3
- "version": "0.0.123",
3
+ "version": "0.0.125",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.0",
6
- "@fy-stack/auth-construct": "0.0.122",
7
- "@fy-stack/storage-construct": "0.0.122",
8
- "@fy-stack/database-construct": "0.0.122",
9
- "@fy-stack/event-construct": "0.0.122",
10
- "@fy-stack/secret-construct": "0.0.122",
11
- "@fy-stack/cdn-construct": "0.0.122",
12
- "@fy-stack/apigateway-construct": "0.0.122",
13
- "@fy-stack/types": "0.0.122",
14
- "@fy-stack/app-construct": "0.0.123"
6
+ "@fy-stack/auth-construct": "0.0.125",
7
+ "@fy-stack/storage-construct": "0.0.125",
8
+ "@fy-stack/database-construct": "0.0.125",
9
+ "@fy-stack/event-construct": "0.0.125",
10
+ "@fy-stack/secret-construct": "0.0.125",
11
+ "@fy-stack/cdn-construct": "0.0.125",
12
+ "@fy-stack/apigateway-construct": "0.0.125",
13
+ "@fy-stack/types": "0.0.125",
14
+ "@fy-stack/app-construct": "0.0.125"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "aws-cdk-lib": "2.164.1",