@nhost/stripe-graphql-js 1.2.0 → 1.3.0-beta.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.
Files changed (232) hide show
  1. package/dist/dev/server.js +17 -0
  2. package/dist/src/builder.js +8 -0
  3. package/dist/{index.d.ts → src/index.js} +0 -1
  4. package/dist/{schema → src/schema}/address.js +2 -5
  5. package/dist/{schema → src/schema}/billing-portal-session.js +2 -5
  6. package/dist/{schema → src/schema}/charge.js +9 -21
  7. package/dist/{schema → src/schema}/charges.js +2 -5
  8. package/dist/{schema → src/schema}/connectedAccount.js +2 -5
  9. package/dist/{schema → src/schema}/connectedAccounts.js +2 -5
  10. package/dist/{schema → src/schema}/customer-shipping.js +2 -5
  11. package/dist/{schema → src/schema}/customer-tax-location.js +2 -5
  12. package/dist/{schema → src/schema}/customer-tax.js +2 -5
  13. package/dist/{schema → src/schema}/customer.js +20 -32
  14. package/dist/{schema → src/schema}/customers.js +2 -5
  15. package/dist/{schema/index.d.ts → src/schema/index.js} +2 -2
  16. package/dist/{schema → src/schema}/invoice-automatic-tax.js +2 -5
  17. package/dist/{schema → src/schema}/invoice-custom-field.js +2 -5
  18. package/dist/{schema → src/schema}/invoice-customer-shipping.js +2 -5
  19. package/dist/{schema → src/schema}/invoice-customer-tax-id.js +2 -5
  20. package/dist/{schema → src/schema}/invoice-line-item-period.js +2 -5
  21. package/dist/{schema → src/schema}/invoice-line-item-tax-amount.js +2 -5
  22. package/dist/{schema → src/schema}/invoice-line-item.js +2 -5
  23. package/dist/{schema → src/schema}/invoice-line-items.js +2 -5
  24. package/dist/{schema → src/schema}/invoice-rendering-options.js +2 -5
  25. package/dist/{schema → src/schema}/invoice-status-transitions.js +2 -5
  26. package/dist/{schema → src/schema}/invoice.js +12 -24
  27. package/dist/{schema → src/schema}/invoices.js +2 -5
  28. package/dist/{schema → src/schema}/payment-intent.js +6 -18
  29. package/dist/{schema → src/schema}/payment-intents.js +2 -5
  30. package/dist/{schema → src/schema}/payment-method-billing-details.js +2 -5
  31. package/dist/{schema → src/schema}/payment-method-card-checks.js +2 -5
  32. package/dist/{schema → src/schema}/payment-method-card-networks.js +2 -5
  33. package/dist/src/schema/payment-method-card-three-d-secure-usage.js +8 -0
  34. package/dist/{schema → src/schema}/payment-method-card-wallet-masterpass.js +2 -5
  35. package/dist/{schema → src/schema}/payment-method-card-wallet-visa-checkout.js +2 -5
  36. package/dist/{schema → src/schema}/payment-method-card-wallet.js +3 -7
  37. package/dist/{schema → src/schema}/payment-method-card.js +2 -5
  38. package/dist/{schema → src/schema}/payment-method.js +2 -5
  39. package/dist/{schema → src/schema}/payment-methods.js +3 -7
  40. package/dist/{schema → src/schema}/plan-transform-usage.js +2 -5
  41. package/dist/{schema → src/schema}/plan.js +6 -18
  42. package/dist/{schema → src/schema}/price.js +6 -18
  43. package/dist/{schema → src/schema}/product.js +6 -18
  44. package/dist/{schema → src/schema}/stripe.js +30 -42
  45. package/dist/src/schema/subscription-automatic-tax.js +9 -0
  46. package/dist/{schema → src/schema}/subscription-billing-thresholds.js +2 -5
  47. package/dist/src/schema/subscription-item-billing-thresholds.js +10 -0
  48. package/dist/{schema → src/schema}/subscription-item.js +2 -5
  49. package/dist/{schema → src/schema}/subscription-items.js +2 -5
  50. package/dist/{schema → src/schema}/subscription-pause-collection.js +2 -5
  51. package/dist/{schema → src/schema}/subscription.js +12 -24
  52. package/dist/{schema → src/schema}/subscriptions.js +2 -5
  53. package/dist/{schema → src/schema}/tax-rate.js +2 -5
  54. package/dist/{schema → src/schema}/test-clock.js +2 -5
  55. package/dist/{server.js → src/server.js} +15 -16
  56. package/dist/src/types.js +1 -0
  57. package/dist/src/utils.js +26 -0
  58. package/package.json +3 -3
  59. package/dist/builder.d.ts +0 -72
  60. package/dist/builder.d.ts.map +0 -1
  61. package/dist/builder.js +0 -15
  62. package/dist/builder.js.map +0 -1
  63. package/dist/index.d.ts.map +0 -1
  64. package/dist/index.js +0 -21
  65. package/dist/index.js.map +0 -1
  66. package/dist/schema/address.d.ts +0 -2
  67. package/dist/schema/address.d.ts.map +0 -1
  68. package/dist/schema/address.js.map +0 -1
  69. package/dist/schema/billing-portal-session.d.ts +0 -2
  70. package/dist/schema/billing-portal-session.d.ts.map +0 -1
  71. package/dist/schema/billing-portal-session.js.map +0 -1
  72. package/dist/schema/charge.d.ts +0 -2
  73. package/dist/schema/charge.d.ts.map +0 -1
  74. package/dist/schema/charge.js.map +0 -1
  75. package/dist/schema/charges.d.ts +0 -2
  76. package/dist/schema/charges.d.ts.map +0 -1
  77. package/dist/schema/charges.js.map +0 -1
  78. package/dist/schema/connectedAccount.d.ts +0 -2
  79. package/dist/schema/connectedAccount.d.ts.map +0 -1
  80. package/dist/schema/connectedAccount.js.map +0 -1
  81. package/dist/schema/connectedAccounts.d.ts +0 -2
  82. package/dist/schema/connectedAccounts.d.ts.map +0 -1
  83. package/dist/schema/connectedAccounts.js.map +0 -1
  84. package/dist/schema/customer-shipping.d.ts +0 -2
  85. package/dist/schema/customer-shipping.d.ts.map +0 -1
  86. package/dist/schema/customer-shipping.js.map +0 -1
  87. package/dist/schema/customer-tax-location.d.ts +0 -2
  88. package/dist/schema/customer-tax-location.d.ts.map +0 -1
  89. package/dist/schema/customer-tax-location.js.map +0 -1
  90. package/dist/schema/customer-tax.d.ts +0 -2
  91. package/dist/schema/customer-tax.d.ts.map +0 -1
  92. package/dist/schema/customer-tax.js.map +0 -1
  93. package/dist/schema/customer.d.ts +0 -2
  94. package/dist/schema/customer.d.ts.map +0 -1
  95. package/dist/schema/customer.js.map +0 -1
  96. package/dist/schema/customers.d.ts +0 -2
  97. package/dist/schema/customers.d.ts.map +0 -1
  98. package/dist/schema/customers.js.map +0 -1
  99. package/dist/schema/index.d.ts.map +0 -1
  100. package/dist/schema/index.js +0 -56
  101. package/dist/schema/index.js.map +0 -1
  102. package/dist/schema/invoice-automatic-tax.d.ts +0 -2
  103. package/dist/schema/invoice-automatic-tax.d.ts.map +0 -1
  104. package/dist/schema/invoice-automatic-tax.js.map +0 -1
  105. package/dist/schema/invoice-custom-field.d.ts +0 -2
  106. package/dist/schema/invoice-custom-field.d.ts.map +0 -1
  107. package/dist/schema/invoice-custom-field.js.map +0 -1
  108. package/dist/schema/invoice-customer-shipping.d.ts +0 -2
  109. package/dist/schema/invoice-customer-shipping.d.ts.map +0 -1
  110. package/dist/schema/invoice-customer-shipping.js.map +0 -1
  111. package/dist/schema/invoice-customer-tax-id.d.ts +0 -2
  112. package/dist/schema/invoice-customer-tax-id.d.ts.map +0 -1
  113. package/dist/schema/invoice-customer-tax-id.js.map +0 -1
  114. package/dist/schema/invoice-line-item-period.d.ts +0 -2
  115. package/dist/schema/invoice-line-item-period.d.ts.map +0 -1
  116. package/dist/schema/invoice-line-item-period.js.map +0 -1
  117. package/dist/schema/invoice-line-item-tax-amount.d.ts +0 -2
  118. package/dist/schema/invoice-line-item-tax-amount.d.ts.map +0 -1
  119. package/dist/schema/invoice-line-item-tax-amount.js.map +0 -1
  120. package/dist/schema/invoice-line-item.d.ts +0 -2
  121. package/dist/schema/invoice-line-item.d.ts.map +0 -1
  122. package/dist/schema/invoice-line-item.js.map +0 -1
  123. package/dist/schema/invoice-line-items.d.ts +0 -2
  124. package/dist/schema/invoice-line-items.d.ts.map +0 -1
  125. package/dist/schema/invoice-line-items.js.map +0 -1
  126. package/dist/schema/invoice-rendering-options.d.ts +0 -2
  127. package/dist/schema/invoice-rendering-options.d.ts.map +0 -1
  128. package/dist/schema/invoice-rendering-options.js.map +0 -1
  129. package/dist/schema/invoice-status-transitions.d.ts +0 -2
  130. package/dist/schema/invoice-status-transitions.d.ts.map +0 -1
  131. package/dist/schema/invoice-status-transitions.js.map +0 -1
  132. package/dist/schema/invoice.d.ts +0 -2
  133. package/dist/schema/invoice.d.ts.map +0 -1
  134. package/dist/schema/invoice.js.map +0 -1
  135. package/dist/schema/invoices.d.ts +0 -2
  136. package/dist/schema/invoices.d.ts.map +0 -1
  137. package/dist/schema/invoices.js.map +0 -1
  138. package/dist/schema/payment-intent.d.ts +0 -2
  139. package/dist/schema/payment-intent.d.ts.map +0 -1
  140. package/dist/schema/payment-intent.js.map +0 -1
  141. package/dist/schema/payment-intents.d.ts +0 -2
  142. package/dist/schema/payment-intents.d.ts.map +0 -1
  143. package/dist/schema/payment-intents.js.map +0 -1
  144. package/dist/schema/payment-method-billing-details.d.ts +0 -2
  145. package/dist/schema/payment-method-billing-details.d.ts.map +0 -1
  146. package/dist/schema/payment-method-billing-details.js.map +0 -1
  147. package/dist/schema/payment-method-card-checks.d.ts +0 -2
  148. package/dist/schema/payment-method-card-checks.d.ts.map +0 -1
  149. package/dist/schema/payment-method-card-checks.js.map +0 -1
  150. package/dist/schema/payment-method-card-networks.d.ts +0 -2
  151. package/dist/schema/payment-method-card-networks.d.ts.map +0 -1
  152. package/dist/schema/payment-method-card-networks.js.map +0 -1
  153. package/dist/schema/payment-method-card-three-d-secure-usage.d.ts +0 -2
  154. package/dist/schema/payment-method-card-three-d-secure-usage.d.ts.map +0 -1
  155. package/dist/schema/payment-method-card-three-d-secure-usage.js +0 -11
  156. package/dist/schema/payment-method-card-three-d-secure-usage.js.map +0 -1
  157. package/dist/schema/payment-method-card-wallet-masterpass.d.ts +0 -2
  158. package/dist/schema/payment-method-card-wallet-masterpass.d.ts.map +0 -1
  159. package/dist/schema/payment-method-card-wallet-masterpass.js.map +0 -1
  160. package/dist/schema/payment-method-card-wallet-visa-checkout.d.ts +0 -2
  161. package/dist/schema/payment-method-card-wallet-visa-checkout.d.ts.map +0 -1
  162. package/dist/schema/payment-method-card-wallet-visa-checkout.js.map +0 -1
  163. package/dist/schema/payment-method-card-wallet.d.ts +0 -2
  164. package/dist/schema/payment-method-card-wallet.d.ts.map +0 -1
  165. package/dist/schema/payment-method-card-wallet.js.map +0 -1
  166. package/dist/schema/payment-method-card.d.ts +0 -2
  167. package/dist/schema/payment-method-card.d.ts.map +0 -1
  168. package/dist/schema/payment-method-card.js.map +0 -1
  169. package/dist/schema/payment-method.d.ts +0 -2
  170. package/dist/schema/payment-method.d.ts.map +0 -1
  171. package/dist/schema/payment-method.js.map +0 -1
  172. package/dist/schema/payment-methods.d.ts +0 -2
  173. package/dist/schema/payment-methods.d.ts.map +0 -1
  174. package/dist/schema/payment-methods.js.map +0 -1
  175. package/dist/schema/plan-transform-usage.d.ts +0 -2
  176. package/dist/schema/plan-transform-usage.d.ts.map +0 -1
  177. package/dist/schema/plan-transform-usage.js.map +0 -1
  178. package/dist/schema/plan.d.ts +0 -2
  179. package/dist/schema/plan.d.ts.map +0 -1
  180. package/dist/schema/plan.js.map +0 -1
  181. package/dist/schema/price.d.ts +0 -2
  182. package/dist/schema/price.d.ts.map +0 -1
  183. package/dist/schema/price.js.map +0 -1
  184. package/dist/schema/product.d.ts +0 -2
  185. package/dist/schema/product.d.ts.map +0 -1
  186. package/dist/schema/product.js.map +0 -1
  187. package/dist/schema/stripe.d.ts +0 -2
  188. package/dist/schema/stripe.d.ts.map +0 -1
  189. package/dist/schema/stripe.js.map +0 -1
  190. package/dist/schema/subscription-automatic-tax.d.ts +0 -2
  191. package/dist/schema/subscription-automatic-tax.d.ts.map +0 -1
  192. package/dist/schema/subscription-automatic-tax.js +0 -12
  193. package/dist/schema/subscription-automatic-tax.js.map +0 -1
  194. package/dist/schema/subscription-billing-thresholds.d.ts +0 -2
  195. package/dist/schema/subscription-billing-thresholds.d.ts.map +0 -1
  196. package/dist/schema/subscription-billing-thresholds.js.map +0 -1
  197. package/dist/schema/subscription-item-billing-thresholds.d.ts +0 -2
  198. package/dist/schema/subscription-item-billing-thresholds.d.ts.map +0 -1
  199. package/dist/schema/subscription-item-billing-thresholds.js +0 -13
  200. package/dist/schema/subscription-item-billing-thresholds.js.map +0 -1
  201. package/dist/schema/subscription-item.d.ts +0 -2
  202. package/dist/schema/subscription-item.d.ts.map +0 -1
  203. package/dist/schema/subscription-item.js.map +0 -1
  204. package/dist/schema/subscription-items.d.ts +0 -2
  205. package/dist/schema/subscription-items.d.ts.map +0 -1
  206. package/dist/schema/subscription-items.js.map +0 -1
  207. package/dist/schema/subscription-pause-collection.d.ts +0 -2
  208. package/dist/schema/subscription-pause-collection.d.ts.map +0 -1
  209. package/dist/schema/subscription-pause-collection.js.map +0 -1
  210. package/dist/schema/subscription.d.ts +0 -2
  211. package/dist/schema/subscription.d.ts.map +0 -1
  212. package/dist/schema/subscription.js.map +0 -1
  213. package/dist/schema/subscriptions.d.ts +0 -2
  214. package/dist/schema/subscriptions.d.ts.map +0 -1
  215. package/dist/schema/subscriptions.js.map +0 -1
  216. package/dist/schema/tax-rate.d.ts +0 -2
  217. package/dist/schema/tax-rate.d.ts.map +0 -1
  218. package/dist/schema/tax-rate.js.map +0 -1
  219. package/dist/schema/test-clock.d.ts +0 -2
  220. package/dist/schema/test-clock.d.ts.map +0 -1
  221. package/dist/schema/test-clock.js.map +0 -1
  222. package/dist/server.d.ts +0 -5
  223. package/dist/server.d.ts.map +0 -1
  224. package/dist/server.js.map +0 -1
  225. package/dist/types.d.ts +0 -57
  226. package/dist/types.d.ts.map +0 -1
  227. package/dist/types.js +0 -3
  228. package/dist/types.js.map +0 -1
  229. package/dist/utils.d.ts +0 -5
  230. package/dist/utils.d.ts.map +0 -1
  231. package/dist/utils.js +0 -34
  232. package/dist/utils.js.map +0 -1
