cdk-appsync-typescript-resolver 0.0.0 → 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 +82 -170
- package/README.md +7 -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://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,11 +1,15 @@
|
|
|
1
1
|
# cdk-appsync-typescript-resolver
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/cdk-appsync-typescript-resolver.svg)
|
|
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
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
6
|
[](https://github.com/sudokar/nx-serverless)
|
|
5
7
|

|
|
6
8
|
|
|
7
9
|
Constructs to transpile and bundle Typescript to valid AWS Appsync's JS resolvers
|
|
8
10
|
|
|
11
|
+
[](https://constructs.dev/packages/cdk-appsync-typescript-resolver)
|
|
12
|
+
|
|
9
13
|
# ✨ Highlights
|
|
10
14
|
|
|
11
15
|
- [AppsyncTypescriptFunction](src%2Flib%2FAppsyncTypescriptFunction.ts) - CDK construct to transpile and bundle Typescript
|
|
@@ -22,7 +26,7 @@ const appsyncFunction = new AppsyncTypescriptFunction(stack, "TSDemoFunction", {
|
|
|
22
26
|
api: new appsync.GraphqlApi(...),
|
|
23
27
|
path: path.join(__dirname, "path", "to", "file.ts"),
|
|
24
28
|
dataSource: new appsync.DynamoDbDataSource(...),
|
|
25
|
-
sourceMap,
|
|
29
|
+
sourceMap: true,
|
|
26
30
|
});
|
|
27
31
|
```
|
|
28
32
|
|
|
@@ -35,7 +39,7 @@ const resolver = new TSExpressPipelineResolver(testStack, "DemoResolver", {
|
|
|
35
39
|
api: new appsync.GraphqlApi(...),
|
|
36
40
|
typeName: "Query",
|
|
37
41
|
fieldName: "hello",
|
|
38
|
-
|
|
42
|
+
tsFunction: new AppsyncTypescriptFunction(...),
|
|
39
43
|
});
|
|
40
44
|
```
|
|
41
45
|
# API Reference <a name="API Reference" id="api-reference"></a>
|
|
@@ -432,6 +436,8 @@ the ARN of the resolver.
|
|
|
432
436
|
|
|
433
437
|
### AppsyncTypescriptFunctionProps <a name="AppsyncTypescriptFunctionProps" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps"></a>
|
|
434
438
|
|
|
439
|
+
AppsyncTypescriptFunctionProps.
|
|
440
|
+
|
|
435
441
|
#### Initializer <a name="Initializer" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.Initializer"></a>
|
|
436
442
|
|
|
437
443
|
```typescript
|
|
@@ -444,144 +450,116 @@ const appsyncTypescriptFunctionProps: AppsyncTypescriptFunctionProps = { ... }
|
|
|
444
450
|
|
|
445
451
|
| **Name** | **Type** | **Description** |
|
|
446
452
|
| --- | --- | --- |
|
|
447
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.name">name</a></code> | <code>string</code> | the name of the AppSync Function. |
|
|
448
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.code">code</a></code> | <code>aws-cdk-lib.aws_appsync.Code</code> | The function code. |
|
|
449
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.description">description</a></code> | <code>string</code> | the description for this AppSync Function. |
|
|
450
|
-
| <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. |
|
|
451
|
-
| <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. |
|
|
452
|
-
| <code><a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.runtime">runtime</a></code> | <code>aws-cdk-lib.aws_appsync.FunctionRuntime</code> | The functions runtime. |
|
|
453
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. |
|
|
454
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. |
|
|
455
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. |
|
|
456
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. |
|
|
457
|
-
| <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. |
|
|
458
462
|
|
|
459
463
|
---
|
|
460
464
|
|
|
461
|
-
##### `
|
|
465
|
+
##### `api`<sup>Required</sup> <a name="api" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.api"></a>
|
|
462
466
|
|
|
463
467
|
```typescript
|
|
464
|
-
public readonly
|
|
468
|
+
public readonly api: IGraphqlApi;
|
|
465
469
|
```
|
|
466
470
|
|
|
467
|
-
- *Type:*
|
|
471
|
+
- *Type:* aws-cdk-lib.aws_appsync.IGraphqlApi
|
|
468
472
|
|
|
469
|
-
the
|
|
473
|
+
the GraphQL Api linked to this AppSync Function.
|
|
470
474
|
|
|
471
475
|
---
|
|
472
476
|
|
|
473
|
-
##### `
|
|
477
|
+
##### `dataSource`<sup>Required</sup> <a name="dataSource" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.dataSource"></a>
|
|
474
478
|
|
|
475
479
|
```typescript
|
|
476
|
-
public readonly
|
|
480
|
+
public readonly dataSource: BaseDataSource;
|
|
477
481
|
```
|
|
478
482
|
|
|
479
|
-
- *Type:* aws-cdk-lib.aws_appsync.
|
|
480
|
-
- *Default:* no code is used
|
|
483
|
+
- *Type:* aws-cdk-lib.aws_appsync.BaseDataSource
|
|
481
484
|
|
|
482
|
-
|
|
485
|
+
the data source linked to this AppSync Function.
|
|
483
486
|
|
|
484
487
|
---
|
|
485
488
|
|
|
486
|
-
##### `
|
|
489
|
+
##### `name`<sup>Required</sup> <a name="name" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.name"></a>
|
|
487
490
|
|
|
488
491
|
```typescript
|
|
489
|
-
public readonly
|
|
492
|
+
public readonly name: string;
|
|
490
493
|
```
|
|
491
494
|
|
|
492
495
|
- *Type:* string
|
|
493
|
-
- *Default:* no description
|
|
494
|
-
|
|
495
|
-
the description for this AppSync Function.
|
|
496
|
-
|
|
497
|
-
---
|
|
498
|
-
|
|
499
|
-
##### `requestMappingTemplate`<sup>Optional</sup> <a name="requestMappingTemplate" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.requestMappingTemplate"></a>
|
|
500
|
-
|
|
501
|
-
```typescript
|
|
502
|
-
public readonly requestMappingTemplate: MappingTemplate;
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate
|
|
506
|
-
- *Default:* no request mapping template
|
|
507
496
|
|
|
508
|
-
the
|
|
497
|
+
the name of the AppSync Function.
|
|
509
498
|
|
|
510
499
|
---
|
|
511
500
|
|
|
512
|
-
##### `
|
|
501
|
+
##### `path`<sup>Required</sup> <a name="path" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.path"></a>
|
|
513
502
|
|
|
514
503
|
```typescript
|
|
515
|
-
public readonly
|
|
504
|
+
public readonly path: string;
|
|
516
505
|
```
|
|
517
506
|
|
|
518
|
-
- *Type:*
|
|
519
|
-
- *Default:* no response mapping template
|
|
507
|
+
- *Type:* string
|
|
520
508
|
|
|
521
|
-
|
|
509
|
+
Path of typescript file that will be transpiled and bundled.
|
|
522
510
|
|
|
523
511
|
---
|
|
524
512
|
|
|
525
|
-
##### `
|
|
513
|
+
##### `description`<sup>Optional</sup> <a name="description" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.description"></a>
|
|
526
514
|
|
|
527
515
|
```typescript
|
|
528
|
-
public readonly
|
|
516
|
+
public readonly description: string;
|
|
529
517
|
```
|
|
530
518
|
|
|
531
|
-
- *Type:*
|
|
532
|
-
- *Default:* no
|
|
519
|
+
- *Type:* string
|
|
520
|
+
- *Default:* no description
|
|
533
521
|
|
|
534
|
-
|
|
522
|
+
the description for this AppSync Function.
|
|
535
523
|
|
|
536
524
|
---
|
|
537
525
|
|
|
538
|
-
##### `
|
|
526
|
+
##### `replaceStrings`<sup>Optional</sup> <a name="replaceStrings" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.replaceStrings"></a>
|
|
539
527
|
|
|
540
528
|
```typescript
|
|
541
|
-
public readonly
|
|
529
|
+
public readonly replaceStrings: {[ key: string ]: string};
|
|
542
530
|
```
|
|
543
531
|
|
|
544
|
-
- *Type:*
|
|
545
|
-
|
|
546
|
-
the GraphQL Api linked to this AppSync Function.
|
|
547
|
-
|
|
548
|
-
---
|
|
549
|
-
|
|
550
|
-
##### `dataSource`<sup>Required</sup> <a name="dataSource" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.dataSource"></a>
|
|
551
|
-
|
|
552
|
-
```typescript
|
|
553
|
-
public readonly dataSource: BaseDataSource;
|
|
554
|
-
```
|
|
532
|
+
- *Type:* {[ key: string ]: string}
|
|
555
533
|
|
|
556
|
-
|
|
534
|
+
A map of replacement strings in the bundled code.
|
|
557
535
|
|
|
558
|
-
|
|
536
|
+
e.g { ENV: "PROD" }
|
|
559
537
|
|
|
560
538
|
---
|
|
561
539
|
|
|
562
|
-
##### `
|
|
540
|
+
##### `requestMappingTemplate`<sup>Optional</sup> <a name="requestMappingTemplate" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.requestMappingTemplate"></a>
|
|
563
541
|
|
|
564
542
|
```typescript
|
|
565
|
-
public readonly
|
|
543
|
+
public readonly requestMappingTemplate: MappingTemplate;
|
|
566
544
|
```
|
|
567
545
|
|
|
568
|
-
- *Type:*
|
|
546
|
+
- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate
|
|
547
|
+
- *Default:* no request mapping template
|
|
569
548
|
|
|
570
|
-
|
|
549
|
+
the request mapping template for the AppSync Function.
|
|
571
550
|
|
|
572
551
|
---
|
|
573
552
|
|
|
574
|
-
##### `
|
|
553
|
+
##### `responseMappingTemplate`<sup>Optional</sup> <a name="responseMappingTemplate" id="cdk-appsync-typescript-resolver.AppsyncTypescriptFunctionProps.property.responseMappingTemplate"></a>
|
|
575
554
|
|
|
576
555
|
```typescript
|
|
577
|
-
public readonly
|
|
556
|
+
public readonly responseMappingTemplate: MappingTemplate;
|
|
578
557
|
```
|
|
579
558
|
|
|
580
|
-
- *Type:*
|
|
581
|
-
|
|
582
|
-
A map of replacement strings in the bundled code.
|
|
559
|
+
- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate
|
|
560
|
+
- *Default:* no response mapping template
|
|
583
561
|
|
|
584
|
-
|
|
562
|
+
the response mapping template for the AppSync Function.
|
|
585
563
|
|
|
586
564
|
---
|
|
587
565
|
|
|
@@ -593,12 +571,16 @@ public readonly sourceMap: boolean;
|
|
|
593
571
|
|
|
594
572
|
- *Type:* boolean
|
|
595
573
|
|
|
596
|
-
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
|
|
597
577
|
|
|
598
578
|
---
|
|
599
579
|
|
|
600
580
|
### TSExpressPipelineResolverProps <a name="TSExpressPipelineResolverProps" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps"></a>
|
|
601
581
|
|
|
582
|
+
TSExpressPipelineResolverProps.
|
|
583
|
+
|
|
602
584
|
#### Initializer <a name="Initializer" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.Initializer"></a>
|
|
603
585
|
|
|
604
586
|
```typescript
|
|
@@ -611,133 +593,74 @@ const tSExpressPipelineResolverProps: TSExpressPipelineResolverProps = { ... }
|
|
|
611
593
|
|
|
612
594
|
| **Name** | **Type** | **Description** |
|
|
613
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. |
|
|
614
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. |
|
|
615
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. |
|
|
616
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. |
|
|
617
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.code">code</a></code> | <code>aws-cdk-lib.aws_appsync.Code</code> | The function code. |
|
|
618
|
-
| <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. |
|
|
619
|
-
| <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. |
|
|
620
|
-
| <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. |
|
|
621
|
-
| <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. |
|
|
622
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.runtime">runtime</a></code> | <code>aws-cdk-lib.aws_appsync.FunctionRuntime</code> | The functions runtime. |
|
|
623
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. |
|
|
624
|
-
| <code><a href="#cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.
|
|
625
|
-
| <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. |
|
|
626
603
|
|
|
627
604
|
---
|
|
628
605
|
|
|
629
|
-
##### `
|
|
606
|
+
##### `api`<sup>Required</sup> <a name="api" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.api"></a>
|
|
630
607
|
|
|
631
608
|
```typescript
|
|
632
|
-
public readonly
|
|
609
|
+
public readonly api: IGraphqlApi;
|
|
633
610
|
```
|
|
634
611
|
|
|
635
|
-
- *Type:*
|
|
612
|
+
- *Type:* aws-cdk-lib.aws_appsync.IGraphqlApi
|
|
636
613
|
|
|
637
|
-
|
|
614
|
+
The API this resolver is attached to.
|
|
638
615
|
|
|
639
616
|
---
|
|
640
617
|
|
|
641
|
-
##### `
|
|
618
|
+
##### `fieldName`<sup>Required</sup> <a name="fieldName" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.fieldName"></a>
|
|
642
619
|
|
|
643
620
|
```typescript
|
|
644
|
-
public readonly
|
|
621
|
+
public readonly fieldName: string;
|
|
645
622
|
```
|
|
646
623
|
|
|
647
624
|
- *Type:* string
|
|
648
625
|
|
|
649
|
-
name of the GraphQL type this resolver is attached to.
|
|
650
|
-
|
|
651
|
-
---
|
|
652
|
-
|
|
653
|
-
##### `cachingConfig`<sup>Optional</sup> <a name="cachingConfig" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.cachingConfig"></a>
|
|
654
|
-
|
|
655
|
-
```typescript
|
|
656
|
-
public readonly cachingConfig: CachingConfig;
|
|
657
|
-
```
|
|
658
|
-
|
|
659
|
-
- *Type:* aws-cdk-lib.aws_appsync.CachingConfig
|
|
660
|
-
- *Default:* No caching configuration
|
|
661
|
-
|
|
662
|
-
The caching configuration for this resolver.
|
|
663
|
-
|
|
664
|
-
---
|
|
665
|
-
|
|
666
|
-
##### `code`<sup>Optional</sup> <a name="code" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.code"></a>
|
|
667
|
-
|
|
668
|
-
```typescript
|
|
669
|
-
public readonly code: Code;
|
|
670
|
-
```
|
|
671
|
-
|
|
672
|
-
- *Type:* aws-cdk-lib.aws_appsync.Code
|
|
673
|
-
- *Default:* no code is used
|
|
674
|
-
|
|
675
|
-
The function code.
|
|
676
|
-
|
|
677
|
-
---
|
|
678
|
-
|
|
679
|
-
##### `maxBatchSize`<sup>Optional</sup> <a name="maxBatchSize" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.maxBatchSize"></a>
|
|
680
|
-
|
|
681
|
-
```typescript
|
|
682
|
-
public readonly maxBatchSize: number;
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
- *Type:* number
|
|
686
|
-
- *Default:* No max batch size
|
|
687
|
-
|
|
688
|
-
The maximum number of elements per batch, when using batch invoke.
|
|
689
|
-
|
|
690
|
-
---
|
|
691
|
-
|
|
692
|
-
##### `pipelineConfig`<sup>Optional</sup> <a name="pipelineConfig" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.pipelineConfig"></a>
|
|
693
|
-
|
|
694
|
-
```typescript
|
|
695
|
-
public readonly pipelineConfig: IAppsyncFunction[];
|
|
696
|
-
```
|
|
697
|
-
|
|
698
|
-
- *Type:* aws-cdk-lib.aws_appsync.IAppsyncFunction[]
|
|
699
|
-
- *Default:* no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit
|
|
700
|
-
|
|
701
|
-
configuration of the pipeline resolver.
|
|
626
|
+
name of the GraphQL field in the given type this resolver is attached to.
|
|
702
627
|
|
|
703
628
|
---
|
|
704
629
|
|
|
705
|
-
##### `
|
|
630
|
+
##### `tsFunction`<sup>Required</sup> <a name="tsFunction" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.tsFunction"></a>
|
|
706
631
|
|
|
707
632
|
```typescript
|
|
708
|
-
public readonly
|
|
633
|
+
public readonly tsFunction: AppsyncTypescriptFunction;
|
|
709
634
|
```
|
|
710
635
|
|
|
711
|
-
- *Type:*
|
|
712
|
-
- *Default:* No mapping template
|
|
636
|
+
- *Type:* <a href="#cdk-appsync-typescript-resolver.AppsyncTypescriptFunction">AppsyncTypescriptFunction</a>
|
|
713
637
|
|
|
714
|
-
|
|
638
|
+
Instance of AppsyncTypescriptFunction construct.
|
|
715
639
|
|
|
716
640
|
---
|
|
717
641
|
|
|
718
|
-
##### `
|
|
642
|
+
##### `typeName`<sup>Required</sup> <a name="typeName" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.typeName"></a>
|
|
719
643
|
|
|
720
644
|
```typescript
|
|
721
|
-
public readonly
|
|
645
|
+
public readonly typeName: string;
|
|
722
646
|
```
|
|
723
647
|
|
|
724
|
-
- *Type:*
|
|
725
|
-
- *Default:* No mapping template
|
|
648
|
+
- *Type:* string
|
|
726
649
|
|
|
727
|
-
|
|
650
|
+
name of the GraphQL type this resolver is attached to.
|
|
728
651
|
|
|
729
652
|
---
|
|
730
653
|
|
|
731
|
-
##### `
|
|
654
|
+
##### `cachingConfig`<sup>Optional</sup> <a name="cachingConfig" id="cdk-appsync-typescript-resolver.TSExpressPipelineResolverProps.property.cachingConfig"></a>
|
|
732
655
|
|
|
733
656
|
```typescript
|
|
734
|
-
public readonly
|
|
657
|
+
public readonly cachingConfig: CachingConfig;
|
|
735
658
|
```
|
|
736
659
|
|
|
737
|
-
- *Type:* aws-cdk-lib.aws_appsync.
|
|
738
|
-
- *Default:*
|
|
660
|
+
- *Type:* aws-cdk-lib.aws_appsync.CachingConfig
|
|
661
|
+
- *Default:* No caching configuration
|
|
739
662
|
|
|
740
|
-
The
|
|
663
|
+
The caching configuration for this resolver.
|
|
741
664
|
|
|
742
665
|
---
|
|
743
666
|
|
|
@@ -754,27 +677,16 @@ The data source this resolver is using.
|
|
|
754
677
|
|
|
755
678
|
---
|
|
756
679
|
|
|
757
|
-
##### `
|
|
758
|
-
|
|
759
|
-
```typescript
|
|
760
|
-
public readonly api: IGraphqlApi;
|
|
761
|
-
```
|
|
762
|
-
|
|
763
|
-
- *Type:* aws-cdk-lib.aws_appsync.IGraphqlApi
|
|
764
|
-
|
|
765
|
-
The API this resolver is attached to.
|
|
766
|
-
|
|
767
|
-
---
|
|
768
|
-
|
|
769
|
-
##### `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>
|
|
770
681
|
|
|
771
682
|
```typescript
|
|
772
|
-
public readonly
|
|
683
|
+
public readonly maxBatchSize: number;
|
|
773
684
|
```
|
|
774
685
|
|
|
775
|
-
- *Type:*
|
|
686
|
+
- *Type:* number
|
|
687
|
+
- *Default:* No max batch size
|
|
776
688
|
|
|
777
|
-
|
|
689
|
+
The maximum number of elements per batch, when using batch invoke.
|
|
778
690
|
|
|
779
691
|
---
|
|
780
692
|
|
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# cdk-appsync-typescript-resolver
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/cdk-appsync-typescript-resolver.svg)
|
|
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
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
6
|
[](https://github.com/sudokar/nx-serverless)
|
|
5
7
|

|
|
6
8
|
|
|
7
9
|
Constructs to transpile and bundle Typescript to valid AWS Appsync's JS resolvers
|
|
8
10
|
|
|
11
|
+
[](https://constructs.dev/packages/cdk-appsync-typescript-resolver)
|
|
12
|
+
|
|
9
13
|
# ✨ Highlights
|
|
10
14
|
|
|
11
15
|
- [AppsyncTypescriptFunction](src%2Flib%2FAppsyncTypescriptFunction.ts) - CDK construct to transpile and bundle Typescript
|
|
@@ -22,7 +26,7 @@ const appsyncFunction = new AppsyncTypescriptFunction(stack, "TSDemoFunction", {
|
|
|
22
26
|
api: new appsync.GraphqlApi(...),
|
|
23
27
|
path: path.join(__dirname, "path", "to", "file.ts"),
|
|
24
28
|
dataSource: new appsync.DynamoDbDataSource(...),
|
|
25
|
-
sourceMap,
|
|
29
|
+
sourceMap: true,
|
|
26
30
|
});
|
|
27
31
|
```
|
|
28
32
|
|
|
@@ -35,6 +39,6 @@ const resolver = new TSExpressPipelineResolver(testStack, "DemoResolver", {
|
|
|
35
39
|
api: new appsync.GraphqlApi(...),
|
|
36
40
|
typeName: "Query",
|
|
37
41
|
fieldName: "hello",
|
|
38
|
-
|
|
42
|
+
tsFunction: new AppsyncTypescriptFunction(...),
|
|
39
43
|
});
|
|
40
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9BcHBzeW5jVHlwZXNjcmlwdEZ1bmN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbURBQW1EO0FBR25ELHVDQUFtQztBQUVuQzs7R0FFRztBQUNILE1BQWEseUJBQTBCLFNBQVEsT0FBTyxDQUFDLGVBQWU7SUFDcEUsWUFDRSxLQUFpQixFQUNqQixFQUFVLEVBQ1YsS0FBcUM7UUFFckMsTUFBTSxFQUFFLElBQUksRUFBRSxTQUFTLEVBQUUsY0FBYyxFQUFFLEdBQUcsS0FBSyxDQUFDO1FBQ2xELEtBQUssQ0FBQyxLQUFLLEVBQUUsRUFBRSxFQUFFO1lBQ2YsR0FBRyxLQUFLO1lBQ1IsSUFBSSxFQUFFLE9BQU8sQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUMzQixJQUFBLGdCQUFNLEVBQUM7Z0JBQ0wsVUFBVSxFQUFFLElBQUk7Z0JBQ2hCLFNBQVMsRUFBRSxTQUFTLElBQUksS0FBSztnQkFDN0IsY0FBYzthQUNmLENBQUMsQ0FDSDtZQUNELE9BQU8sRUFBRSxPQUFPLENBQUMsZUFBZSxDQUFDLFFBQVE7U0FDMUMsQ0FBQyxDQUFDO0lBQ0wsQ0FB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ltZTogYXBwc3luYy5GdW5jdGlvblJ1bnRpbWUuSlNfMV8wXzAsXG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvblByb3BzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0FwcHN5bmNUeXBlc2NyaXB0RnVuY3Rpb25Qcm9wcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiLy8gfn4gR2VuZXJhdGVkIGJ5IHByb2plbi4gVG8gbW9kaWZ5LCBlZGl0IC5wcm9qZW5yYy50cyBhbmQgcnVuIFwibnB4IHByb2plblwiLlxuaW1wb3J0IHsgYXdzX2FwcHN5bmMgfSBmcm9tICdhd3MtY2RrLWxpYic7XG5cbi8qKlxuICogQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvblByb3BzXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgQXBwc3luY1R5cGVzY3JpcHRGdW5jdGlvblByb3BzIHtcbiAgLyoqXG4gICAqIHRoZSBkYXRhIHNvdXJjZSBsaW5rZWQgdG8gdGhpcyBBcHBTeW5jIEZ1bmN0aW9uLlxuICAgKiBAc3RhYmlsaXR5IHN0YWJsZVxuICAgKi9cbiAgcmVhZG9ubHkgZGF0YVNvdXJjZTogYXdzX2FwcHN5bmMuQmFzZURhdGFTb3VyY2U7XG4gIC8qKlxuICAgKiB0aGUgR3JhcGhRTCBBcGkgbGlua2VkIHRvIHRoaXMgQXBwU3luYyBGdW5jdGlvbi5cbiAgICogQHN0YWJpbGl0eSBzdGFibGVcbiAg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OiBcIlBST0RcIiB9XG4gICAqL1xuICByZWFkb25seSByZXBsYWNlU3RyaW5ncz86IFJlY29yZDxzdHJpbmcsIHN0cmluZz47XG4gIC8qKlxuICAgKiBGbGFnIHRvIGVuYWJsZSBvciBkaXNhYmxlIHNvdXJjZSBtYXBzIGluIGJ1bmRsZWQgY29kZS4gZGVmYXVsdHMgdG8gZmFsc2VcbiAgICovXG4gIHJlYWRvbmx5IHNvdXJjZU1hcD86IGJvb2xlYW47XG4gIC8qKlxuICAgKiBQYXRoIG9mIHR5cGVzY3JpcHQgZmlsZSB0aGF0IHdpbGwgYmUgdHJhbnNwaWxlZCBhbmQgYnVuZGxlZFxuICAgKi9cbiAgcmVhZG9ubHkgcGF0aDogc3RyaW5nO1xufVxuIl19
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVFNFeHByZXNzUGlwZWxpbmVSZXNvbHZlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9UU0V4cHJlc3NQaXBlbGluZVJlc29sdmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbURBQW1EO0FBSW5ELE1BQU0sbUJBQW1CLEdBQVc7Ozs7Ozs7O0VBUWxDLENBQUM7QUFFSDs7R0FFRztBQUNILE1BQWEseUJBQTBCLFNBQVEsT0FBTyxDQUFDLFFBQVE7SUFDN0QsWUFDRSxLQUFpQixFQUNqQixFQUFVLEVBQ1YsS0FBcUM7UUFFckMsTUFBTSxFQUFFLFVBQVUsRUFBRSxlQUFlLEVBQUUsR0FBRyxhQUFhLEVBQUUsR0FBRyxLQUFLLENBQUM7UUFDaEUsS0FBSyxDQUFDLEtBQUssRUFBRSxFQUFFLEVBQUU7WUFDZixHQUFHLGFBQWE7WUFDaEIsY0FBYyxFQUFFLENBQUMsZUFBZSxDQUFDO1lBQ2pDLElBQUksRUFBRSxPQUFPLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxtQkFBbUIsQ0FBQztZQUNsRCxPQUFPLEVBQUUsT0FBTyxDQUFDLGVBQWUsQ0FBQyxRQUFRO1NBQzFDLENBQUMsQ0FBQztJQUN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aWQsIHtcbiAgICAgIC4uLnJlc29sdmVyUHJvcHMsXG4gICAgICBwaXBlbGluZUNvbmZpZzogW2FwcHN5bmNGdW5jdGlvbl0sXG4gICAgICBjb2RlOiBhcHBzeW5jLkNvZGUuZnJvbUlubGluZShkZWZhdWx0UGlwZWxpbmVDb2RlKSxcbiAgICAgIHJ1bnRpbWU6IGFwcHN5bmMuRnVuY3Rpb25SdW50aW1lLkpTXzFfMF8wLFxuICAgIH0pO1xuICB9XG59XG4iXX0=
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVFNFeHByZXNzUGlwZWxpbmVSZXNvbHZlclByb3BzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1RTRXhwcmVzc1BpcGVsaW5lUmVzb2x2ZXJQcm9wcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiLy8gfn4gR2VuZXJhdGVkIGJ5IHByb2plbi4gVG8gbW9kaWZ5LCBlZGl0IC5wcm9qZW5yYy50cyBhbmQgcnVuIFwibnB4IHByb2plblwiLlxuaW1wb3J0IHsgYXdzX2FwcHN5bmMgfSBmcm9tICdhd3MtY2RrLWxpYic7XG5pbXBvcnQgeyBBcHBzeW5jVHlwZXNjcmlwdEZ1bmN0aW9uIH0gZnJvbSAnLi8nO1xuXG4vKipcbiAqIFRTRXhwcmVzc1BpcGVsaW5lUmVzb2x2ZXJQcm9wc1xuICovXG5leHBvcnQgaW50ZXJmYWNlIFRTRXhwcmVzc1BpcGVsaW5lUmVzb2x2ZXJQcm9wcyB7XG4gIC8qKlxuICAgKiBUaGUgQVBJIHRoaXMgcmVzb2x2ZXIgaXMgYXR0YWNoZWQgdG8uXG4gICAqIEBzdGFiaWxpdHkgc3RhYmxlXG4gICAqL1xuICByZWFkb25seSBhcGk6IGF3c19hcHBzeW5jLklHcmFwaHFsQXBpO1xuICAvKipcbiAgICogVGhlIGRhdGEgc291cmNlIHRoaXM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luY1R5cGVzY3JpcHRGdW5jdGlvbiBjb25zdHJ1Y3RcbiAgICovXG4gIHJlYWRvbmx5IHRzRnVuY3Rpb246IEFwcHN5bmNUeXBlc2NyaXB0RnVuY3Rpb247XG59XG4iXX0=
|
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)",
|