Added core files
This commit is contained in:
parent
cb9bb33d4b
commit
5626f0bf48
13 changed files with 5336 additions and 0 deletions
2
.eslintignore
Normal file
2
.eslintignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
CHANGELOG.md
|
||||
*.d.ts
|
10
.eslintrc.json
Normal file
10
.eslintrc.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"extends": "marine/prettier/node",
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.eslint.json",
|
||||
"extraFileExtensions": [
|
||||
".mjs"
|
||||
]
|
||||
}
|
||||
}
|
67
.gitignore
vendored
Normal file
67
.gitignore
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
node_modules/
|
||||
|
||||
# Custom ESLint rules
|
||||
.eslintplugin/*
|
||||
!.eslintplugin/index.ts
|
||||
!.eslintplugin/tsconfig.json
|
||||
|
||||
# Don't commit build outputs
|
||||
globals.js
|
||||
globals.*map
|
||||
globals.d.ts
|
||||
globals.mjs
|
||||
|
||||
v*.js
|
||||
v*.*map
|
||||
v*.d.ts
|
||||
v*.mjs
|
||||
|
||||
deno/**/*.js
|
||||
deno/**/*.map
|
||||
deno/**/*.d.ts
|
||||
deno/**/*.mjs
|
||||
|
||||
gateway/**/*.js
|
||||
gateway/**/*.map
|
||||
gateway/**/*.d.ts
|
||||
gateway/**/*.mjs
|
||||
|
||||
payloads/**/*.js
|
||||
payloads/**/*.map
|
||||
payloads/**/*.d.ts
|
||||
payloads/**/*.mjs
|
||||
|
||||
rest/**/*.js
|
||||
rest/**/*.map
|
||||
rest/**/*.d.ts
|
||||
rest/**/*.mjs
|
||||
|
||||
rpc/**/*.js
|
||||
rpc/**/*.map
|
||||
rpc/**/*.d.ts
|
||||
rpc/**/*.mjs
|
||||
|
||||
shortcuts/**/*.js
|
||||
shortcuts/**/*.map
|
||||
shortcuts/**/*.d.ts
|
||||
shortcuts/**/*.mjs
|
||||
|
||||
utils/**/*.js
|
||||
utils/**/*.map
|
||||
utils/**/*.d.ts
|
||||
utils/**/*.mjs
|
||||
|
||||
voice/**/*.js
|
||||
voice/**/*.map
|
||||
voice/**/*.d.ts
|
||||
voice/**/*.mjs
|
||||
|
||||
valkyriechat/**/*.js
|
||||
valkyriechat/**/*.map
|
||||
valkyriechat/**/*.d.ts
|
||||
valkyriechat/**/*.mjs
|
||||
|
||||
!scripts/versions.mjs
|
||||
|
||||
# macOS files
|
||||
.DS_Store
|
6
.npmrc
Normal file
6
.npmrc
Normal file
|
@ -0,0 +1,6 @@
|
|||
audit=false
|
||||
fund=false
|
||||
legacy-peer-deps=true
|
||||
tag-version-prefix=""
|
||||
git-tag-version=false
|
||||
message="chore(release): %s 🎉"
|
3
.prettierignore
Normal file
3
.prettierignore
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Node modules
|
||||
node_modules/
|
||||
CHANGELOG.md
|
8
.prettierrc.json
Normal file
8
.prettierrc.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"printWidth": 120,
|
||||
"useTabs": true,
|
||||
"singleQuote": true,
|
||||
"quoteProps": "as-needed",
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "lf"
|
||||
}
|
12
.vscode/settings.json
vendored
Normal file
12
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"files.eol": "\n",
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": "never",
|
||||
"source.fixAll": "explicit",
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"cSpell.enableFiletypes": [
|
||||
"mdx"
|
||||
]
|
||||
}
|
97
globals.ts
Normal file
97
globals.ts
Normal file
|
@ -0,0 +1,97 @@
|
|||
/**
|
||||
* https://discord.com/developers/docs/reference#snowflakes
|
||||
*/
|
||||
export type Snowflake = string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions
|
||||
* @internal
|
||||
*/
|
||||
export type Permissions = string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#message-formatting-formats
|
||||
*/
|
||||
export const FormattingPatterns = {
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
User: /<@(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly with a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
UserWithNickname: /<@!(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, with or without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a channel mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Channel: /<#(?<id>\d*)>/,
|
||||
/**
|
||||
* Regular expression for matching a role mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Role: /<@&(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a application command mention
|
||||
*
|
||||
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
SlashCommand:
|
||||
/<\/(?<fullName>(?<name>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?<subcommandOrGroup>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?<subcommand>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?<id>\d{17,20})>/u,
|
||||
/**
|
||||
* Regular expression for matching a custom emoji, either static or animated
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
Emoji: /<(?<animated>a)?:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly an animated custom emoji
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
AnimatedEmoji: /<(?<animated>a):(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly a static custom emoji
|
||||
*
|
||||
* The `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
StaticEmoji: /<:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a timestamp, either default or custom styled
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
Timestamp: /<t:(?<timestamp>-?\d{1,13})(:(?<style>[tTdDfFR]))?>/,
|
||||
/**
|
||||
* Regular expression for matching strictly default styled timestamps
|
||||
*
|
||||
* The `timestamp` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
DefaultStyledTimestamp: /<t:(?<timestamp>-?\d{1,13})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly custom styled timestamps
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
StyledTimestamp: /<t:(?<timestamp>-?\d{1,13}):(?<style>[tTdDfFR])>/,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freezes the formatting patterns
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(FormattingPatterns);
|
153
package.json
Normal file
153
package.json
Normal file
|
@ -0,0 +1,153 @@
|
|||
{
|
||||
"name": "@valkyriechat/valkyrie-api-types",
|
||||
"version": "0.37.51",
|
||||
"description": "Valkyrie API typings that are kept up to date for use in bot library and client creation.",
|
||||
"homepage": "https://chat.valkyriecoms.com",
|
||||
"exports": {
|
||||
"./globals": {
|
||||
"require": "./globals.js",
|
||||
"import": "./globals.mjs",
|
||||
"types": "./globals.d.ts"
|
||||
},
|
||||
"./v9": {
|
||||
"require": "./v9.js",
|
||||
"import": "./v9.mjs",
|
||||
"types": "./v9.d.ts"
|
||||
},
|
||||
"./gateway": {
|
||||
"require": "./gateway/index.js",
|
||||
"import": "./gateway/index.mjs",
|
||||
"types": "./gateway/index.d.ts"
|
||||
},
|
||||
"./gateway/v*": {
|
||||
"require": "./gateway/v*.js",
|
||||
"import": "./gateway/v*.mjs",
|
||||
"types": "./gateway/v*.d.ts"
|
||||
},
|
||||
"./payloads": {
|
||||
"require": "./payloads/index.js",
|
||||
"import": "./payloads/index.mjs",
|
||||
"types": "./payloads/index.d.ts"
|
||||
},
|
||||
"./payloads/v*": {
|
||||
"require": "./payloads/v*/index.js",
|
||||
"import": "./payloads/v*/index.mjs",
|
||||
"types": "./payloads/v*/index.d.ts"
|
||||
},
|
||||
"./rest": {
|
||||
"require": "./rest/index.js",
|
||||
"import": "./rest/index.mjs",
|
||||
"types": "./rest/index.d.ts"
|
||||
},
|
||||
"./rest/v*": {
|
||||
"require": "./rest/v*/index.js",
|
||||
"import": "./rest/v*/index.mjs",
|
||||
"types": "./rest/v*/index.d.ts"
|
||||
},
|
||||
"./rpc": {
|
||||
"require": "./rpc/index.js",
|
||||
"import": "./rpc/index.mjs",
|
||||
"types": "./rpc/index.d.ts"
|
||||
},
|
||||
"./rpc/v*": {
|
||||
"require": "./rpc/v*.js",
|
||||
"import": "./rpc/v*.mjs",
|
||||
"types": "./rpc/v*.d.ts"
|
||||
},
|
||||
"./voice": {
|
||||
"require": "./voice/index.js",
|
||||
"import": "./voice/index.mjs",
|
||||
"types": "./voice/index.d.ts"
|
||||
},
|
||||
"./voice/v*": {
|
||||
"require": "./voice/v*.js",
|
||||
"import": "./voice/v*.mjs",
|
||||
"types": "./voice/v*.d.ts"
|
||||
},
|
||||
"./utils": {
|
||||
"require": "./utils/index.js",
|
||||
"import": "./utils/index.mjs",
|
||||
"types": "./utils/index.d.ts"
|
||||
},
|
||||
"./utils/v*": {
|
||||
"require": "./utils/v*.js",
|
||||
"import": "./utils/v*.mjs",
|
||||
"types": "./utils/v*.d.ts"
|
||||
},
|
||||
"./valkyriechat": {
|
||||
"require": "./index.js",
|
||||
"import": "./index.mjs",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build:ci": "tsc --noEmit --incremental false",
|
||||
"build:node": "tsc && run-p esm:*",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
||||
"ci:pr": "run-s changelog lint",
|
||||
"clean:node": "rimraf {gateway,payloads,rest,rpc,voice,utils,valkyriechat}/**/*.{js,mjs,d.ts,*map} {globals,v*}.{js,mjs,d.ts,*map}",
|
||||
"clean": "run-p clean:*",
|
||||
"esm:gateway": "gen-esm-wrapper ./gateway/index.js ./gateway/index.mjs",
|
||||
"esm:globals": "gen-esm-wrapper ./globals.js ./globals.mjs",
|
||||
"esm:payloads": "gen-esm-wrapper ./payloads/index.js ./payloads/index.mjs",
|
||||
"esm:rest": "gen-esm-wrapper ./rest/index.js ./rest/index.mjs",
|
||||
"esm:rpc": "gen-esm-wrapper ./rpc/index.js ./rpc/index.mjs",
|
||||
"esm:utils": "gen-esm-wrapper ./utils/index.js ./utils/index.mjs",
|
||||
"esm:valkyriechat": "gen-esm-wrapper ./utils/index.js ./utils/index.mjs",
|
||||
"esm:versions": "node ./scripts/versions.mjs",
|
||||
"esm:voice": "gen-esm-wrapper ./voice/index.js ./voice/index.mjs",
|
||||
"lint": "prettier --write . && eslint --fix --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils,valkyriechat}/**/*.ts {globals,v*}.ts scripts/**/*.mjs",
|
||||
"prepare": "is-ci || husky install",
|
||||
"prepublishOnly": "run-s clean test:lint build:node",
|
||||
"test:lint": "prettier --check . && eslint --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils,valkyriechat}/**/*.ts {globals,v*}.ts scripts/**/*.mjs",
|
||||
"pretest:types": "tsc",
|
||||
"test:types": "node ./scripts/run-tsd.mjs",
|
||||
"posttest:types": "npm run clean:node"
|
||||
},
|
||||
"author": "Toastie <toastie@toastiet0ast.com>",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
"{gateway,payloads,rest,rpc,voice,utils,valkyriechat}/**/*.{js,js.map,d.ts,d.ts.map,mjs,ts}",
|
||||
"{globals,v*}.{js,js.map,d.ts,d.ts.map,mjs,ts}"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/runtime-corejs3": "^7.18.0",
|
||||
"@commitlint/cli": "^17.0.0",
|
||||
"@commitlint/config-angular": "^17.0.0",
|
||||
"@favware/npm-deprecate": "^1.0.4",
|
||||
"@sapphire/prettier-config": "^1.4.3",
|
||||
"@types/conventional-recommended-bump": "^6.1.0",
|
||||
"@types/node": "^17.0.35",
|
||||
"@typescript-eslint/eslint-plugin": "^5.26.0",
|
||||
"@typescript-eslint/parser": "^5.26.0",
|
||||
"conventional-changelog-cli": "^2.2.2",
|
||||
"conventional-recommended-bump": "^6.1.0",
|
||||
"eslint": "^8.16.0",
|
||||
"eslint-config-marine": "^9.4.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-import-resolver-typescript": "^2.7.1",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.5.1",
|
||||
"eslint-plugin-react": "^7.30.0",
|
||||
"eslint-plugin-react-hooks": "^4.5.0",
|
||||
"gen-esm-wrapper": "^1.1.3",
|
||||
"husky": "^8.0.1",
|
||||
"is-ci": "^3.0.1",
|
||||
"lint-staged": "^12.4.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.6.2",
|
||||
"pretty-quick": "^3.1.3",
|
||||
"rimraf": "^3.0.2",
|
||||
"tsd": "^0.20.0",
|
||||
"typescript": "^4.6.4"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://toastielab.dev/ValkyrieChat/valkyrie-api-types.git"
|
||||
},
|
||||
"lint-staged": {
|
||||
"{gateway,payloads,rest,rpc,voice,utils}/**/*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts",
|
||||
"{globals,v*}.ts": "eslint --fix --ext mjs,js,ts"
|
||||
},
|
||||
"packageManager": "pnpm@8.15.6+sha512.77b89e9be77a2b06ad8f403a19cae5e22976f61023f98ad323d5c30194958ebc02ee0a6ae5d13ee454f6134e4e8caf29a05f0b1a0e1d2b17bca6b6a1f1159f86"
|
||||
}
|
4919
pnpm-lock.yaml
Normal file
4919
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
19
tsconfig.eslint.json
Normal file
19
tsconfig.eslint.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true
|
||||
},
|
||||
"include": [
|
||||
"globals.ts",
|
||||
"v9.ts",
|
||||
"gateway/**/*.ts",
|
||||
"payloads/**/*.ts",
|
||||
"rest/**/*.ts",
|
||||
"rpc/**/*.ts",
|
||||
"utils/**/*.ts",
|
||||
"voice/**/*.ts",
|
||||
"scripts",
|
||||
"tests/**/*.ts",
|
||||
"spacebar/**/*.ts"
|
||||
]
|
||||
}
|
33
tsconfig.json
Normal file
33
tsconfig.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"compileOnSave": true,
|
||||
"compilerOptions": {
|
||||
"alwaysStrict": true,
|
||||
"lib": [
|
||||
"esnext"
|
||||
],
|
||||
"module": "commonjs",
|
||||
"ignoreDeprecations": "5.0",
|
||||
"noUnusedParameters": true,
|
||||
"sourceMap": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"noUnusedLocals": true,
|
||||
"removeComments": false,
|
||||
"target": "ES2018",
|
||||
"importsNotUsedAsValues": "error",
|
||||
"strictNullChecks": true,
|
||||
"preserveConstEnums": true,
|
||||
"exactOptionalPropertyTypes": true
|
||||
},
|
||||
"include": [
|
||||
"globals.ts",
|
||||
"v9.ts",
|
||||
"gateway/**/*.ts",
|
||||
"payloads/**/*.ts",
|
||||
"rest/**/*.ts",
|
||||
"rpc/**/*.ts",
|
||||
"utils/**/*.ts",
|
||||
"voice/**/*.ts",
|
||||
"spacebar/**/*.ts"
|
||||
]
|
||||
}
|
7
v9.ts
Normal file
7
v9.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
export * from './gateway/v9';
|
||||
export * from './globals';
|
||||
export * from './payloads/v9/index';
|
||||
export * from './rest/v9/index';
|
||||
export * from './rpc/v9';
|
||||
export * as Utils from './utils/v9';
|
||||
export * from './valkyriechat/index';
|
Loading…
Reference in a new issue