wabe 0.5.20 → 0.5.22
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/dist/index.d.ts +21 -60
- package/dist/index.js +368 -150
- package/generated/schema.graphql +0 -256
- package/generated/wabe.ts +1 -294
- package/package.json +3 -4
package/dist/index.d.ts
CHANGED
|
@@ -61,18 +61,6 @@ declare enum AuthenticationProvider {
|
|
|
61
61
|
declare enum SecondaryFactor {
|
|
62
62
|
EmailOTP = "EmailOTP"
|
|
63
63
|
}
|
|
64
|
-
declare enum PaymentMode {
|
|
65
|
-
payment = "payment",
|
|
66
|
-
subscription = "subscription"
|
|
67
|
-
}
|
|
68
|
-
declare enum PaymentReccuringInterval {
|
|
69
|
-
month = "month",
|
|
70
|
-
year = "year"
|
|
71
|
-
}
|
|
72
|
-
declare enum Currency {
|
|
73
|
-
eur = "eur",
|
|
74
|
-
usd = "usd"
|
|
75
|
-
}
|
|
76
64
|
export type User = {
|
|
77
65
|
id: Scalars["ID"]["output"];
|
|
78
66
|
name?: Scalars["String"]["output"];
|
|
@@ -203,30 +191,6 @@ export type RoleACLObjectRolesACL = {
|
|
|
203
191
|
read: Scalars["Boolean"]["output"];
|
|
204
192
|
write: Scalars["Boolean"]["output"];
|
|
205
193
|
};
|
|
206
|
-
export type Payment = {
|
|
207
|
-
id: Scalars["ID"]["output"];
|
|
208
|
-
user?: User;
|
|
209
|
-
amount: Scalars["Int"]["output"];
|
|
210
|
-
currency: Currency;
|
|
211
|
-
acl?: PaymentACLObject;
|
|
212
|
-
createdAt?: Scalars["Date"]["output"];
|
|
213
|
-
updatedAt?: Scalars["Date"]["output"];
|
|
214
|
-
search?: Scalars["String"]["output"][];
|
|
215
|
-
};
|
|
216
|
-
export type PaymentACLObject = {
|
|
217
|
-
users?: PaymentACLObjectUsersACL[];
|
|
218
|
-
roles?: PaymentACLObjectRolesACL[];
|
|
219
|
-
};
|
|
220
|
-
export type PaymentACLObjectUsersACL = {
|
|
221
|
-
userId: Scalars["String"]["output"];
|
|
222
|
-
read: Scalars["Boolean"]["output"];
|
|
223
|
-
write: Scalars["Boolean"]["output"];
|
|
224
|
-
};
|
|
225
|
-
export type PaymentACLObjectRolesACL = {
|
|
226
|
-
roleId: Scalars["String"]["output"];
|
|
227
|
-
read: Scalars["Boolean"]["output"];
|
|
228
|
-
write: Scalars["Boolean"]["output"];
|
|
229
|
-
};
|
|
230
194
|
export type _InternalConfig = {
|
|
231
195
|
id: Scalars["ID"]["output"];
|
|
232
196
|
configKey: Scalars["String"]["output"];
|
|
@@ -296,16 +260,12 @@ export type WabeSchemaEnums = {
|
|
|
296
260
|
RoleEnum: RoleEnum;
|
|
297
261
|
AuthenticationProvider: AuthenticationProvider;
|
|
298
262
|
SecondaryFactor: SecondaryFactor;
|
|
299
|
-
PaymentMode: PaymentMode;
|
|
300
|
-
PaymentReccuringInterval: PaymentReccuringInterval;
|
|
301
|
-
Currency: Currency;
|
|
302
263
|
};
|
|
303
264
|
export type WabeSchemaTypes = {
|
|
304
265
|
User: User;
|
|
305
266
|
Post: Post;
|
|
306
267
|
_Session: _Session;
|
|
307
268
|
Role: Role;
|
|
308
|
-
Payment: Payment;
|
|
309
269
|
_InternalConfig: _InternalConfig;
|
|
310
270
|
};
|
|
311
271
|
export interface WabeContext<T extends WabeTypes> {
|
|
@@ -449,7 +409,7 @@ export declare const buildMongoWhereQuery: <T extends WabeTypes, K extends keyof
|
|
|
449
409
|
export declare class MongoAdapter<T extends WabeTypes> implements DatabaseAdapter<T> {
|
|
450
410
|
options: AdapterOptions;
|
|
451
411
|
database?: Db;
|
|
452
|
-
|
|
412
|
+
client: MongoClient;
|
|
453
413
|
constructor(options: AdapterOptions);
|
|
454
414
|
connect(): Promise<MongoClient>;
|
|
455
415
|
close(): Promise<void>;
|
|
@@ -908,7 +868,6 @@ export declare class Schema<T extends WabeTypes> {
|
|
|
908
868
|
mergeResolvers(defaultResolvers: TypeResolver<T>): TypeResolver<T>;
|
|
909
869
|
defaultResolvers(): TypeResolver<T>;
|
|
910
870
|
sessionClass(): ClassInterface<T>;
|
|
911
|
-
paymentClass(): ClassInterface<T>;
|
|
912
871
|
roleClass(): ClassInterface<T>;
|
|
913
872
|
internalConfigClass(): ClassInterface<T>;
|
|
914
873
|
userClass(): ClassInterface<T>;
|
|
@@ -934,12 +893,6 @@ export type AuthenticationEventsOptionsWithUserId<T> = AuthenticationEventsOptio
|
|
|
934
893
|
export type ProviderInterface<T = any> = {
|
|
935
894
|
onSignIn: (options: AuthenticationEventsOptions<T>) => Promise<{
|
|
936
895
|
user: Partial<User>;
|
|
937
|
-
oauth?: {
|
|
938
|
-
refreshToken: string;
|
|
939
|
-
accessToken: string;
|
|
940
|
-
accessTokenExpiresAt: Date;
|
|
941
|
-
refreshTokenExpiresAt: Date;
|
|
942
|
-
};
|
|
943
896
|
}>;
|
|
944
897
|
onSignUp: (options: AuthenticationEventsOptions<T>) => Promise<{
|
|
945
898
|
authenticationDataToSave: any;
|
|
@@ -1058,7 +1011,7 @@ declare class EmailController implements EmailAdapter {
|
|
|
1058
1011
|
constructor(adapter: EmailAdapter);
|
|
1059
1012
|
send(options: EmailSendOptions): Promise<string>;
|
|
1060
1013
|
}
|
|
1061
|
-
declare enum Currency
|
|
1014
|
+
export declare enum Currency {
|
|
1062
1015
|
EUR = "eur",
|
|
1063
1016
|
USD = "usd"
|
|
1064
1017
|
}
|
|
@@ -1070,12 +1023,12 @@ export type Address = {
|
|
|
1070
1023
|
postalCode: string;
|
|
1071
1024
|
state: string;
|
|
1072
1025
|
};
|
|
1073
|
-
declare enum PaymentMode
|
|
1026
|
+
export declare enum PaymentMode {
|
|
1074
1027
|
payment = "payment",
|
|
1075
1028
|
subscription = "subscription"
|
|
1076
1029
|
}
|
|
1077
1030
|
export type PaymentMethod = "card" | "paypal" | "link" | "sepa_debit" | "revolut_pay" | "us_bank_account";
|
|
1078
|
-
declare enum PaymentReccuringInterval
|
|
1031
|
+
export declare enum PaymentReccuringInterval {
|
|
1079
1032
|
Month = "month",
|
|
1080
1033
|
Year = "year"
|
|
1081
1034
|
}
|
|
@@ -1105,12 +1058,12 @@ export interface OnPaymentFailedOptions {
|
|
|
1105
1058
|
export interface PaymentConfig {
|
|
1106
1059
|
adapter: PaymentAdapter;
|
|
1107
1060
|
supportedPaymentMethods: Array<PaymentMethod>;
|
|
1108
|
-
currency: Currency
|
|
1061
|
+
currency: Currency;
|
|
1109
1062
|
}
|
|
1110
1063
|
export type Invoice = {
|
|
1111
1064
|
amountDue: number;
|
|
1112
1065
|
amountPaid: number;
|
|
1113
|
-
currency: Currency
|
|
1066
|
+
currency: Currency;
|
|
1114
1067
|
id: string;
|
|
1115
1068
|
created: number;
|
|
1116
1069
|
invoiceUrl: string;
|
|
@@ -1119,7 +1072,7 @@ export type Invoice = {
|
|
|
1119
1072
|
export type Transaction = {
|
|
1120
1073
|
customerEmail: string;
|
|
1121
1074
|
amount: number;
|
|
1122
|
-
currency: Currency
|
|
1075
|
+
currency: Currency;
|
|
1123
1076
|
created: number;
|
|
1124
1077
|
isSubscription: boolean;
|
|
1125
1078
|
reccuringInterval?: "month" | "year";
|
|
@@ -1132,11 +1085,11 @@ export type CreateCustomerOptions = {
|
|
|
1132
1085
|
paymentMethod: PaymentMethod;
|
|
1133
1086
|
};
|
|
1134
1087
|
export type CreatePaymentOptions = {
|
|
1135
|
-
currency: Currency
|
|
1088
|
+
currency: Currency;
|
|
1136
1089
|
customerEmail?: string;
|
|
1137
1090
|
products: Array<Product>;
|
|
1138
1091
|
paymentMethod: Array<PaymentMethod>;
|
|
1139
|
-
paymentMode: PaymentMode
|
|
1092
|
+
paymentMode: PaymentMode;
|
|
1140
1093
|
successUrl: string;
|
|
1141
1094
|
cancelUrl: string;
|
|
1142
1095
|
automaticTax?: boolean;
|
|
@@ -1188,7 +1141,7 @@ export type InitWebhookOutput = {
|
|
|
1188
1141
|
};
|
|
1189
1142
|
export type CreateCouponOptions = {
|
|
1190
1143
|
amountOff?: number;
|
|
1191
|
-
currency?: Currency
|
|
1144
|
+
currency?: Currency;
|
|
1192
1145
|
duration?: "forever" | "once" | "repeating";
|
|
1193
1146
|
durationInMonths?: number;
|
|
1194
1147
|
name?: string;
|
|
@@ -1318,6 +1271,15 @@ declare class PaymentController implements PaymentAdapter {
|
|
|
1318
1271
|
getAllTransactions(options: GetAllTransactionsOptions): Promise<Transaction[]>;
|
|
1319
1272
|
getHypotheticalSubscriptionRevenue(): Promise<number>;
|
|
1320
1273
|
}
|
|
1274
|
+
export interface CreateCompletionOptions {
|
|
1275
|
+
content: string;
|
|
1276
|
+
}
|
|
1277
|
+
export interface AIAdapter {
|
|
1278
|
+
createCompletion(options: CreateCompletionOptions): Promise<string>;
|
|
1279
|
+
}
|
|
1280
|
+
export interface AIConfig {
|
|
1281
|
+
adapter: AIAdapter;
|
|
1282
|
+
}
|
|
1321
1283
|
export type SecurityConfig = {
|
|
1322
1284
|
corsOptions?: CorsOptions;
|
|
1323
1285
|
rateLimit?: RateLimitOptions;
|
|
@@ -1340,6 +1302,7 @@ export interface WabeConfig<T extends WabeTypes> {
|
|
|
1340
1302
|
hooks?: Hook<T, any>[];
|
|
1341
1303
|
email?: EmailConfig;
|
|
1342
1304
|
payment?: PaymentConfig;
|
|
1305
|
+
ai?: AIConfig;
|
|
1343
1306
|
file?: FileConfig;
|
|
1344
1307
|
}
|
|
1345
1308
|
export type WabeTypes = {
|
|
@@ -1472,12 +1435,10 @@ export declare class PaymentDevAdapter implements PaymentAdapter {
|
|
|
1472
1435
|
getAllTransactions(): Promise<never[]>;
|
|
1473
1436
|
getHypotheticalSubscriptionRevenue(): Promise<number>;
|
|
1474
1437
|
}
|
|
1438
|
+
export declare const contextWithRoot: (context: WabeContext<any>) => WabeContext<any>;
|
|
1475
1439
|
|
|
1476
1440
|
export {
|
|
1477
1441
|
AuthenticationProvider$1 as AuthenticationProvider,
|
|
1478
|
-
Currency$1 as Currency,
|
|
1479
|
-
PaymentMode$1 as PaymentMode,
|
|
1480
|
-
PaymentReccuringInterval$1 as PaymentReccuringInterval,
|
|
1481
1442
|
};
|
|
1482
1443
|
|
|
1483
1444
|
export {};
|