@bash-app/bash-common 1.0.8 → 1.0.11
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/package.json +1 -2
- package/src/definitions.ts +11 -11
- package/src/extendedSchemas.ts +1 -0
- package/scripts/installSelfInMainProject.ts +0 -23
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bash-app/bash-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Common data and scripts to use on the frontend and backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"installSelf": "tsx scripts/installSelfInMainProject.ts",
|
|
9
8
|
"build": "npm run generate && npm run tsc",
|
|
10
9
|
"generate": "prisma generate",
|
|
11
10
|
"tsc": "tsc",
|
package/src/definitions.ts
CHANGED
|
@@ -110,6 +110,15 @@ export interface SignInEmailWithCode {
|
|
|
110
110
|
code: string;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
export interface ApiResult<T, P extends ErrorDataType = ErrorDataType> {
|
|
114
|
+
data?: T;
|
|
115
|
+
status?: number;
|
|
116
|
+
token?: string;
|
|
117
|
+
error?: string;
|
|
118
|
+
errorType?: ApiErrorType;
|
|
119
|
+
errorData?: P;
|
|
120
|
+
}
|
|
121
|
+
|
|
113
122
|
export enum ApiErrorType {
|
|
114
123
|
Unknown = 1,
|
|
115
124
|
UserAlreadyHasMaximumAllowedFreeTicketsForBashEvent,
|
|
@@ -124,21 +133,12 @@ export enum ApiErrorType {
|
|
|
124
133
|
StripeCheckoutSessionIncomplete
|
|
125
134
|
}
|
|
126
135
|
|
|
136
|
+
export type ErrorDataType = Record<RecordKey, any>;
|
|
137
|
+
|
|
127
138
|
export const StripeErrorToApiErrorType = {
|
|
128
139
|
"stripe_tax_inactive": ApiErrorType.StripeAccountHasNotSetupTaxData
|
|
129
140
|
}
|
|
130
141
|
|
|
131
|
-
export type ErrorDataType = Record<RecordKey, any>;
|
|
132
|
-
export interface ApiResult<T, P extends ErrorDataType = ErrorDataType> {
|
|
133
|
-
data?: T;
|
|
134
|
-
token?: string;
|
|
135
|
-
error?: string;
|
|
136
|
-
errorType?: ApiErrorType;
|
|
137
|
-
errorData?: P;
|
|
138
|
-
details?: string;
|
|
139
|
-
message?: string;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
142
|
export interface StripeCreateCheckoutSessionArgs {
|
|
143
143
|
currency: string;
|
|
144
144
|
paymentMethodType: string;
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface BashEventExt extends BashEvent {
|
|
|
25
25
|
tickets?: Ticket[]; // Only include tickets that the user has purchased and not all tickets (could be thousands + privacy)
|
|
26
26
|
// Do not include in fetch. Could be hundreds of these
|
|
27
27
|
invitations: InvitationExt[];
|
|
28
|
+
place?: string;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export const BASH_EVENT_DATA_TO_INCLUDE = {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import shell from 'shelljs';
|
|
2
|
-
|
|
3
|
-
const BASH_COMMON_DIR = 'bash-common';
|
|
4
|
-
const BASH_APP_PATH = '../node_modules/@bash-app/'; // Need to get to the main project folder
|
|
5
|
-
const BASH_COMMON_PATH = `${BASH_APP_PATH}${BASH_COMMON_DIR}`;
|
|
6
|
-
|
|
7
|
-
shell.echo('', `Current working dir: ${shell.pwd()}`);
|
|
8
|
-
shell.echo('', `Deleting bash-common folder: ${BASH_COMMON_PATH}`);
|
|
9
|
-
|
|
10
|
-
shell.rm('-rf', BASH_COMMON_PATH);
|
|
11
|
-
shell.mkdir('-p', BASH_COMMON_PATH);
|
|
12
|
-
|
|
13
|
-
shell.echo('', `Copying bash-common folder: ${BASH_COMMON_PATH}`);
|
|
14
|
-
shell.cp('-rf', `../${BASH_COMMON_DIR}`,`${BASH_APP_PATH}`);
|
|
15
|
-
|
|
16
|
-
shell.echo('', `Running npm commands in bash-common folder: ${BASH_COMMON_PATH}`);
|
|
17
|
-
shell.exec(`npm --prefix ${BASH_COMMON_PATH} install`);
|
|
18
|
-
shell.exec(`npm --prefix ${BASH_COMMON_PATH} run build`);
|
|
19
|
-
|
|
20
|
-
shell.echo('', `Copying prisma folder from bash-common folder: ${BASH_COMMON_PATH}`);
|
|
21
|
-
shell.cp('-rf', `${BASH_COMMON_PATH}/prisma`, '../'); // Need to get to the main project folder
|
|
22
|
-
|
|
23
|
-
shell.echo('', 'Done setting up bash-common!');
|