@nhost/stripe-graphql-js 0.0.1 → 0.0.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.
- package/dist/builder.d.ts +66 -0
- package/dist/builder.d.ts.map +1 -0
- package/dist/builder.js +15 -0
- package/dist/builder.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/address.d.ts +2 -0
- package/dist/schema/address.d.ts.map +1 -0
- package/dist/schema/address.js +14 -0
- package/dist/schema/address.js.map +1 -0
- package/dist/schema/billing-portal-session.d.ts +2 -0
- package/dist/schema/billing-portal-session.d.ts.map +1 -0
- package/dist/schema/billing-portal-session.js +23 -0
- package/dist/schema/billing-portal-session.js.map +1 -0
- package/dist/schema/customer-shipping.d.ts +2 -0
- package/dist/schema/customer-shipping.d.ts.map +1 -0
- package/dist/schema/customer-shipping.js +24 -0
- package/dist/schema/customer-shipping.js.map +1 -0
- package/dist/schema/customer-tax-location.d.ts +2 -0
- package/dist/schema/customer-tax-location.d.ts.map +1 -0
- package/dist/schema/customer-tax-location.js +20 -0
- package/dist/schema/customer-tax-location.js.map +1 -0
- package/dist/schema/customer-tax.d.ts +2 -0
- package/dist/schema/customer-tax.d.ts.map +1 -0
- package/dist/schema/customer-tax.js +21 -0
- package/dist/schema/customer-tax.js.map +1 -0
- package/dist/schema/customer.d.ts +2 -0
- package/dist/schema/customer.d.ts.map +1 -0
- package/dist/schema/customer.js +126 -0
- package/dist/schema/customer.js.map +1 -0
- package/dist/schema/customers.d.ts +2 -0
- package/dist/schema/customers.d.ts.map +1 -0
- package/dist/schema/customers.js +15 -0
- package/dist/schema/customers.js.map +1 -0
- package/dist/schema/index.d.ts +46 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +50 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/invoice-automatic-tax.d.ts +2 -0
- package/dist/schema/invoice-automatic-tax.d.ts.map +1 -0
- package/dist/schema/invoice-automatic-tax.js +12 -0
- package/dist/schema/invoice-automatic-tax.js.map +1 -0
- package/dist/schema/invoice-custom-field.d.ts +2 -0
- package/dist/schema/invoice-custom-field.d.ts.map +1 -0
- package/dist/schema/invoice-custom-field.js +10 -0
- package/dist/schema/invoice-custom-field.js.map +1 -0
- package/dist/schema/invoice-customer-shipping.d.ts +2 -0
- package/dist/schema/invoice-customer-shipping.d.ts.map +1 -0
- package/dist/schema/invoice-customer-shipping.js +24 -0
- package/dist/schema/invoice-customer-shipping.js.map +1 -0
- package/dist/schema/invoice-customer-tax-id.d.ts +2 -0
- package/dist/schema/invoice-customer-tax-id.d.ts.map +1 -0
- package/dist/schema/invoice-customer-tax-id.js +12 -0
- package/dist/schema/invoice-customer-tax-id.js.map +1 -0
- package/dist/schema/invoice-line-item-period.d.ts +2 -0
- package/dist/schema/invoice-line-item-period.d.ts.map +1 -0
- package/dist/schema/invoice-line-item-period.js +10 -0
- package/dist/schema/invoice-line-item-period.js.map +1 -0
- package/dist/schema/invoice-line-item-tax-amount.d.ts +2 -0
- package/dist/schema/invoice-line-item-tax-amount.d.ts.map +1 -0
- package/dist/schema/invoice-line-item-tax-amount.js +15 -0
- package/dist/schema/invoice-line-item-tax-amount.js.map +1 -0
- package/dist/schema/invoice-line-item.d.ts +2 -0
- package/dist/schema/invoice-line-item.d.ts.map +1 -0
- package/dist/schema/invoice-line-item.js +59 -0
- package/dist/schema/invoice-line-item.js.map +1 -0
- package/dist/schema/invoice-line-items.d.ts +2 -0
- package/dist/schema/invoice-line-items.d.ts.map +1 -0
- package/dist/schema/invoice-line-items.js +15 -0
- package/dist/schema/invoice-line-items.js.map +1 -0
- package/dist/schema/invoice-rendering-options.d.ts +2 -0
- package/dist/schema/invoice-rendering-options.d.ts.map +1 -0
- package/dist/schema/invoice-rendering-options.js +12 -0
- package/dist/schema/invoice-rendering-options.js.map +1 -0
- package/dist/schema/invoice-status-transitions.d.ts +2 -0
- package/dist/schema/invoice-status-transitions.d.ts.map +1 -0
- package/dist/schema/invoice-status-transitions.js +24 -0
- package/dist/schema/invoice-status-transitions.js.map +1 -0
- package/dist/schema/invoice.d.ts +2 -0
- package/dist/schema/invoice.d.ts.map +1 -0
- package/dist/schema/invoice.js +201 -0
- package/dist/schema/invoice.js.map +1 -0
- package/dist/schema/invoices.d.ts +2 -0
- package/dist/schema/invoices.d.ts.map +1 -0
- package/dist/schema/invoices.js +15 -0
- package/dist/schema/invoices.js.map +1 -0
- package/dist/schema/payment-method-billing-details.d.ts +2 -0
- package/dist/schema/payment-method-billing-details.d.ts.map +1 -0
- package/dist/schema/payment-method-billing-details.js +21 -0
- package/dist/schema/payment-method-billing-details.js.map +1 -0
- package/dist/schema/payment-method-card-checks.d.ts +2 -0
- package/dist/schema/payment-method-card-checks.d.ts.map +1 -0
- package/dist/schema/payment-method-card-checks.js +17 -0
- package/dist/schema/payment-method-card-checks.js.map +1 -0
- package/dist/schema/payment-method-card-networks.d.ts +2 -0
- package/dist/schema/payment-method-card-networks.d.ts.map +1 -0
- package/dist/schema/payment-method-card-networks.js +12 -0
- package/dist/schema/payment-method-card-networks.js.map +1 -0
- package/dist/schema/payment-method-card-three-d-secure-usage.d.ts +2 -0
- package/dist/schema/payment-method-card-three-d-secure-usage.d.ts.map +1 -0
- package/dist/schema/payment-method-card-three-d-secure-usage.js +9 -0
- package/dist/schema/payment-method-card-three-d-secure-usage.js.map +1 -0
- package/dist/schema/payment-method-card-wallet-masterpass.d.ts +2 -0
- package/dist/schema/payment-method-card-wallet-masterpass.d.ts.map +1 -0
- package/dist/schema/payment-method-card-wallet-masterpass.js +22 -0
- package/dist/schema/payment-method-card-wallet-masterpass.js.map +1 -0
- package/dist/schema/payment-method-card-wallet-visa-checkout.d.ts +2 -0
- package/dist/schema/payment-method-card-wallet-visa-checkout.d.ts.map +1 -0
- package/dist/schema/payment-method-card-wallet-visa-checkout.js +22 -0
- package/dist/schema/payment-method-card-wallet-visa-checkout.js.map +1 -0
- package/dist/schema/payment-method-card-wallet.d.ts +2 -0
- package/dist/schema/payment-method-card-wallet.d.ts.map +1 -0
- package/dist/schema/payment-method-card-wallet.js +31 -0
- package/dist/schema/payment-method-card-wallet.js.map +1 -0
- package/dist/schema/payment-method-card.d.ts +2 -0
- package/dist/schema/payment-method-card.d.ts.map +1 -0
- package/dist/schema/payment-method-card.js +48 -0
- package/dist/schema/payment-method-card.js.map +1 -0
- package/dist/schema/payment-method.d.ts +2 -0
- package/dist/schema/payment-method.d.ts.map +1 -0
- package/dist/schema/payment-method.js +27 -0
- package/dist/schema/payment-method.js.map +1 -0
- package/dist/schema/payment-methods.d.ts +2 -0
- package/dist/schema/payment-methods.d.ts.map +1 -0
- package/dist/schema/payment-methods.js +66 -0
- package/dist/schema/payment-methods.js.map +1 -0
- package/dist/schema/plan-transform-usage.d.ts +2 -0
- package/dist/schema/plan-transform-usage.d.ts.map +1 -0
- package/dist/schema/plan-transform-usage.js +15 -0
- package/dist/schema/plan-transform-usage.js.map +1 -0
- package/dist/schema/plan.d.ts +2 -0
- package/dist/schema/plan.d.ts.map +1 -0
- package/dist/schema/plan.js +69 -0
- package/dist/schema/plan.js.map +1 -0
- package/dist/schema/price.d.ts +2 -0
- package/dist/schema/price.d.ts.map +1 -0
- package/dist/schema/price.js +63 -0
- package/dist/schema/price.js.map +1 -0
- package/dist/schema/product.d.ts +2 -0
- package/dist/schema/product.d.ts.map +1 -0
- package/dist/schema/product.js +75 -0
- package/dist/schema/product.js.map +1 -0
- package/dist/schema/stripe.d.ts +2 -0
- package/dist/schema/stripe.d.ts.map +1 -0
- package/dist/schema/stripe.js +117 -0
- package/dist/schema/stripe.js.map +1 -0
- package/dist/schema/subscription-automatic-tax.d.ts +2 -0
- package/dist/schema/subscription-automatic-tax.d.ts.map +1 -0
- package/dist/schema/subscription-automatic-tax.js +10 -0
- package/dist/schema/subscription-automatic-tax.js.map +1 -0
- package/dist/schema/subscription-billing-thresholds.d.ts +2 -0
- package/dist/schema/subscription-billing-thresholds.d.ts.map +1 -0
- package/dist/schema/subscription-billing-thresholds.js +15 -0
- package/dist/schema/subscription-billing-thresholds.js.map +1 -0
- package/dist/schema/subscription-item-billing-thresholds.d.ts +2 -0
- package/dist/schema/subscription-item-billing-thresholds.d.ts.map +1 -0
- package/dist/schema/subscription-item-billing-thresholds.js +12 -0
- package/dist/schema/subscription-item-billing-thresholds.js.map +1 -0
- package/dist/schema/subscription-item.d.ts +2 -0
- package/dist/schema/subscription-item.d.ts.map +1 -0
- package/dist/schema/subscription-item.js +33 -0
- package/dist/schema/subscription-item.js.map +1 -0
- package/dist/schema/subscription-items.d.ts +2 -0
- package/dist/schema/subscription-items.d.ts.map +1 -0
- package/dist/schema/subscription-items.js +15 -0
- package/dist/schema/subscription-items.js.map +1 -0
- package/dist/schema/subscription-pause-collection.d.ts +2 -0
- package/dist/schema/subscription-pause-collection.d.ts.map +1 -0
- package/dist/schema/subscription-pause-collection.js +16 -0
- package/dist/schema/subscription-pause-collection.js.map +1 -0
- package/dist/schema/subscription.d.ts +2 -0
- package/dist/schema/subscription.d.ts.map +1 -0
- package/dist/schema/subscription.js +134 -0
- package/dist/schema/subscription.js.map +1 -0
- package/dist/schema/subscriptions.d.ts +2 -0
- package/dist/schema/subscriptions.d.ts.map +1 -0
- package/dist/schema/subscriptions.js +15 -0
- package/dist/schema/subscriptions.js.map +1 -0
- package/dist/schema/tax-rate.d.ts +2 -0
- package/dist/schema/tax-rate.d.ts.map +1 -0
- package/dist/schema/tax-rate.js +58 -0
- package/dist/schema/tax-rate.js.map +1 -0
- package/dist/schema/test-clock.d.ts +2 -0
- package/dist/schema/test-clock.d.ts.map +1 -0
- package/dist/schema/test-clock.js +19 -0
- package/dist/schema/test-clock.js.map +1 -0
- package/dist/server.d.ts +9 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +41 -0
- package/dist/server.js.map +1 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +34 -0
- package/dist/utils.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
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 node_1 = require("@graphql-yoga/node");
|
|
13
|
+
const builder_1 = require("../builder");
|
|
14
|
+
const utils_1 = require("../utils");
|
|
15
|
+
builder_1.builder.objectType('Stripe', {
|
|
16
|
+
fields: (t) => ({
|
|
17
|
+
customer: t.field({
|
|
18
|
+
type: 'StripeCustomer',
|
|
19
|
+
args: {
|
|
20
|
+
id: t.arg.string({
|
|
21
|
+
required: true
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
resolve: (_parent, { id }, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
const { isAllowed } = context;
|
|
26
|
+
if (!isAllowed(id, context)) {
|
|
27
|
+
throw new node_1.GraphQLYogaError('Not allowed');
|
|
28
|
+
}
|
|
29
|
+
const customer = yield utils_1.stripe.customers.retrieve(id);
|
|
30
|
+
if (customer.deleted) {
|
|
31
|
+
throw new node_1.GraphQLYogaError('The Stripe customer is deleted');
|
|
32
|
+
}
|
|
33
|
+
return customer;
|
|
34
|
+
})
|
|
35
|
+
}),
|
|
36
|
+
customers: t.field({
|
|
37
|
+
type: 'StripeCustomers',
|
|
38
|
+
args: {
|
|
39
|
+
email: t.arg.string({
|
|
40
|
+
description: "A case-sensitive filter on the list based on the customer's `email` field. The value must be a string.",
|
|
41
|
+
required: false
|
|
42
|
+
}),
|
|
43
|
+
endingBefore: t.arg.string({
|
|
44
|
+
description: 'A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.',
|
|
45
|
+
required: false
|
|
46
|
+
}),
|
|
47
|
+
limit: t.arg.int({
|
|
48
|
+
description: 'A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.',
|
|
49
|
+
required: false
|
|
50
|
+
}),
|
|
51
|
+
startingAfter: t.arg.string({
|
|
52
|
+
description: 'A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.',
|
|
53
|
+
required: false
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
resolve: (_parent, { email, endingBefore, limit, startingAfter }, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
+
const { isAllowed } = context;
|
|
58
|
+
const customers = yield utils_1.stripe.customers.list({
|
|
59
|
+
email: email || undefined,
|
|
60
|
+
limit: limit || undefined,
|
|
61
|
+
ending_before: endingBefore || undefined,
|
|
62
|
+
starting_after: startingAfter || undefined
|
|
63
|
+
});
|
|
64
|
+
const customerData = customers.data.filter((customer) => isAllowed(customer.id, context));
|
|
65
|
+
customers.data = customerData;
|
|
66
|
+
return customers;
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
builder_1.builder.objectType('StripeMutations', {
|
|
72
|
+
fields: (t) => ({
|
|
73
|
+
createBillingPortalSession: t.field({
|
|
74
|
+
type: 'StripeBillingPortalSession',
|
|
75
|
+
args: {
|
|
76
|
+
customer: t.arg.string({
|
|
77
|
+
required: true
|
|
78
|
+
}),
|
|
79
|
+
configuration: t.arg.string({
|
|
80
|
+
required: false
|
|
81
|
+
}),
|
|
82
|
+
locale: t.arg.string({
|
|
83
|
+
required: false
|
|
84
|
+
}),
|
|
85
|
+
returnUrl: t.arg.string({
|
|
86
|
+
required: false
|
|
87
|
+
})
|
|
88
|
+
},
|
|
89
|
+
resolve: (_, { customer, configuration, locale, returnUrl }, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
|
+
const { isAllowed } = context;
|
|
91
|
+
if (!isAllowed(customer, context)) {
|
|
92
|
+
throw new node_1.GraphQLYogaError('Not allowed');
|
|
93
|
+
}
|
|
94
|
+
const session = yield utils_1.stripe.billingPortal.sessions.create({
|
|
95
|
+
customer,
|
|
96
|
+
configuration: configuration || undefined,
|
|
97
|
+
locale: locale || undefined,
|
|
98
|
+
return_url: returnUrl || undefined
|
|
99
|
+
});
|
|
100
|
+
return session;
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
builder_1.builder.queryFields((t) => ({
|
|
106
|
+
stripe: t.field({
|
|
107
|
+
type: 'Stripe',
|
|
108
|
+
resolve: () => ({})
|
|
109
|
+
})
|
|
110
|
+
}));
|
|
111
|
+
builder_1.builder.mutationFields((t) => ({
|
|
112
|
+
stripe: t.field({
|
|
113
|
+
type: 'StripeMutations',
|
|
114
|
+
resolve: () => ({})
|
|
115
|
+
})
|
|
116
|
+
}));
|
|
117
|
+
//# sourceMappingURL=stripe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../src/schema/stripe.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,6CAAqD;AAErD,wCAAoC;AACpC,oCAAiC;AAEjC,iBAAO,CAAC,UAAU,CAAC,QA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"","sources":["../../src/schema/subscription-automatic-tax.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeSubscriptionAutomaticTax', {
|
|
5
|
+
description: '',
|
|
6
|
+
fields: (t) => ({
|
|
7
|
+
enabled: t.exposeBoolean('enabled')
|
|
8
|
+
})
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=subscription-automatic-tax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-automatic-tax.js","sourceRoot":"","sources":["../../src/schema/subscription-automatic-tax.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,gCAAgC,EAAE;IACnD,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,OAAO,EAAE,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC;KACpC,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-billing-thresholds.d.ts","sourceRoot":"","sources":["../../src/schema/subscription-billing-thresholds.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeSubscriptionBillingThresholds', {
|
|
5
|
+
description: '',
|
|
6
|
+
fields: (t) => ({
|
|
7
|
+
amountGte: t.exposeInt('amount_gte', {
|
|
8
|
+
nullable: true
|
|
9
|
+
}),
|
|
10
|
+
resetBillingCycleAnchor: t.exposeBoolean('reset_billing_cycle_anchor', {
|
|
11
|
+
nullable: true
|
|
12
|
+
})
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=subscription-billing-thresholds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-billing-thresholds.js","sourceRoot":"","sources":["../../src/schema/subscription-billing-thresholds.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,qCAAqC,EAAE;IACxD,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE;YACnC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,uBAAuB,EAAE,CAAC,CAAC,aAAa,CAAC,4BAA4B,EAAE;YACrE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-item-billing-thresholds.d.ts","sourceRoot":"","sources":["../../src/schema/subscription-item-billing-thresholds.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeSubscriptionItemBillingThresholds', {
|
|
5
|
+
description: '',
|
|
6
|
+
fields: (t) => ({
|
|
7
|
+
usageGte: t.exposeInt('usage_gte', {
|
|
8
|
+
nullable: true
|
|
9
|
+
})
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=subscription-item-billing-thresholds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-item-billing-thresholds.js","sourceRoot":"","sources":["../../src/schema/subscription-item-billing-thresholds.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,yCAAyC,EAAE;IAC5D,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-item.d.ts","sourceRoot":"","sources":["../../src/schema/subscription-item.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeSubscriptionItem', {
|
|
5
|
+
description: '',
|
|
6
|
+
fields: (t) => ({
|
|
7
|
+
id: t.exposeString('id'),
|
|
8
|
+
object: t.exposeString('object'),
|
|
9
|
+
billingThresholds: t.expose('billing_thresholds', {
|
|
10
|
+
type: 'StripeSubscriptionItemBillingThresholds',
|
|
11
|
+
nullable: true
|
|
12
|
+
}),
|
|
13
|
+
created: t.exposeInt('created'),
|
|
14
|
+
metadata: t.expose('metadata', {
|
|
15
|
+
type: 'JSON'
|
|
16
|
+
}),
|
|
17
|
+
plan: t.expose('plan', {
|
|
18
|
+
type: 'StripePlan'
|
|
19
|
+
}),
|
|
20
|
+
price: t.expose('price', {
|
|
21
|
+
type: 'StripePrice'
|
|
22
|
+
}),
|
|
23
|
+
quantity: t.exposeInt('quantity', {
|
|
24
|
+
nullable: true
|
|
25
|
+
}),
|
|
26
|
+
subscription: t.exposeString('subscription')
|
|
27
|
+
// todo:
|
|
28
|
+
// taxRates: t.exposeStringList('tax_rates', {
|
|
29
|
+
// nullable: true
|
|
30
|
+
// })
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=subscription-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-item.js","sourceRoot":"","sources":["../../src/schema/subscription-item.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,wBAAwB,EAAE;IAC3C,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC;QACxB,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC;QAChC,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,oBAAoB,EAAE;YAChD,IAAI,EAAE,yCAAyC;YAC/C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;QAC/B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE;YAC7B,IAAI,EAAE,MAAM;SACb,CAAC;QACF,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE;YACrB,IAAI,EAAE,YAAY;SACnB,CAAC;QACF,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE;YACvB,IAAI,EAAE,aAAa;SACpB,CAAC;QACF,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,EAAE;YAChC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC,cAAc,CAAC;QAC5C,QAAQ;QACR,8CAA8C;QAC9C,mBAAmB;QACnB,KAAK;KACN,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-items.d.ts","sourceRoot":"","sources":["../../src/schema/subscription-items.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeSubscriptionItems', {
|
|
5
|
+
fields: (t) => ({
|
|
6
|
+
object: t.exposeString('object'),
|
|
7
|
+
url: t.exposeString('url'),
|
|
8
|
+
hasMore: t.exposeBoolean('has_more'),
|
|
9
|
+
data: t.expose('data', {
|
|
10
|
+
type: ['StripeSubscriptionItem'],
|
|
11
|
+
nullable: false
|
|
12
|
+
})
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=subscription-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-items.js","sourceRoot":"","sources":["../../src/schema/subscription-items.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE;IAC5C,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC;QAChC,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC;QAC1B,OAAO,EAAE,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC;QACpC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE;YACrB,IAAI,EAAE,CAAC,wBAAwB,CAAC;YAChC,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-pause-collection.d.ts","sourceRoot":"","sources":["../../src/schema/subscription-pause-collection.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeSubscriptionPauseCollection', {
|
|
5
|
+
description: '',
|
|
6
|
+
fields: (t) => ({
|
|
7
|
+
behavior: t.exposeString('behavior', {
|
|
8
|
+
description: 'The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.'
|
|
9
|
+
}),
|
|
10
|
+
resumesAt: t.exposeInt('resumes_at', {
|
|
11
|
+
description: 'The time after which the subscription will resume collecting payments.',
|
|
12
|
+
nullable: true
|
|
13
|
+
})
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=subscription-pause-collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription-pause-collection.js","sourceRoot":"","sources":["../../src/schema/subscription-pause-collection.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,mCAAmC,EAAE;IACtD,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,QAAQ,EAAE,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE;YACnC,WAAW,EACT,8HAA8H;SACjI,CAAC;QACF,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE;YACnC,WAAW,EAAE,wEAAwE;YACrF,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/schema/subscription.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,134 @@
|
|
|
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('StripeSubscription', {
|
|
15
|
+
description: '',
|
|
16
|
+
fields: (t) => ({
|
|
17
|
+
id: t.exposeString('id'),
|
|
18
|
+
object: t.exposeString('object'),
|
|
19
|
+
// todo: application
|
|
20
|
+
applicationFeePercent: t.exposeFloat('application_fee_percent', {
|
|
21
|
+
nullable: true
|
|
22
|
+
}),
|
|
23
|
+
automaticTax: t.expose('automatic_tax', {
|
|
24
|
+
type: 'StripeSubscriptionAutomaticTax'
|
|
25
|
+
}),
|
|
26
|
+
billingCycleAnchor: t.exposeInt('billing_cycle_anchor'),
|
|
27
|
+
billingThresholds: t.expose('billing_thresholds', {
|
|
28
|
+
type: 'StripeSubscriptionBillingThresholds',
|
|
29
|
+
nullable: true
|
|
30
|
+
}),
|
|
31
|
+
cancelAt: t.exposeInt('cancel_at', {
|
|
32
|
+
nullable: true
|
|
33
|
+
}),
|
|
34
|
+
cancelAtPeriodEnd: t.exposeBoolean('cancel_at_period_end'),
|
|
35
|
+
canceledAt: t.exposeInt('canceled_at', {
|
|
36
|
+
nullable: true
|
|
37
|
+
}),
|
|
38
|
+
collectionMethods: t.exposeString('collection_method'),
|
|
39
|
+
created: t.exposeInt('created'),
|
|
40
|
+
currency: t.exposeString('currency'),
|
|
41
|
+
currentPeriodEnd: t.exposeInt('current_period_end'),
|
|
42
|
+
currentPeriodStart: t.exposeInt('current_period_start'),
|
|
43
|
+
customer: t.exposeString('customer'),
|
|
44
|
+
daysUntilDue: t.exposeInt('days_until_due', {
|
|
45
|
+
nullable: true
|
|
46
|
+
}),
|
|
47
|
+
defaultPaymentMethod: t.field({
|
|
48
|
+
type: 'StripePaymentMethod',
|
|
49
|
+
nullable: true,
|
|
50
|
+
resolve: (subscription) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
+
const { default_payment_method } = subscription;
|
|
52
|
+
if (!default_payment_method) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const paymentMethod = yield utils_1.stripe.paymentMethods.retrieve(default_payment_method);
|
|
56
|
+
if (!paymentMethod) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return paymentMethod;
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
// todo: default source
|
|
63
|
+
defaultTaxRates: t.expose('default_tax_rates', {
|
|
64
|
+
type: ['StripeTaxRate'],
|
|
65
|
+
nullable: true
|
|
66
|
+
}),
|
|
67
|
+
description: t.exposeString('description', {
|
|
68
|
+
nullable: true
|
|
69
|
+
}),
|
|
70
|
+
// TODO: discount
|
|
71
|
+
endedAt: t.exposeInt('ended_at', {
|
|
72
|
+
nullable: true
|
|
73
|
+
}),
|
|
74
|
+
items: t.expose('items', {
|
|
75
|
+
type: 'StripeSubscriptionItems'
|
|
76
|
+
}),
|
|
77
|
+
latestInvoice: t.field({
|
|
78
|
+
type: 'StripeInvoice',
|
|
79
|
+
nullable: true,
|
|
80
|
+
resolve: (subscription) => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
+
const { latest_invoice } = subscription;
|
|
82
|
+
if (!latest_invoice) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
const invoice = yield utils_1.stripe.invoices.retrieve(latest_invoice);
|
|
86
|
+
if (!invoice) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
return invoice;
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
livemode: t.exposeBoolean('livemode'),
|
|
93
|
+
metadata: t.expose('metadata', {
|
|
94
|
+
type: 'JSON'
|
|
95
|
+
}),
|
|
96
|
+
nextPendingInvoiceItemInvoice: t.exposeInt('next_pending_invoice_item_invoice', {
|
|
97
|
+
nullable: true
|
|
98
|
+
}),
|
|
99
|
+
pauseCollection: t.expose('pause_collection', {
|
|
100
|
+
type: 'StripeSubscriptionPauseCollection',
|
|
101
|
+
nullable: true
|
|
102
|
+
}),
|
|
103
|
+
// todo: payment settings
|
|
104
|
+
// todo: pending_invoice_item_interval
|
|
105
|
+
// todo: pending_setup_intent
|
|
106
|
+
// todo: pending_update
|
|
107
|
+
// todo: schedule
|
|
108
|
+
startDate: t.exposeInt('start_date'),
|
|
109
|
+
status: t.exposeString('status'),
|
|
110
|
+
testClock: t.field({
|
|
111
|
+
type: 'StripeTestClock',
|
|
112
|
+
nullable: true,
|
|
113
|
+
resolve: (subscription) => __awaiter(void 0, void 0, void 0, function* () {
|
|
114
|
+
const { test_clock } = subscription;
|
|
115
|
+
if (!test_clock) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
const testClock = yield utils_1.stripe.testHelpers.testClocks.retrieve(test_clock);
|
|
119
|
+
if (!testClock) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
return testClock;
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
// todo: transfer data
|
|
126
|
+
trialEnd: t.exposeInt('trial_end', {
|
|
127
|
+
nullable: true
|
|
128
|
+
}),
|
|
129
|
+
trialStart: t.exposeInt('trial_start', {
|
|
130
|
+
nullable: true
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../src/schema/subscription.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAAoC;AAEpC,oCAAiC;AAEjC,iBAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE;IACvC,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC;QACxB,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC;QAChC,oBA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","sources":["../../src/schema/subscriptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeSubscriptions', {
|
|
5
|
+
fields: (t) => ({
|
|
6
|
+
object: t.exposeString('object'),
|
|
7
|
+
url: t.exposeString('url'),
|
|
8
|
+
hasMore: t.exposeBoolean('has_more'),
|
|
9
|
+
data: t.expose('data', {
|
|
10
|
+
type: ['StripeSubscription'],
|
|
11
|
+
nullable: false
|
|
12
|
+
})
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/schema/subscriptions.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,qBAAqB,EAAE;IACxC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC;QAChC,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC;QAC1B,OAAO,EAAE,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC;QACpC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE;YACrB,IAAI,EAAE,CAAC,oBAAoB,CAAC;YAC5B,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax-rate.d.ts","sourceRoot":"","sources":["../../src/schema/tax-rate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeTaxRate', {
|
|
5
|
+
description: 'Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.',
|
|
6
|
+
fields: (t) => ({
|
|
7
|
+
id: t.exposeString('id', {
|
|
8
|
+
description: 'Unique identifier for the object.'
|
|
9
|
+
}),
|
|
10
|
+
object: t.exposeString('object', {
|
|
11
|
+
description: `String representing the object's type. Objects of the same type share the same value.`
|
|
12
|
+
}),
|
|
13
|
+
active: t.exposeBoolean('active', {
|
|
14
|
+
description: 'Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.'
|
|
15
|
+
}),
|
|
16
|
+
country: t.exposeString('country', {
|
|
17
|
+
description: 'Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).',
|
|
18
|
+
nullable: true
|
|
19
|
+
}),
|
|
20
|
+
created: t.exposeInt('created', {
|
|
21
|
+
description: 'Time at which the object was created. Measured in seconds since the Unix epoch.'
|
|
22
|
+
}),
|
|
23
|
+
description: t.exposeString('description', {
|
|
24
|
+
description: 'An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.',
|
|
25
|
+
nullable: true
|
|
26
|
+
}),
|
|
27
|
+
displayName: t.exposeString('display_name', {
|
|
28
|
+
description: 'The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.'
|
|
29
|
+
}),
|
|
30
|
+
inclusive: t.exposeBoolean('inclusive', {
|
|
31
|
+
description: 'This specifies if the tax rate is inclusive or exclusive.'
|
|
32
|
+
}),
|
|
33
|
+
jurisdiction: t.exposeString('jurisdiction', {
|
|
34
|
+
description: 'The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.',
|
|
35
|
+
nullable: true
|
|
36
|
+
}),
|
|
37
|
+
livemode: t.exposeBoolean('livemode', {
|
|
38
|
+
description: 'Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.'
|
|
39
|
+
}),
|
|
40
|
+
metadata: t.expose('metadata', {
|
|
41
|
+
description: 'Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.',
|
|
42
|
+
type: 'JSON',
|
|
43
|
+
nullable: true
|
|
44
|
+
}),
|
|
45
|
+
percentage: t.exposeFloat('percentage', {
|
|
46
|
+
description: 'This represents the tax rate percent out of 100.'
|
|
47
|
+
}),
|
|
48
|
+
state: t.exposeString('state', {
|
|
49
|
+
description: '[ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.',
|
|
50
|
+
nullable: true
|
|
51
|
+
}),
|
|
52
|
+
taxType: t.exposeString('tax_type', {
|
|
53
|
+
description: 'The high-level tax type, such as `vat` or `sales_tax`.',
|
|
54
|
+
nullable: true
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=tax-rate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax-rate.js","sourceRoot":"","sources":["../../src/schema/tax-rate.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,eAAe,EAAE;IAClC,WAAW,EACT,qRAAqR;IACvR,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE;YACvB,WAAW,EAAE,mCAAmC;SACjD,CAAC;QACF,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE;YAC/B,WAAW,EAAE,uFAAuF;SACrG,CAAC;QACF,MAAM,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE;YA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AC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-clock.d.ts","sourceRoot":"","sources":["../../src/schema/test-clock.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const builder_1 = require("../builder");
|
|
4
|
+
builder_1.builder.objectType('StripeTestClock', {
|
|
5
|
+
description: '',
|
|
6
|
+
fields: (t) => ({
|
|
7
|
+
id: t.exposeString('id'),
|
|
8
|
+
object: t.exposeString('object'),
|
|
9
|
+
created: t.exposeInt('created'),
|
|
10
|
+
deletesAfter: t.exposeInt('deletes_after'),
|
|
11
|
+
frozenTime: t.exposeInt('frozen_time'),
|
|
12
|
+
livemode: t.exposeBoolean('livemode'),
|
|
13
|
+
name: t.exposeString('name', {
|
|
14
|
+
nullable: true
|
|
15
|
+
}),
|
|
16
|
+
status: t.exposeString('status')
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=test-clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-clock.js","sourceRoot":"","sources":["../../src/schema/test-clock.ts"],"names":[],"mappings":";;AAAA,wCAAoC;AAEpC,iBAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE;IACpC,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC;QACxB,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC;QAChC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;QAC/B,YAAY,EAAE,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;QAC1C,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC;QACtC,QAAQ,EAAE,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC;QACrC,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC;KACjC,CAAC;CACH,CAAC,CAAA"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { schema } from './schema';
|
|
3
|
+
import { Context, CreateServerProps } from './types';
|
|
4
|
+
declare const createStripeGraphQLServer: (params?: CreateServerProps) => import("@graphql-yoga/node").YogaNodeServerInstance<{
|
|
5
|
+
req: import("http").IncomingMessage;
|
|
6
|
+
res: import("http").ServerResponse;
|
|
7
|
+
}, Context, {}>;
|
|
8
|
+
export { createStripeGraphQLServer, schema };
|
|
9
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGpD,QAAA,MAAM,yBAAyB,YAAa,iBAAiB;;;eA6C5D,CAAA;AAED,OAAO,EAAE,yBAAyB,EAAE,MAAM,EAAE,CAAA"}
|