wabe 0.5.1 → 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,6 +794,16 @@ 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
809
  createUser(input: CreateUserInput!): CreateUserPayload
@@ -816,6 +844,12 @@ type Mutation {
816
844
  customMutation(input: CustomMutationInput!): Int
817
845
  secondCustomMutation(input: SecondCustomMutationInput!): Int
818
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
+
819
853
  """Send basic email with text and html, returns the id of the email"""
820
854
  sendEmail(input: SendEmailInput!): String
821
855
  signInWith(input: SignInWithInput!): SignInWithOutput
@@ -1154,6 +1188,26 @@ input SecondCustomMutationSumInput {
1154
1188
  b: Int!
1155
1189
  }
1156
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
+
1157
1211
  input SendEmailInput {
1158
1212
  from: String!
1159
1213
  to: [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,9 @@ 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']>;
905
941
  /** Send basic email with text and html, returns the id of the email */
906
942
  sendEmail?: Maybe<Scalars['String']['output']>;
907
943
  signInWith?: Maybe<SignInWithOutput>;
@@ -1047,6 +1083,16 @@ export type MutationSecondCustomMutationArgs = {
1047
1083
  };
1048
1084
 
1049
1085
 
1086
+ export type MutationCreatePaymentArgs = {
1087
+ input: CreatePaymentInput;
1088
+ };
1089
+
1090
+
1091
+ export type MutationCancelSubscriptionArgs = {
1092
+ input: CancelSubscriptionInput;
1093
+ };
1094
+
1095
+
1050
1096
  export type MutationSendEmailArgs = {
1051
1097
  input: SendEmailInput;
1052
1098
  };
@@ -1412,6 +1458,26 @@ export type SecondCustomMutationSumInput = {
1412
1458
  b: Scalars['Int']['input'];
1413
1459
  };
1414
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
+
1415
1481
  export type SendEmailInput = {
1416
1482
  from: Scalars['String']['input'];
1417
1483
  to: Array<Scalars['String']['input']>;
@@ -1523,7 +1589,7 @@ export type Sdk = ReturnType<typeof getSdk>;
1523
1589
 
1524
1590
  export type WabeSchemaScalars = "Phone"
1525
1591
 
1526
- export type WabeSchemaEnums = "AuthenticationProvider" | "SecondaryFactor"
1592
+ export type WabeSchemaEnums = "AuthenticationProvider" | "SecondaryFactor" | "PaymentMode" | "PaymentReccuringInterval" | "Currency"
1527
1593
 
1528
1594
  export type WabeSchemaTypes = {
1529
1595
  User: User,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wabe",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Your backend in minutes not days",
5
5
  "homepage": "https://wabe.dev",
6
6
  "author": {
@@ -8,14 +8,19 @@
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
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=../../",