nestjs-backend-common 0.1.0 → 0.4.0
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/.github/workflows/docs.yml +61 -0
- package/.github/workflows/publish.yml +21 -4
- package/.prettierignore +1 -0
- package/CONTRIBUTING.md +5 -0
- package/README.md +12 -2
- package/dist/jest.config.d.ts +1 -0
- package/dist/jest.config.d.ts.map +1 -1
- package/dist/jest.config.js +1 -0
- package/dist/jest.config.js.map +1 -1
- package/dist/src/decorators/any-of/any-of.decorator.d.ts +1 -1
- package/dist/src/decorators/any-of/any-of.decorator.js +1 -1
- package/dist/src/decorators/get-ip/get-ip.decorator.d.ts +4 -0
- package/dist/src/decorators/get-ip/get-ip.decorator.d.ts.map +1 -1
- package/dist/src/decorators/get-ip/get-ip.decorator.js +4 -0
- package/dist/src/decorators/get-ip/get-ip.decorator.js.map +1 -1
- package/dist/src/decorators/index.d.ts +3 -2
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +7 -16
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/one-of/one-of.decorator.d.ts +1 -1
- package/dist/src/decorators/one-of/one-of.decorator.d.ts.map +1 -1
- package/dist/src/decorators/one-of/one-of.decorator.js +3 -5
- package/dist/src/decorators/one-of/one-of.decorator.js.map +1 -1
- package/dist/src/graphql-types/index.d.ts +2 -0
- package/dist/src/graphql-types/index.d.ts.map +1 -0
- package/dist/src/graphql-types/index.js +18 -0
- package/dist/src/graphql-types/index.js.map +1 -0
- package/dist/src/graphql-types/relay-pagination.type.d.ts +24 -0
- package/dist/src/graphql-types/relay-pagination.type.d.ts.map +1 -0
- package/dist/src/graphql-types/relay-pagination.type.js +97 -0
- package/dist/src/graphql-types/relay-pagination.type.js.map +1 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces/index.d.ts +13 -0
- package/dist/src/interfaces/index.d.ts.map +1 -0
- package/dist/src/{types → interfaces}/index.js.map +1 -1
- package/dist/src/modules/correlation-id/correlation-id.constant.d.ts.map +1 -0
- package/dist/src/modules/correlation-id/correlation-id.constant.js.map +1 -0
- package/dist/src/{correlation-id → modules/correlation-id}/correlation-id.interceptor.d.ts +6 -3
- package/dist/src/modules/correlation-id/correlation-id.interceptor.d.ts.map +1 -0
- package/dist/src/modules/correlation-id/correlation-id.interceptor.js +117 -0
- package/dist/src/modules/correlation-id/correlation-id.interceptor.js.map +1 -0
- package/dist/src/modules/correlation-id/correlation-id.interface.d.ts +3 -0
- package/dist/src/modules/correlation-id/correlation-id.interface.d.ts.map +1 -0
- package/dist/src/modules/correlation-id/correlation-id.interface.js +3 -0
- package/dist/src/modules/correlation-id/correlation-id.interface.js.map +1 -0
- package/dist/src/modules/correlation-id/correlation-id.module.d.ts +17 -0
- package/dist/src/modules/correlation-id/correlation-id.module.d.ts.map +1 -0
- package/dist/src/{correlation-id → modules/correlation-id}/correlation-id.module.js +12 -1
- package/dist/src/modules/correlation-id/correlation-id.module.js.map +1 -0
- package/dist/src/{correlation-id → modules/correlation-id}/correlation-id.service.d.ts +0 -1
- package/dist/src/modules/correlation-id/correlation-id.service.d.ts.map +1 -0
- package/dist/src/{correlation-id → modules/correlation-id}/correlation-id.service.js +2 -4
- package/dist/src/modules/correlation-id/correlation-id.service.js.map +1 -0
- package/dist/src/{correlation-id → modules/correlation-id}/index.d.ts +1 -1
- package/dist/src/modules/correlation-id/index.d.ts.map +1 -0
- package/dist/src/{correlation-id → modules/correlation-id}/index.js +1 -1
- package/dist/src/modules/correlation-id/index.js.map +1 -0
- package/dist/src/modules/index.d.ts +3 -0
- package/dist/src/modules/index.d.ts.map +1 -0
- package/dist/src/modules/index.js +19 -0
- package/dist/src/modules/index.js.map +1 -0
- package/dist/src/modules/logger/correlation-id.format.d.ts +7 -0
- package/dist/src/modules/logger/correlation-id.format.d.ts.map +1 -0
- package/dist/src/modules/logger/correlation-id.format.js +42 -0
- package/dist/src/modules/logger/correlation-id.format.js.map +1 -0
- package/dist/src/modules/logger/custom-logger.service.d.ts +15 -0
- package/dist/src/modules/logger/custom-logger.service.d.ts.map +1 -0
- package/dist/src/modules/logger/custom-logger.service.js +160 -0
- package/dist/src/modules/logger/custom-logger.service.js.map +1 -0
- package/dist/src/modules/logger/index.d.ts +5 -0
- package/dist/src/modules/logger/index.d.ts.map +1 -0
- package/dist/src/modules/logger/index.js +10 -0
- package/dist/src/modules/logger/index.js.map +1 -0
- package/dist/src/modules/logger/json-format.d.ts +7 -0
- package/dist/src/modules/logger/json-format.d.ts.map +1 -0
- package/dist/src/modules/logger/json-format.js +10 -0
- package/dist/src/modules/logger/json-format.js.map +1 -0
- package/dist/src/modules/logger/logger.interface.d.ts +8 -0
- package/dist/src/modules/logger/logger.interface.d.ts.map +1 -0
- package/dist/src/{correlation-id/correlation-id.type.js → modules/logger/logger.interface.js} +1 -1
- package/dist/src/modules/logger/logger.interface.js.map +1 -0
- package/dist/src/modules/logger/logger.module-definition.d.ts +12 -0
- package/dist/src/modules/logger/logger.module-definition.d.ts.map +1 -0
- package/dist/src/modules/logger/logger.module-definition.js +14 -0
- package/dist/src/modules/logger/logger.module-definition.js.map +1 -0
- package/dist/src/modules/logger/logger.module.d.ts +51 -0
- package/dist/src/modules/logger/logger.module.d.ts.map +1 -0
- package/dist/src/modules/logger/logger.module.js +165 -0
- package/dist/src/modules/logger/logger.module.js.map +1 -0
- package/dist/src/modules/logger/nest-like-with-dash.format.d.ts +7 -0
- package/dist/src/modules/logger/nest-like-with-dash.format.d.ts.map +1 -0
- package/dist/src/modules/logger/nest-like-with-dash.format.js +16 -0
- package/dist/src/modules/logger/nest-like-with-dash.format.js.map +1 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +20 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/is-nil.util.d.ts +2 -0
- package/dist/src/utils/is-nil.util.d.ts.map +1 -0
- package/dist/src/utils/is-nil.util.js +7 -0
- package/dist/src/utils/is-nil.util.js.map +1 -0
- package/dist/src/utils/url-builder.d.ts +2 -0
- package/dist/src/utils/url-builder.d.ts.map +1 -0
- package/dist/src/utils/url-builder.js +12 -0
- package/dist/src/utils/url-builder.js.map +1 -0
- package/dist/src/utils/validate-envs.util.d.ts +3 -0
- package/dist/src/utils/validate-envs.util.d.ts.map +1 -0
- package/dist/src/utils/validate-envs.util.js +29 -0
- package/dist/src/utils/validate-envs.util.js.map +1 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +78 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/CorrelationIdModule.html +3 -0
- package/docs/classes/CorrelationIdService.html +3 -0
- package/docs/classes/CustomLoggerService.html +13 -0
- package/docs/classes/LoggerModule.html +8 -0
- package/docs/classes/PageInfo.html +6 -0
- package/docs/functions/AnyOf.html +2 -0
- package/docs/functions/ConnectionType.html +1 -0
- package/docs/functions/EdgeType.html +1 -0
- package/docs/functions/OneOf.html +2 -0
- package/docs/functions/isNil.html +1 -0
- package/docs/functions/urlBuilder.html +1 -0
- package/docs/functions/validateEnvs.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +10 -0
- package/docs/interfaces/Class.html +2 -0
- package/docs/interfaces/Connection.html +3 -0
- package/docs/interfaces/CorrelationIdModuleOptions.html +6 -0
- package/docs/interfaces/Edge.html +3 -0
- package/docs/interfaces/LogMetadata.html +3 -0
- package/docs/modules.html +1 -0
- package/docs/types/CommonExecutionContext.html +1 -0
- package/docs/types/LogLevel.html +1 -0
- package/docs/types/LogMode.html +1 -0
- package/docs/types/NodeEnv.html +1 -0
- package/docs/types/RecursivePartial.html +1 -0
- package/docs/variables/CORRELATION_ID_CLS_KEY.html +1 -0
- package/docs/variables/CORRELATION_ID_HEADER_NAME.html +1 -0
- package/docs/variables/jsonFormat.html +3 -0
- package/eslint.config.mjs +3 -0
- package/jest.config.ts +1 -0
- package/package.json +21 -7
- package/src/decorators/any-of/any-of.decorator.spec.ts +11 -0
- package/src/decorators/any-of/any-of.decorator.ts +1 -1
- package/src/decorators/get-ip/get-ip.decorator.ts +4 -0
- package/src/decorators/index.ts +3 -2
- package/src/decorators/one-of/one-of.decorator.ts +3 -5
- package/src/graphql-types/index.ts +1 -0
- package/src/graphql-types/relay-pagination.type.ts +89 -0
- package/src/index.ts +4 -2
- package/src/interfaces/index.ts +19 -0
- package/src/modules/correlation-id/correlation-id.interceptor.spec.ts +146 -0
- package/src/modules/correlation-id/correlation-id.interceptor.ts +162 -0
- package/src/modules/correlation-id/correlation-id.interface.ts +3 -0
- package/src/{correlation-id → modules/correlation-id}/correlation-id.module.ts +13 -2
- package/src/{correlation-id → modules/correlation-id}/correlation-id.service.ts +1 -3
- package/src/{correlation-id → modules/correlation-id}/index.ts +1 -1
- package/src/modules/index.ts +2 -0
- package/src/modules/logger/correlation-id.format.ts +47 -0
- package/src/modules/logger/custom-logger.service.spec.ts +155 -0
- package/src/modules/logger/custom-logger.service.ts +170 -0
- package/src/modules/logger/index.ts +8 -0
- package/src/modules/logger/json-format.ts +13 -0
- package/src/modules/logger/logger.interface.ts +14 -0
- package/src/modules/logger/logger.module-definition.ts +34 -0
- package/src/modules/logger/logger.module.ts +157 -0
- package/src/modules/logger/nest-like-with-dash.format.ts +16 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/is-nil.util.spec.ts +25 -0
- package/src/utils/is-nil.util.ts +3 -0
- package/src/utils/url-builder.spec.ts +48 -0
- package/src/utils/url-builder.ts +10 -0
- package/src/utils/validate-envs.helper.spec.ts +38 -0
- package/src/utils/validate-envs.util.ts +32 -0
- package/.github/README.md +0 -19
- package/dist/src/correlation-id/correlation-id.constant.d.ts.map +0 -1
- package/dist/src/correlation-id/correlation-id.constant.js.map +0 -1
- package/dist/src/correlation-id/correlation-id.interceptor.d.ts.map +0 -1
- package/dist/src/correlation-id/correlation-id.interceptor.js +0 -68
- package/dist/src/correlation-id/correlation-id.interceptor.js.map +0 -1
- package/dist/src/correlation-id/correlation-id.module.d.ts +0 -6
- package/dist/src/correlation-id/correlation-id.module.d.ts.map +0 -1
- package/dist/src/correlation-id/correlation-id.module.js.map +0 -1
- package/dist/src/correlation-id/correlation-id.service.d.ts.map +0 -1
- package/dist/src/correlation-id/correlation-id.service.js.map +0 -1
- package/dist/src/correlation-id/correlation-id.type.d.ts +0 -8
- package/dist/src/correlation-id/correlation-id.type.d.ts.map +0 -1
- package/dist/src/correlation-id/correlation-id.type.js.map +0 -1
- package/dist/src/correlation-id/index.d.ts.map +0 -1
- package/dist/src/correlation-id/index.js.map +0 -1
- package/dist/src/types/index.d.ts +0 -3
- package/dist/src/types/index.d.ts.map +0 -1
- package/src/correlation-id/correlation-id.interceptor.spec.ts +0 -45
- package/src/correlation-id/correlation-id.interceptor.ts +0 -78
- package/src/correlation-id/correlation-id.type.ts +0 -7
- package/src/types/index.ts +0 -3
- /package/dist/src/{types → interfaces}/index.js +0 -0
- /package/dist/src/{correlation-id → modules/correlation-id}/correlation-id.constant.d.ts +0 -0
- /package/dist/src/{correlation-id → modules/correlation-id}/correlation-id.constant.js +0 -0
- /package/src/{correlation-id → modules/correlation-id}/correlation-id.constant.ts +0 -0
- /package/src/{correlation-id → modules/correlation-id}/correlation-id.service.spec.ts +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Generate Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["Publish The Library"]
|
|
6
|
+
types:
|
|
7
|
+
- completed
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
docs:
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- uses: pnpm/action-setup@v4
|
|
23
|
+
name: Install pnpm
|
|
24
|
+
with:
|
|
25
|
+
version: 10
|
|
26
|
+
run_install: false
|
|
27
|
+
|
|
28
|
+
- name: Install NodeJS
|
|
29
|
+
uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: 24
|
|
32
|
+
cache: "pnpm"
|
|
33
|
+
|
|
34
|
+
- name: Install Dependencies
|
|
35
|
+
run: pnpm install --frozen-lockfile
|
|
36
|
+
|
|
37
|
+
- name: Generate Documentation
|
|
38
|
+
run: pnpm exec typedoc src/index.ts
|
|
39
|
+
|
|
40
|
+
- name: Commit Documentation
|
|
41
|
+
id: commit_docs
|
|
42
|
+
run: |
|
|
43
|
+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
44
|
+
git config --local user.name "github-actions[bot]"
|
|
45
|
+
git add docs/
|
|
46
|
+
|
|
47
|
+
if [[ -n $(git status --porcelain docs/) ]]; then
|
|
48
|
+
echo "Documentation changes detected, committing..."
|
|
49
|
+
git commit -m "chore: update documentation"
|
|
50
|
+
echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
51
|
+
else
|
|
52
|
+
echo "No documentation changes detected, skipping commit"
|
|
53
|
+
echo "has_changes=false" >> $GITHUB_OUTPUT
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
- name: Push Changes
|
|
57
|
+
if: steps.commit_docs.outputs.has_changes == 'true'
|
|
58
|
+
uses: ad-m/github-push-action@master
|
|
59
|
+
with:
|
|
60
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
61
|
+
branch: ${{ github.ref }}
|
|
@@ -17,34 +17,51 @@ jobs:
|
|
|
17
17
|
uses: actions/checkout@v4
|
|
18
18
|
|
|
19
19
|
- name: Check the current published version
|
|
20
|
+
id: version_check
|
|
20
21
|
run: |
|
|
21
22
|
LAST_PUBLISHED_VERSION=$(npm view nestjs-backend-common version 2> /dev/null || echo "")
|
|
22
|
-
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')
|
|
23
|
-
|
|
23
|
+
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d ' ')
|
|
24
|
+
|
|
25
|
+
echo "last_published=$LAST_PUBLISHED_VERSION" >> $GITHUB_OUTPUT
|
|
26
|
+
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
|
|
27
|
+
|
|
28
|
+
if [[ "$LAST_PUBLISHED_VERSION" == "$PACKAGE_VERSION" ]]; then
|
|
29
|
+
echo "should_publish=false" >> $GITHUB_OUTPUT
|
|
30
|
+
echo "::warning::Skipping publish - version $PACKAGE_VERSION is already published on npm"
|
|
31
|
+
else
|
|
32
|
+
echo "should_publish=true" >> $GITHUB_OUTPUT
|
|
33
|
+
echo "Will publish new version: $PACKAGE_VERSION (current: $LAST_PUBLISHED_VERSION)"
|
|
34
|
+
fi
|
|
24
35
|
|
|
25
36
|
- uses: pnpm/action-setup@v4
|
|
37
|
+
if: steps.version_check.outputs.should_publish == 'true'
|
|
26
38
|
name: Install pnpm
|
|
27
39
|
with:
|
|
28
40
|
version: 10
|
|
29
41
|
run_install: false
|
|
30
42
|
|
|
31
43
|
- name: Install NodeJS
|
|
44
|
+
if: steps.version_check.outputs.should_publish == 'true'
|
|
32
45
|
uses: actions/setup-node@v4
|
|
33
46
|
with:
|
|
34
|
-
node-version:
|
|
47
|
+
node-version: 24
|
|
35
48
|
cache: "pnpm"
|
|
36
49
|
registry-url: "https://registry.npmjs.org/"
|
|
37
50
|
|
|
38
51
|
- name: Install Dependencies
|
|
52
|
+
if: steps.version_check.outputs.should_publish == 'true'
|
|
39
53
|
run: pnpm install --frozen-lockfile
|
|
40
54
|
|
|
41
55
|
- name: Apply Eslint
|
|
56
|
+
if: steps.version_check.outputs.should_publish == 'true'
|
|
42
57
|
run: pnpm lint
|
|
43
58
|
|
|
44
59
|
- name: Run Unit Tests
|
|
60
|
+
if: steps.version_check.outputs.should_publish == 'true'
|
|
45
61
|
run: pnpm test:unit
|
|
46
62
|
|
|
47
63
|
- name: Publish Package on npm 📦
|
|
64
|
+
if: steps.version_check.outputs.should_publish == 'true'
|
|
48
65
|
run: pnpm publish --provenance --access public --no-git-checks
|
|
49
66
|
env:
|
|
50
|
-
|
|
67
|
+
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.prettierignore
CHANGED
package/CONTRIBUTING.md
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NestJS Backend Common
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All the utility functions and common modules I usually use in my NestJS applications will be published and maintained here.
|
|
4
|
+
|
|
5
|
+
📚 **[View Full API Documentation](https://kasir-barati.github.io/nestjs-backend-common/)**.
|
|
6
|
+
|
|
7
|
+
📦 **[View the package on NPM](https://www.npmjs.com/package/nestjs-backend-common)**.
|
|
8
|
+
|
|
9
|
+
## Why `nestjs-cls` Is Peer Dependency?
|
|
10
|
+
|
|
11
|
+
This is because we wanna share the same storage between our App and this library. Thus we have to define it as peer dependency;
|
|
12
|
+
|
|
13
|
+
> **Peer Dependencies**: These are dependencies that your project hooks into or modifies in the parent project, usually a plugin for some other library or tool. Peer dependencies are not automatically installed by npm. Instead, they are only checked for, ensuring that the parent project (the project that will depend on your project) has a dependency on the project you hook into. For example, if you create a plugin for a library like Chai, you would specify Chai as a peer dependency. This ensures that the user of your plugin has the correct version of Chai installed.
|
package/dist/jest.config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":";;;;;;;;AAEA,wBAOmB"}
|
package/dist/jest.config.js
CHANGED
package/dist/jest.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":";;AAEA,kBAAe;IACb,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE;QACT,WAAW,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;KAC7B;IACD,kBAAkB,EAAE,CAAC,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":";;AAEA,kBAAe;IACb,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE;QACT,WAAW,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;KAC7B;IACD,kBAAkB,EAAE,CAAC,2BAA2B,CAAC;IACjD,SAAS,EAAE,CAAC,cAAc,CAAC;CACX,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @description
|
|
3
|
-
* Do not annotate the fields with `@IsOptional` since it will not validate them at all.
|
|
3
|
+
* Do not annotate the fields with `@IsOptional` since it will not validate them at all. Learn how to use it by reading the unit tests.
|
|
4
4
|
*/
|
|
5
5
|
export declare function AnyOf(properties: string[]): (target: any) => void;
|
|
6
6
|
//# sourceMappingURL=any-of.decorator.d.ts.map
|
|
@@ -5,7 +5,7 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const class_validator_1 = require("class-validator");
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
8
|
-
* Do not annotate the fields with `@IsOptional` since it will not validate them at all.
|
|
8
|
+
* Do not annotate the fields with `@IsOptional` since it will not validate them at all. Learn how to use it by reading the unit tests.
|
|
9
9
|
*/
|
|
10
10
|
function AnyOf(properties) {
|
|
11
11
|
return function (target) {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ExecutionContext } from '@nestjs/common';
|
|
2
2
|
export declare function getIpFactory(data: unknown, ctx: ExecutionContext): string | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Returns the IP address of the client making the request. Learn how to use it by reading the unit tests.
|
|
6
|
+
*/
|
|
3
7
|
export declare const GetIp: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
4
8
|
//# sourceMappingURL=get-ip.decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ip.decorator.d.ts","sourceRoot":"","sources":["../../../../src/decorators/get-ip/get-ip.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAGxB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,gBAAgB,GACpB,MAAM,GAAG,SAAS,CAUpB;AAED,eAAO,MAAM,KAAK,mDAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"get-ip.decorator.d.ts","sourceRoot":"","sources":["../../../../src/decorators/get-ip/get-ip.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAGxB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,gBAAgB,GACpB,MAAM,GAAG,SAAS,CAUpB;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,mDAAqC,CAAC"}
|
|
@@ -13,5 +13,9 @@ function getIpFactory(data, ctx) {
|
|
|
13
13
|
return ip;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* @description
|
|
18
|
+
* Returns the IP address of the client making the request. Learn how to use it by reading the unit tests.
|
|
19
|
+
*/
|
|
16
20
|
exports.GetIp = (0, common_1.createParamDecorator)(getIpFactory);
|
|
17
21
|
//# sourceMappingURL=get-ip.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ip.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/get-ip/get-ip.decorator.ts"],"names":[],"mappings":";;;AAMA,oCAaC;AAnBD,2CAGwB;AACxB,qDAAuC;AAEvC,SAAgB,YAAY,CAC1B,IAAa,EACb,GAAqB;IAErB,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,MAAM,EAAE,GACN,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC;QAClC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/B,IAAI,IAAA,sBAAI,EAAC,EAAE,CAAC,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;
|
|
1
|
+
{"version":3,"file":"get-ip.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/get-ip/get-ip.decorator.ts"],"names":[],"mappings":";;;AAMA,oCAaC;AAnBD,2CAGwB;AACxB,qDAAuC;AAEvC,SAAgB,YAAY,CAC1B,IAAa,EACb,GAAqB;IAErB,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,MAAM,EAAE,GACN,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC;QAClC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/B,IAAI,IAAA,sBAAI,EAAC,EAAE,CAAC,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACU,QAAA,KAAK,GAAG,IAAA,6BAAoB,EAAC,YAAY,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { AnyOf } from './any-of/any-of.decorator';
|
|
2
|
+
export { GetIp } from './get-ip/get-ip.decorator';
|
|
3
|
+
export { OneOf } from './one-of/one-of.decorator';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
exports.OneOf = exports.GetIp = exports.AnyOf = void 0;
|
|
4
|
+
var any_of_decorator_1 = require("./any-of/any-of.decorator");
|
|
5
|
+
Object.defineProperty(exports, "AnyOf", { enumerable: true, get: function () { return any_of_decorator_1.AnyOf; } });
|
|
6
|
+
var get_ip_decorator_1 = require("./get-ip/get-ip.decorator");
|
|
7
|
+
Object.defineProperty(exports, "GetIp", { enumerable: true, get: function () { return get_ip_decorator_1.GetIp; } });
|
|
8
|
+
var one_of_decorator_1 = require("./one-of/one-of.decorator");
|
|
9
|
+
Object.defineProperty(exports, "OneOf", { enumerable: true, get: function () { return one_of_decorator_1.OneOf; } });
|
|
19
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA,8DAAkD;AAAzC,yGAAA,KAAK,OAAA;AACd,8DAAkD;AAAzC,yGAAA,KAAK,OAAA;AACd,8DAAkD;AAAzC,yGAAA,KAAK,OAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @description
|
|
3
|
-
* Throws an error if more than one of the properties are present in the request body/querystring.
|
|
3
|
+
* Throws an error if more than one of the properties are present in the request body/querystring. Learn how to use it by reading the unit tests.
|
|
4
4
|
*/
|
|
5
5
|
export declare function OneOf(properties: string[]): (target: any) => void;
|
|
6
6
|
//# sourceMappingURL=one-of.decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"one-of.decorator.d.ts","sourceRoot":"","sources":["../../../../src/decorators/one-of/one-of.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"one-of.decorator.d.ts","sourceRoot":"","sources":["../../../../src/decorators/one-of/one-of.decorator.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IACvB,QAAQ,GAAG,UAoB7B"}
|
|
@@ -9,9 +9,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.OneOf = OneOf;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const class_validator_1 = require("class-validator");
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
12
13
|
/**
|
|
13
14
|
* @description
|
|
14
|
-
* Throws an error if more than one of the properties are present in the request body/querystring.
|
|
15
|
+
* Throws an error if more than one of the properties are present in the request body/querystring. Learn how to use it by reading the unit tests.
|
|
15
16
|
*/
|
|
16
17
|
function OneOf(properties) {
|
|
17
18
|
return function (target) {
|
|
@@ -43,7 +44,7 @@ let OneOfCheckerConstraint = class OneOfCheckerConstraint {
|
|
|
43
44
|
const data = validationArguments.object;
|
|
44
45
|
for (const property of properties) {
|
|
45
46
|
const propertyValue = data[property];
|
|
46
|
-
if (!isNil(value) && !isNil(propertyValue)) {
|
|
47
|
+
if (!(0, utils_1.isNil)(value) && !(0, utils_1.isNil)(propertyValue)) {
|
|
47
48
|
return false;
|
|
48
49
|
}
|
|
49
50
|
}
|
|
@@ -69,7 +70,4 @@ let OneOfCheckerConstraint = class OneOfCheckerConstraint {
|
|
|
69
70
|
OneOfCheckerConstraint = __decorate([
|
|
70
71
|
(0, class_validator_1.ValidatorConstraint)({ name: 'OneOfChecker' })
|
|
71
72
|
], OneOfCheckerConstraint);
|
|
72
|
-
function isNil(value) {
|
|
73
|
-
return value === null || value === undefined;
|
|
74
|
-
}
|
|
75
73
|
//# sourceMappingURL=one-of.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"one-of.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/one-of/one-of.decorator.ts"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"one-of.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/one-of/one-of.decorator.ts"],"names":[],"mappings":";;;;;;;;AAeA,sBAqBC;AApCD,2CAAiD;AACjD,qDAMyB;AAEzB,uCAAoC;AAEpC;;;GAGG;AACH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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./relay-pagination.type"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graphql-types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Type } from '@nestjs/common';
|
|
2
|
+
type ClassRef<T> = Type<T>;
|
|
3
|
+
export interface Edge<TNode> {
|
|
4
|
+
/** @description An opaque cursor for pagination */
|
|
5
|
+
cursor: string;
|
|
6
|
+
/** @description The item at the end of the edge */
|
|
7
|
+
node: TNode;
|
|
8
|
+
}
|
|
9
|
+
export interface Connection<TEdge> {
|
|
10
|
+
/** @description A list of edges in the connection */
|
|
11
|
+
edges: TEdge[];
|
|
12
|
+
/** @description Information about the current page of results */
|
|
13
|
+
pageInfo: PageInfo;
|
|
14
|
+
}
|
|
15
|
+
export declare class PageInfo {
|
|
16
|
+
endCursor: string | null;
|
|
17
|
+
hasNextPage: boolean;
|
|
18
|
+
hasPreviousPage: boolean;
|
|
19
|
+
startCursor: string | null;
|
|
20
|
+
}
|
|
21
|
+
export declare function EdgeType<TNode>(classRef: ClassRef<TNode>): ClassRef<Edge<TNode>>;
|
|
22
|
+
export declare function ConnectionType<TNode, TEdge extends Edge<TNode>>(classRef: ClassRef<TNode>, edgeRef?: ClassRef<TEdge>): ClassRef<Connection<TEdge>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=relay-pagination.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-pagination.type.d.ts","sourceRoot":"","sources":["../../../src/graphql-types/relay-pagination.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAGtC,KAAK,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAE3B,MAAM,WAAW,IAAI,CAAC,KAAK;IACzB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,IAAI,EAAE,KAAK,CAAC;CACb;AAED,MAAM,WAAW,UAAU,CAAC,KAAK;IAC/B,qDAAqD;IACrD,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,iEAAiE;IACjE,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,qBACa,QAAQ;IAMnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAMzB,WAAW,EAAE,OAAO,CAAC;IAMrB,eAAe,EAAE,OAAO,CAAC;IAOzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAC5B,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,GACxB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAevB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,EAC7D,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,EACzB,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,GACxB,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAkB7B"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PageInfo = void 0;
|
|
13
|
+
exports.EdgeType = EdgeType;
|
|
14
|
+
exports.ConnectionType = ConnectionType;
|
|
15
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
16
|
+
let PageInfo = class PageInfo {
|
|
17
|
+
endCursor;
|
|
18
|
+
hasNextPage;
|
|
19
|
+
hasPreviousPage;
|
|
20
|
+
startCursor;
|
|
21
|
+
};
|
|
22
|
+
exports.PageInfo = PageInfo;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, graphql_1.Field)(() => String, {
|
|
25
|
+
nullable: true,
|
|
26
|
+
description: 'The opaque cursor representing the end of the current page',
|
|
27
|
+
}),
|
|
28
|
+
__metadata("design:type", Object)
|
|
29
|
+
], PageInfo.prototype, "endCursor", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, graphql_1.Field)({
|
|
32
|
+
description: 'Indicates if there are more items after the current page',
|
|
33
|
+
}),
|
|
34
|
+
__metadata("design:type", Boolean)
|
|
35
|
+
], PageInfo.prototype, "hasNextPage", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, graphql_1.Field)({
|
|
38
|
+
description: 'Indicates if there are more items before the current page',
|
|
39
|
+
}),
|
|
40
|
+
__metadata("design:type", Boolean)
|
|
41
|
+
], PageInfo.prototype, "hasPreviousPage", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, graphql_1.Field)(() => String, {
|
|
44
|
+
nullable: true,
|
|
45
|
+
description: 'The opaque cursor representing the start of the current page',
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], PageInfo.prototype, "startCursor", void 0);
|
|
49
|
+
exports.PageInfo = PageInfo = __decorate([
|
|
50
|
+
(0, graphql_1.ObjectType)()
|
|
51
|
+
], PageInfo);
|
|
52
|
+
function EdgeType(classRef) {
|
|
53
|
+
let EdgeTypeClass = class EdgeTypeClass {
|
|
54
|
+
cursor;
|
|
55
|
+
node;
|
|
56
|
+
};
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, graphql_1.Field)(() => String, {
|
|
59
|
+
description: 'An opaque cursor for pagination',
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], EdgeTypeClass.prototype, "cursor", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, graphql_1.Field)(() => classRef, {
|
|
65
|
+
description: 'The item at the end of the edge',
|
|
66
|
+
}),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], EdgeTypeClass.prototype, "node", void 0);
|
|
69
|
+
EdgeTypeClass = __decorate([
|
|
70
|
+
(0, graphql_1.ObjectType)({ isAbstract: true })
|
|
71
|
+
], EdgeTypeClass);
|
|
72
|
+
return EdgeTypeClass;
|
|
73
|
+
}
|
|
74
|
+
function ConnectionType(classRef, edgeRef) {
|
|
75
|
+
const resolvedEdgeRef = edgeRef ?? EdgeType(classRef);
|
|
76
|
+
let ConnectionTypeClass = class ConnectionTypeClass {
|
|
77
|
+
edges;
|
|
78
|
+
pageInfo;
|
|
79
|
+
};
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, graphql_1.Field)(() => [resolvedEdgeRef], {
|
|
82
|
+
description: 'A list of edges in the connection',
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", Array)
|
|
85
|
+
], ConnectionTypeClass.prototype, "edges", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, graphql_1.Field)(() => PageInfo, {
|
|
88
|
+
description: 'Information about the current page of results',
|
|
89
|
+
}),
|
|
90
|
+
__metadata("design:type", PageInfo)
|
|
91
|
+
], ConnectionTypeClass.prototype, "pageInfo", void 0);
|
|
92
|
+
ConnectionTypeClass = __decorate([
|
|
93
|
+
(0, graphql_1.ObjectType)({ isAbstract: true })
|
|
94
|
+
], ConnectionTypeClass);
|
|
95
|
+
return ConnectionTypeClass;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=relay-pagination.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-pagination.type.js","sourceRoot":"","sources":["../../../src/graphql-types/relay-pagination.type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgDA,4BAiBC;AAED,wCAqBC;AAvFD,6CAAoD;AAmB7C,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAMnB,SAAS,CAAgB;IAMzB,WAAW,CAAU;IAMrB,eAAe,CAAU;IAOzB,WAAW,CAAgB;CAC5B,CAAA;AA1BY,4BAAQ;AAMnB;IALC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE;QACnB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,4DAA4D;KAC/D,CAAC;;2CACuB;AAMzB;IAJC,IAAA,eAAK,EAAC;QACL,WAAW,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ADxB,IAAA,oBAAU,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;OAC3B,mBAAmB,CAUxB;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./correlation-id"), exports);
|
|
18
17
|
__exportStar(require("./decorators"), exports);
|
|
19
|
-
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./graphql-types"), exports);
|
|
19
|
+
__exportStar(require("./interfaces"), exports);
|
|
20
|
+
__exportStar(require("./modules"), exports);
|
|
21
|
+
__exportStar(require("./utils"), exports);
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,kDAAgC;AAChC,+CAA6B;AAC7B,4CAA0B;AAC1B,0CAAwB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContextType } from '@nestjs/common';
|
|
2
|
+
export type CommonExecutionContext = 'graphql' | ContextType;
|
|
3
|
+
export type NodeEnv = 'development' | 'production' | 'test';
|
|
4
|
+
export interface Class<T> {
|
|
5
|
+
new (...args: any[]): T;
|
|
6
|
+
}
|
|
7
|
+
export type RecursivePartial<T> = Partial<{
|
|
8
|
+
[key in keyof T]: T[key] extends (...a: Array<infer U>) => unknown ? (...a: Array<U>) => RecursivePartial<ReturnType<T[key]>> | ReturnType<T[key]> : T[key] extends Array<unknown> ? Array<RecursivePartial<T[key][number]>> : RecursivePartial<T[key]> | T[key];
|
|
9
|
+
}>;
|
|
10
|
+
export interface CommonModuleOptions {
|
|
11
|
+
global?: boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,WAAW,CAAC;AAC7D,MAAM,MAAM,OAAO,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;AAC5D,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB;AACD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,OAAO,CAAC;KACvC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,OAAO,GAC9D,CACE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,KACX,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAC9D,CAAC,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAC3B,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GACvC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;CACxC,CAAC,CAAC;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-id.constant.d.ts","sourceRoot":"","sources":["../../../../src/modules/correlation-id/correlation-id.constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAC3D,eAAO,MAAM,sBAAsB,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-id.constant.js","sourceRoot":"","sources":["../../../../src/modules/correlation-id/correlation-id.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,gBAAgB,CAAC;AAC9C,QAAA,sBAAsB,GAAG,wBAAwB,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { Observable } from 'rxjs';
|
|
2
1
|
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
|
3
2
|
import { ClsService } from 'nestjs-cls';
|
|
3
|
+
import { type Observable } from 'rxjs';
|
|
4
4
|
export declare class CorrelationIdInterceptor implements NestInterceptor {
|
|
5
5
|
private readonly clsService;
|
|
6
|
-
private logger;
|
|
7
6
|
constructor(clsService: ClsService);
|
|
8
|
-
intercept(executionContext: ExecutionContext, next: CallHandler): Observable<
|
|
7
|
+
intercept(executionContext: ExecutionContext, next: CallHandler): Observable<any>;
|
|
8
|
+
private isHttp;
|
|
9
|
+
private isWebSocket;
|
|
10
|
+
private getGraphqlCorrelationIdHeader;
|
|
11
|
+
private setGraphqlCorrelationIdHeader;
|
|
9
12
|
}
|
|
10
13
|
//# sourceMappingURL=correlation-id.interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-id.interceptor.d.ts","sourceRoot":"","sources":["../../../../src/modules/correlation-id/correlation-id.interceptor.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,gBAAgB,EAEhB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,KAAK,UAAU,EAAO,MAAM,MAAM,CAAC;AAQ5C,qBACa,wBAAyB,YAAW,eAAe;IAClD,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEnD,SAAS,CACP,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,WAAW,GAChB,UAAU,CAAC,GAAG,CAAC;IAwFlB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,6BAA6B;IAcrC,OAAO,CAAC,6BAA6B;CAoBtC"}
|