open-index/open-npm huggingface dataset:
npm package: @newesissrl/nodemailer-sendgrid
Description: SendGrid transport for Nodemailer
Author: Newesis Srl
Latest version: 1.0.7

# nodemailer-sendgrid

SendGrid transport object for Nodemailer.

## Warning, vendor lock-in ahead!

Using provider APIs like SendGrid might result in a vendor lock-in, especially if you are using provider specific features. So always consider if you would
prefer to use SMTP based services instead where vendor lock-ins do not happen.

Switching from a SMTP based provider to another is much easier (you do need to edit some DNS settings at least) than switching API based providers where you
probably have a lot of custom code targeting your existing provider.

This module is specially designed to be as much compatible with Nodemailer as possible, so if you do not touch the Sendgrid specific configuration options then
switching from SendGrid API to any other provider should be just as easy as switching from SMTP.

## Usage

> Requires Nodemailer v6.0.0+

This module is mostly meant to demonstrate the usage of `mail.normalize(cb)` method in Nodemailer v4.3. This allows creating HTTP API based transports for
Nodemailer much easier.

### Install from NPM

    npm install nodemailer @newesissrl/nodemailer-sendgrid

### Create Nodemailer transport

```javascript
const nodemailer = require('nodemailer');
const nodemailerSendgrid = require('@newesissrl/nodemailer-sendgrid');
const transport = nodemailer.createTransport(
    nodemailerSendgrid({
        apiKey: process.env.SENDGRID_API_KEY
    })
);
```

See [full example](./examples/mail.js).

### Send a message

Message objects support the entire Nodemailer API. In addition you can provide SendGrid specific keys like `templateId` or `sendAt`.

```javascript
transport.sendMail({
    from: 'sender@example.com',
    to: 'Receiver Name <receiver@example.com>, someother@example.com',
    subject: 'hello world',
    html: '<h1>Hello world!</h1>'
});
```

## License

This project is licensed under the [Apache license](LICENSE)

## Conduct

We follow the [CNCF Code of Conduct](CODE_OF_CONDUCT.md).
npm package: @newesissrl/payload-exportcollections-plugin
Description: Extends `mzinga` with the ability to export all collection's data to CSV or JSON
Author: Newesis Srl
Latest version: 1.0.3

# payload-exportcollections-plugin

Extends `mzinga` with the ability to export all collection's data to CSV or JSON

## Install

`npm install @newesissrl/payload-exportcollections-plugin`

## Get Started

### mzinga.config.ts

```js
import { exportCollectionsPlugin } from "@newesissrl/payload-exportcollections-plugin";

export default buildConfig({
    ....
    plugins: [exportCollectionsPlugin(config?)],
    i18n: {
      resources: {
        // to localize the buttons' labels
        en: {
          general: {
            "export-list-csv": "Export list (CSV)",
            "export-list-json": "Export list (JSON)",
          },
        },
        it: {
          general: {
            "export-list-csv": "Esporta lista (CSV)",
            "export-list-json": "Esporta lista (JSON)",
          },
        },
      },
    }
    ....
})
```

The plugin may expects a `config` object defined like this:

```js
export type ExportCollectionsPluginConfig = {
  disabledCollections?: string[];
  rootDir?: string;
  jsonReplacer?: (key: string, value: any) => any;
  csvOptions?: Json2CsvOptions;
  componentPlacement?:
    | "AfterList"
    | "AfterListTable"
    | "BeforeList"
    | "BeforeListTable";
};
```

where:

