Code Monkey home page Code Monkey logo

nestjs-plugins's Introduction

nestjs-plugins's People

Contributors

9renpoto avatar abyssparanoia avatar dependabot-preview[bot] avatar dependabot[bot] avatar duduzera1997 avatar mkoepf-man avatar renovate-bot avatar renovate[bot] avatar wontondon avatar yasai-t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nestjs-plugins's Issues

Compatibility Issue with @nestjs-firebase Module and nest/common Version 10.0.3

The @nestjs-firebase module currently does not support the latest version of nest/common (version 10.0.3) as a peer dependency. To ensure compatibility with the library's new version of nest/common, an update is required.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! Found: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! @nestjs/common@"^10.0.3" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"^9.0.0" from [email protected]
npm ERR! node_modules/nestjs-firebase
npm ERR! nestjs-firebase@"^9.0.0" from the root project
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

For detailed information, please refer to the official documentation
Migration Guide.

Ability to post to multiple channel ?

With the current implementation, it accepts a single url string.

@Module({
  imports: [
    SlackModule.forRoot({
      url: "SLACK_WEBHOOK_URL", // ref: https://api.slack.com/messaging/webhooks#posting_with_webhooks
    }),
  ],
})

How do I configure the url so that I can use different url and post to different channels?

Thanks

pageInfo error

CleanShot 2021-08-18 at 10 11 16

Property 'pageInfo' in type 'LanguageConnection' is not assignable to the same property in base type 'Connection'.
Type 'import("/node_modules/nestjs-graphql-relay/lib/pageInfo").PageInfo' is not assignable to type 'import("/node_modules/graphql-relay/connection/connection").PageInfo'.
Property 'startCursor' is optional in type 'PageInfo' but required in type 'PageInfo'.ts(2416)
(property) LanguageConnection.pageInfo: PageInfo

NestJS 9: `InjectKysley` type error Argument of type 'undefined' is not assignable to parameter of type 'string | symbol'.

When injecting the kysley module with InjectKysely in NestJS 9 there is a type error:

TS1239: Unable to resolve signature of parameter decorator when called as an expression.   Argument of type 'undefined' is not assignable to parameter of type 'string | symbol'.

This seems to be stemming from the fact that when the package is being published, it is being published with NestJS 8 as it's dependency, which results in the wrong typings for the decorator when using it in NestJS 9.

NestJS 9 unsupported

Hello, it seems that there is a peer dependency on @nestjs/common@^8.0.0 which prevents upgrading to v9.

npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR!   @nestjs/common@"9.0.5" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"^8.0.0" from [email protected]
npm ERR! node_modules/nestjs-firebase
npm ERR!   nestjs-firebase@"8.2.3" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

nestjs-firebase 8.2.1 npm package contains wrong "compiled" code

Hello,

I noticed that [email protected] npm package contains "compiled" code under the lib/ folder that does not match the corresponding typescript code.

As an example this "if" condition is not present in the compiled code:

if (!options || Object.values(options).filter((v) => !!v).length === 0) {
return createInstances(admin.initializeApp());
}

Compiled code of the whole method:

const getFirebaseAdmin = (_a) => {
    var { googleApplicationCredential: serviceAccountPath } = _a, options = __rest(_a, ["googleApplicationCredential"]);
    const app = firebaseAdmin.initializeApp(Object.assign({ credential: serviceAccountPath
            ? firebaseAdmin.credential.cert(serviceAccountPath)
            : undefined }, options));
    return {
        auth: app.auth(),
        messaging: app.messaging(),
        db: app.firestore(),
        storage: app.storage(),
    };
};

EDIT: About the duplicates I closed, I don't know how it happened, looks like a Github bug.

FirebaseAuthError, FirebaseError, FirebaseMessagingError doesn't export

Hello, I'm using credentials FirebaseAuthError, FirebaseError, FirebaseMessagingError but they don't export. My dependencies: firebase-admin: ^11.0.1, nestjs-firebase: ^8.2.3, nestjs version: 8.2. Do you can help me, please

node:internal/modules/cjs/loader:488
[0] throw e;
[0] ^
[0]
[0] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/utils/error' is not defined by "exports" in F:\dashboard\dashboard-nest-api\node_modules\fire
base-admin\package.json
[0] at new NodeError (node:internal/errors:371:5)
[0] at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
[0] at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
[0] at resolveExports (node:internal/modules/cjs/loader:482:36)
[0] at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
[0] at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
[0] at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[0] at Module.require (node:internal/modules/cjs/loader:1005:19)
[0] at require (node:internal/modules/cjs/helpers:102:18)
[0] at Object. (F:\dashboard\dashboard-nest-api\build\financialAnalyst\financialAnalyst.service.js:23:17)
[0] at Module._compile (node:internal/modules/cjs/loader:1101:14)
[0] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[0] at Module.load (node:internal/modules/cjs/loader:981:32)
[0] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[0] at Module.require (node:internal/modules/cjs/loader:1005:19)
[0] at require (node:internal/modules/cjs/helpers:102:18) {
[0] code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
[0] }

