cdk-appsync-typescript-resolver 0.0.1 → 0.0.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/.gitattributes +2 -0
- package/.jsii +233 -32
- package/.projenrc.ts +51 -1
- package/API.md +80 -170
- package/README.md +5 -3
- package/lib/AppsyncTypescriptFunction.d.ts +1 -14
- package/lib/AppsyncTypescriptFunction.js +2 -2
- package/lib/AppsyncTypescriptFunctionProps.d.ts +51 -0
- package/lib/AppsyncTypescriptFunctionProps.js +3 -0
- package/lib/TSExpressPipelineResolver.d.ts +1 -7
- package/lib/TSExpressPipelineResolver.js +3 -3
- package/lib/TSExpressPipelineResolverProps.d.ts +44 -0
- package/lib/TSExpressPipelineResolverProps.js +3 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/package.json +2 -1
package/.gitattributes
CHANGED
|
@@ -19,5 +19,7 @@
|
|
|
19
19
|
/API.md linguist-generated
|
|
20
20
|
/LICENSE linguist-generated
|
|
21
21
|
/package.json linguist-generated
|
|
22
|
+
/src/AppsyncTypescriptFunctionProps.ts linguist-generated
|
|
23
|
+
/src/TSExpressPipelineResolverProps.ts linguist-generated
|
|
22
24
|
/tsconfig.dev.json linguist-generated
|
|
23
25
|
/yarn.lock linguist-generated
|
package/.jsii
CHANGED
|
@@ -3370,7 +3370,7 @@
|
|
|
3370
3370
|
},
|
|
3371
3371
|
"name": "cdk-appsync-typescript-resolver",
|
|
3372
3372
|
"readme": {
|
|
3373
|
-
"markdown": "# cdk-appsync-typescript-resolver\n\n[](https://
|
|
3373
|
+
"markdown": "# cdk-appsync-typescript-resolver\n\n[](https://www.npmjs.com/package/cdk-appsync-typescript-resolver.svg)\n[](https://app.codacy.com/gh/sudokar/cdk-appsync-typescript-resolver/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n[](https://opensource.org/licenses/Apache-2.0)\n[](https://github.com/sudokar/nx-serverless)\n\n\nConstructs to transpile and bundle Typescript to valid AWS Appsync's JS resolvers\n\n[](https://constructs.dev/packages/cdk-appsync-typescript-resolver)\n\n# ✨ Highlights\n\n- [AppsyncTypescriptFunction](src%2Flib%2FAppsyncTypescriptFunction.ts) - CDK construct to transpile and bundle Typescript\n- [TSExpressPipelineResolver](src%2Flib%2FJSExpressPipelineResolver.ts) - CDK construct to use AppsyncTypescriptFunction with boilerplate code\n\n# 🚀 Usage\n\n- AppsyncTypescriptFunction\n```typescript\nimport { AppsyncTypescriptFunction } from 'cdk-appsync-typescript-resolver'\n...\nconst appsyncFunction = new AppsyncTypescriptFunction(stack, \"TSDemoFunction\", {\n name: \"TSDemoFunction\",\n api: new appsync.GraphqlApi(...),\n path: path.join(__dirname, \"path\", \"to\", \"file.ts\"),\n dataSource: new appsync.DynamoDbDataSource(...),\n sourceMap: true,\n});\n```\n\n- TSExpressPipelineResolver\n\n```typescript\nimport { TSExpressPipelineResolver } from 'cdk-appsync-typescript-resolver'\n...\nconst resolver = new TSExpressPipelineResolver(testStack, \"DemoResolver\", {\n api: new appsync.GraphqlApi(...),\n typeName: \"Query\",\n fieldName: \"hello\",\n tsFunction: new AppsyncTypescriptFunction(...),\n});\n```"
|
|
3374
3374
|
},
|
|
3375
3375
|
"repository": {
|
|
3376
3376
|
"type": "git",
|
|
@@ -3397,7 +3397,7 @@
|
|
|
3397
3397
|
},
|
|
3398
3398
|
"locationInModule": {
|
|
3399
3399
|
"filename": "src/AppsyncTypescriptFunction.ts",
|
|
3400
|
-
"line":
|
|
3400
|
+
"line": 10
|
|
3401
3401
|
},
|
|
3402
3402
|
"parameters": [
|
|
3403
3403
|
{
|
|
@@ -3423,7 +3423,7 @@
|
|
|
3423
3423
|
"kind": "class",
|
|
3424
3424
|
"locationInModule": {
|
|
3425
3425
|
"filename": "src/AppsyncTypescriptFunction.ts",
|
|
3426
|
-
"line":
|
|
3426
|
+
"line": 9
|
|
3427
3427
|
},
|
|
3428
3428
|
"name": "AppsyncTypescriptFunction",
|
|
3429
3429
|
"symbolId": "src/AppsyncTypescriptFunction:AppsyncTypescriptFunction"
|
|
@@ -3432,19 +3432,65 @@
|
|
|
3432
3432
|
"assembly": "cdk-appsync-typescript-resolver",
|
|
3433
3433
|
"datatype": true,
|
|
3434
3434
|
"docs": {
|
|
3435
|
-
"stability": "stable"
|
|
3435
|
+
"stability": "stable",
|
|
3436
|
+
"summary": "AppsyncTypescriptFunctionProps."
|
|
3436
3437
|
},
|
|
3437
3438
|
"fqn": "cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps",
|
|
3438
|
-
"interfaces": [
|
|
3439
|
-
"aws-cdk-lib.aws_appsync.AppsyncFunctionProps"
|
|
3440
|
-
],
|
|
3441
3439
|
"kind": "interface",
|
|
3442
3440
|
"locationInModule": {
|
|
3443
|
-
"filename": "src/
|
|
3444
|
-
"line":
|
|
3441
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3442
|
+
"line": 7
|
|
3445
3443
|
},
|
|
3446
3444
|
"name": "AppsyncTypescriptFunctionProps",
|
|
3447
3445
|
"properties": [
|
|
3446
|
+
{
|
|
3447
|
+
"abstract": true,
|
|
3448
|
+
"docs": {
|
|
3449
|
+
"stability": "stable",
|
|
3450
|
+
"summary": "the GraphQL Api linked to this AppSync Function."
|
|
3451
|
+
},
|
|
3452
|
+
"immutable": true,
|
|
3453
|
+
"locationInModule": {
|
|
3454
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3455
|
+
"line": 17
|
|
3456
|
+
},
|
|
3457
|
+
"name": "api",
|
|
3458
|
+
"type": {
|
|
3459
|
+
"fqn": "aws-cdk-lib.aws_appsync.IGraphqlApi"
|
|
3460
|
+
}
|
|
3461
|
+
},
|
|
3462
|
+
{
|
|
3463
|
+
"abstract": true,
|
|
3464
|
+
"docs": {
|
|
3465
|
+
"stability": "stable",
|
|
3466
|
+
"summary": "the data source linked to this AppSync Function."
|
|
3467
|
+
},
|
|
3468
|
+
"immutable": true,
|
|
3469
|
+
"locationInModule": {
|
|
3470
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3471
|
+
"line": 12
|
|
3472
|
+
},
|
|
3473
|
+
"name": "dataSource",
|
|
3474
|
+
"type": {
|
|
3475
|
+
"fqn": "aws-cdk-lib.aws_appsync.BaseDataSource"
|
|
3476
|
+
}
|
|
3477
|
+
},
|
|
3478
|
+
{
|
|
3479
|
+
"abstract": true,
|
|
3480
|
+
"docs": {
|
|
3481
|
+
"stability": "stable",
|
|
3482
|
+
"summary": "the name of the AppSync Function."
|
|
3483
|
+
},
|
|
3484
|
+
"immutable": true,
|
|
3485
|
+
"locationInModule": {
|
|
3486
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3487
|
+
"line": 40
|
|
3488
|
+
},
|
|
3489
|
+
"name": "name",
|
|
3490
|
+
"type": {
|
|
3491
|
+
"primitive": "string"
|
|
3492
|
+
}
|
|
3493
|
+
},
|
|
3448
3494
|
{
|
|
3449
3495
|
"abstract": true,
|
|
3450
3496
|
"docs": {
|
|
@@ -3453,8 +3499,8 @@
|
|
|
3453
3499
|
},
|
|
3454
3500
|
"immutable": true,
|
|
3455
3501
|
"locationInModule": {
|
|
3456
|
-
"filename": "src/
|
|
3457
|
-
"line":
|
|
3502
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3503
|
+
"line": 52
|
|
3458
3504
|
},
|
|
3459
3505
|
"name": "path",
|
|
3460
3506
|
"type": {
|
|
@@ -3464,14 +3510,32 @@
|
|
|
3464
3510
|
{
|
|
3465
3511
|
"abstract": true,
|
|
3466
3512
|
"docs": {
|
|
3467
|
-
"
|
|
3513
|
+
"default": "- no description",
|
|
3514
|
+
"stability": "stable",
|
|
3515
|
+
"summary": "the description for this AppSync Function."
|
|
3516
|
+
},
|
|
3517
|
+
"immutable": true,
|
|
3518
|
+
"locationInModule": {
|
|
3519
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3520
|
+
"line": 35
|
|
3521
|
+
},
|
|
3522
|
+
"name": "description",
|
|
3523
|
+
"optional": true,
|
|
3524
|
+
"type": {
|
|
3525
|
+
"primitive": "string"
|
|
3526
|
+
}
|
|
3527
|
+
},
|
|
3528
|
+
{
|
|
3529
|
+
"abstract": true,
|
|
3530
|
+
"docs": {
|
|
3531
|
+
"remarks": "e.g { ENV: \"PROD\" }",
|
|
3468
3532
|
"stability": "stable",
|
|
3469
3533
|
"summary": "A map of replacement strings in the bundled code."
|
|
3470
3534
|
},
|
|
3471
3535
|
"immutable": true,
|
|
3472
3536
|
"locationInModule": {
|
|
3473
|
-
"filename": "src/
|
|
3474
|
-
"line":
|
|
3537
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3538
|
+
"line": 44
|
|
3475
3539
|
},
|
|
3476
3540
|
"name": "replaceStrings",
|
|
3477
3541
|
"optional": true,
|
|
@@ -3487,13 +3551,50 @@
|
|
|
3487
3551
|
{
|
|
3488
3552
|
"abstract": true,
|
|
3489
3553
|
"docs": {
|
|
3554
|
+
"default": "- no request mapping template",
|
|
3490
3555
|
"stability": "stable",
|
|
3491
|
-
"summary": "
|
|
3556
|
+
"summary": "the request mapping template for the AppSync Function."
|
|
3492
3557
|
},
|
|
3493
3558
|
"immutable": true,
|
|
3494
3559
|
"locationInModule": {
|
|
3495
|
-
"filename": "src/
|
|
3496
|
-
"line":
|
|
3560
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3561
|
+
"line": 29
|
|
3562
|
+
},
|
|
3563
|
+
"name": "requestMappingTemplate",
|
|
3564
|
+
"optional": true,
|
|
3565
|
+
"type": {
|
|
3566
|
+
"fqn": "aws-cdk-lib.aws_appsync.MappingTemplate"
|
|
3567
|
+
}
|
|
3568
|
+
},
|
|
3569
|
+
{
|
|
3570
|
+
"abstract": true,
|
|
3571
|
+
"docs": {
|
|
3572
|
+
"default": "- no response mapping template",
|
|
3573
|
+
"stability": "stable",
|
|
3574
|
+
"summary": "the response mapping template for the AppSync Function."
|
|
3575
|
+
},
|
|
3576
|
+
"immutable": true,
|
|
3577
|
+
"locationInModule": {
|
|
3578
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3579
|
+
"line": 23
|
|
3580
|
+
},
|
|
3581
|
+
"name": "responseMappingTemplate",
|
|
3582
|
+
"optional": true,
|
|
3583
|
+
"type": {
|
|
3584
|
+
"fqn": "aws-cdk-lib.aws_appsync.MappingTemplate"
|
|
3585
|
+
}
|
|
3586
|
+
},
|
|
3587
|
+
{
|
|
3588
|
+
"abstract": true,
|
|
3589
|
+
"docs": {
|
|
3590
|
+
"remarks": "defaults to false",
|
|
3591
|
+
"stability": "stable",
|
|
3592
|
+
"summary": "Flag to enable or disable source maps in bundled code."
|
|
3593
|
+
},
|
|
3594
|
+
"immutable": true,
|
|
3595
|
+
"locationInModule": {
|
|
3596
|
+
"filename": "src/AppsyncTypescriptFunctionProps.ts",
|
|
3597
|
+
"line": 48
|
|
3497
3598
|
},
|
|
3498
3599
|
"name": "sourceMap",
|
|
3499
3600
|
"optional": true,
|
|
@@ -3502,7 +3603,7 @@
|
|
|
3502
3603
|
}
|
|
3503
3604
|
}
|
|
3504
3605
|
],
|
|
3505
|
-
"symbolId": "src/
|
|
3606
|
+
"symbolId": "src/AppsyncTypescriptFunctionProps:AppsyncTypescriptFunctionProps"
|
|
3506
3607
|
},
|
|
3507
3608
|
"cdk-appsync-typescript-resolver.TSExpressPipelineResolver": {
|
|
3508
3609
|
"assembly": "cdk-appsync-typescript-resolver",
|
|
@@ -3518,7 +3619,7 @@
|
|
|
3518
3619
|
},
|
|
3519
3620
|
"locationInModule": {
|
|
3520
3621
|
"filename": "src/TSExpressPipelineResolver.ts",
|
|
3521
|
-
"line":
|
|
3622
|
+
"line": 19
|
|
3522
3623
|
},
|
|
3523
3624
|
"parameters": [
|
|
3524
3625
|
{
|
|
@@ -3544,7 +3645,7 @@
|
|
|
3544
3645
|
"kind": "class",
|
|
3545
3646
|
"locationInModule": {
|
|
3546
3647
|
"filename": "src/TSExpressPipelineResolver.ts",
|
|
3547
|
-
"line":
|
|
3648
|
+
"line": 18
|
|
3548
3649
|
},
|
|
3549
3650
|
"name": "TSExpressPipelineResolver",
|
|
3550
3651
|
"symbolId": "src/TSExpressPipelineResolver:TSExpressPipelineResolver"
|
|
@@ -3553,19 +3654,49 @@
|
|
|
3553
3654
|
"assembly": "cdk-appsync-typescript-resolver",
|
|
3554
3655
|
"datatype": true,
|
|
3555
3656
|
"docs": {
|
|
3556
|
-
"stability": "stable"
|
|
3657
|
+
"stability": "stable",
|
|
3658
|
+
"summary": "TSExpressPipelineResolverProps."
|
|
3557
3659
|
},
|
|
3558
3660
|
"fqn": "cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps",
|
|
3559
|
-
"interfaces": [
|
|
3560
|
-
"aws-cdk-lib.aws_appsync.ResolverProps"
|
|
3561
|
-
],
|
|
3562
3661
|
"kind": "interface",
|
|
3563
3662
|
"locationInModule": {
|
|
3564
|
-
"filename": "src/
|
|
3565
|
-
"line":
|
|
3663
|
+
"filename": "src/TSExpressPipelineResolverProps.ts",
|
|
3664
|
+
"line": 8
|
|
3566
3665
|
},
|
|
3567
3666
|
"name": "TSExpressPipelineResolverProps",
|
|
3568
3667
|
"properties": [
|
|
3668
|
+
{
|
|
3669
|
+
"abstract": true,
|
|
3670
|
+
"docs": {
|
|
3671
|
+
"stability": "stable",
|
|
3672
|
+
"summary": "The API this resolver is attached to."
|
|
3673
|
+
},
|
|
3674
|
+
"immutable": true,
|
|
3675
|
+
"locationInModule": {
|
|
3676
|
+
"filename": "src/TSExpressPipelineResolverProps.ts",
|
|
3677
|
+
"line": 13
|
|
3678
|
+
},
|
|
3679
|
+
"name": "api",
|
|
3680
|
+
"type": {
|
|
3681
|
+
"fqn": "aws-cdk-lib.aws_appsync.IGraphqlApi"
|
|
3682
|
+
}
|
|
3683
|
+
},
|
|
3684
|
+
{
|
|
3685
|
+
"abstract": true,
|
|
3686
|
+
"docs": {
|
|
3687
|
+
"stability": "stable",
|
|
3688
|
+
"summary": "name of the GraphQL field in the given type this resolver is attached to."
|
|
3689
|
+
},
|
|
3690
|
+
"immutable": true,
|
|
3691
|
+
"locationInModule": {
|
|
3692
|
+
"filename": "src/TSExpressPipelineResolverProps.ts",
|
|
3693
|
+
"line": 41
|
|
3694
|
+
},
|
|
3695
|
+
"name": "fieldName",
|
|
3696
|
+
"type": {
|
|
3697
|
+
"primitive": "string"
|
|
3698
|
+
}
|
|
3699
|
+
},
|
|
3569
3700
|
{
|
|
3570
3701
|
"abstract": true,
|
|
3571
3702
|
"docs": {
|
|
@@ -3574,18 +3705,88 @@
|
|
|
3574
3705
|
},
|
|
3575
3706
|
"immutable": true,
|
|
3576
3707
|
"locationInModule": {
|
|
3577
|
-
"filename": "src/
|
|
3578
|
-
"line":
|
|
3708
|
+
"filename": "src/TSExpressPipelineResolverProps.ts",
|
|
3709
|
+
"line": 45
|
|
3579
3710
|
},
|
|
3580
|
-
"name": "
|
|
3711
|
+
"name": "tsFunction",
|
|
3581
3712
|
"type": {
|
|
3582
3713
|
"fqn": "cdk-appsync-typescript-resolver.AppsyncTypescriptFunction"
|
|
3583
3714
|
}
|
|
3715
|
+
},
|
|
3716
|
+
{
|
|
3717
|
+
"abstract": true,
|
|
3718
|
+
"docs": {
|
|
3719
|
+
"stability": "stable",
|
|
3720
|
+
"summary": "name of the GraphQL type this resolver is attached to."
|
|
3721
|
+
},
|
|
3722
|
+
"immutable": true,
|
|
3723
|
+
"locationInModule": {
|
|
3724
|
+
"filename": "src/TSExpressPipelineResolverProps.ts",
|
|
3725
|
+
"line": 36
|
|
3726
|
+
},
|
|
3727
|
+
"name": "typeName",
|
|
3728
|
+
"type": {
|
|
3729
|
+
"primitive": "string"
|
|
3730
|
+
}
|
|
3731
|
+
},
|
|
3732
|
+
{
|
|
3733
|
+
"abstract": true,
|
|
3734
|
+
"docs": {
|
|
3735
|
+
"default": "- No caching configuration",
|
|
3736
|
+
"stability": "stable",
|
|
3737
|
+
"summary": "The caching configuration for this resolver."
|
|
3738
|
+
},
|
|
3739
|
+
"immutable": true,
|
|
3740
|
+
"locationInModule": {
|
|
3741
|
+
"filename": "src/TSExpressPipelineResolverProps.ts",
|
|
3742
|
+
"line": 31
|
|
3743
|
+
},
|
|
3744
|
+
"name": "cachingConfig",
|
|
3745
|
+
"optional": true,
|
|
3746
|
+
"type": {
|
|
3747
|
+
"fqn": "aws-cdk-lib.aws_appsync.CachingConfig"
|
|
3748
|
+
}
|
|
3749
|
+
},
|
|
3750
|
+
{
|
|
3751
|
+
"abstract": true,
|
|
3752
|
+
"docs": {
|
|
3753
|
+
"default": "- No datasource",
|
|
3754
|
+
"stability": "stable",
|
|
3755
|
+
"summary": "The data source this resolver is using."
|
|
3756
|
+
},
|
|
3757
|
+
"immutable": true,
|
|
3758
|
+
"locationInModule": {
|
|
3759
|
+
"filename": "src/TSExpressPipelineResolverProps.ts",
|
|
3760
|
+
"line": 19
|
|
3761
|
+
},
|
|
3762
|
+
"name": "dataSource",
|
|
3763
|
+
"optional": true,
|
|
3764
|
+
"type": {
|
|
3765
|
+
"fqn": "aws-cdk-lib.aws_appsync.BaseDataSource"
|
|
3766
|
+
}
|
|
3767
|
+
},
|
|
3768
|
+
{
|
|
3769
|
+
"abstract": true,
|
|
3770
|
+
"docs": {
|
|
3771
|
+
"default": "- No max batch size",
|
|
3772
|
+
"stability": "stable",
|
|
3773
|
+
"summary": "The maximum number of elements per batch, when using batch invoke."
|
|
3774
|
+
},
|
|
3775
|
+
"immutable": true,
|
|
3776
|
+
"locationInModule": {
|
|
3777
|
+
"filename": "src/TSExpressPipelineResolverProps.ts",
|
|
3778
|
+
"line": 25
|
|
3779
|
+
},
|
|
3780
|
+
"name": "maxBatchSize",
|
|
3781
|
+
"optional": true,
|
|
3782
|
+
"type": {
|
|
3783
|
+
"primitive": "number"
|
|
3784
|
+
}
|
|
3584
3785
|
}
|
|
3585
3786
|
],
|
|
3586
|
-
"symbolId": "src/
|
|
3787
|
+
"symbolId": "src/TSExpressPipelineResolverProps:TSExpressPipelineResolverProps"
|
|
3587
3788
|
}
|
|
3588
3789
|
},
|
|
3589
|
-
"version": "0.0.
|
|
3590
|
-
"fingerprint": "
|
|
3790
|
+
"version": "0.0.2",
|
|
3791
|
+
"fingerprint": "rU6Y0df3zXEb6+D9ZSsDkU2vec85Rtt3gy5YVxxbETw="
|
|
3591
3792
|
}
|
package/.projenrc.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { CollectionKind, PrimitiveType } from '@jsii/spec';
|
|
2
|
+
import { ProjenStruct, Struct } from '@mrgrain/jsii-struct-builder';
|
|
1
3
|
import { awscdk } from 'projen';
|
|
4
|
+
|
|
2
5
|
const project = new awscdk.AwsCdkConstructLibrary({
|
|
3
6
|
author: 'sudokar',
|
|
4
7
|
authorAddress: 'sudokar@yahoo.com',
|
|
@@ -11,7 +14,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
|
|
|
11
14
|
keywords: ['appsync', 'typescript', 'resolver', 'javascript'],
|
|
12
15
|
|
|
13
16
|
description: 'AWS CDK construct to build AppSync JS resolvers using Typescript',
|
|
14
|
-
devDeps: ['@aws-appsync/utils'], /* Build dependencies for this module. */
|
|
17
|
+
devDeps: ['@aws-appsync/utils', '@mrgrain/jsii-struct-builder'], /* Build dependencies for this module. */
|
|
15
18
|
packageName: 'cdk-appsync-typescript-resolver',
|
|
16
19
|
tsconfigDev: {
|
|
17
20
|
compilerOptions: {
|
|
@@ -23,4 +26,51 @@ const project = new awscdk.AwsCdkConstructLibrary({
|
|
|
23
26
|
releaseToNpm: true,
|
|
24
27
|
gitignore: ['/.idea/'],
|
|
25
28
|
});
|
|
29
|
+
|
|
30
|
+
new ProjenStruct(project, { name: 'AppsyncTypescriptFunctionProps' })
|
|
31
|
+
.mixin(Struct.fromFqn('aws-cdk-lib.aws_appsync.AppsyncFunctionProps'))
|
|
32
|
+
.withoutDeprecated()
|
|
33
|
+
.omit('code', 'runtime')
|
|
34
|
+
.add({
|
|
35
|
+
name: 'path',
|
|
36
|
+
type: { primitive: PrimitiveType.String },
|
|
37
|
+
docs: {
|
|
38
|
+
summary: 'Path of typescript file that will be transpiled and bundled',
|
|
39
|
+
},
|
|
40
|
+
}, {
|
|
41
|
+
name: 'sourceMap',
|
|
42
|
+
optional: true,
|
|
43
|
+
type: { primitive: PrimitiveType.Boolean },
|
|
44
|
+
docs: {
|
|
45
|
+
summary: 'Flag to enable or disable source maps in bundled code. defaults to false',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'replaceStrings',
|
|
50
|
+
optional: true,
|
|
51
|
+
type: { collection: { kind: CollectionKind.Map, elementtype: { primitive: PrimitiveType.String } } },
|
|
52
|
+
docs: {
|
|
53
|
+
summary: 'A map of replacement strings in the bundled code. e.g { ENV: "PROD" }',
|
|
54
|
+
example: '{ ENV: "PROD" }',
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
new ProjenStruct(project, { name: 'TSExpressPipelineResolverProps' })
|
|
59
|
+
.mixin(Struct.fromFqn('aws-cdk-lib.aws_appsync.ResolverProps'))
|
|
60
|
+
.withoutDeprecated()
|
|
61
|
+
.omit(
|
|
62
|
+
'pipelineConfig',
|
|
63
|
+
'requestMappingTemplate',
|
|
64
|
+
'responseMappingTemplate',
|
|
65
|
+
'code',
|
|
66
|
+
'runtime')
|
|
67
|
+
.add({
|
|
68
|
+
name: 'tsFunction',
|
|
69
|
+
type: { fqn: 'cdk-appsync-typescript-resolver.AppsyncTypescriptFunction' },
|
|
70
|
+
docs: {
|
|
71
|
+
summary: 'Instance of AppsyncTypescriptFunction construct',
|
|
72
|
+
see: 'AppsyncTypescriptFunction',
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
26
76
|
project.synth();
|
package/API.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# cdk-appsync-typescript-resolver
|
|
2
2
|
|
|
3
|
-
[](https://
|
|
3
|
+
[](https://www.npmjs.com/package/cdk-appsync-typescript-resolver.svg)
|
|
4
4
|
[](https://app.codacy.com/gh/sudokar/cdk-appsync-typescript-resolver/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
|
5
5
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
6
|
[](https://github.com/sudokar/nx-serverless)
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
Constructs to transpile and bundle Typescript to valid AWS Appsync's JS resolvers
|
|
10
10
|
|
|
11
|
+
[](https://constructs.dev/packages/cdk-appsync-typescript-resolver)
|
|
12
|
+
|
|
11
13
|
# ✨ Highlights
|
|
12
14
|
|
|
13
15
|
- [AppsyncTypescriptFunction](src%2Flib%2FAppsyncTypescriptFunction.ts) - CDK construct to transpile and bundle Typescript
|
|
@@ -24,7 +26,7 @@ const appsyncFunction = new AppsyncTypescriptFunction(stack, "TSDemoFunction", {
|
|
|
24
26
|
api: new appsync.GraphqlApi(...),
|
|
25
27
|
path: path.join(__dirname, "path", "to", "file.ts"),
|
|
26
28
|
dataSource: new appsync.DynamoDbDataSource(...),
|
|
27
|
-
sourceMap,
|
|
29
|
+
sourceMap: true,
|
|
28
30
|
});
|
|
29
31
|
```
|
|
30
32
|
|
|
@@ -37,7 +39,7 @@ const resolver = new TSExpressPipelineResolver(testStack, "DemoResolver", {
|
|
|
37
39
|
api: new appsync.GraphqlApi(...),
|
|
38
40
|
typeName: "Query",
|
|
39
41
|
fieldName: "hello",
|
|
40
|
-
|
|
42
|
+
tsFunction: new AppsyncTypescriptFunction(...),
|
|
41
43
|
});
|
|
42
44
|
```
|
|
43
45
|
# API Reference <a name="API Reference" id="api-reference"></a>
|
|
@@ -434,6 +436,8 @@ the ARN of the resolver.
|
|
|
434
436
|
|
|
435
437
|
### AppsyncTypescriptFunctionProps <a name="AppsyncTypescriptFunctionProps" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps"></a>
|
|
436
438
|
|
|
439
|
+
AppsyncTypescriptFunctionProps.
|
|
440
|
+
|
|
437
441
|
#### Initializer <a name="Initializer" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.Initializer"></a>
|
|
438
442
|
|
|
439
443
|
```typescript
|
|
@@ -446,144 +450,116 @@ const appsyncTypescriptFunctionProps: AppsyncTypescriptFunctionProps = { ... }
|
|
|
446
450
|
|
|
447
451
|
| **Name** | **Type** | **Description** |
|
|
448
452
|
| --- | --- | --- |
|
|
449
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.name">name</a></code> | <code>string</code> | the name of the AppSync Function. |
|
|
450
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.code">code</a></code> | <code>aws-cdk-lib.aws_appsync.Code</code> | The function code. |
|
|
451
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.description">description</a></code> | <code>string</code> | the description for this AppSync Function. |
|
|
452
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.requestMappingTemplate">requestMappingTemplate</a></code> | <code>aws-cdk-lib.aws_appsync.MappingTemplate</code> | the request mapping template for the AppSync Function. |
|
|
453
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.responseMappingTemplate">responseMappingTemplate</a></code> | <code>aws-cdk-lib.aws_appsync.MappingTemplate</code> | the response mapping template for the AppSync Function. |
|
|
454
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.runtime">runtime</a></code> | <code>aws-cdk-lib.aws_appsync.FunctionRuntime</code> | The functions runtime. |
|
|
455
453
|
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.api">api</a></code> | <code>aws-cdk-lib.aws_appsync.IGraphqlApi</code> | the GraphQL Api linked to this AppSync Function. |
|
|
456
454
|
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.dataSource">dataSource</a></code> | <code>aws-cdk-lib.aws_appsync.BaseDataSource</code> | the data source linked to this AppSync Function. |
|
|
455
|
+
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.name">name</a></code> | <code>string</code> | the name of the AppSync Function. |
|
|
457
456
|
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.path">path</a></code> | <code>string</code> | Path of typescript file that will be transpiled and bundled. |
|
|
457
|
+
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.description">description</a></code> | <code>string</code> | the description for this AppSync Function. |
|
|
458
458
|
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.replaceStrings">replaceStrings</a></code> | <code>{[ key: string ]: string}</code> | A map of replacement strings in the bundled code. |
|
|
459
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.
|
|
459
|
+
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.requestMappingTemplate">requestMappingTemplate</a></code> | <code>aws-cdk-lib.aws_appsync.MappingTemplate</code> | the request mapping template for the AppSync Function. |
|
|
460
|
+
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.responseMappingTemplate">responseMappingTemplate</a></code> | <code>aws-cdk-lib.aws_appsync.MappingTemplate</code> | the response mapping template for the AppSync Function. |
|
|
461
|
+
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.sourceMap">sourceMap</a></code> | <code>boolean</code> | Flag to enable or disable source maps in bundled code. |
|
|
460
462
|
|
|
461
463
|
---
|
|
462
464
|
|
|
463
|
-
##### `
|
|
465
|
+
##### `api`<sup>Required</sup> <a name="api" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.api"></a>
|
|
464
466
|
|
|
465
467
|
```typescript
|
|
466
|
-
public readonly
|
|
468
|
+
public readonly api: IGraphqlApi;
|
|
467
469
|
```
|
|
468
470
|
|
|
469
|
-
- *Type:*
|
|
471
|
+
- *Type:* aws-cdk-lib.aws_appsync.IGraphqlApi
|
|
470
472
|
|
|
471
|
-
the
|
|
473
|
+
the GraphQL Api linked to this AppSync Function.
|
|
472
474
|
|
|
473
475
|
---
|
|
474
476
|
|
|
475
|
-
##### `
|
|
477
|
+
##### `dataSource`<sup>Required</sup> <a name="dataSource" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.dataSource"></a>
|
|
476
478
|
|
|
477
479
|
```typescript
|
|
478
|
-
public readonly
|
|
480
|
+
public readonly dataSource: BaseDataSource;
|
|
479
481
|
```
|
|
480
482
|
|
|
481
|
-
- *Type:* aws-cdk-lib.aws_appsync.
|
|
482
|
-
- *Default:* no code is used
|
|
483
|
+
- *Type:* aws-cdk-lib.aws_appsync.BaseDataSource
|
|
483
484
|
|
|
484
|
-
|
|
485
|
+
the data source linked to this AppSync Function.
|
|
485
486
|
|
|
486
487
|
---
|
|
487
488
|
|
|
488
|
-
##### `
|
|
489
|
+
##### `name`<sup>Required</sup> <a name="name" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.name"></a>
|
|
489
490
|
|
|
490
491
|
```typescript
|
|
491
|
-
public readonly
|
|
492
|
+
public readonly name: string;
|
|
492
493
|
```
|
|
493
494
|
|
|
494
495
|
- *Type:* string
|
|
495
|
-
- *Default:* no description
|
|
496
|
-
|
|
497
|
-
the description for this AppSync Function.
|
|
498
|
-
|
|
499
|
-
---
|
|
500
|
-
|
|
501
|
-
##### `requestMappingTemplate`<sup>Optional</sup> <a name="requestMappingTemplate" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.requestMappingTemplate"></a>
|
|
502
|
-
|
|
503
|
-
```typescript
|
|
504
|
-
public readonly requestMappingTemplate: MappingTemplate;
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate
|
|
508
|
-
- *Default:* no request mapping template
|
|
509
496
|
|
|
510
|
-
the
|
|
497
|
+
the name of the AppSync Function.
|
|
511
498
|
|
|
512
499
|
---
|
|
513
500
|
|
|
514
|
-
##### `
|
|
501
|
+
##### `path`<sup>Required</sup> <a name="path" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.path"></a>
|
|
515
502
|
|
|
516
503
|
```typescript
|
|
517
|
-
public readonly
|
|
504
|
+
public readonly path: string;
|
|
518
505
|
```
|
|
519
506
|
|
|
520
|
-
- *Type:*
|
|
521
|
-
- *Default:* no response mapping template
|
|
507
|
+
- *Type:* string
|
|
522
508
|
|
|
523
|
-
|
|
509
|
+
Path of typescript file that will be transpiled and bundled.
|
|
524
510
|
|
|
525
511
|
---
|
|
526
512
|
|
|
527
|
-
##### `
|
|
513
|
+
##### `description`<sup>Optional</sup> <a name="description" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.description"></a>
|
|
528
514
|
|
|
529
515
|
```typescript
|
|
530
|
-
public readonly
|
|
516
|
+
public readonly description: string;
|
|
531
517
|
```
|
|
532
518
|
|
|
533
|
-
- *Type:*
|
|
534
|
-
- *Default:* no
|
|
519
|
+
- *Type:* string
|
|
520
|
+
- *Default:* no description
|
|
535
521
|
|
|
536
|
-
|
|
522
|
+
the description for this AppSync Function.
|
|
537
523
|
|
|
538
524
|
---
|
|
539
525
|
|
|
540
|
-
##### `
|
|
526
|
+
##### `replaceStrings`<sup>Optional</sup> <a name="replaceStrings" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.replaceStrings"></a>
|
|
541
527
|
|
|
542
528
|
```typescript
|
|
543
|
-
public readonly
|
|
529
|
+
public readonly replaceStrings: {[ key: string ]: string};
|
|
544
530
|
```
|
|
545
531
|
|
|
546
|
-
- *Type:*
|
|
547
|
-
|
|
548
|
-
the GraphQL Api linked to this AppSync Function.
|
|
549
|
-
|
|
550
|
-
---
|
|
551
|
-
|
|
552
|
-
##### `dataSource`<sup>Required</sup> <a name="dataSource" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.dataSource"></a>
|
|
553
|
-
|
|
554
|
-
```typescript
|
|
555
|
-
public readonly dataSource: BaseDataSource;
|
|
556
|
-
```
|
|
532
|
+
- *Type:* {[ key: string ]: string}
|
|
557
533
|
|
|
558
|
-
|
|
534
|
+
A map of replacement strings in the bundled code.
|
|
559
535
|
|
|
560
|
-
|
|
536
|
+
e.g { ENV: "PROD" }
|
|
561
537
|
|
|
562
538
|
---
|
|
563
539
|
|
|
564
|
-
##### `
|
|
540
|
+
##### `requestMappingTemplate`<sup>Optional</sup> <a name="requestMappingTemplate" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.requestMappingTemplate"></a>
|
|
565
541
|
|
|
566
542
|
```typescript
|
|
567
|
-
public readonly
|
|
543
|
+
public readonly requestMappingTemplate: MappingTemplate;
|
|
568
544
|
```
|
|
569
545
|
|
|
570
|
-
- *Type:*
|
|
546
|
+
- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate
|
|
547
|
+
- *Default:* no request mapping template
|
|
571
548
|
|
|
572
|
-
|
|
549
|
+
the request mapping template for the AppSync Function.
|
|
573
550
|
|
|
574
551
|
---
|
|
575
552
|
|
|
576
|
-
##### `
|
|
553
|
+
##### `responseMappingTemplate`<sup>Optional</sup> <a name="responseMappingTemplate" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.responseMappingTemplate"></a>
|
|
577
554
|
|
|
578
555
|
```typescript
|
|
579
|
-
public readonly
|
|
556
|
+
public readonly responseMappingTemplate: MappingTemplate;
|
|
580
557
|
```
|
|
581
558
|
|
|
582
|
-
- *Type:*
|
|
583
|
-
|
|
584
|
-
A map of replacement strings in the bundled code.
|
|
559
|
+
- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate
|
|
560
|
+
- *Default:* no response mapping template
|
|
585
561
|
|
|
586
|
-
|
|
562
|
+
the response mapping template for the AppSync Function.
|
|
587
563
|
|
|
588
564
|
---
|
|
589
565
|
|
|
@@ -595,12 +571,16 @@ public readonly sourceMap: boolean;
|
|
|
595
571
|
|
|
596
572
|
- *Type:* boolean
|
|
597
573
|
|
|
598
|
-
Flag to enable or disable source maps in bundled code
|
|
574
|
+
Flag to enable or disable source maps in bundled code.
|
|
575
|
+
|
|
576
|
+
defaults to false
|
|
599
577
|
|
|
600
578
|
---
|
|
601
579
|
|
|
602
580
|
### TSExpressPipelineResolverProps <a name="TSExpressPipelineResolverProps" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps"></a>
|
|
603
581
|
|
|
582
|
+
TSExpressPipelineResolverProps.
|
|
583
|
+
|
|
604
584
|
#### Initializer <a name="Initializer" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.Initializer"></a>
|
|
605
585
|
|
|
606
586
|
```typescript
|
|
@@ -613,133 +593,74 @@ const tSExpressPipelineResolverProps: TSExpressPipelineResolverProps = { ... }
|
|
|
613
593
|
|
|
614
594
|
| **Name** | **Type** | **Description** |
|
|
615
595
|
| --- | --- | --- |
|
|
596
|
+
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.api">api</a></code> | <code>aws-cdk-lib.aws_appsync.IGraphqlApi</code> | The API this resolver is attached to. |
|
|
616
597
|
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.fieldName">fieldName</a></code> | <code>string</code> | name of the GraphQL field in the given type this resolver is attached to. |
|
|
598
|
+
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.tsFunction">tsFunction</a></code> | <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunction">AppsyncTypescriptFunction</a></code> | Instance of AppsyncTypescriptFunction construct. |
|
|
617
599
|
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.typeName">typeName</a></code> | <code>string</code> | name of the GraphQL type this resolver is attached to. |
|
|
618
600
|
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.cachingConfig">cachingConfig</a></code> | <code>aws-cdk-lib.aws_appsync.CachingConfig</code> | The caching configuration for this resolver. |
|
|
619
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.code">code</a></code> | <code>aws-cdk-lib.aws_appsync.Code</code> | The function code. |
|
|
620
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.maxBatchSize">maxBatchSize</a></code> | <code>number</code> | The maximum number of elements per batch, when using batch invoke. |
|
|
621
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.pipelineConfig">pipelineConfig</a></code> | <code>aws-cdk-lib.aws_appsync.IAppsyncFunction[]</code> | configuration of the pipeline resolver. |
|
|
622
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.requestMappingTemplate">requestMappingTemplate</a></code> | <code>aws-cdk-lib.aws_appsync.MappingTemplate</code> | The request mapping template for this resolver. |
|
|
623
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.responseMappingTemplate">responseMappingTemplate</a></code> | <code>aws-cdk-lib.aws_appsync.MappingTemplate</code> | The response mapping template for this resolver. |
|
|
624
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.runtime">runtime</a></code> | <code>aws-cdk-lib.aws_appsync.FunctionRuntime</code> | The functions runtime. |
|
|
625
601
|
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.dataSource">dataSource</a></code> | <code>aws-cdk-lib.aws_appsync.BaseDataSource</code> | The data source this resolver is using. |
|
|
626
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.
|
|
627
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.typescriptFunction">typescriptFunction</a></code> | <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunction">AppsyncTypescriptFunction</a></code> | Instance of AppsyncTypescriptFunction construct. |
|
|
602
|
+
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.maxBatchSize">maxBatchSize</a></code> | <code>number</code> | The maximum number of elements per batch, when using batch invoke. |
|
|
628
603
|
|
|
629
604
|
---
|
|
630
605
|
|
|
631
|
-
##### `
|
|
606
|
+
##### `api`<sup>Required</sup> <a name="api" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.api"></a>
|
|
632
607
|
|
|
633
608
|
```typescript
|
|
634
|
-
public readonly
|
|
609
|
+
public readonly api: IGraphqlApi;
|
|
635
610
|
```
|
|
636
611
|
|
|
637
|
-
- *Type:*
|
|
612
|
+
- *Type:* aws-cdk-lib.aws_appsync.IGraphqlApi
|
|
638
613
|
|
|
639
|
-
|
|
614
|
+
The API this resolver is attached to.
|
|
640
615
|
|
|
641
616
|
---
|
|
642
617
|
|
|
643
|
-
##### `
|
|
618
|
+
##### `fieldName`<sup>Required</sup> <a name="fieldName" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.fieldName"></a>
|
|
644
619
|
|
|
645
620
|
```typescript
|
|
646
|
-
public readonly
|
|
621
|
+
public readonly fieldName: string;
|
|
647
622
|
```
|
|
648
623
|
|
|
649
624
|
- *Type:* string
|
|
650
625
|
|
|
651
|
-
name of the GraphQL type this resolver is attached to.
|
|
652
|
-
|
|
653
|
-
---
|
|
654
|
-
|
|
655
|
-
##### `cachingConfig`<sup>Optional</sup> <a name="cachingConfig" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.cachingConfig"></a>
|
|
656
|
-
|
|
657
|
-
```typescript
|
|
658
|
-
public readonly cachingConfig: CachingConfig;
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
- *Type:* aws-cdk-lib.aws_appsync.CachingConfig
|
|
662
|
-
- *Default:* No caching configuration
|
|
663
|
-
|
|
664
|
-
The caching configuration for this resolver.
|
|
665
|
-
|
|
666
|
-
---
|
|
667
|
-
|
|
668
|
-
##### `code`<sup>Optional</sup> <a name="code" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.code"></a>
|
|
669
|
-
|
|
670
|
-
```typescript
|
|
671
|
-
public readonly code: Code;
|
|
672
|
-
```
|
|
673
|
-
|
|
674
|
-
- *Type:* aws-cdk-lib.aws_appsync.Code
|
|
675
|
-
- *Default:* no code is used
|
|
676
|
-
|
|
677
|
-
The function code.
|
|
678
|
-
|
|
679
|
-
---
|
|
680
|
-
|
|
681
|
-
##### `maxBatchSize`<sup>Optional</sup> <a name="maxBatchSize" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.maxBatchSize"></a>
|
|
682
|
-
|
|
683
|
-
```typescript
|
|
684
|
-
public readonly maxBatchSize: number;
|
|
685
|
-
```
|
|
686
|
-
|
|
687
|
-
- *Type:* number
|
|
688
|
-
- *Default:* No max batch size
|
|
689
|
-
|
|
690
|
-
The maximum number of elements per batch, when using batch invoke.
|
|
691
|
-
|
|
692
|
-
---
|
|
693
|
-
|
|
694
|
-
##### `pipelineConfig`<sup>Optional</sup> <a name="pipelineConfig" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.pipelineConfig"></a>
|
|
695
|
-
|
|
696
|
-
```typescript
|
|
697
|
-
public readonly pipelineConfig: IAppsyncFunction[];
|
|
698
|
-
```
|
|
699
|
-
|
|
700
|
-
- *Type:* aws-cdk-lib.aws_appsync.IAppsyncFunction[]
|
|
701
|
-
- *Default:* no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit
|
|
702
|
-
|
|
703
|
-
configuration of the pipeline resolver.
|
|
626
|
+
name of the GraphQL field in the given type this resolver is attached to.
|
|
704
627
|
|
|
705
628
|
---
|
|
706
629
|
|
|
707
|
-
##### `
|
|
630
|
+
##### `tsFunction`<sup>Required</sup> <a name="tsFunction" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.tsFunction"></a>
|
|
708
631
|
|
|
709
632
|
```typescript
|
|
710
|
-
public readonly
|
|
633
|
+
public readonly tsFunction: AppsyncTypescriptFunction;
|
|
711
634
|
```
|
|
712
635
|
|
|
713
|
-
- *Type:*
|
|
714
|
-
- *Default:* No mapping template
|
|
636
|
+
- *Type:* <a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunction">AppsyncTypescriptFunction</a>
|
|
715
637
|
|
|
716
|
-
|
|
638
|
+
Instance of AppsyncTypescriptFunction construct.
|
|
717
639
|
|
|
718
640
|
---
|
|
719
641
|
|
|
720
|
-
##### `
|
|
642
|
+
##### `typeName`<sup>Required</sup> <a name="typeName" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.typeName"></a>
|
|
721
643
|
|
|
722
644
|
```typescript
|
|
723
|
-
public readonly
|
|
645
|
+
public readonly typeName: string;
|
|
724
646
|
```
|
|
725
647
|
|
|
726
|
-
- *Type:*
|
|
727
|
-
- *Default:* No mapping template
|
|
648
|
+
- *Type:* string
|
|
728
649
|
|
|
729
|
-
|
|
650
|
+
name of the GraphQL type this resolver is attached to.
|
|
730
651
|
|
|
731
652
|
---
|
|
732
653
|
|
|
733
|
-
##### `
|
|
654
|
+
##### `cachingConfig`<sup>Optional</sup> <a name="cachingConfig" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.cachingConfig"></a>
|
|
734
655
|
|
|
735
656
|
```typescript
|
|
736
|
-
public readonly
|
|
657
|
+
public readonly cachingConfig: CachingConfig;
|
|
737
658
|
```
|
|
738
659
|
|
|
739
|
-
- *Type:* aws-cdk-lib.aws_appsync.
|
|
740
|
-
- *Default:*
|
|
660
|
+
- *Type:* aws-cdk-lib.aws_appsync.CachingConfig
|
|
661
|
+
- *Default:* No caching configuration
|
|
741
662
|
|
|
742
|
-
The
|
|
663
|
+
The caching configuration for this resolver.
|
|
743
664
|
|
|
744
665
|
---
|
|
745
666
|
|
|
@@ -756,27 +677,16 @@ The data source this resolver is using.
|
|
|
756
677
|
|
|
757
678
|
---
|
|
758
679
|
|
|
759
|
-
##### `
|
|
760
|
-
|
|
761
|
-
```typescript
|
|
762
|
-
public readonly api: IGraphqlApi;
|
|
763
|
-
```
|
|
764
|
-
|
|
765
|
-
- *Type:* aws-cdk-lib.aws_appsync.IGraphqlApi
|
|
766
|
-
|
|
767
|
-
The API this resolver is attached to.
|
|
768
|
-
|
|
769
|
-
---
|
|
770
|
-
|
|
771
|
-
##### `typescriptFunction`<sup>Required</sup> <a name="typescriptFunction" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.typescriptFunction"></a>
|
|
680
|
+
##### `maxBatchSize`<sup>Optional</sup> <a name="maxBatchSize" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.maxBatchSize"></a>
|
|
772
681
|
|
|
773
682
|
```typescript
|
|
774
|
-
public readonly
|
|
683
|
+
public readonly maxBatchSize: number;
|
|
775
684
|
```
|
|
776
685
|
|
|
777
|
-
- *Type:*
|
|
686
|
+
- *Type:* number
|
|
687
|
+
- *Default:* No max batch size
|
|
778
688
|
|
|
779
|
-
|
|
689
|
+
The maximum number of elements per batch, when using batch invoke.
|
|
780
690
|
|
|
781
691
|
---
|
|
782
692
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# cdk-appsync-typescript-resolver
|
|
2
2
|
|
|
3
|
-
[](https://
|
|
3
|
+
[](https://www.npmjs.com/package/cdk-appsync-typescript-resolver.svg)
|
|
4
4
|
[](https://app.codacy.com/gh/sudokar/cdk-appsync-typescript-resolver/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
|
5
5
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
6
|
[](https://github.com/sudokar/nx-serverless)
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
Constructs to transpile and bundle Typescript to valid AWS Appsync's JS resolvers
|
|
10
10
|
|
|
11
|
+
[](https://constructs.dev/packages/cdk-appsync-typescript-resolver)
|
|
12
|
+
|
|
11
13
|
# ✨ Highlights
|
|
12
14
|
|
|
13
15
|
- [AppsyncTypescriptFunction](src%2Flib%2FAppsyncTypescriptFunction.ts) - CDK construct to transpile and bundle Typescript
|
|
@@ -24,7 +26,7 @@ const appsyncFunction = new AppsyncTypescriptFunction(stack, "TSDemoFunction", {
|
|
|
24
26
|
api: new appsync.GraphqlApi(...),
|
|
25
27
|
path: path.join(__dirname, "path", "to", "file.ts"),
|
|
26
28
|
dataSource: new appsync.DynamoDbDataSource(...),
|
|
27
|
-
sourceMap,
|
|
29
|
+
sourceMap: true,
|
|
28
30
|
});
|
|
29
31
|
```
|
|
30
32
|
|
|
@@ -37,6 +39,6 @@ const resolver = new TSExpressPipelineResolver(testStack, "DemoResolver", {
|
|
|
37
39
|
api: new appsync.GraphqlApi(...),
|
|
38
40
|
typeName: "Query",
|
|
39
41
|
fieldName: "hello",
|
|
40
|
-
|
|
42
|
+
tsFunction: new AppsyncTypescriptFunction(...),
|
|
41
43
|
});
|
|
42
44
|
```
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import * as appsync from 'aws-cdk-lib/aws-appsync';
|
|
2
2
|
import type { IConstruct } from 'constructs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Path of typescript file that will be transpiled and bundled
|
|
6
|
-
*/
|
|
7
|
-
readonly path: string;
|
|
8
|
-
/**
|
|
9
|
-
* Flag to enable or disable source maps in bundled code, defaulted to false
|
|
10
|
-
*/
|
|
11
|
-
readonly sourceMap?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* A map of replacement strings in the bundled code. Example: { "ENV", "prod" }
|
|
14
|
-
*/
|
|
15
|
-
readonly replaceStrings?: Record<string, string>;
|
|
16
|
-
}
|
|
3
|
+
import type { AppsyncTypescriptFunctionProps } from './AppsyncTypescriptFunctionProps';
|
|
17
4
|
/**
|
|
18
5
|
* Transpile and bundle Typescript to AWS Appsync JS function
|
|
19
6
|
*/
|
|
@@ -23,6 +23,6 @@ class AppsyncTypescriptFunction extends appsync.AppsyncFunction {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
_a = JSII_RTTI_SYMBOL_1;
|
|
26
|
-
AppsyncTypescriptFunction[_a] = { fqn: "cdk-appsync-typescript-resolver.AppsyncTypescriptFunction", version: "0.0.
|
|
26
|
+
AppsyncTypescriptFunction[_a] = { fqn: "cdk-appsync-typescript-resolver.AppsyncTypescriptFunction", version: "0.0.2" };
|
|
27
27
|
exports.AppsyncTypescriptFunction = AppsyncTypescriptFunction;
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9BcHBzeW5jVHlwZXNjcmlwdEZ1bmN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbURBQW1EO0FBR25ELHVDQUFtQztBQUVuQzs7R0FFRztBQUNILE1BQWEseUJBQTBCLFNBQVEsT0FBTyxDQUFDLGVBQWU7SUFDcEUsWUFDRSxLQUFpQixFQUNqQixFQUFVLEVBQ1YsS0FBcUM7UUFFckMsTUFBTSxFQUFFLElBQUksRUFBRSxTQUFTLEVBQUUsY0FBYyxFQUFFLEdBQUcsS0FBSyxDQUFDO1FBQ2xELEtBQUssQ0FBQyxLQUFLLEVBQUUsRUFBRSxFQUFFO1lBQ2YsR0FBRyxLQUFLO1lBQ1IsSUFBSSxFQUFFLE9BQU8sQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUMzQixJQUFBLGdCQUFNLEVBQUM7Z0JBQ0wsVUFBVSxFQUFFLElBQUk7Z0JBQ2hCLFNBQVMsRUFBRSxTQUFTLElBQUksS0FBSztnQkFDN0IsY0FBYzthQUNmLENBQU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HNvdXJjZU1hcCA/PyBmYWxzZSxcbiAgICAgICAgICByZXBsYWNlU3RyaW5ncyxcbiAgICAgICAgfSksXG4gICAgICApLFxuICAgICAgcnVudGltZTogYXBwc3luYy5GdW5jdGlvblJ1bnRpbWUuSlNfMV8wXzAsXG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { aws_appsync } from 'aws-cdk-lib';
|
|
2
|
+
/**
|
|
3
|
+
* AppsyncTypescriptFunctionProps
|
|
4
|
+
*/
|
|
5
|
+
export interface AppsyncTypescriptFunctionProps {
|
|
6
|
+
/**
|
|
7
|
+
* the data source linked to this AppSync Function.
|
|
8
|
+
* @stability stable
|
|
9
|
+
*/
|
|
10
|
+
readonly dataSource: aws_appsync.BaseDataSource;
|
|
11
|
+
/**
|
|
12
|
+
* the GraphQL Api linked to this AppSync Function.
|
|
13
|
+
* @stability stable
|
|
14
|
+
*/
|
|
15
|
+
readonly api: aws_appsync.IGraphqlApi;
|
|
16
|
+
/**
|
|
17
|
+
* the response mapping template for the AppSync Function.
|
|
18
|
+
* @default - no response mapping template
|
|
19
|
+
* @stability stable
|
|
20
|
+
*/
|
|
21
|
+
readonly responseMappingTemplate?: aws_appsync.MappingTemplate;
|
|
22
|
+
/**
|
|
23
|
+
* the request mapping template for the AppSync Function.
|
|
24
|
+
* @default - no request mapping template
|
|
25
|
+
* @stability stable
|
|
26
|
+
*/
|
|
27
|
+
readonly requestMappingTemplate?: aws_appsync.MappingTemplate;
|
|
28
|
+
/**
|
|
29
|
+
* the description for this AppSync Function.
|
|
30
|
+
* @default - no description
|
|
31
|
+
* @stability stable
|
|
32
|
+
*/
|
|
33
|
+
readonly description?: string;
|
|
34
|
+
/**
|
|
35
|
+
* the name of the AppSync Function.
|
|
36
|
+
* @stability stable
|
|
37
|
+
*/
|
|
38
|
+
readonly name: string;
|
|
39
|
+
/**
|
|
40
|
+
* A map of replacement strings in the bundled code. e.g { ENV: "PROD" }
|
|
41
|
+
*/
|
|
42
|
+
readonly replaceStrings?: Record<string, string>;
|
|
43
|
+
/**
|
|
44
|
+
* Flag to enable or disable source maps in bundled code. defaults to false
|
|
45
|
+
*/
|
|
46
|
+
readonly sourceMap?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Path of typescript file that will be transpiled and bundled
|
|
49
|
+
*/
|
|
50
|
+
readonly path: string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvblByb3BzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0FwcHN5bmNUeXBlc2NyaXB0RnVuY3Rpb25Qcm9wcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiLy8gfn4gR2VuZXJhdGVkIGJ5IHByb2plbi4gVG8gbW9kaWZ5LCBlZGl0IC5wcm9qZW5yYy50cyBhbmQgcnVuIFwibnB4IHByb2plblwiLlxuaW1wb3J0IHsgYXdzX2FwcHN5bmMgfSBmcm9tICdhd3MtY2RrLWxpYic7XG5cbi8qKlxuICogQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvblByb3BzXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvblByb3BzIHtcbiAgLyoqXG4gICAqIHRoZSBkYXRhIHNvdXJjZSBsaW5rZWQgdG8gdGhpcyBBcHBTeW5jIEZ1bmN0aW9uLlxuICAgKiBAc3RhYmlsaXR5IHN0YWJsZVxuICAgKi9cbiAgcmVhZG9ubHkgZGF0YVNvdXJjZTogYXdzX2FwcHN5bmMuQmFzZURhdGFTb3VyY2U7XG4gIC8qKlxuICAgKiB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ztcbiAgLyoqXG4gICAqIEEgbWFwIG9mIHJlcGxhY2VtZW50IHN0cmluZ3MgaW4gdGhlIGJ1bmRsZWQgY29kZS4gZS5nIHsgRU5WOiBcIlBST0RcIiB9XG4gICAqL1xuICByZWFkb25seSByZXBsYWNlU3RyaW5ncz86IFJlY29yZDxzdHJpbmcsIHN0cmluZz47XG4gIC8qKlxuICAgKiBGbGFnIHRvIGVuYWJsZSBvciBkaXNhYmxlIHNvdXJjZSBtYXBzIGluIGJ1bmRsZWQgY29kZS4gZGVmYXVsdHMgdG8gZmFsc2VcbiAgICovXG4gIHJlYWRvbmx5IHNvdXJjZU1hcD86IGJvb2xlYW47XG4gIC8qKlxuICAgKiBQYXRoIG9mIHR5cGVzY3JpcHQgZmlsZSB0aGF0IHdpbGwgYmUgdHJhbnNwaWxlZCBhbmQgYnVuZGxlZFxuICAgKi9cbiAgcmVhZG9ubHkgcGF0aDogc3RyaW5nO1xufVxuIl19
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import * as appsync from 'aws-cdk-lib/aws-appsync';
|
|
2
2
|
import type { IConstruct } from 'constructs';
|
|
3
|
-
import {
|
|
4
|
-
export interface TSExpressPipelineResolverProps extends appsync.ResolverProps {
|
|
5
|
-
/**
|
|
6
|
-
* Instance of AppsyncTypescriptFunction construct
|
|
7
|
-
*/
|
|
8
|
-
readonly typescriptFunction: AppsyncTypescriptFunction;
|
|
9
|
-
}
|
|
3
|
+
import type { TSExpressPipelineResolverProps } from './TSExpressPipelineResolverProps';
|
|
10
4
|
/**
|
|
11
5
|
* Appsync's JS pipeline resolver with default bolierplate code using AppsyncTypescriptFunction construct
|
|
12
6
|
*/
|
|
@@ -18,7 +18,7 @@ export function response(ctx) {
|
|
|
18
18
|
*/
|
|
19
19
|
class TSExpressPipelineResolver extends appsync.Resolver {
|
|
20
20
|
constructor(scope, id, props) {
|
|
21
|
-
const {
|
|
21
|
+
const { tsFunction: appsyncFunction, ...resolverProps } = props;
|
|
22
22
|
super(scope, id, {
|
|
23
23
|
...resolverProps,
|
|
24
24
|
pipelineConfig: [appsyncFunction],
|
|
@@ -28,6 +28,6 @@ class TSExpressPipelineResolver extends appsync.Resolver {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
_a = JSII_RTTI_SYMBOL_1;
|
|
31
|
-
TSExpressPipelineResolver[_a] = { fqn: "cdk-appsync-typescript-resolver.TSExpressPipelineResolver", version: "0.0.
|
|
31
|
+
TSExpressPipelineResolver[_a] = { fqn: "cdk-appsync-typescript-resolver.TSExpressPipelineResolver", version: "0.0.2" };
|
|
32
32
|
exports.TSExpressPipelineResolver = TSExpressPipelineResolver;
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVFNFeHByZXNzUGlwZWxpbmVSZXNvbHZlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9UU0V4cHJlc3NQaXBlbGluZVJlc29sdmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbURBQW1EO0FBSW5ELE1BQU0sbUJBQW1CLEdBQVc7Ozs7Ozs7O0VBUWxDLENBQUM7QUFFSDs7R0FFRztBQUNILE1BQWEseUJBQTBCLFNBQVEsT0FBTyxDQUFDLFFBQVE7SUFDN0QsWUFDRSxLQUFpQixFQUNqQixFQUFVLEVBQ1YsS0FBcUM7UUFFckMsTUFBTSxFQUFFLFVBQVUsRUFBRSxlQUFlLEVBQUUsR0FBRyxhQUFhLEVBQUUsR0FBRyxLQUFLLENBQUM7UUFDaEUsS0FBSyxDQUFDLEtBQUssRUFBRSxFQUFFLEVBQUU7WUFDZixHQUFHLGFBQWE7WUFDaEIsY0FBYyxFQUFFLENBQUMsZUFBZSxDQUFDO1lBQ2pDLElBQUksRUFBRSxPQUFPLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyx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HsgdHNGdW5jdGlvbjogYXBwc3luY0Z1bmN0aW9uLCAuLi5yZXNvbHZlclByb3BzIH0gPSBwcm9wcztcbiAgICBzdXBlcihzY29wZSwgaWQsIHtcbiAgICAgIC4uLnJlc29sdmVyUHJvcHMsXG4gICAgICBwaXBlbGluZUNvbmZpZzogW2FwcHN5bmNGdW5jdGlvbl0sXG4gICAgICBjb2RlOiBhcHBzeW5jLkNvZGUuZnJvbUlubGluZShkZWZhdWx0UGlwZWxpbmVDb2RlKSxcbiAgICAgIHJ1bnRpbWU6IGFwcHN5bmMuRnVuY3Rpb25SdW50aW1lLkpTXzFfMF8wLFxuICAgIH0pO1xuICB9XG59XG4iXX0=
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { aws_appsync } from 'aws-cdk-lib';
|
|
2
|
+
import { AppsyncTypescriptFunction } from './';
|
|
3
|
+
/**
|
|
4
|
+
* TSExpressPipelineResolverProps
|
|
5
|
+
*/
|
|
6
|
+
export interface TSExpressPipelineResolverProps {
|
|
7
|
+
/**
|
|
8
|
+
* The API this resolver is attached to.
|
|
9
|
+
* @stability stable
|
|
10
|
+
*/
|
|
11
|
+
readonly api: aws_appsync.IGraphqlApi;
|
|
12
|
+
/**
|
|
13
|
+
* The data source this resolver is using.
|
|
14
|
+
* @default - No datasource
|
|
15
|
+
* @stability stable
|
|
16
|
+
*/
|
|
17
|
+
readonly dataSource?: aws_appsync.BaseDataSource;
|
|
18
|
+
/**
|
|
19
|
+
* The maximum number of elements per batch, when using batch invoke.
|
|
20
|
+
* @default - No max batch size
|
|
21
|
+
* @stability stable
|
|
22
|
+
*/
|
|
23
|
+
readonly maxBatchSize?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The caching configuration for this resolver.
|
|
26
|
+
* @default - No caching configuration
|
|
27
|
+
* @stability stable
|
|
28
|
+
*/
|
|
29
|
+
readonly cachingConfig?: aws_appsync.CachingConfig;
|
|
30
|
+
/**
|
|
31
|
+
* name of the GraphQL type this resolver is attached to.
|
|
32
|
+
* @stability stable
|
|
33
|
+
*/
|
|
34
|
+
readonly typeName: string;
|
|
35
|
+
/**
|
|
36
|
+
* name of the GraphQL field in the given type this resolver is attached to.
|
|
37
|
+
* @stability stable
|
|
38
|
+
*/
|
|
39
|
+
readonly fieldName: string;
|
|
40
|
+
/**
|
|
41
|
+
* Instance of AppsyncTypescriptFunction construct
|
|
42
|
+
*/
|
|
43
|
+
readonly tsFunction: AppsyncTypescriptFunction;
|
|
44
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVFNFeHByZXNzUGlwZWxpbmVSZXNvbHZlclByb3BzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1RTRXhwcmVzc1BpcGVsaW5lUmVzb2x2ZXJQcm9wcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiLy8gfn4gR2VuZXJhdGVkIGJ5IHByb2plbi4gVG8gbW9kaWZ5LCBlZGl0IC5wcm9qZW5yYy50cyBhbmQgcnVuIFwibnB4IHByb2plblwiLlxuaW1wb3J0IHsgYXdzX2FwcHN5bmMgfSBmcm9tICdhd3MtY2RrLWxpYic7XG5pbXBvcnQgeyBBcHBzeW5jVHlwZXNjcmlwdEZ1bmN0aW9uIH0gZnJvbSAnLi8nO1xuXG4vKipcbiAqIFRTRXhwcmVzc1BpcGVsaW5lUmVzb2x2ZXJQcm9wc1xuICovXG5leHBvcnQgaW50ZXJmYWNlIFRTRXhwcmVzc1BpcGVsaW5lUmVzb2x2ZXJQcm9wcyB7XG4gIC8qKlxuICAgKiBUaGUgQVBJIHRoaXMgcmVzb2x2ZXIgaXMgYXR0YWNoZWQgdG8uXG4gICAqIEBzdGFiaWxpdHkgc3RhYmxlXG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0eSBzdGFibGVcbiAgICovXG4gIHJlYWRvbmx5IGZpZWxkTmFtZTogc3RyaW5nO1xuICAvKipcbiAgICogSW5zdGFuY2Ugb2YgQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvbiBjb25zdHJ1Y3RcbiAgICovXG4gIHJlYWRvbmx5IHRzRnVuY3Rpb246IEFwcHN5bmNUeXBlc2NyaXB0RnVuY3Rpb247XG59XG4iXX0=
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -15,5 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./AppsyncTypescriptFunction"), exports);
|
|
18
|
+
__exportStar(require("./AppsyncTypescriptFunctionProps"), exports);
|
|
18
19
|
__exportStar(require("./TSExpressPipelineResolver"), exports);
|
|
19
|
-
|
|
20
|
+
__exportStar(require("./TSExpressPipelineResolverProps"), exports);
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDhEQUE0QztBQUM1QyxtRUFBaUQ7QUFDakQsOERBQTRDO0FBQzVDLG1FQUFpRCIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvbic7XG5leHBvcnQgKiBmcm9tICcuL0FwcHN5bmNUeXBlc2NyaXB0RnVuY3Rpb25Qcm9wcyc7XG5leHBvcnQgKiBmcm9tICcuL1RTRXhwcmVzc1BpcGVsaW5lUmVzb2x2ZXInO1xuZXhwb3J0ICogZnJvbSAnLi9UU0V4cHJlc3NQaXBlbGluZVJlc29sdmVyUHJvcHMnO1xuIl19
|
package/package.json
CHANGED
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@aws-appsync/utils": "^1.2.5",
|
|
39
|
+
"@mrgrain/jsii-struct-builder": "^0.5.2",
|
|
39
40
|
"@types/jest": "^29.5.3",
|
|
40
41
|
"@types/node": "^16",
|
|
41
42
|
"@typescript-eslint/eslint-plugin": "^5",
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
],
|
|
80
81
|
"main": "lib/index.js",
|
|
81
82
|
"license": "Apache-2.0",
|
|
82
|
-
"version": "0.0.
|
|
83
|
+
"version": "0.0.2",
|
|
83
84
|
"jest": {
|
|
84
85
|
"testMatch": [
|
|
85
86
|
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|