Skip to content

Commit

Permalink
fix: change ChatKitty Client Secret param type to secret
Browse files Browse the repository at this point in the history
  • Loading branch information
aerovulpe committed Aug 15, 2024
1 parent a876982 commit 90eb74a
Show file tree
Hide file tree
Showing 14 changed files with 6,479 additions and 75 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm ci

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
run: npx semantic-release
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
.idea
.vscode

## Node modules
node_modules

## Log files
**/*.log
18 changes: 18 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- - "@semantic-release/changelog"
- changelogFile: "CHANGELOG.md"
- - "@semantic-release/exec"
- prepareCmd: "./prepare-release.sh ${nextRelease.version}"
- - "@semantic-release/github"
- - "@semantic-release/git"
- assets:
- "extension.yaml"
- "CHANGELOG.md"
message: "chore(release): prepare ${nextRelease.version} [skip ci]"

branches:
- name: "main"

tagFormat: ${version}
2 changes: 0 additions & 2 deletions CHANGELOG.md

This file was deleted.

13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2024 ChatKitty, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
16 changes: 13 additions & 3 deletions extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sourceUrl: https://github.com/chatkitty/chatkitty-firebase-extension
releaseNotesUrl: https://github.com/chatkitty/chatkitty-firebase-extension/blob/main/CHANGELOG.md

resources:
- name: createChatUser
- name: handleCreateUser
type: firebaseextensions.v1beta.function
description: >-
Listens for user accounts to be created in your Firebase project and creates a ChatKitty user for each new user.
Expand All @@ -29,7 +29,17 @@ resources:
eventType: providers/firebase.auth/eventTypes/user.create
resource: projects/${PROJECT}

- name: deleteChatUser
- name: handleSignInUser
type: firebaseextensions.v1beta.function
description: >-
Listens for user accounts to sign in in your Firebase project and creates a ChatKitty user for each new user.
properties:
runtime: nodejs18
eventTrigger:
eventType: providers/firebase.auth/eventTypes/user.signIn
resource: projects/${PROJECT}

- name: handleDeleteUser
type: firebaseextensions.v1beta.function
description: >-
Listens for user accounts to be deleted in your Firebase project and deletes the corresponding ChatKitty user.
Expand All @@ -52,6 +62,6 @@ params:
label: ChatKitty Client Secret
description: >-
Your ChatKitty Client Secret. You can find this in your ChatKitty console.
type: string
type: secret
required: true
immutable: true
6 changes: 3 additions & 3 deletions functions/lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion functions/lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 35 additions & 59 deletions functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions functions/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"name": "chatkitty",
"name": "functions",
"description": "ChatKitty Firebase Functions",
"main": "lib/index.js",
"engines": {
"node": "18"
},
"scripts": {
"lint": "eslint \"src/**/*\"",
"lint:fix": "eslint \"src/**/*\" --fix",
"package": "tsc",
"build:package": "tsc",
"build:watch": "tsc --watch"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const chatkitty = new ChatKitty({
});


export const createChatUser =
export const handleCreateUser =
functions.auth.user().onCreate(async (user) => {
await chatkitty.Users.checkUserExists(user.uid).catch(async () => {
await chatkitty.Users.createUser({
Expand All @@ -18,7 +18,7 @@ export const createChatUser =
});
});

export const deleteChatUser = functions.auth.user().onDelete(async (user) => {
export const handleDeleteUser = functions.auth.user().onDelete(async (user) => {
const result = await chatkitty.Users.listUsers(0, 0, undefined, user.uid);

const users = result.data._embedded?.users;
Expand Down
Loading

0 comments on commit 90eb74a

Please sign in to comment.