@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.
- package/dist/dev/server.js +17 -0
- package/dist/src/builder.js +8 -0
- package/dist/{index.d.ts → src/index.js} +0 -1
- package/dist/{schema → src/schema}/address.js +2 -5
- package/dist/{schema → src/schema}/billing-portal-session.js +2 -5
- package/dist/{schema → src/schema}/charge.js +9 -21
- package/dist/{schema → src/schema}/charges.js +2 -5
- package/dist/{schema → src/schema}/connectedAccount.js +2 -5
- package/dist/{schema → src/schema}/connectedAccounts.js +2 -5
- package/dist/{schema → src/schema}/customer-shipping.js +2 -5
- package/dist/{schema → src/schema}/customer-tax-location.js +2 -5
- package/dist/{schema → src/schema}/customer-tax.js +2 -5
- package/dist/{schema → src/schema}/customer.js +20 -32
- package/dist/{schema → src/schema}/customers.js +2 -5
- package/dist/{schema/index.d.ts → src/schema/index.js} +2 -2
- package/dist/{schema → src/schema}/invoice-automatic-tax.js +2 -5
- package/dist/{schema → src/schema}/invoice-custom-field.js +2 -5
- package/dist/{schema → src/schema}/invoice-customer-shipping.js +2 -5
- package/dist/{schema → src/schema}/invoice-customer-tax-id.js +2 -5
- package/dist/{schema → src/schema}/invoice-line-item-period.js +2 -5
- package/dist/{schema → src/schema}/invoice-line-item-tax-amount.js +2 -5
- package/dist/{schema → src/schema}/invoice-line-item.js +2 -5
- package/dist/{schema → src/schema}/invoice-line-items.js +2 -5
- package/dist/{schema → src/schema}/invoice-rendering-options.js +2 -5
- package/dist/{schema → src/schema}/invoice-status-transitions.js +2 -5
- package/dist/{schema → src/schema}/invoice.js +12 -24
- package/dist/{schema → src/schema}/invoices.js +2 -5
- package/dist/{schema → src/schema}/payment-intent.js +6 -18
- package/dist/{schema → src/schema}/payment-intents.js +2 -5
- package/dist/{schema → src/schema}/payment-method-billing-details.js +2 -5
- package/dist/{schema → src/schema}/payment-method-card-checks.js +2 -5
- package/dist/{schema → src/schema}/payment-method-card-networks.js +2 -5
- package/dist/src/schema/payment-method-card-three-d-secure-usage.js +8 -0
- package/dist/{schema → src/schema}/payment-method-card-wallet-masterpass.js +2 -5
- package/dist/{schema → src/schema}/payment-method-card-wallet-visa-checkout.js +2 -5
- package/dist/{schema → src/schema}/payment-method-card-wallet.js +3 -7
- package/dist/{schema → src/schema}/payment-method-card.js +2 -5
- package/dist/{schema → src/schema}/payment-method.js +2 -5
- package/dist/{schema → src/schema}/payment-methods.js +3 -7
- package/dist/{schema → src/schema}/plan-transform-usage.js +2 -5
- package/dist/{schema → src/schema}/plan.js +6 -18
- package/dist/{schema → src/schema}/price.js +6 -18
- package/dist/{schema → src/schema}/product.js +6 -18
- package/dist/{schema → src/schema}/stripe.js +30 -42
- package/dist/src/schema/subscription-automatic-tax.js +9 -0
- package/dist/{schema → src/schema}/subscription-billing-thresholds.js +2 -5
- package/dist/src/schema/subscription-item-billing-thresholds.js +10 -0
- package/dist/{schema → src/schema}/subscription-item.js +2 -5
- package/dist/{schema → src/schema}/subscription-items.js +2 -5
- package/dist/{schema → src/schema}/subscription-pause-collection.js +2 -5
- package/dist/{schema → src/schema}/subscription.js +12 -24
- package/dist/{schema → src/schema}/subscriptions.js +2 -5
- package/dist/{schema → src/schema}/tax-rate.js +2 -5
- package/dist/{schema → src/schema}/test-clock.js +2 -5
- package/dist/{server.js → src/server.js} +15 -16
- package/dist/src/types.js +1 -0
- package/dist/src/utils.js +26 -0
- package/package.json +3 -3
- package/dist/builder.d.ts +0 -72
- package/dist/builder.d.ts.map +0 -1
- package/dist/builder.js +0 -15
- package/dist/builder.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/dist/schema/address.d.ts +0 -2
- package/dist/schema/address.d.ts.map +0 -1
- package/dist/schema/address.js.map +0 -1
- package/dist/schema/billing-portal-session.d.ts +0 -2
- package/dist/schema/billing-portal-session.d.ts.map +0 -1
- package/dist/schema/billing-portal-session.js.map +0 -1
- package/dist/schema/charge.d.ts +0 -2
- package/dist/schema/charge.d.ts.map +0 -1
- package/dist/schema/charge.js.map +0 -1
- package/dist/schema/charges.d.ts +0 -2
- package/dist/schema/charges.d.ts.map +0 -1
- package/dist/schema/charges.js.map +0 -1
- package/dist/schema/connectedAccount.d.ts +0 -2
- package/dist/schema/connectedAccount.d.ts.map +0 -1
- package/dist/schema/connectedAccount.js.map +0 -1
- package/dist/schema/connectedAccounts.d.ts +0 -2
- package/dist/schema/connectedAccounts.d.ts.map +0 -1
- package/dist/schema/connectedAccounts.js.map +0 -1
- package/dist/schema/customer-shipping.d.ts +0 -2
- package/dist/schema/customer-shipping.d.ts.map +0 -1
- package/dist/schema/customer-shipping.js.map +0 -1
- package/dist/schema/customer-tax-location.d.ts +0 -2
- package/dist/schema/customer-tax-location.d.ts.map +0 -1
- package/dist/schema/customer-tax-location.js.map +0 -1
- package/dist/schema/customer-tax.d.ts +0 -2
- package/dist/schema/customer-tax.d.ts.map +0 -1
- package/dist/schema/customer-tax.js.map +0 -1
- package/dist/schema/customer.d.ts +0 -2
- package/dist/schema/customer.d.ts.map +0 -1
- package/dist/schema/customer.js.map +0 -1
- package/dist/schema/customers.d.ts +0 -2
- package/dist/schema/customers.d.ts.map +0 -1
- package/dist/schema/customers.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js +0 -56
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/invoice-automatic-tax.d.ts +0 -2
- package/dist/schema/invoice-automatic-tax.d.ts.map +0 -1
- package/dist/schema/invoice-automatic-tax.js.map +0 -1
- package/dist/schema/invoice-custom-field.d.ts +0 -2
- package/dist/schema/invoice-custom-field.d.ts.map +0 -1
- package/dist/schema/invoice-custom-field.js.map +0 -1
- package/dist/schema/invoice-customer-shipping.d.ts +0 -2
- package/dist/schema/invoice-customer-shipping.d.ts.map +0 -1
- package/dist/schema/invoice-customer-shipping.js.map +0 -1
- package/dist/schema/invoice-customer-tax-id.d.ts +0 -2
- package/dist/schema/invoice-customer-tax-id.d.ts.map +0 -1
- package/dist/schema/invoice-customer-tax-id.js.map +0 -1
- package/dist/schema/invoice-line-item-period.d.ts +0 -2
- package/dist/schema/invoice-line-item-period.d.ts.map +0 -1
- package/dist/schema/invoice-line-item-period.js.map +0 -1
- package/dist/schema/invoice-line-item-tax-amount.d.ts +0 -2
- package/dist/schema/invoice-line-item-tax-amount.d.ts.map +0 -1
- package/dist/schema/invoice-line-item-tax-amount.js.map +0 -1
- package/dist/schema/invoice-line-item.d.ts +0 -2
- package/dist/schema/invoice-line-item.d.ts.map +0 -1
- package/dist/schema/invoice-line-item.js.map +0 -1
- package/dist/schema/invoice-line-items.d.ts +0 -2
- package/dist/schema/invoice-line-items.d.ts.map +0 -1
- package/dist/schema/invoice-line-items.js.map +0 -1
- package/dist/schema/invoice-rendering-options.d.ts +0 -2
- package/dist/schema/invoice-rendering-options.d.ts.map +0 -1
- package/dist/schema/invoice-rendering-options.js.map +0 -1
- package/dist/schema/invoice-status-transitions.d.ts +0 -2
- package/dist/schema/invoice-status-transitions.d.ts.map +0 -1
- package/dist/schema/invoice-status-transitions.js.map +0 -1
- package/dist/schema/invoice.d.ts +0 -2
- package/dist/schema/invoice.d.ts.map +0 -1
- package/dist/schema/invoice.js.map +0 -1
- package/dist/schema/invoices.d.ts +0 -2
- package/dist/schema/invoices.d.ts.map +0 -1
- package/dist/schema/invoices.js.map +0 -1
- package/dist/schema/payment-intent.d.ts +0 -2
- package/dist/schema/payment-intent.d.ts.map +0 -1
- package/dist/schema/payment-intent.js.map +0 -1
- package/dist/schema/payment-intents.d.ts +0 -2
- package/dist/schema/payment-intents.d.ts.map +0 -1
- package/dist/schema/payment-intents.js.map +0 -1
- package/dist/schema/payment-method-billing-details.d.ts +0 -2
- package/dist/schema/payment-method-billing-details.d.ts.map +0 -1
- package/dist/schema/payment-method-billing-details.js.map +0 -1
- package/dist/schema/payment-method-card-checks.d.ts +0 -2
- package/dist/schema/payment-method-card-checks.d.ts.map +0 -1
- package/dist/schema/payment-method-card-checks.js.map +0 -1
- package/dist/schema/payment-method-card-networks.d.ts +0 -2
- package/dist/schema/payment-method-card-networks.d.ts.map +0 -1
- package/dist/schema/payment-method-card-networks.js.map +0 -1
- package/dist/schema/payment-method-card-three-d-secure-usage.d.ts +0 -2
- package/dist/schema/payment-method-card-three-d-secure-usage.d.ts.map +0 -1
- package/dist/schema/payment-method-card-three-d-secure-usage.js +0 -11
- package/dist/schema/payment-method-card-three-d-secure-usage.js.map +0 -1
- package/dist/schema/payment-method-card-wallet-masterpass.d.ts +0 -2
- package/dist/schema/payment-method-card-wallet-masterpass.d.ts.map +0 -1
- package/dist/schema/payment-method-card-wallet-masterpass.js.map +0 -1
- package/dist/schema/payment-method-card-wallet-visa-checkout.d.ts +0 -2
- package/dist/schema/payment-method-card-wallet-visa-checkout.d.ts.map +0 -1
- package/dist/schema/payment-method-card-wallet-visa-checkout.js.map +0 -1
- package/dist/schema/payment-method-card-wallet.d.ts +0 -2
- package/dist/schema/payment-method-card-wallet.d.ts.map +0 -1
- package/dist/schema/payment-method-card-wallet.js.map +0 -1
- package/dist/schema/payment-method-card.d.ts +0 -2
- package/dist/schema/payment-method-card.d.ts.map +0 -1
- package/dist/schema/payment-method-card.js.map +0 -1
- package/dist/schema/payment-method.d.ts +0 -2
- package/dist/schema/payment-method.d.ts.map +0 -1
- package/dist/schema/payment-method.js.map +0 -1
- package/dist/schema/payment-methods.d.ts +0 -2
- package/dist/schema/payment-methods.d.ts.map +0 -1
- package/dist/schema/payment-methods.js.map +0 -1
- package/dist/schema/plan-transform-usage.d.ts +0 -2
- package/dist/schema/plan-transform-usage.d.ts.map +0 -1
- package/dist/schema/plan-transform-usage.js.map +0 -1
- package/dist/schema/plan.d.ts +0 -2
- package/dist/schema/plan.d.ts.map +0 -1
- package/dist/schema/plan.js.map +0 -1
- package/dist/schema/price.d.ts +0 -2
- package/dist/schema/price.d.ts.map +0 -1
- package/dist/schema/price.js.map +0 -1
- package/dist/schema/product.d.ts +0 -2
- package/dist/schema/product.d.ts.map +0 -1
- package/dist/schema/product.js.map +0 -1
- package/dist/schema/stripe.d.ts +0 -2
- package/dist/schema/stripe.d.ts.map +0 -1
- package/dist/schema/stripe.js.map +0 -1
- package/dist/schema/subscription-automatic-tax.d.ts +0 -2
- package/dist/schema/subscription-automatic-tax.d.ts.map +0 -1
- package/dist/schema/subscription-automatic-tax.js +0 -12
- package/dist/schema/subscription-automatic-tax.js.map +0 -1
- package/dist/schema/subscription-billing-thresholds.d.ts +0 -2
- package/dist/schema/subscription-billing-thresholds.d.ts.map +0 -1
- package/dist/schema/subscription-billing-thresholds.js.map +0 -1
- package/dist/schema/subscription-item-billing-thresholds.d.ts +0 -2
- package/dist/schema/subscription-item-billing-thresholds.d.ts.map +0 -1
- package/dist/schema/subscription-item-billing-thresholds.js +0 -13
- package/dist/schema/subscription-item-billing-thresholds.js.map +0 -1
- package/dist/schema/subscription-item.d.ts +0 -2
- package/dist/schema/subscription-item.d.ts.map +0 -1
- package/dist/schema/subscription-item.js.map +0 -1
- package/dist/schema/subscription-items.d.ts +0 -2
- package/dist/schema/subscription-items.d.ts.map +0 -1
- package/dist/schema/subscription-items.js.map +0 -1
- package/dist/schema/subscription-pause-collection.d.ts +0 -2
- package/dist/schema/subscription-pause-collection.d.ts.map +0 -1
- package/dist/schema/subscription-pause-collection.js.map +0 -1
- package/dist/schema/subscription.d.ts +0 -2
- package/dist/schema/subscription.d.ts.map +0 -1
- package/dist/schema/subscription.js.map +0 -1
- package/dist/schema/subscriptions.d.ts +0 -2
- package/dist/schema/subscriptions.d.ts.map +0 -1
- package/dist/schema/subscriptions.js.map +0 -1
- package/dist/schema/tax-rate.d.ts +0 -2
- package/dist/schema/tax-rate.d.ts.map +0 -1
- package/dist/schema/tax-rate.js.map +0 -1
- package/dist/schema/test-clock.d.ts +0 -2
- package/dist/schema/test-clock.d.ts.map +0 -1
- package/dist/schema/test-clock.js.map +0 -1
- package/dist/server.d.ts +0 -5
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/types.d.ts +0 -57
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -5
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -34
- package/dist/utils.js.map +0 -1
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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) =>
|
|
53
|
+
resolve: async (paymentIntent) => {
|
|
65
54
|
const { invoice } = paymentIntent;
|
|
66
55
|
if (!invoice) {
|
|
67
56
|
return null;
|
|
68
57
|
}
|
|
69
|
-
const invoiceData =
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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) =>
|
|
58
|
+
resolve: async (price) => {
|
|
70
59
|
const { product } = price;
|
|
71
60
|
if (!product) {
|
|
72
61
|
return null;
|
|
73
62
|
}
|
|
74
|
-
const productData =
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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) =>
|
|
46
|
+
resolve: async (price) => {
|
|
58
47
|
const { product } = price;
|
|
59
|
-
const productData =
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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) =>
|
|
34
|
+
resolve: async (product) => {
|
|
46
35
|
const { default_price } = product;
|
|
47
36
|
if (!default_price) {
|
|
48
37
|
return null;
|
|
49
38
|
}
|
|
50
|
-
const 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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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) =>
|
|
8
|
+
resolve: async (_parent, _, context) => {
|
|
20
9
|
const { isAdmin } = context;
|
|
21
10
|
if (!isAdmin)
|
|
22
|
-
throw new
|
|
23
|
-
const connectedAccounts =
|
|
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) =>
|
|
23
|
+
resolve: async (_parent, { id }, context) => {
|
|
35
24
|
const { isAdmin } = context;
|
|
36
25
|
if (!isAdmin)
|
|
37
|
-
throw new
|
|
38
|
-
const connectedAccount =
|
|
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) =>
|
|
38
|
+
resolve: async (_parent, { id }, context) => {
|
|
50
39
|
const { isAllowed } = context;
|
|
51
|
-
if (!(
|
|
52
|
-
throw new
|
|
40
|
+
if (!(await isAllowed(id, context))) {
|
|
41
|
+
throw new GraphQLError('Not allowed');
|
|
53
42
|
}
|
|
54
|
-
const customer =
|
|
43
|
+
const customer = await stripe.customers.retrieve(id);
|
|
55
44
|
if (customer.deleted) {
|
|
56
|
-
throw new
|
|
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) =>
|
|
70
|
+
resolve: async (_parent, { email, endingBefore, limit, startingAfter }, context) => {
|
|
82
71
|
const { isAllowed } = context;
|
|
83
|
-
const customers =
|
|
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 (
|
|
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
|
-
|
|
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) =>
|
|
108
|
+
resolve: async (_, { customer, configuration, locale, returnUrl }, context) => {
|
|
120
109
|
const { isAllowed } = context;
|
|
121
|
-
if (!(
|
|
122
|
-
throw new
|
|
110
|
+
if (!(await isAllowed(customer, context))) {
|
|
111
|
+
throw new GraphQLError('Not allowed');
|
|
123
112
|
}
|
|
124
|
-
const session =
|
|
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
|
-
|
|
124
|
+
builder.queryFields((t) => ({
|
|
136
125
|
stripe: t.field({
|
|
137
126
|
type: 'Stripe',
|
|
138
127
|
resolve: () => ({})
|
|
139
128
|
})
|
|
140
129
|
}));
|
|
141
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|