- `disabledCollections` is a list of collections' slugs that you want to exclude from the plugin's enrichment.
- `rootDir` is the directory where to temporarily store the exported files
- `componentPlacement` identify where to place the component
- `jsonReplacer` is a function useful to replace fields (and/or omit them in the final result). see [here](https://dillionmegida.com/p/second-argument-in-json-stringify/#function-replacers)
- `csvOptions` is the same implementation as per the core [json-2-csv](https://www.npmjs.com/package/json-2-csv) package. see [here](https://mrodrig.github.io/json-2-csv/)

## Notes

If you followed the above guide and still cannot see the buttons, it may be needed to update your webpack config as per below:

```js
export default buildConfig({
  admin: {
    webpack: (config: any) => {
      return {
        ...config,
        resolve: {
          ...config.resolve,
          alias: {
            ...config.resolve.alias,
            payload: path.resolve("./node_modules/mzinga"), // this will fix the components usage of `useConfig` hook
          }
        }
      }
    }
  }
})
```
npm package: @newesissrl/payload-zitadel-plugin
Description: Extends `payloadcms` with [Zitadel](https://www.zitadel.com) integration
Author: Newesis Srl
Latest version: 1.0.3

# payload-zitadel-plugin

Extends `payloadcms` with [Zitadel](https://www.zitadel.com) integration

## Install

`yarn add @newesissrl/payload-zitadel-plugin`
`yarn add cookie-parser`

## Get Started



### server.ts
```js
const cookieParser = require("cookie-parser");
import { ZitadelRoutes } from "@newesissrl/payload-zitadel-plugin/dist/routes";
....
app.use(cookieParser());
....
await payload.init(....);
ZitadelRoutes(app);
....
```

### PAYLOAD_PUBLIC env variables

```sh
PAYLOAD_PUBLIC_ZITADEL_REDIRECT_URI=http://localhost:3030/zitadel/redirect
PAYLOAD_PUBLIC_ZITADEL_TOKEN_ENDPOINT=http://localhost:8080/oauth/v2/token
PAYLOAD_PUBLIC_ZITADEL_USER_INFO=http://localhost:8080/oidc/v1/userinfo
PAYLOAD_PUBLIC_ZITADEL_AUTHORIZE_ENDPOINT=http://localhost:8080/oauth/v2/authorize
PAYLOAD_PUBLIC_ZITADEL_CLIENT_ID= #the one you get from Zitadel app
PAYLOAD_PUBLIC_ZITADEL_COOKIE_NAME= #(optional) if you want to specify a different cookie name
PAYLOAD_PUBLIC_ZITADEL_COOKIE_SECURE= #(optional) if you want to specify a secure cookie (default = false)
PAYLOAD_PUBLIC_ZITADEL_COOKIE_SAMESITE= #(optional) if you want to specify a different sameSite option for cookie. default = "lax"
PAYLOAD_PUBLIC_COOKIE_DOMAIN= #(optional) if you want to specify a cookie domain
```

### payload.config.ts

```js
import { ZitadelStrategyPlugin } from "@newesissrl/payload-zitadel-plugin/dist/plugins";
import { LoginButton } from "@newesissrl/payload-zitadel-plugin/dist/components/LoginButton";

const buildConfigAsync = async () => {
    const zitadelPlugin = await ZitadelStrategyPlugin({
      ui: {
        beforeOrAfterLogin? // where to place the button (before|after, default = "after")
        loginButtonLabel? // the label to use for the login button (default = "login-with-zitadel")
        LoginButton: LoginButton // the component to use for the login button
      },
      auth: {
        authorizeEndpoint: process.env.PAYLOAD_PUBLIC_ZITADEL_AUTHORIZE_ENDPOINT,
        clientID: process.env.PAYLOAD_PUBLIC_ZITADEL_CLIENT_ID,
        redirectUri: process.env.PAYLOAD_PUBLIC_ZITADEL_REDIRECT_URI,
      },
      fieldsMappings: [], // useful to remap fields from idP to the desired `required` fields
      /*
      [{
        from: "name",
        to: "first_name"
      },
      ...]
      */
     loggerOptions? // optional logging options for `pino` library
    });
    return buildConfig({
      .....
      plugins: [...., zitadelPlugin],
    })
}
```

## Notes

If you want to override the `LoginButton` component, your React component must accept those properties:

```js
loginButtonLabel,
codeChallenge,
authorizeEndpoint,
redirectUri,
clientID,
scope,
codeChallengeMethod,
state
```