@openhi/constructs 0.0.18 → 0.0.20
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/lib/index.d.mts +23 -1
- package/lib/index.d.ts +25 -3
- package/lib/index.js +39 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +41 -0
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.mts
CHANGED
|
@@ -885,4 +885,26 @@ declare class OpenHiDataService extends OpenHiService {
|
|
|
885
885
|
protected createDataStore(): ITable;
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
-
|
|
888
|
+
interface OpenHiGraphqlServiceProps extends OpenHiServiceProps {
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* GraphQL API service stack: creates the AppSync API via {@link RootGraphqlApi}
|
|
892
|
+
* and exports its ID via SSM. Look up from other stacks via
|
|
893
|
+
* {@link OpenHiGraphqlService.graphqlApiFromConstruct}.
|
|
894
|
+
*/
|
|
895
|
+
declare class OpenHiGraphqlService extends OpenHiService {
|
|
896
|
+
static readonly SERVICE_TYPE = "graphql-api";
|
|
897
|
+
/**
|
|
898
|
+
* Returns the GraphQL API by looking up the GraphQL stack's API ID from SSM.
|
|
899
|
+
* Use from other stacks to obtain an IGraphqlApi reference.
|
|
900
|
+
*/
|
|
901
|
+
static graphqlApiFromConstruct(scope: Construct): IGraphqlApi;
|
|
902
|
+
get serviceType(): string;
|
|
903
|
+
props: OpenHiGraphqlServiceProps;
|
|
904
|
+
readonly rootGraphqlApi: RootGraphqlApi;
|
|
905
|
+
constructor(ohEnv: OpenHiEnvironment, props?: OpenHiGraphqlServiceProps);
|
|
906
|
+
/** Creates the root GraphQL API with Cognito user pool. */
|
|
907
|
+
protected createRootGraphqlApi(): RootGraphqlApi;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
export { type BuildParameterNameProps, ChildHostedZone, type ChildHostedZoneProps, CognitoUserPool, CognitoUserPoolClient, CognitoUserPoolDomain, CognitoUserPoolKmsKey, DataEventBus, DiscoverableStringParameter, type DiscoverableStringParameterProps, DynamoDbDataStore, type DynamoDbDataStoreProps, OpenHiApp, type OpenHiAppProps, OpenHiAuthService, type OpenHiAuthServiceProps, OpenHiDataService, type OpenHiDataServiceProps, OpenHiEnvironment, type OpenHiEnvironmentProps, OpenHiGlobalService, type OpenHiGlobalServiceProps, OpenHiGraphqlService, type OpenHiGraphqlServiceProps, OpenHiRestApiService, type OpenHiRestApiServiceProps, OpenHiService, type OpenHiServiceProps, type OpenHiServiceType, OpenHiStage, type OpenHiStageProps, OpsEventBus, PreTokenGenerationLambda, REST_API_BASE_URL_SSM_NAME, type RestApiCorsOptions, RootGraphqlApi, type RootGraphqlApiProps, RootHostedZone, RootHttpApi, RootWildcardCertificate, getDynamoDbDataStoreTableName };
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { RemovalPolicy, App, AppProps, Stage, StageProps, Stack, StackProps } fr
|
|
|
2
2
|
import { Construct, IConstruct } from 'constructs';
|
|
3
3
|
import { ICertificate, Certificate, CertificateProps } from 'aws-cdk-lib/aws-certificatemanager';
|
|
4
4
|
import { IHttpApi, CorsHttpMethod, HttpApi, HttpApiProps, DomainName } from 'aws-cdk-lib/aws-apigatewayv2';
|
|
5
|
-
import {
|
|
5
|
+
import { IGraphqlApi, GraphqlApi, GraphqlApiProps } from 'aws-cdk-lib/aws-appsync';
|
|
6
6
|
import { UserPool, UserPoolProps, UserPoolClient, UserPoolClientProps, UserPoolDomain, UserPoolDomainProps, IUserPool, IUserPoolClient, IUserPoolDomain } from 'aws-cdk-lib/aws-cognito';
|
|
7
7
|
import { Key, KeyProps, IKey } from 'aws-cdk-lib/aws-kms';
|
|
8
8
|
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
|
|
@@ -965,5 +965,27 @@ declare class OpenHiDataService extends OpenHiService {
|
|
|
965
965
|
protected createDataStore(): ITable;
|
|
966
966
|
}
|
|
967
967
|
|
|
968
|
-
|
|
969
|
-
|
|
968
|
+
interface OpenHiGraphqlServiceProps extends OpenHiServiceProps {
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* GraphQL API service stack: creates the AppSync API via {@link RootGraphqlApi}
|
|
972
|
+
* and exports its ID via SSM. Look up from other stacks via
|
|
973
|
+
* {@link OpenHiGraphqlService.graphqlApiFromConstruct}.
|
|
974
|
+
*/
|
|
975
|
+
declare class OpenHiGraphqlService extends OpenHiService {
|
|
976
|
+
static readonly SERVICE_TYPE = "graphql-api";
|
|
977
|
+
/**
|
|
978
|
+
* Returns the GraphQL API by looking up the GraphQL stack's API ID from SSM.
|
|
979
|
+
* Use from other stacks to obtain an IGraphqlApi reference.
|
|
980
|
+
*/
|
|
981
|
+
static graphqlApiFromConstruct(scope: Construct): IGraphqlApi;
|
|
982
|
+
get serviceType(): string;
|
|
983
|
+
props: OpenHiGraphqlServiceProps;
|
|
984
|
+
readonly rootGraphqlApi: RootGraphqlApi;
|
|
985
|
+
constructor(ohEnv: OpenHiEnvironment, props?: OpenHiGraphqlServiceProps);
|
|
986
|
+
/** Creates the root GraphQL API with Cognito user pool. */
|
|
987
|
+
protected createRootGraphqlApi(): RootGraphqlApi;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
export { ChildHostedZone, CognitoUserPool, CognitoUserPoolClient, CognitoUserPoolDomain, CognitoUserPoolKmsKey, DataEventBus, DiscoverableStringParameter, DynamoDbDataStore, OpenHiApp, OpenHiAuthService, OpenHiDataService, OpenHiEnvironment, OpenHiGlobalService, OpenHiGraphqlService, OpenHiRestApiService, OpenHiService, OpenHiStage, OpsEventBus, PreTokenGenerationLambda, REST_API_BASE_URL_SSM_NAME, RootGraphqlApi, RootHostedZone, RootHttpApi, RootWildcardCertificate, getDynamoDbDataStoreTableName };
|
|
991
|
+
export type { BuildParameterNameProps, ChildHostedZoneProps, DiscoverableStringParameterProps, DynamoDbDataStoreProps, OpenHiAppProps, OpenHiAuthServiceProps, OpenHiDataServiceProps, OpenHiEnvironmentProps, OpenHiGlobalServiceProps, OpenHiGraphqlServiceProps, OpenHiRestApiServiceProps, OpenHiServiceProps, OpenHiServiceType, OpenHiStageProps, RestApiCorsOptions, RootGraphqlApiProps };
|
package/lib/index.js
CHANGED
|
@@ -106,6 +106,7 @@ __export(src_exports, {
|
|
|
106
106
|
OpenHiDataService: () => OpenHiDataService,
|
|
107
107
|
OpenHiEnvironment: () => OpenHiEnvironment,
|
|
108
108
|
OpenHiGlobalService: () => OpenHiGlobalService,
|
|
109
|
+
OpenHiGraphqlService: () => OpenHiGraphqlService,
|
|
109
110
|
OpenHiRestApiService: () => OpenHiRestApiService,
|
|
110
111
|
OpenHiService: () => OpenHiService,
|
|
111
112
|
OpenHiStage: () => OpenHiStage,
|
|
@@ -1401,6 +1402,43 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
|
|
|
1401
1402
|
};
|
|
1402
1403
|
_OpenHiRestApiService.SERVICE_TYPE = "rest-api";
|
|
1403
1404
|
var OpenHiRestApiService = _OpenHiRestApiService;
|
|
1405
|
+
|
|
1406
|
+
// src/services/open-hi-graphql-service.ts
|
|
1407
|
+
var import_aws_appsync2 = require("aws-cdk-lib/aws-appsync");
|
|
1408
|
+
var _OpenHiGraphqlService = class _OpenHiGraphqlService extends OpenHiService {
|
|
1409
|
+
/**
|
|
1410
|
+
* Returns the GraphQL API by looking up the GraphQL stack's API ID from SSM.
|
|
1411
|
+
* Use from other stacks to obtain an IGraphqlApi reference.
|
|
1412
|
+
*/
|
|
1413
|
+
static graphqlApiFromConstruct(scope) {
|
|
1414
|
+
return RootGraphqlApi.fromConstruct(scope);
|
|
1415
|
+
}
|
|
1416
|
+
get serviceType() {
|
|
1417
|
+
return _OpenHiGraphqlService.SERVICE_TYPE;
|
|
1418
|
+
}
|
|
1419
|
+
constructor(ohEnv, props = {}) {
|
|
1420
|
+
super(ohEnv, _OpenHiGraphqlService.SERVICE_TYPE, props);
|
|
1421
|
+
this.props = props;
|
|
1422
|
+
this.rootGraphqlApi = this.createRootGraphqlApi();
|
|
1423
|
+
}
|
|
1424
|
+
/** Creates the root GraphQL API with Cognito user pool. */
|
|
1425
|
+
createRootGraphqlApi() {
|
|
1426
|
+
const userPool = OpenHiAuthService.userPoolFromConstruct(this);
|
|
1427
|
+
return new RootGraphqlApi(this, {
|
|
1428
|
+
authorizationConfig: {
|
|
1429
|
+
defaultAuthorization: {
|
|
1430
|
+
authorizationType: import_aws_appsync2.AuthorizationType.USER_POOL,
|
|
1431
|
+
userPoolConfig: {
|
|
1432
|
+
userPool,
|
|
1433
|
+
defaultAction: import_aws_appsync2.UserPoolDefaultAction.ALLOW
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
};
|
|
1440
|
+
_OpenHiGraphqlService.SERVICE_TYPE = "graphql-api";
|
|
1441
|
+
var OpenHiGraphqlService = _OpenHiGraphqlService;
|
|
1404
1442
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1405
1443
|
0 && (module.exports = {
|
|
1406
1444
|
ChildHostedZone,
|
|
@@ -1416,6 +1454,7 @@ var OpenHiRestApiService = _OpenHiRestApiService;
|
|
|
1416
1454
|
OpenHiDataService,
|
|
1417
1455
|
OpenHiEnvironment,
|
|
1418
1456
|
OpenHiGlobalService,
|
|
1457
|
+
OpenHiGraphqlService,
|
|
1419
1458
|
OpenHiRestApiService,
|
|
1420
1459
|
OpenHiService,
|
|
1421
1460
|
OpenHiStage,
|