-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "moved to firebase, scaffolding for challenges, new courses"
This reverts commit 717119f.
- Loading branch information
nsjames
authored and
nsjames
committed
Oct 2, 2023
1 parent
1cb88f7
commit 794469a
Showing
49 changed files
with
3,739 additions
and
7,482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,5 +111,3 @@ dist | |
*.tar | ||
*.tar.gz | ||
*.zip | ||
|
||
sensitive/firebase.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
|
||
FIRESTORE_COLLECTION_NAME=learnhub | ||
|
||
COUCHBASE_HOST=couchbase://localhost | ||
COUCHBASE_USERNAME=test | ||
COUCHBASE_PASSWORD=testtest | ||
|
||
AUTH0_CLIENT_ID=test | ||
AUTH0_CLIENT_SECRET=test | ||
AUTH0_AUDIENCE=https://dev.eosnetwork.com | ||
AUTH0_ISSUER_URL=https://devhub.us.auth0.com/ | ||
USER_CREATE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
CREATE INDEX course_progress_agg ON devhub(`finished`,`course_slug_hash`) WHERE doc_type = 'course_progress' USING GSI | ||
CREATE INDEX idx_challenges ON devhub(doc_type) WHERE doc_type = 'challenge' USING GSI | ||
CREATE INDEX idx_course_progress ON devhub(doc_type) WHERE doc_type = 'course_progress' USING GSI | ||
CREATE INDEX course_difficulty ON devhub(`difficulty`) WHERE doc_type = 'course' USING GSI | ||
CREATE INDEX course_search ON devhub(`title`,`description`) WHERE doc_type = 'course' USING GSI | ||
CREATE INDEX bounty_search ON devhub(`type`) WHERE doc_type = 'bounty' USING GSI | ||
CREATE INDEX doctype ON devhub(`doc_type`) USING GSI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import {Bounty} from "@eosn/devhub-structures/bounty"; | ||
import {sha256} from "eosjs-ecc"; | ||
import ORM from "../util/orm"; | ||
|
||
export default class BountyService { | ||
|
||
static async get(slug:string): Promise<Bounty | null> { | ||
const hash = sha256(slug); | ||
const bounty = await ORM.get(Bounty.key(hash), Bounty); | ||
if(!bounty) return null; | ||
return <Bounty>bounty; | ||
} | ||
|
||
static async set(bounty:Bounty): Promise<boolean> { | ||
return await ORM.update(bounty); | ||
} | ||
|
||
static async create(json:any): Promise<boolean> { | ||
json.slug = Bounty.titleToSlug(json.localizations['en'].title); | ||
json.slug_hash = sha256(json.slug); | ||
return await this.set(new Bounty(json)); | ||
} | ||
|
||
static async getByType(type:number): Promise<Array<Bounty>> { | ||
return ORM.query(`SELECT * FROM BUCKET_NAME WHERE doc_type = 'bounty' AND type = ${type}`, Bounty) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.