wabe 0.5.0 → 0.5.2

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.
@@ -9,6 +9,21 @@ enum SecondaryFactor {
9
9
  EmailOTP
10
10
  }
11
11
 
12
+ enum PaymentMode {
13
+ payment
14
+ subscription
15
+ }
16
+
17
+ enum PaymentReccuringInterval {
18
+ month
19
+ year
20
+ }
21
+
22
+ enum Currency {
23
+ eur
24
+ usd
25
+ }
26
+
12
27
  """User class"""
13
28
  type User {
14
29
  id: ID!
@@ -505,6 +520,9 @@ type Query {
505
520
  """Hello world description"""
506
521
  helloWorld(name: String!): String
507
522
  me: MeOutput
523
+
524
+ """Get invoices of a customer"""
525
+ getInvoices(email: Email!): [Invoice]!
508
526
  }
509
527
 
510
528
  """User class"""
@@ -776,50 +794,69 @@ type MeOutput {
776
794
  user: User
777
795
  }
778
796
 
797
+ type Invoice {
798
+ amountDue: Int!
799
+ amountPaid: Int!
800
+ currency: Currency!
801
+ id: String!
802
+ created: Int!
803
+ invoiceUrl: String!
804
+ isPaid: Boolean!
805
+ }
806
+
779
807
  type Mutation {
780
808
  """User class"""
781
- createUser(input: CreateUserInput): CreateUserPayload
809
+ createUser(input: CreateUserInput!): CreateUserPayload
782
810
 
783
811
  """User class"""
784
- createUsers(input: CreateUsersInput): UserConnection!
812
+ createUsers(input: CreateUsersInput!): UserConnection!
785
813
 
786
814
  """User class"""
787
- updateUser(input: UpdateUserInput): UpdateUserPayload
815
+ updateUser(input: UpdateUserInput!): UpdateUserPayload
788
816
 
789
817
  """User class"""
790
- updateUsers(input: UpdateUsersInput): UserConnection!
818
+ updateUsers(input: UpdateUsersInput!): UserConnection!
791
819
 
792
820
  """User class"""
793
- deleteUser(input: DeleteUserInput): DeleteUserPayload
821
+ deleteUser(input: DeleteUserInput!): DeleteUserPayload
794
822
 
795
823
  """User class"""
796
- deleteUsers(input: DeleteUsersInput): UserConnection!
797
- createPost(input: CreatePostInput): CreatePostPayload
798
- createPosts(input: CreatePostsInput): PostConnection!
799
- updatePost(input: UpdatePostInput): UpdatePostPayload
800
- updatePosts(input: UpdatePostsInput): PostConnection!
801
- deletePost(input: DeletePostInput): DeletePostPayload
802
- deletePosts(input: DeletePostsInput): PostConnection!
803
- create_Session(input: Create_SessionInput): Create_SessionPayload
804
- create_Sessions(input: Create_SessionsInput): _SessionConnection!
805
- update_Session(input: Update_SessionInput): Update_SessionPayload
806
- update_Sessions(input: Update_SessionsInput): _SessionConnection!
807
- delete_Session(input: Delete_SessionInput): Delete_SessionPayload
808
- delete_Sessions(input: Delete_SessionsInput): _SessionConnection!
809
- createRole(input: CreateRoleInput): CreateRolePayload
810
- createRoles(input: CreateRolesInput): RoleConnection!
811
- updateRole(input: UpdateRoleInput): UpdateRolePayload
812
- updateRoles(input: UpdateRolesInput): RoleConnection!
813
- deleteRole(input: DeleteRoleInput): DeleteRolePayload
814
- deleteRoles(input: DeleteRolesInput): RoleConnection!
815
- createMutation(input: CreateMutationInput): Boolean!
816
- customMutation(input: CustomMutationInput): Int
817
- secondCustomMutation(input: SecondCustomMutationInput): Int
818
- signInWith(input: SignInWithInput): SignInWithOutput
819
- signUpWith(input: SignUpWithInput): SignUpWithOutput
824
+ deleteUsers(input: DeleteUsersInput!): UserConnection!
825
+ createPost(input: CreatePostInput!): CreatePostPayload
826
+ createPosts(input: CreatePostsInput!): PostConnection!
827
+ updatePost(input: UpdatePostInput!): UpdatePostPayload
828
+ updatePosts(input: UpdatePostsInput!): PostConnection!
829
+ deletePost(input: DeletePostInput!): DeletePostPayload
830
+ deletePosts(input: DeletePostsInput!): PostConnection!
831
+ create_Session(input: Create_SessionInput!): Create_SessionPayload
832
+ create_Sessions(input: Create_SessionsInput!): _SessionConnection!
833
+ update_Session(input: Update_SessionInput!): Update_SessionPayload
834
+ update_Sessions(input: Update_SessionsInput!): _SessionConnection!
835
+ delete_Session(input: Delete_SessionInput!): Delete_SessionPayload
836
+ delete_Sessions(input: Delete_SessionsInput!): _SessionConnection!
837
+ createRole(input: CreateRoleInput!): CreateRolePayload
838
+ createRoles(input: CreateRolesInput!): RoleConnection!
839
+ updateRole(input: UpdateRoleInput!): UpdateRolePayload
840
+ updateRoles(input: UpdateRolesInput!): RoleConnection!
841
+ deleteRole(input: DeleteRoleInput!): DeleteRolePayload
842
+ deleteRoles(input: DeleteRolesInput!): RoleConnection!
843
+ createMutation(input: CreateMutationInput!): Boolean!
844
+ customMutation(input: CustomMutationInput!): Int
845
+ secondCustomMutation(input: SecondCustomMutationInput!): Int
846
+
847
+ """
848
+ Create a payment with the payment provider. Returns the url to redirect the user to pay
849
+ """
850
+ createPayment(input: CreatePaymentInput!): String
851
+ cancelSubscription(input: CancelSubscriptionInput!): Boolean
852
+
853
+ """Send basic email with text and html, returns the id of the email"""
854
+ sendEmail(input: SendEmailInput!): String
855
+ signInWith(input: SignInWithInput!): SignInWithOutput
856
+ signUpWith(input: SignUpWithInput!): SignUpWithOutput
820
857
  signOut: Boolean
821
- refresh(input: RefreshInput): RefreshSessionOutput
822
- verifyChallenge(input: VerifyChallengeInput): Boolean
858
+ refresh(input: RefreshInput!): RefreshSessionOutput
859
+ verifyChallenge(input: VerifyChallengeInput!): Boolean
823
860
  }
824
861
 
825
862
  type CreateUserPayload {
@@ -1151,6 +1188,34 @@ input SecondCustomMutationSumInput {
1151
1188
  b: Int!
1152
1189
  }
1153
1190
 
1191
+ input CreatePaymentInput {
1192
+ customerEmail: Email
1193
+ paymentMode: PaymentMode!
1194
+ successUrl: String!
1195
+ cancelUrl: String!
1196
+ products: [CreatePaymentProductInput]!
1197
+ automaticTax: Boolean
1198
+ recurringInterval: PaymentReccuringInterval
1199
+ }
1200
+
1201
+ input CreatePaymentProductInput {
1202
+ name: String!
1203
+ unitAmount: Int!
1204
+ quantity: Int!
1205
+ }
1206
+
1207
+ input CancelSubscriptionInput {
1208
+ email: Email!
1209
+ }
1210
+
1211
+ input SendEmailInput {
1212
+ from: String!
1213
+ to: [String!]!
1214
+ subject: String!
1215
+ text: String
1216
+ html: String
1217
+ }
1218
+
1154
1219
  type SignInWithOutput {
1155
1220
  id: String
1156
1221
  accessToken: String
package/generated/wabe.ts CHANGED
@@ -37,6 +37,21 @@ export enum SecondaryFactor {
37
37
  EmailOtp = 'EmailOTP'
38
38
  }
39
39
 
40
+ export enum PaymentMode {
41
+ Payment = 'payment',
42
+ Subscription = 'subscription'
43
+ }
44
+
45
+ export enum PaymentReccuringInterval {
46
+ Month = 'month',
47
+ Year = 'year'
48
+ }
49
+
50
+ export enum Currency {
51
+ Eur = 'eur',
52
+ Usd = 'usd'
53
+ }
54
+
40
55
  /** User class */
41
56
  export type User = {
42
57
  __typename?: 'User';
@@ -546,6 +561,8 @@ export type Query = {
546
561
  /** Hello world description */
547
562
  helloWorld?: Maybe<Scalars['String']['output']>;
548
563
  me?: Maybe<MeOutput>;
564
+ /** Get invoices of a customer */
565
+ getInvoices: Array<Maybe<Invoice>>;
549
566
  };
550
567
 
551
568
 
@@ -601,6 +618,11 @@ export type QueryHelloWorldArgs = {
601
618
  name: Scalars['String']['input'];
602
619
  };
603
620
 
621
+
622
+ export type QueryGetInvoicesArgs = {
623
+ email: Scalars['Email']['input'];
624
+ };
625
+
604
626
  /** User class */
605
627
  export type UserWhereInput = {
606
628
  id?: InputMaybe<IdWhereInput>;
@@ -867,6 +889,17 @@ export type MeOutput = {
867
889
  user?: Maybe<User>;
868
890
  };
869
891
 
892
+ export type Invoice = {
893
+ __typename?: 'Invoice';
894
+ amountDue: Scalars['Int']['output'];
895
+ amountPaid: Scalars['Int']['output'];
896
+ currency: Currency;
897
+ id: Scalars['String']['output'];
898
+ created: Scalars['Int']['output'];
899
+ invoiceUrl: Scalars['String']['output'];
900
+ isPaid: Scalars['Boolean']['output'];
901
+ };
902
+
870
903
  export type Mutation = {
871
904
  __typename?: 'Mutation';
872
905
  /** User class */
@@ -902,6 +935,11 @@ export type Mutation = {
902
935
  createMutation: Scalars['Boolean']['output'];
903
936
  customMutation?: Maybe<Scalars['Int']['output']>;
904
937
  secondCustomMutation?: Maybe<Scalars['Int']['output']>;
938
+ /** Create a payment with the payment provider. Returns the url to redirect the user to pay */
939
+ createPayment?: Maybe<Scalars['String']['output']>;
940
+ cancelSubscription?: Maybe<Scalars['Boolean']['output']>;
941
+ /** Send basic email with text and html, returns the id of the email */
942
+ sendEmail?: Maybe<Scalars['String']['output']>;
905
943
  signInWith?: Maybe<SignInWithOutput>;
906
944
  signUpWith?: Maybe<SignUpWithOutput>;
907
945
  signOut?: Maybe<Scalars['Boolean']['output']>;
@@ -911,157 +949,172 @@ export type Mutation = {
911
949
 
912
950
 
913
951
  export type MutationCreateUserArgs = {
914
- input?: InputMaybe<CreateUserInput>;
952
+ input: CreateUserInput;
915
953
  };
916
954
 
917
955
 
918
956
  export type MutationCreateUsersArgs = {
919
- input?: InputMaybe<CreateUsersInput>;
957
+ input: CreateUsersInput;
920
958
  };
921
959
 
922
960
 
923
961
  export type MutationUpdateUserArgs = {
924
- input?: InputMaybe<UpdateUserInput>;
962
+ input: UpdateUserInput;
925
963
  };
926
964
 
927
965
 
928
966
  export type MutationUpdateUsersArgs = {
929
- input?: InputMaybe<UpdateUsersInput>;
967
+ input: UpdateUsersInput;
930
968
  };
931
969
 
932
970
 
933
971
  export type MutationDeleteUserArgs = {
934
- input?: InputMaybe<DeleteUserInput>;
972
+ input: DeleteUserInput;
935
973
  };
936
974
 
937
975
 
938
976
  export type MutationDeleteUsersArgs = {
939
- input?: InputMaybe<DeleteUsersInput>;
977
+ input: DeleteUsersInput;
940
978
  };
941
979
 
942
980
 
943
981
  export type MutationCreatePostArgs = {
944
- input?: InputMaybe<CreatePostInput>;
982
+ input: CreatePostInput;
945
983
  };
946
984
 
947
985
 
948
986
  export type MutationCreatePostsArgs = {
949
- input?: InputMaybe<CreatePostsInput>;
987
+ input: CreatePostsInput;
950
988
  };
951
989
 
952
990
 
953
991
  export type MutationUpdatePostArgs = {
954
- input?: InputMaybe<UpdatePostInput>;
992
+ input: UpdatePostInput;
955
993
  };
956
994
 
957
995
 
958
996
  export type MutationUpdatePostsArgs = {
959
- input?: InputMaybe<UpdatePostsInput>;
997
+ input: UpdatePostsInput;
960
998
  };
961
999
 
962
1000
 
963
1001
  export type MutationDeletePostArgs = {
964
- input?: InputMaybe<DeletePostInput>;
1002
+ input: DeletePostInput;
965
1003
  };
966
1004
 
967
1005
 
968
1006
  export type MutationDeletePostsArgs = {
969
- input?: InputMaybe<DeletePostsInput>;
1007
+ input: DeletePostsInput;
970
1008
  };
971
1009
 
972
1010
 
973
1011
  export type MutationCreate_SessionArgs = {
974
- input?: InputMaybe<Create_SessionInput>;
1012
+ input: Create_SessionInput;
975
1013
  };
976
1014
 
977
1015
 
978
1016
  export type MutationCreate_SessionsArgs = {
979
- input?: InputMaybe<Create_SessionsInput>;
1017
+ input: Create_SessionsInput;
980
1018
  };
981
1019
 
982
1020
 
983
1021
  export type MutationUpdate_SessionArgs = {
984
- input?: InputMaybe<Update_SessionInput>;
1022
+ input: Update_SessionInput;
985
1023
  };
986
1024
 
987
1025
 
988
1026
  export type MutationUpdate_SessionsArgs = {
989
- input?: InputMaybe<Update_SessionsInput>;
1027
+ input: Update_SessionsInput;
990
1028
  };
991
1029
 
992
1030
 
993
1031
  export type MutationDelete_SessionArgs = {
994
- input?: InputMaybe<Delete_SessionInput>;
1032
+ input: Delete_SessionInput;
995
1033
  };
996
1034
 
997
1035
 
998
1036
  export type MutationDelete_SessionsArgs = {
999
- input?: InputMaybe<Delete_SessionsInput>;
1037
+ input: Delete_SessionsInput;
1000
1038
  };
1001
1039
 
1002
1040
 
1003
1041
  export type MutationCreateRoleArgs = {
1004
- input?: InputMaybe<CreateRoleInput>;
1042
+ input: CreateRoleInput;
1005
1043
  };
1006
1044
 
1007
1045
 
1008
1046
  export type MutationCreateRolesArgs = {
1009
- input?: InputMaybe<CreateRolesInput>;
1047
+ input: CreateRolesInput;
1010
1048
  };
1011
1049
 
1012
1050
 
1013
1051
  export type MutationUpdateRoleArgs = {
1014
- input?: InputMaybe<UpdateRoleInput>;
1052
+ input: UpdateRoleInput;
1015
1053
  };
1016
1054
 
1017
1055
 
1018
1056
  export type MutationUpdateRolesArgs = {
1019
- input?: InputMaybe<UpdateRolesInput>;
1057
+ input: UpdateRolesInput;
1020
1058
  };
1021
1059
 
1022
1060
 
1023
1061
  export type MutationDeleteRoleArgs = {
1024
- input?: InputMaybe<DeleteRoleInput>;
1062
+ input: DeleteRoleInput;
1025
1063
  };
1026
1064
 
1027
1065
 
1028
1066
  export type MutationDeleteRolesArgs = {
1029
- input?: InputMaybe<DeleteRolesInput>;
1067
+ input: DeleteRolesInput;
1030
1068
  };
1031
1069
 
1032
1070
 
1033
1071
  export type MutationCreateMutationArgs = {
1034
- input?: InputMaybe<CreateMutationInput>;
1072
+ input: CreateMutationInput;
1035
1073
  };
1036
1074
 
1037
1075
 
1038
1076
  export type MutationCustomMutationArgs = {
1039
- input?: InputMaybe<CustomMutationInput>;
1077
+ input: CustomMutationInput;
1040
1078
  };
1041
1079
 
1042
1080
 
1043
1081
  export type MutationSecondCustomMutationArgs = {
1044
- input?: InputMaybe<SecondCustomMutationInput>;
1082
+ input: SecondCustomMutationInput;
1083
+ };
1084
+
1085
+
1086
+ export type MutationCreatePaymentArgs = {
1087
+ input: CreatePaymentInput;
1088
+ };
1089
+
1090
+
1091
+ export type MutationCancelSubscriptionArgs = {
1092
+ input: CancelSubscriptionInput;
1093
+ };
1094
+
1095
+
1096
+ export type MutationSendEmailArgs = {
1097
+ input: SendEmailInput;
1045
1098
  };
1046
1099
 
1047
1100
 
1048
1101
  export type MutationSignInWithArgs = {
1049
- input?: InputMaybe<SignInWithInput>;
1102
+ input: SignInWithInput;
1050
1103
  };
1051
1104
 
1052
1105
 
1053
1106
  export type MutationSignUpWithArgs = {
1054
- input?: InputMaybe<SignUpWithInput>;
1107
+ input: SignUpWithInput;
1055
1108
  };
1056
1109
 
1057
1110
 
1058
1111
  export type MutationRefreshArgs = {
1059
- input?: InputMaybe<RefreshInput>;
1112
+ input: RefreshInput;
1060
1113
  };
1061
1114
 
1062
1115
 
1063
1116
  export type MutationVerifyChallengeArgs = {
1064
- input?: InputMaybe<VerifyChallengeInput>;
1117
+ input: VerifyChallengeInput;
1065
1118
  };
1066
1119
 
1067
1120
  export type CreateUserPayload = {
@@ -1405,6 +1458,34 @@ export type SecondCustomMutationSumInput = {
1405
1458
  b: Scalars['Int']['input'];
1406
1459
  };
1407
1460
 
1461
+ export type CreatePaymentInput = {
1462
+ customerEmail?: InputMaybe<Scalars['Email']['input']>;
1463
+ paymentMode: PaymentMode;
1464
+ successUrl: Scalars['String']['input'];
1465
+ cancelUrl: Scalars['String']['input'];
1466
+ products: Array<InputMaybe<CreatePaymentProductInput>>;
1467
+ automaticTax?: InputMaybe<Scalars['Boolean']['input']>;
1468
+ recurringInterval?: InputMaybe<PaymentReccuringInterval>;
1469
+ };
1470
+
1471
+ export type CreatePaymentProductInput = {
1472
+ name: Scalars['String']['input'];
1473
+ unitAmount: Scalars['Int']['input'];
1474
+ quantity: Scalars['Int']['input'];
1475
+ };
1476
+
1477
+ export type CancelSubscriptionInput = {
1478
+ email: Scalars['Email']['input'];
1479
+ };
1480
+
1481
+ export type SendEmailInput = {
1482
+ from: Scalars['String']['input'];
1483
+ to: Array<Scalars['String']['input']>;
1484
+ subject: Scalars['String']['input'];
1485
+ text?: InputMaybe<Scalars['String']['input']>;
1486
+ html?: InputMaybe<Scalars['String']['input']>;
1487
+ };
1488
+
1408
1489
  export type SignInWithOutput = {
1409
1490
  __typename?: 'SignInWithOutput';
1410
1491
  id?: Maybe<Scalars['String']['output']>;
@@ -1508,7 +1589,7 @@ export type Sdk = ReturnType<typeof getSdk>;
1508
1589
 
1509
1590
  export type WabeSchemaScalars = "Phone"
1510
1591
 
1511
- export type WabeSchemaEnums = "AuthenticationProvider" | "SecondaryFactor"
1592
+ export type WabeSchemaEnums = "AuthenticationProvider" | "SecondaryFactor" | "PaymentMode" | "PaymentReccuringInterval" | "Currency"
1512
1593
 
1513
1594
  export type WabeSchemaTypes = {
1514
1595
  User: User,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wabe",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Your backend in minutes not days",
5
5
  "homepage": "https://wabe.dev",
6
6
  "author": {
@@ -8,21 +8,26 @@
8
8
  "url": "https://github.com/coratgerl"
9
9
  },
10
10
  "license": "Apache-2.0",
11
- "keywords": ["backend", "wabe", "graphql", "baas"],
11
+ "keywords": [
12
+ "backend",
13
+ "wabe",
14
+ "graphql",
15
+ "baas"
16
+ ],
12
17
  "repository": {
13
18
  "type": "git",
14
- "url": "https://github.com/palixir/wabe"
19
+ "url": "git+https://github.com/palixir/wabe.git"
15
20
  },
16
21
  "main": "dist/index.js",
17
22
  "scripts": {
18
- "build": "bun generate:codegen && bun build --outdir dist $(pwd)/src/index.ts --target=node && bun generate:types",
23
+ "build": "bun generate:codegen && bun build --outdir dist $(pwd)/src/index.ts --target=node --external=argon2 && bun generate:types",
19
24
  "generate:types": "dts-bundle-generator -o dist/index.d.ts src/index.ts --no-check --external-imports=wobe",
20
25
  "check": "tsc --project $(pwd)/tsconfig.json",
21
26
  "lint": "biome lint . --no-errors-on-unmatched --config-path=../../",
22
27
  "ci": "bun generate:codegen && bun check && bun lint $(pwd) && bun test src",
23
- "format": "biome format --write .",
24
- "dev": "bun generate:codegen && bun run --watch dev/index.ts",
25
- "generate:codegen":"touch generated/wabe.ts && CODEGEN=true bun dev/index.ts"
28
+ "format": "biome format --write . --config-path=../../",
29
+ "dev": "bun run --watch dev/index.ts",
30
+ "generate:codegen": "touch generated/wabe.ts && CODEGEN=true bun dev/index.ts"
26
31
  },
27
32
  "dependencies": {
28
33
  "@graphql-codegen/core": "4.0.2",
@@ -31,22 +36,22 @@
31
36
  "@graphql-codegen/typescript-operations": "4.0.1",
32
37
  "@graphql-tools/graphql-file-loader": "8.0.1",
33
38
  "@graphql-tools/load": "8.0.2",
34
- "argon2": "^0.41.1",
39
+ "argon2": "0.41.1",
35
40
  "jsonwebtoken": "9.0.2",
36
- "mongodb": "6.3.0",
41
+ "mongodb": "6.8.0",
37
42
  "wobe": "1.1.7",
38
43
  "wobe-graphql-yoga": "1.2.5"
39
44
  },
40
45
  "devDependencies": {
41
46
  "@parcel/watcher": "2.3.0",
42
- "@types/bun": "1.1.5",
47
+ "@types/bun": "1.1.8",
43
48
  "@types/jsonwebtoken": "9.0.6",
49
+ "@types/react": "^18.3.5",
44
50
  "@types/uuid": "9.0.6",
45
51
  "dts-bundle-generator": "9.5.1",
46
- "get-port": "7.0.0",
52
+ "get-port": "7.1.0",
47
53
  "graphql-request": "6.1.0",
48
- "uuid": "9.0.1",
49
- "wait-on": "7.2.0",
54
+ "uuid": "10.0.0",
50
55
  "wabe-mongodb-launcher": "workspace:*",
51
56
  "wabe-pluralize": "workspace:*"
52
57
  }