@@ -1,17 +1,6 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const builder_1 = require("../builder");
13
- const utils_1 = require("../utils");
14
- builder_1.builder.objectType('StripePaymentIntent', {
1
+ import { builder } from '../builder';
2
+ import { stripe } from '../utils';
3
+ builder.objectType('StripePaymentIntent', {
15
4
  description: 'Payment intents',
16
5
  fields: (t) => ({
17
6
  id: t.exposeString('id'),
@@ -61,14 +50,14 @@ builder_1.builder.objectType('StripePaymentIntent', {
61
50
  invoice: t.field({
62
51
  type: 'StripeInvoice',
63
52
  nullable: true,
64
- resolve: (paymentIntent) => __awaiter(void 0, void 0, void 0, function* () {
53
+ resolve: async (paymentIntent) => {
65
54
  const { invoice } = paymentIntent;
66
55
  if (!invoice) {
67
56
  return null;
68
57
  }
69
- const invoiceData = yield utils_1.stripe.invoices.retrieve(invoice);
58
+ const invoiceData = await stripe.invoices.retrieve(invoice);
70
59
  return invoiceData;
71
- })
60
+ }
72
61
  })
73
62
  // todo: missing fields
74
63
  // capture_method
@@ -76,4 +65,3 @@ builder_1.builder.objectType('StripePaymentIntent', {
76
65
  // application
77
66
  })
78
67
  });
79
- //# sourceMappingURL=payment-intent.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePaymentIntents', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentIntents', {
5
3
  fields: (t) => ({
6
4
  object: t.exposeString('object'),
7
5
  url: t.exposeString('url'),
@@ -12,4 +10,3 @@ builder_1.builder.objectType('StripePaymentIntents', {
12
10
  })
13
11
  })
14
12
  });
15
- //# sourceMappingURL=payment-intents.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePaymentMethodBillingDetails', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethodBillingDetails', {
5
3
  fields: (t) => ({
6
4
  address: t.expose('address', {
7
5
  description: `Billing address.`,
@@ -22,4 +20,3 @@ builder_1.builder.objectType('StripePaymentMethodBillingDetails', {
22
20
  })
23
21
  })
24
22
  });
25
- //# sourceMappingURL=payment-method-billing-details.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePaymentMethodCardChecks', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethodCardChecks', {
5
3
  fields: (t) => ({
6
4
  addressLine1Check: t.exposeString('address_line1_check', {
7
5
  description: `If a address line1 was provided, results of the check, one of \`pass\`, \`fail\`, \`unavailable\`, or \`unchecked\`.`,
@@ -17,4 +15,3 @@ builder_1.builder.objectType('StripePaymentMethodCardChecks', {
17
15
  })
18
16
  })
19
17
  });
20
- //# sourceMappingURL=payment-method-card-checks.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePaymentMethodCardNetworks', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethodCardNetworks', {
5
3
  fields: (t) => ({
6
4
  available: t.exposeStringList('available', {
7
5
  description: `All available networks for the card.`
@@ -12,4 +10,3 @@ builder_1.builder.objectType('StripePaymentMethodCardNetworks', {
12
10
  })
13
11
  })
14
12
  });
15
- //# sourceMappingURL=payment-method-card-networks.js.map
@@ -0,0 +1,8 @@
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethodCardThreeDSecureUsage', {
3
+ fields: (t) => ({
4
+ supported: t.exposeBoolean('supported', {
5
+ description: `Whether 3D Secure is supported on this card.`
6
+ })
7
+ })
8
+ });
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePaymentMethodCardWalletMasterpass', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethodCardWalletMasterpass', {
5
3
  fields: (t) => ({
6
4
  billingAddress: t.expose('billing_address', {
7
5
  description: `Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.`,
@@ -23,4 +21,3 @@ builder_1.builder.objectType('StripePaymentMethodCardWalletMasterpass', {
23
21
  })
24
22
  })
25
23
  });
26
- //# sourceMappingURL=payment-method-card-wallet-masterpass.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePaymentMethodCardWalletVisaCheckout', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethodCardWalletVisaCheckout', {
5
3
  fields: (t) => ({
6
4
  billingAddress: t.expose('billing_address', {
7
5
  description: `Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.`,
@@ -23,4 +21,3 @@ builder_1.builder.objectType('StripePaymentMethodCardWalletVisaCheckout', {
23
21
  })
24
22
  })
25
23
  });
26
- //# sourceMappingURL=payment-method-card-wallet-visa-checkout.js.map
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StripePaymentMethodCardWalletType = void 0;
4
- const builder_1 = require("../builder");
5
- builder_1.builder.objectType('StripePaymentMethodCardWallet', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethodCardWallet', {
6
3
  fields: (t) => ({
7
4
  dynamicLast4: t.exposeString('dynamic_last4', {
8
5
  description: `(For tokenized numbers only.) The last four digits of the device account number.`,
@@ -22,7 +19,7 @@ builder_1.builder.objectType('StripePaymentMethodCardWallet', {
22
19
  })
23
20
  })
24
21
  });
25
- exports.StripePaymentMethodCardWalletType = builder_1.builder.enumType('StripePaymentMethodCardWalletType', {
22
+ export const StripePaymentMethodCardWalletType = builder.enumType('StripePaymentMethodCardWalletType', {
26
23
  values: [
27
24
  'amex_express_checkout',
28
25
  'apple_pay',
@@ -32,4 +29,3 @@ exports.StripePaymentMethodCardWalletType = builder_1.builder.enumType('StripePa
32
29
  'visa_checkout'
33
30
  ]
34
31
  });
35
- //# sourceMappingURL=payment-method-card-wallet.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePaymentMethodCard', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethodCard', {
5
3
  fields: (t) => ({
6
4
  brand: t.exposeString('brand', {
7
5
  description: `Card brand. Can be \`amex\`, \`diners\`, \`discover\`, \`jcb\`, \`mastercard\`, \`unionpay\`, \`visa\`, or \`unknown\`.`
@@ -60,4 +58,3 @@ builder_1.builder.objectType('StripePaymentMethodCard', {
60
58
  })
61
59
  })
62
60
  });
63
- //# sourceMappingURL=payment-method-card.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePaymentMethod', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethod', {
5
3
  fields: (t) => ({
6
4
  id: t.exposeString('id', {
7
5
  description: `Unique identifier for the object.`
@@ -36,4 +34,3 @@ builder_1.builder.objectType('StripePaymentMethod', {
36
34
  })
37
35
  })
38
36
  });
39
- //# sourceMappingURL=payment-method.js.map
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StripePaymentMethodTypes = void 0;
4
- const builder_1 = require("../builder");
5
- builder_1.builder.objectType('StripePaymentMethods', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePaymentMethods', {
6
3
  fields: (t) => ({
7
4
  object: t.exposeString('object'),
8
5
  url: t.exposeString('url', {
@@ -35,7 +32,7 @@ builder_1.builder.objectType('StripePaymentMethods', {
35
32
  // })
36
33
  // }))
37
34
  // TODO: Move to payment-method.ts
38
- exports.StripePaymentMethodTypes = builder_1.builder.enumType('StripePaymentMethodTypes', {
35
+ export const StripePaymentMethodTypes = builder.enumType('StripePaymentMethodTypes', {
39
36
  values: [
40
37
  'acss_debit',
41
38
  'affirm',
@@ -67,4 +64,3 @@ exports.StripePaymentMethodTypes = builder_1.builder.enumType('StripePaymentMeth
67
64
  'wechat_pay'
68
65
  ]
69
66
  });
70
- //# sourceMappingURL=payment-methods.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripePlanTransformUsage', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripePlanTransformUsage', {
5
3
  description: '',
6
4
  fields: (t) => ({
7
5
  divideBy: t.exposeInt('divide_by', {
@@ -12,4 +10,3 @@ builder_1.builder.objectType('StripePlanTransformUsage', {
12
10
  })
13
11
  })
14
12
  });
15
- //# sourceMappingURL=plan-transform-usage.js.map
@@ -1,17 +1,6 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const builder_1 = require("../builder");
13
- const utils_1 = require("../utils");
14
- builder_1.builder.objectType('StripePlan', {
1
+ import { builder } from '../builder';
2
+ import { stripe } from '../utils';
3
+ builder.objectType('StripePlan', {
15
4
  description: '',
16
5
  fields: (t) => ({
17
6
  id: t.exposeString('id', {
@@ -66,14 +55,14 @@ builder_1.builder.objectType('StripePlan', {
66
55
  description: `The product whose pricing this plan determines.`,
67
56
  type: 'StripeProduct',
68
57
  nullable: true,
69
- resolve: (price) => __awaiter(void 0, void 0, void 0, function* () {
58
+ resolve: async (price) => {
70
59
  const { product } = price;
71
60
  if (!product) {
72
61
  return null;
73
62
  }
74
- const productData = yield utils_1.stripe.products.retrieve(product);
63
+ const productData = await stripe.products.retrieve(product);
75
64
  return productData;
76
- })
65
+ }
77
66
  }),
78
67
  // toddo: tiers
79
68
  // todo: tiers
@@ -95,4 +84,3 @@ builder_1.builder.objectType('StripePlan', {
95
84
  })
96
85
  })
97
86
  });
98
- //# sourceMappingURL=plan.js.map
@@ -1,17 +1,6 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const builder_1 = require("../builder");
13
- const utils_1 = require("../utils");
14
- builder_1.builder.objectType('StripePrice', {
1
+ import { builder } from '../builder';
2
+ import { stripe } from '../utils';
3
+ builder.objectType('StripePrice', {
15
4
  description: '',
16
5
  fields: (t) => ({
17
6
  id: t.exposeString('id', {
@@ -54,11 +43,11 @@ builder_1.builder.objectType('StripePrice', {
54
43
  product: t.field({
55
44
  description: `The ID of the product this price is associated with.`,
56
45
  type: 'StripeProduct',
57
- resolve: (price) => __awaiter(void 0, void 0, void 0, function* () {
46
+ resolve: async (price) => {
58
47
  const { product } = price;
59
- const productData = yield utils_1.stripe.products.retrieve(product);
48
+ const productData = await stripe.products.retrieve(product);
60
49
  return productData;
61
- })
50
+ }
62
51
  }),
63
52
  // todo: recurring
64
53
  // todo: tax_behavior
@@ -83,4 +72,3 @@ builder_1.builder.objectType('StripePrice', {
83
72
  })
84
73
  })
85
74
  });
86
- //# sourceMappingURL=price.js.map
@@ -1,17 +1,6 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const builder_1 = require("../builder");
13
- const utils_1 = require("../utils");
14
- builder_1.builder.objectType('StripeProduct', {
1
+ import { builder } from '../builder';
2
+ import { stripe } from '../utils';
3
+ builder.objectType('StripeProduct', {
15
4
  description: '',
16
5
  fields: (t) => ({
17
6
  id: t.exposeString('id', {
@@ -42,17 +31,17 @@ builder_1.builder.objectType('StripeProduct', {
42
31
  description: `The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product.`,
43
32
  type: 'StripePrice',
44
33
  nullable: true,
45
- resolve: (product) => __awaiter(void 0, void 0, void 0, function* () {
34
+ resolve: async (product) => {
46
35
  const { default_price } = product;
47
36
  if (!default_price) {
48
37
  return null;
49
38
  }
50
- const price = yield utils_1.stripe.prices.retrieve(default_price);
39
+ const price = await stripe.prices.retrieve(default_price);
51
40
  if (!price) {
52
41
  return null;
53
42
  }
54
43
  return price;
55
- })
44
+ }
56
45
  }),
57
46
  description: t.exposeString('description', {
58
47
  description: `The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.`,
@@ -100,4 +89,3 @@ builder_1.builder.objectType('StripeProduct', {
100
89
  })
101
90
  })
102
91
  });
103
- //# sourceMappingURL=product.js.map
@@ -1,28 +1,17 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const graphql_1 = require("graphql");
13
- const builder_1 = require("../builder");
14
- const utils_1 = require("../utils");
15
- builder_1.builder.objectType('Stripe', {
1
+ import { GraphQLError } from 'graphql';
2
+ import { builder } from '../builder';
3
+ import { stripe } from '../utils';
4
+ builder.objectType('Stripe', {
16
5
  fields: (t) => ({
17
6
  connectedAccounts: t.field({
18
7
  type: 'StripeConnectedAccounts',
19
- resolve: (_parent, _, context) => __awaiter(void 0, void 0, void 0, function* () {
8
+ resolve: async (_parent, _, context) => {
20
9
  const { isAdmin } = context;
21
10
  if (!isAdmin)
22
- throw new graphql_1.GraphQLError('Not allowed');
23
- const connectedAccounts = yield utils_1.stripe.accounts.list();
11
+ throw new GraphQLError('Not allowed');
12
+ const connectedAccounts = await stripe.accounts.list();
24
13
  return connectedAccounts;
25
- })
14
+ }
26
15
  }),
27
16
  connectedAccount: t.field({
28
17
  type: 'StripeConnectedAccount',
@@ -31,13 +20,13 @@ builder_1.builder.objectType('Stripe', {
31
20
  required: true
32
21
  })
33
22
  },
34
- resolve: (_parent, { id }, context) => __awaiter(void 0, void 0, void 0, function* () {
23
+ resolve: async (_parent, { id }, context) => {
35
24
  const { isAdmin } = context;
36
25
  if (!isAdmin)
37
- throw new graphql_1.GraphQLError('Not allowed');
38
- const connectedAccount = yield utils_1.stripe.accounts.retrieve(id);
26
+ throw new GraphQLError('Not allowed');
27
+ const connectedAccount = await stripe.accounts.retrieve(id);
39
28
  return connectedAccount;
40
- })
29
+ }
41
30
  }),
42
31
  customer: t.field({
43
32
  type: 'StripeCustomer',
@@ -46,17 +35,17 @@ builder_1.builder.objectType('Stripe', {
46
35
  required: true
47
36
  })
48
37
  },
49
- resolve: (_parent, { id }, context) => __awaiter(void 0, void 0, void 0, function* () {
38
+ resolve: async (_parent, { id }, context) => {
50
39
  const { isAllowed } = context;
51
- if (!(yield isAllowed(id, context))) {
52
- throw new graphql_1.GraphQLError('Not allowed');
40
+ if (!(await isAllowed(id, context))) {
41
+ throw new GraphQLError('Not allowed');
53
42
  }
54
- const customer = yield utils_1.stripe.customers.retrieve(id);
43
+ const customer = await stripe.customers.retrieve(id);
55
44
  if (customer.deleted) {
56
- throw new graphql_1.GraphQLError('The Stripe customer is deleted');
45
+ throw new GraphQLError('The Stripe customer is deleted');
57
46
  }
58
47
  return customer;
59
- })
48
+ }
60
49
  }),
61
50
  customers: t.field({
62
51
  type: 'StripeCustomers',
@@ -78,9 +67,9 @@ builder_1.builder.objectType('Stripe', {
78
67
  required: false
79
68
  })
80
69
  },
81
- resolve: (_parent, { email, endingBefore, limit, startingAfter }, context) => __awaiter(void 0, void 0, void 0, function* () {
70
+ resolve: async (_parent, { email, endingBefore, limit, startingAfter }, context) => {
82
71
  const { isAllowed } = context;
83
- const customers = yield utils_1.stripe.customers.list({
72
+ const customers = await stripe.customers.list({
84
73
  email: email || undefined,
85
74
  limit: limit || undefined,
86
75
  ending_before: endingBefore || undefined,
@@ -88,17 +77,17 @@ builder_1.builder.objectType('Stripe', {
88
77
  });
89
78
  const customerData = [];
90
79
  for (const customer of customers.data) {
91
- if (yield isAllowed(customer.id, context)) {
80
+ if (await isAllowed(customer.id, context)) {
92
81
  customerData.push(customer);
93
82
  }
94
83
  }
95
84
  customers.data = customerData;
96
85
  return customers;
97
- })
86
+ }
98
87
  })
99
88
  })
100
89
  });
101
- builder_1.builder.objectType('StripeMutations', {
90
+ builder.objectType('StripeMutations', {
102
91
  fields: (t) => ({
103
92
  createBillingPortalSession: t.field({
104
93
  type: 'StripeBillingPortalSession',
@@ -116,32 +105,31 @@ builder_1.builder.objectType('StripeMutations', {
116
105
  required: false
117
106
  })
118
107
  },
119
- resolve: (_, { customer, configuration, locale, returnUrl }, context) => __awaiter(void 0, void 0, void 0, function* () {
108
+ resolve: async (_, { customer, configuration, locale, returnUrl }, context) => {
120
109
  const { isAllowed } = context;
121
- if (!(yield isAllowed(customer, context))) {
122
- throw new graphql_1.GraphQLError('Not allowed');
110
+ if (!(await isAllowed(customer, context))) {
111
+ throw new GraphQLError('Not allowed');
123
112
  }
124
- const session = yield utils_1.stripe.billingPortal.sessions.create({
113
+ const session = await stripe.billingPortal.sessions.create({
125
114
  customer,
126
115
  configuration: configuration || undefined,
127
116
  locale: locale || undefined,
128
117
  return_url: returnUrl || undefined
129
118
  });
130
119
  return session;
131
- })
120
+ }
132
121
  })
133
122
  })
134
123
  });
135
- builder_1.builder.queryFields((t) => ({
124
+ builder.queryFields((t) => ({
136
125
  stripe: t.field({
137
126
  type: 'Stripe',
138
127
  resolve: () => ({})
139
128
  })
140
129
  }));
141
- builder_1.builder.mutationFields((t) => ({
130
+ builder.mutationFields((t) => ({
142
131
  stripe: t.field({
143
132
  type: 'StripeMutations',
144
133
  resolve: () => ({})
145
134
  })
146
135
  }));
147
- //# sourceMappingURL=stripe.js.map
@@ -0,0 +1,9 @@
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripeSubscriptionAutomaticTax', {
3
+ description: '',
4
+ fields: (t) => ({
5
+ enabled: t.exposeBoolean('enabled', {
6
+ description: `Whether Stripe automatically computes tax on this subscription.`
7
+ })
8
+ })
9
+ });
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripeSubscriptionBillingThresholds', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripeSubscriptionBillingThresholds', {
5
3
  description: '',
6
4
  fields: (t) => ({
7
5
  amountGte: t.exposeInt('amount_gte', {
@@ -14,4 +12,3 @@ builder_1.builder.objectType('StripeSubscriptionBillingThresholds', {
14
12
  })
15
13
  })
16
14
  });
17
- //# sourceMappingURL=subscription-billing-thresholds.js.map
@@ -0,0 +1,10 @@
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripeSubscriptionItemBillingThresholds', {
3
+ description: '',
4
+ fields: (t) => ({
5
+ usageGte: t.exposeInt('usage_gte', {
6
+ description: `Usage threshold that triggers the subscription to create an invoice`,
7
+ nullable: true
8
+ })
9
+ })
10
+ });
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripeSubscriptionItem', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripeSubscriptionItem', {
5
3
  description: '',
6
4
  fields: (t) => ({
7
5
  id: t.exposeString('id', {
@@ -43,4 +41,3 @@ builder_1.builder.objectType('StripeSubscriptionItem', {
43
41
  // })
44
42
  })
45
43
  });
46
- //# sourceMappingURL=subscription-item.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripeSubscriptionItems', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripeSubscriptionItems', {
5
3
  fields: (t) => ({
6
4
  object: t.exposeString('object'),
7
5
  url: t.exposeString('url', {
@@ -16,4 +14,3 @@ builder_1.builder.objectType('StripeSubscriptionItems', {
16
14
  })
17
15
  })
18
16
  });
19
- //# sourceMappingURL=subscription-items.js.map
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("../builder");
4
- builder_1.builder.objectType('StripeSubscriptionPauseCollection', {
1
+ import { builder } from '../builder';
2
+ builder.objectType('StripeSubscriptionPauseCollection', {
5
3
  description: '',
6
4
  fields: (t) => ({
7
5
  behavior: t.exposeString('behavior', {
@@ -13,4 +11,3 @@ builder_1.builder.objectType('StripeSubscriptionPauseCollection', {
13
11
  })
14
12
  })
15
13
  });
16
- //# sourceMappingURL=subscription-pause-collection.js.map