import {FirebaseAuthError, FirebaseError, FirebaseMessagingError} from "firebase-admin/lib/utils/error";
return validationDataFinancialAnalyst$.pipe(
switchMap(err => iif(
() => Array.of(err).every(data => data === data),
from(this.rmq.send('', 'Valid data')),
throwError(err => of(new FirebaseMessagingError({code: '400', message: 'Data aren't valid'}))),
))
)

Installation issue

Hi. Once I trying install nestjs-firebase I got an error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! @nestjs/common@"^9.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"^8.0.0" from [email protected]
npm ERR! node_modules/nestjs-firebase
npm ERR! nestjs-firebase@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/marktanasevich/.npm/eresolve-report.txt for a full report.

Please help me solve this issue.

nestjs-firebase 8.2.1 npm package contains wrong "compiled" code

Hello,

I noticed that [email protected] npm package contains "compiled" code under the lib/ folder that does not match the corresponding typescript code.

As an example this "if" condition is not present in the compiled code:

if (!options || Object.values(options).filter((v) => !!v).length === 0) {
return createInstances(admin.initializeApp());
}

Compiled code of the whole method:

const getFirebaseAdmin = (_a) => {
    var { googleApplicationCredential: serviceAccountPath } = _a, options = __rest(_a, ["googleApplicationCredential"]);
    const app = firebaseAdmin.initializeApp(Object.assign({ credential: serviceAccountPath
            ? firebaseAdmin.credential.cert(serviceAccountPath)
            : undefined }, options));
    return {
        auth: app.auth(),
        messaging: app.messaging(),
        db: app.firestore(),
        storage: app.storage(),
    };
};

Missing dependency on @nestjs/common

I'm making the switch to Yarn 2 and PNP, it's telling me:

Error: nestjs-firebase tried to access @nestjs/common, but it isn't declared in its dependencies

Please can it be added?

Adding support for CRUD operations with Firebase by extending Nestjs Controllers

Hello, I have never contributed before to a project and I dont really know exactly how to integrate my code into a PR for this one, so if you can guide me through it and you like what I did, I'd be happy to.

https://github.com/Darkbound/nestjs-firebase

https://github.com/Darkbound/nestjs-firebase/tree/main/src/firebase here I have a FirebaseCollectionService class that can be used to extend a NestjsController and give it CRUD methods for collections (nested too) out of the box:

import { Injectable } from "@nestjs/common";
import { FirebaseAdmin } from "nestjs-firebase/lib/firebase.interface";
import { InjectFirebaseAdmin } from "nestjs-firebase/lib/firebase.decorator";
import { User } from "./entities/user.entity";
import { FirebaseCollectionService } from "src/firebase/firebase-collection.service";
import { UpdateUserCreditsDto } from "./dto/update-user-credits.dto";

@Injectable()
export class UserService extends FirebaseCollectionService<User> {
  constructor(@InjectFirebaseAdmin() firebase: FirebaseAdmin) {
    super(firebase, "users");
  }
}

This is for a "level 1" collection, you instantiate it once for the service, give it firebase admin and the pattern of the collection path.

This will expose findOne, findAll, create, delete, update methods to the controller.

Basically if you run nest generate resource user and then delete the contents of the user.service.ts and just extend with my FirebaseCollectionService it will work directly with firebase

Now with purchase-transactions which is a nested collection of users, so users/{userId}/purchase-transactions/{transactionId}, you instantiate it the same way, but the second argument is the path, with the keys that are going to change for each document:

https://github.com/Darkbound/nestjs-firebase/blob/main/src/user/modules/purchase-transaction/purchase-transaction.service.ts

// This type is only for the keys within the path to the collection, as the last key is the "normal" `id` that comes from the controller itself and it can be named anything.
type FirebaseCollectionPathParams = {
  userId: string,
}

@Injectable()
export class PurchaseTransactionService extends FirebaseCollectionService<PurchaseTransaction, FirebaseCollectionPathParams> {
  constructor(@InjectFirebaseAdmin() firebase: FirebaseAdmin) {
    super(firebase, "users/{userId}/purchase-transactions");
  }
}

The path that is being supplied is the path of the collection.

Now in purchase-transactions.controller.ts, if I want to get a certain transaction:

@Get(":transactionId")
findOne(@Param("userId") userId: string, @Param("transactionId") transactionId: string) {
  return this.purchaseTransactionService.findOne(transactionId, { userId }); // Typescript for `userId` works
}

Let me know if you like it and would like it integrated, and if you can guide me through the process, I'd be more than happy to do it! :)

I guess it can probably be made into an Injectable module, just like your firebase admin, but I am still relatively new to Nestjs, so thats why I did not head that way :) Maybe that will be the next thing I will try to do...

Any recommendations are more than welcome!

How to call FieldValue.arrayUnion()

Hello,

I use this package, all is fine when I do this.firebase.firestore.(+something) in my service.

I would like to add a value in an array (from Firestore) via FieldValue.arrayUnion() but I am unable to retrieve FieldValue.
I tried FirebaseFirestore.FieldValue.arrayUnion(), but FirebaseFirestore is not defined.

I would greatly appreciate your assistance.

nestjs-firebase 8.2.1 npm package contains wrong "compiled" code

Hello,

I noticed that [email protected] npm package contains "compiled" code under the lib/ folder that does not match the corresponding typescript code.

As an example this "if" condition is not present in the compiled code:

if (!options || Object.values(options).filter((v) => !!v).length === 0) {
return createInstances(admin.initializeApp());
}

Compiled code of the whole method:

const getFirebaseAdmin = (_a) => {
    var { googleApplicationCredential: serviceAccountPath } = _a, options = __rest(_a, ["googleApplicationCredential"]);
    const app = firebaseAdmin.initializeApp(Object.assign({ credential: serviceAccountPath
            ? firebaseAdmin.credential.cert(serviceAccountPath)
            : undefined }, options));
    return {
        auth: app.auth(),
        messaging: app.messaging(),
        db: app.firestore(),
        storage: app.storage(),
    };
};

How to make module global in the app?

Hi! Tasnks for package!
I saw that your module doesn't have option isGlobal. How can I do module global without many imports to each extra module?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/actionlint.yml
  • actions/checkout v4
  • reviewdog/action-actionlint v1
.github/workflows/bump.yml
  • actions/checkout v4
  • actions/github-script v7
  • peter-evans/create-pull-request v5
.github/workflows/nodejs.yml
  • actions/checkout v4
  • actions/setup-node v4
  • codecov/codecov-action v3
.github/workflows/npm-publish-packages.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/setup-node v4
npm
example/package.json
  • @apollo/server ^4.7.3
  • @as-integrations/fastify ^2.0.0
  • @nestjs/apollo ^12.0.0
  • @nestjs/cli ^10.0.0
  • @nestjs/config ^3.0.0
  • @nestjs/platform-fastify ^10.0.0
  • uuid ^9.0.0
  • @nestjs/testing ^10.0.0
  • @types/uuid ^9.0.2
package.json
  • @9renpoto/tsconfig ^7.6.0
  • @nestjs/testing ^10.0.0
  • @types/jest ^29.5.2
  • husky ^8.0.3
  • jest-mock-extended ^3.0.5
  • lint-staged ^15.0.0
  • ts-jest ^29.1.0
  • npm ^10.0.0
packages/nestjs-firebase/package.json
  • @google-cloud/firestore ^7.0.0
  • @google-cloud/storage ^7.0.0
  • @nestjs/common ^10.0.0
  • firebase-admin ^10.0.0 || ^11.0.0
packages/nestjs-graphql-relay/package.json
  • @types/validator ^13.7.17
  • @types/ws ^8.5.5
  • sqlite3 ^5.1.6
  • @apollo/gateway ^2.0.0
  • @nestjs/graphql ^12.0.0
  • @nestjs/typeorm ^10.0.0
  • graphql-relay ^0.10.0
  • ts-morph *
  • class-validator *
packages/nestjs-slack-webhook/package.json
  • @nestjs/common ^10.0.0
  • @slack/webhook ^6.0.0 || ^7.0.0
packages/nestjs-zendesk/package.json
  • @nestjs/testing ^10.0.0
  • node-zendesk ^5.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

[nestjs-firebase] is @Global() really needed?

hello.

have u considered making nestjs-firebase module not @Global()? i think generally it's better for module which is distributed to be local because one can always make it global by wrapping it into another global module but the opposite cannot be done.

consider the situation where you would want to restrict firebase usage to certain modules.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.