@opexa/portal-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1591 -0
- package/dist/graphql/account.service.d.ts +24 -0
- package/dist/graphql/announcement.d.ts +29 -0
- package/dist/graphql/auth.service.d.ts +16 -0
- package/dist/graphql/bet-record.d.ts +71 -0
- package/dist/graphql/bonus.d.ts +43 -0
- package/dist/graphql/cashback.d.ts +22 -0
- package/dist/graphql/deposit.d.ts +94 -0
- package/dist/graphql/file.d.ts +38 -0
- package/dist/graphql/file.service.d.ts +11 -0
- package/dist/graphql/game.d.ts +84 -0
- package/dist/graphql/game.service.d.ts +14 -0
- package/dist/graphql/index.d.ts +23 -0
- package/dist/graphql/member.d.ts +182 -0
- package/dist/graphql/platform.d.ts +38 -0
- package/dist/graphql/points.d.ts +22 -0
- package/dist/graphql/portal.service.d.ts +9 -0
- package/dist/graphql/promo.d.ts +35 -0
- package/dist/graphql/report.service.d.ts +18 -0
- package/dist/graphql/session.d.ts +25 -0
- package/dist/graphql/static.service.d.ts +12 -0
- package/dist/graphql/transaction.d.ts +26 -0
- package/dist/graphql/types.d.ts +93 -0
- package/dist/graphql/wallet.d.ts +14 -0
- package/dist/graphql/wallet.service.d.ts +30 -0
- package/dist/graphql/withdrawal.d.ts +106 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1007 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2916 -0
- package/dist/index.mjs.map +1 -0
- package/dist/logger.d.ts +15 -0
- package/dist/object-id.d.ts +1 -0
- package/dist/object-type.d.ts +9 -0
- package/dist/sdk.d.ts +228 -0
- package/dist/session-service.d.ts +25 -0
- package/dist/transformer.d.ts +52 -0
- package/dist/types.d.ts +839 -0
- package/dist/utils/add-days.d.ts +1 -0
- package/dist/utils/add-minutes.d.ts +1 -0
- package/dist/utils/clone-date.d.ts +1 -0
- package/dist/utils/gql.d.ts +1 -0
- package/dist/utils/graphql-client.d.ts +29 -0
- package/dist/utils/http-error.d.ts +6 -0
- package/dist/utils/is-after.d.ts +4 -0
- package/dist/utils/parse-decimal.d.ts +2 -0
- package/dist/utils/sha256.d.ts +1 -0
- package/dist/utils/sub-minutes.d.ts +1 -0
- package/dist/utils/types.d.ts +5 -0
- package/package.json +81 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addDays(date: Date, days: number): Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addMinutes(date: Date, minutes: number): Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cloneDate(date: Date): Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function gql(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HttpError } from './http-error';
|
|
2
|
+
import { GenericObject } from './types';
|
|
3
|
+
|
|
4
|
+
export type GraphQLClientMiddleware = (request: Request) => Request | Promise<Request>;
|
|
5
|
+
export interface GraphQLClientFetchOptions extends Omit<RequestInit, 'body' | 'method'> {
|
|
6
|
+
}
|
|
7
|
+
export interface GraphQLClientConfig {
|
|
8
|
+
middlewares?: GraphQLClientMiddleware[];
|
|
9
|
+
fetchOptions?: GraphQLClientFetchOptions;
|
|
10
|
+
}
|
|
11
|
+
export type GraphQLClientResponse<Data> = {
|
|
12
|
+
ok: true;
|
|
13
|
+
data: Data;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
error: HttpError;
|
|
17
|
+
};
|
|
18
|
+
export declare class GraphQLClient {
|
|
19
|
+
private url;
|
|
20
|
+
private options;
|
|
21
|
+
private middlewares;
|
|
22
|
+
constructor(url: string, config?: GraphQLClientConfig);
|
|
23
|
+
request<Data>(query: string, variables?: GenericObject): Promise<GraphQLClientResponse<Data>>;
|
|
24
|
+
/** Single file upload */
|
|
25
|
+
upload<Data>(query: string, variables: GenericObject): Promise<GraphQLClientResponse<Data>>;
|
|
26
|
+
private runMiddlewares;
|
|
27
|
+
private static createUploadBody;
|
|
28
|
+
private static extractFiles;
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type HttpErrorCode = 'HttpBadRequest' | 'HttpUnauthorized' | 'HttpForbidden' | 'HttpNotFound' | 'HttpRequestTimeout' | 'HttpTooManyRequests' | 'HttpInternalServerError' | 'HttpServiceUnavailable';
|
|
2
|
+
export interface HttpError {
|
|
3
|
+
code: HttpErrorCode;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function createHttpError(statusCode: number, message?: string): HttpError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sha256(input: string): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function subMinutes(date: Date, minutes: number): Date;
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opexa/portal-sdk",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "vite",
|
|
24
|
+
"build": "vite build --mode library",
|
|
25
|
+
"test": "vitest",
|
|
26
|
+
"release": "release-it"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@opexa/object-id": "0.1.6"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@ark-ui/react": "3.5.0",
|
|
33
|
+
"@faker-js/faker": "8.4.1",
|
|
34
|
+
"@fontsource/fira-code": "5.0.18",
|
|
35
|
+
"@fontsource/inter": "5.0.18",
|
|
36
|
+
"@types/node": "20.14.9",
|
|
37
|
+
"@types/react": "18.3.3",
|
|
38
|
+
"@types/react-dom": "18.3.0",
|
|
39
|
+
"@untitled-theme/icons-react": "0.10.1",
|
|
40
|
+
"@vitejs/plugin-react-swc": "3.7.0",
|
|
41
|
+
"autoprefixer": "10.4.19",
|
|
42
|
+
"clsx": "2.1.1",
|
|
43
|
+
"date-fns": "3.6.0",
|
|
44
|
+
"msw": "2.3.1",
|
|
45
|
+
"postcss": "8.4.39",
|
|
46
|
+
"prettier": "3.3.2",
|
|
47
|
+
"prettier-plugin-svelte": "3.2.5",
|
|
48
|
+
"prettier-plugin-tailwindcss": "0.6.5",
|
|
49
|
+
"react": "18.3.1",
|
|
50
|
+
"react-dom": "18.3.1",
|
|
51
|
+
"react-router-dom": "6.24.0",
|
|
52
|
+
"release-it": "17.4.1",
|
|
53
|
+
"shiki": "1.10.1",
|
|
54
|
+
"tailwind-variants": "0.2.1",
|
|
55
|
+
"tailwindcss": "3.4.4",
|
|
56
|
+
"typescript": "5.5.3",
|
|
57
|
+
"vite": "5.3.3",
|
|
58
|
+
"vite-plugin-dts": "3.9.1",
|
|
59
|
+
"vite-plugin-node-polyfills": "0.22.0",
|
|
60
|
+
"vite-tsconfig-paths": "4.3.2",
|
|
61
|
+
"vitest": "1.6.0",
|
|
62
|
+
"zod": "3.23.8"
|
|
63
|
+
},
|
|
64
|
+
"release-it": {
|
|
65
|
+
"git": {
|
|
66
|
+
"commitMessage": "chore: release ${npm.name} v${version}",
|
|
67
|
+
"tagName": "${npm.name}@${version}"
|
|
68
|
+
},
|
|
69
|
+
"github": {
|
|
70
|
+
"release": false
|
|
71
|
+
},
|
|
72
|
+
"hooks": {
|
|
73
|
+
"before:init": [
|
|
74
|
+
"pnpm test"
|
|
75
|
+
],
|
|
76
|
+
"after:bump": [
|
|
77
|
+
"pnpm build"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|