From 473f814f41476b86d1b3e132d4d5a3e09971dc49 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:46:36 -0500 Subject: [PATCH] feat/slack update pnpm lock --- libs/util/src/extension.ts | 32 ++++++++++ pnpm-lock.yaml | 124 ++++++++++++++++++++++++++++++------- 2 files changed, 134 insertions(+), 22 deletions(-) diff --git a/libs/util/src/extension.ts b/libs/util/src/extension.ts index f5d3c0264..e34c65926 100644 --- a/libs/util/src/extension.ts +++ b/libs/util/src/extension.ts @@ -10,6 +10,10 @@ import { import type z from 'zod'; import type { DbConfig } from './databaseConnection/types'; import { getDbConfig } from './assertDbEnvVars'; +import { + EdgeFunctionsOptions, + FunctionsOptions, +} from '@netlify/sdk/dist/extension/types'; type BuildHookWithEnvVars< DbConfig, @@ -88,4 +92,32 @@ export class Extension< }, ); }; + + addFunctions = async ( + path: string, + options: FunctionsOptions, + ): Promise => { + super.addFunctions(path, { + prefix: options.prefix, + shouldInjectFunction: () => { + try { + if (!process.env.SLACK_ENABLED) { + return false; + } + + if (options?.shouldInjectFunction) { + return options.shouldInjectFunction({ + name: options.shouldInjectFunction.name, + }); + } + return true; + } catch (e) { + console.info( + `Function injection did not complete successfully. Errored with error: ${e}`, + ); + return false; + } + }, + }); + }; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60dc3571d..48570d7ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -348,6 +348,85 @@ importers: specifier: ^2.0.5 version: 2.1.4(@types/node@20.17.5)(jsdom@20.0.3) + extensions/slack: + dependencies: + '@netlify/functions': + specifier: ^2.8.2 + version: 2.8.2 + '@netlify/sdk': + specifier: ^2.6.0 + version: 2.8.2(@google-cloud/storage@5.20.5)(@trpc/server@11.0.0-rc.604)(@types/react@18.3.12)(autoprefixer@10.4.20(postcss@8.4.47))(graphql@16.9.0)(postcss@8.4.47)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.14(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) + '@tanstack/react-query': + specifier: ^5.59.6 + version: 5.59.16(react@18.3.1) + '@trpc/client': + specifier: ^11.0.0-rc.477 + version: 11.0.0-rc.604(@trpc/server@11.0.0-rc.604) + '@trpc/react-query': + specifier: ^11.0.0-rc.477 + version: 11.0.0-rc.604(@tanstack/react-query@5.59.16(react@18.3.1))(@trpc/client@11.0.0-rc.604(@trpc/server@11.0.0-rc.604))(@trpc/server@11.0.0-rc.604)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@trpc/server': + specifier: ^11.0.0-rc.477 + version: 11.0.0-rc.604 + axios: + specifier: ^1.7.7 + version: 1.7.7 + mongodb: + specifier: ^6.9.0 + version: 6.10.0(socks@2.8.3) + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + zod: + specifier: ^3.23.8 + version: 3.23.8 + devDependencies: + '@netlify/netlify-plugin-netlify-extension': + specifier: ^1.0.3 + version: 1.0.3 + '@tsconfig/node18': + specifier: ^18.2.4 + version: 18.2.4 + '@tsconfig/recommended': + specifier: ^1.0.7 + version: 1.0.8 + '@tsconfig/strictest': + specifier: ^2.0.5 + version: 2.0.5 + '@tsconfig/vite-react': + specifier: ^3.0.2 + version: 3.0.2 + '@types/react': + specifier: ^18.3.11 + version: 18.3.12 + '@types/react-dom': + specifier: ^18.3.0 + version: 18.3.1 + '@vitejs/plugin-react': + specifier: ^4.3.2 + version: 4.3.3(vite@5.4.10(@types/node@22.9.0)) + autoprefixer: + specifier: ^10.4.20 + version: 10.4.20(postcss@8.4.47) + netlify-cli: + specifier: ^17.36.4 + version: 17.37.2(@types/express@4.17.21)(@types/node@22.9.0) + tailwindcss: + specifier: ^3.4.13 + version: 3.4.14(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) + typescript: + specifier: ^5.6.3 + version: 5.6.3 + util: + specifier: workspace:* + version: link:../../libs/util + vite: + specifier: ^5.4.8 + version: 5.4.10(@types/node@22.9.0) + extensions/snooty-cache: dependencies: '@netlify/netlify-plugin-netlify-extension': @@ -12579,7 +12658,7 @@ snapshots: '@stackbit/artisanal-names@1.0.1': {} - '@stackbit/cms-contentful@0.4.56(graphql@16.9.0)': + '@stackbit/cms-contentful@0.4.56': dependencies: '@contentful/rich-text-types': 15.15.1 '@stackbit/cms-core': 2.0.1(graphql@16.9.0) @@ -12591,7 +12670,6 @@ snapshots: transitivePeerDependencies: - debug - encoding - - graphql - supports-color '@stackbit/cms-core@2.0.1(graphql@16.9.0)': @@ -12626,7 +12704,7 @@ snapshots: - supports-color - utf-8-validate - '@stackbit/cms-git@0.4.18(graphql@16.9.0)': + '@stackbit/cms-git@0.4.18': dependencies: '@stackbit/artisanal-names': 1.0.1 '@stackbit/cms-core': 2.0.1(graphql@16.9.0) @@ -12640,15 +12718,11 @@ snapshots: micromatch: 4.0.8 slugify: 1.6.6 transitivePeerDependencies: - - bufferutil - - canvas - debug - encoding - - graphql - supports-color - - utf-8-validate - '@stackbit/cms-sanity@0.2.56(graphql@16.9.0)': + '@stackbit/cms-sanity@0.2.56': dependencies: '@sanity/block-tools': 2.36.2 '@sanity/client': 3.4.1 @@ -12668,18 +12742,17 @@ snapshots: - canvas - debug - encoding - - graphql - supports-color - utf-8-validate - '@stackbit/dev-common@0.5.51(graphql@16.9.0)': + '@stackbit/dev-common@0.5.51': dependencies: '@iarna/toml': 2.2.5 '@stackbit/artisanal-names': 1.0.1 - '@stackbit/cms-contentful': 0.4.56(graphql@16.9.0) + '@stackbit/cms-contentful': 0.4.56 '@stackbit/cms-core': 2.0.1(graphql@16.9.0) - '@stackbit/cms-git': 0.4.18(graphql@16.9.0) - '@stackbit/cms-sanity': 0.2.56(graphql@16.9.0) + '@stackbit/cms-git': 0.4.18 + '@stackbit/cms-sanity': 0.2.56 '@stackbit/sdk': 2.0.1 '@stackbit/types': 1.0.1 '@stackbit/utils': 0.4.19 @@ -12705,15 +12778,14 @@ snapshots: - canvas - debug - encoding - - graphql - supports-color - utf-8-validate '@stackbit/dev@1.0.35(graphql@16.9.0)': dependencies: '@stackbit/cms-core': 2.0.1(graphql@16.9.0) - '@stackbit/cms-git': 0.4.18(graphql@16.9.0) - '@stackbit/dev-common': 0.5.51(graphql@16.9.0) + '@stackbit/cms-git': 0.4.18 + '@stackbit/dev-common': 0.5.51 '@stackbit/sdk': 2.0.1 axios: 0.25.0 chalk: 4.1.2 @@ -13520,25 +13592,25 @@ snapshots: axios@0.21.4: dependencies: - follow-redirects: 1.15.9(debug@4.3.7) + follow-redirects: 1.15.9(debug@2.6.9) transitivePeerDependencies: - debug axios@0.24.0: dependencies: - follow-redirects: 1.15.9(debug@4.3.7) + follow-redirects: 1.15.9(debug@2.6.9) transitivePeerDependencies: - debug axios@0.25.0: dependencies: - follow-redirects: 1.15.9(debug@4.3.7) + follow-redirects: 1.15.9(debug@2.6.9) transitivePeerDependencies: - debug axios@1.7.7: dependencies: - follow-redirects: 1.15.9(debug@4.3.7) + follow-redirects: 1.15.9(debug@2.6.9) form-data: 4.0.1 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -16018,7 +16090,7 @@ snapshots: '@types/follow-redirects': 1.14.4 '@types/progress-stream': 2.0.5 decompress-response: 7.0.0 - follow-redirects: 1.15.9(debug@4.3.7) + follow-redirects: 1.15.9(debug@2.6.9) is-retry-allowed: 2.2.0 progress-stream: 2.0.0 tunnel-agent: 0.6.0 @@ -16440,7 +16512,7 @@ snapshots: http-proxy-middleware@0.20.0: dependencies: - http-proxy: 1.18.1(debug@4.3.7) + http-proxy: 1.18.1 is-glob: 4.0.3 lodash: 4.17.21 micromatch: 4.0.8 @@ -16459,6 +16531,14 @@ snapshots: transitivePeerDependencies: - debug + http-proxy@1.18.1: + dependencies: + eventemitter3: 4.0.7 + follow-redirects: 1.15.9(debug@2.6.9) + requires-port: 1.0.0 + transitivePeerDependencies: + - debug + http-proxy@1.18.1(debug@4.3.7): dependencies: eventemitter3: 4.0.7