Skip to content

Commit f544ccc

Browse files
chore: break long lines in snippets into multiline
1 parent e6d2b66 commit f544ccc

File tree

13 files changed

+200
-33
lines changed

13 files changed

+200
-33
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ const client = new Orb({
4444
apiKey: process.env['ORB_API_KEY'], // This is the default and can be omitted
4545
});
4646

47-
const params: Orb.CustomerCreateParams = { email: 'example-customer@withorb.com', name: 'My Customer' };
47+
const params: Orb.CustomerCreateParams = {
48+
email: 'example-customer@withorb.com',
49+
name: 'My Customer',
50+
};
4851
const customer: Orb.Customer = await client.customers.create(params);
4952
```
5053

tests/api-resources/beta/beta.test.ts

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ describe('resource beta', () => {
3232
applies_to_item_ids: ['item_1', 'item_2'],
3333
applies_to_price_ids: ['price_1', 'price_2'],
3434
currency: 'currency',
35-
filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }],
35+
filters: [
36+
{
37+
field: 'price_id',
38+
operator: 'includes',
39+
values: ['string'],
40+
},
41+
],
3642
is_invoice_level: true,
3743
price_type: 'usage',
3844
},
@@ -47,7 +53,13 @@ describe('resource beta', () => {
4753
currency: 'USD',
4854
custom_expiration: { duration: 0, duration_unit: 'day' },
4955
expires_at_end_of_cadence: true,
50-
filters: [{ field: 'item_id', operator: 'includes', values: ['string'] }],
56+
filters: [
57+
{
58+
field: 'item_id',
59+
operator: 'includes',
60+
values: ['string'],
61+
},
62+
],
5163
item_id: 'item_id',
5264
per_unit_cost_basis: 'per_unit_cost_basis',
5365
},
@@ -92,7 +104,13 @@ describe('resource beta', () => {
92104
applies_to_item_ids: ['item_1', 'item_2'],
93105
applies_to_price_ids: ['price_1', 'price_2'],
94106
currency: 'currency',
95-
filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }],
107+
filters: [
108+
{
109+
field: 'price_id',
110+
operator: 'includes',
111+
values: ['string'],
112+
},
113+
],
96114
is_invoice_level: true,
97115
price_type: 'usage',
98116
},
@@ -109,7 +127,13 @@ describe('resource beta', () => {
109127
currency: 'USD',
110128
custom_expiration: { duration: 0, duration_unit: 'day' },
111129
expires_at_end_of_cadence: true,
112-
filters: [{ field: 'item_id', operator: 'includes', values: ['string'] }],
130+
filters: [
131+
{
132+
field: 'item_id',
133+
operator: 'includes',
134+
values: ['string'],
135+
},
136+
],
113137
item_id: 'item_id',
114138
per_unit_cost_basis: 'per_unit_cost_basis',
115139
},

tests/api-resources/beta/external-plan-id.test.ts

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ describe('resource externalPlanId', () => {
3232
applies_to_item_ids: ['item_1', 'item_2'],
3333
applies_to_price_ids: ['price_1', 'price_2'],
3434
currency: 'currency',
35-
filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }],
35+
filters: [
36+
{
37+
field: 'price_id',
38+
operator: 'includes',
39+
values: ['string'],
40+
},
41+
],
3642
is_invoice_level: true,
3743
price_type: 'usage',
3844
},
@@ -47,7 +53,13 @@ describe('resource externalPlanId', () => {
4753
currency: 'USD',
4854
custom_expiration: { duration: 0, duration_unit: 'day' },
4955
expires_at_end_of_cadence: true,
50-
filters: [{ field: 'item_id', operator: 'includes', values: ['string'] }],
56+
filters: [
57+
{
58+
field: 'item_id',
59+
operator: 'includes',
60+
values: ['string'],
61+
},
62+
],
5163
item_id: 'item_id',
5264
per_unit_cost_basis: 'per_unit_cost_basis',
5365
},
@@ -92,7 +104,13 @@ describe('resource externalPlanId', () => {
92104
applies_to_item_ids: ['item_1', 'item_2'],
93105
applies_to_price_ids: ['price_1', 'price_2'],
94106
currency: 'currency',
95-
filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }],
107+
filters: [
108+
{
109+
field: 'price_id',
110+
operator: 'includes',
111+
values: ['string'],
112+
},
113+
],
96114
is_invoice_level: true,
97115
price_type: 'usage',
98116
},
@@ -109,7 +127,13 @@ describe('resource externalPlanId', () => {
109127
currency: 'USD',
110128
custom_expiration: { duration: 0, duration_unit: 'day' },
111129
expires_at_end_of_cadence: true,
112-
filters: [{ field: 'item_id', operator: 'includes', values: ['string'] }],
130+
filters: [
131+
{
132+
field: 'item_id',
133+
operator: 'includes',
134+
values: ['string'],
135+
},
136+
],
113137
item_id: 'item_id',
114138
per_unit_cost_basis: 'per_unit_cost_basis',
115139
},

tests/api-resources/coupons/coupons.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ describe('resource coupons', () => {
5454
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
5555
await expect(
5656
client.coupons.list(
57-
{ cursor: 'cursor', limit: 1, redemption_code: 'redemption_code', show_archived: true },
57+
{
58+
cursor: 'cursor',
59+
limit: 1,
60+
redemption_code: 'redemption_code',
61+
show_archived: true,
62+
},
5863
{ path: '/_stainless_unknown_path' },
5964
),
6065
).rejects.toThrow(Orb.NotFoundError);

tests/api-resources/customers/credits/credits.test.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ describe('resource credits', () => {
3232
await expect(
3333
client.customers.credits.list(
3434
'customer_id',
35-
{ currency: 'currency', cursor: 'cursor', include_all_blocks: true, limit: 1 },
35+
{
36+
currency: 'currency',
37+
cursor: 'cursor',
38+
include_all_blocks: true,
39+
limit: 1,
40+
},
3641
{ path: '/_stainless_unknown_path' },
3742
),
3843
).rejects.toThrow(Orb.NotFoundError);
@@ -61,7 +66,12 @@ describe('resource credits', () => {
6166
await expect(
6267
client.customers.credits.listByExternalId(
6368
'external_customer_id',
64-
{ currency: 'currency', cursor: 'cursor', include_all_blocks: true, limit: 1 },
69+
{
70+
currency: 'currency',
71+
cursor: 'cursor',
72+
include_all_blocks: true,
73+
limit: 1,
74+
},
6575
{ path: '/_stainless_unknown_path' },
6676
),
6777
).rejects.toThrow(Orb.NotFoundError);

tests/api-resources/customers/credits/ledger.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ describe('resource ledger', () => {
7171
description: 'description',
7272
effective_date: '2019-12-27T18:11:19.117Z',
7373
expiry_date: '2019-12-27T18:11:19.117Z',
74-
filters: [{ field: 'item_id', operator: 'includes', values: ['string'] }],
74+
filters: [
75+
{
76+
field: 'item_id',
77+
operator: 'includes',
78+
values: ['string'],
79+
},
80+
],
7581
invoice_settings: {
7682
auto_collection: true,
7783
custom_due_date: '2019-12-27',
@@ -108,7 +114,13 @@ describe('resource ledger', () => {
108114
description: 'description',
109115
effective_date: '2019-12-27T18:11:19.117Z',
110116
expiry_date: '2019-12-27T18:11:19.117Z',
111-
filters: [{ field: 'item_id', operator: 'includes', values: ['string'] }],
117+
filters: [
118+
{
119+
field: 'item_id',
120+
operator: 'includes',
121+
values: ['string'],
122+
},
123+
],
112124
invoice_settings: {
113125
auto_collection: true,
114126
custom_due_date: '2019-12-27',

tests/api-resources/customers/customers.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ describe('resource customers', () => {
6666
automatic_tax_enabled: true,
6767
tax_exemption_code: 'tax_exemption_code',
6868
},
69-
tax_id: { country: 'AD', type: 'ad_nrt', value: 'value' },
69+
tax_id: {
70+
country: 'AD',
71+
type: 'ad_nrt',
72+
value: 'value',
73+
},
7074
timezone: 'timezone',
7175
});
7276
});

tests/api-resources/invoices.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ describe('resource invoices', () => {
5454
discount_type: 'percentage',
5555
percentage_discount: 0.15,
5656
applies_to_price_ids: ['h74gfhdjvn7ujokd', '7hfgtgjnbvc3ujkl'],
57-
filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }],
57+
filters: [
58+
{
59+
field: 'price_id',
60+
operator: 'includes',
61+
values: ['string'],
62+
},
63+
],
5864
reason: 'reason',
5965
},
6066
due_date: '2023-09-22',

tests/api-resources/items.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ describe('resource items', () => {
2121
});
2222

2323
test('create: required and optional params', async () => {
24-
const response = await client.items.create({ name: 'API requests', metadata: { foo: 'string' } });
24+
const response = await client.items.create({
25+
name: 'API requests',
26+
metadata: { foo: 'string' },
27+
});
2528
});
2629

2730
test('update', async () => {

tests/api-resources/plans/plans.test.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const client = new Orb({
1010

1111
describe('resource plans', () => {
1212
test('create: only required params', async () => {
13-
const responsePromise = client.plans.create({ currency: 'currency', name: 'name', prices: [{}] });
13+
const responsePromise = client.plans.create({
14+
currency: 'currency',
15+
name: 'name',
16+
prices: [{}],
17+
});
1418
const rawResponse = await responsePromise.asResponse();
1519
expect(rawResponse).toBeInstanceOf(Response);
1620
const response = await responsePromise;
@@ -32,7 +36,13 @@ describe('resource plans', () => {
3236
currency: 'USD',
3337
custom_expiration: { duration: 0, duration_unit: 'day' },
3438
expires_at_end_of_cadence: true,
35-
filters: [{ field: 'item_id', operator: 'includes', values: ['string'] }],
39+
filters: [
40+
{
41+
field: 'item_id',
42+
operator: 'includes',
43+
values: ['string'],
44+
},
45+
],
3646
item_id: 'item_id',
3747
per_unit_cost_basis: 'per_unit_cost_basis',
3848
},
@@ -75,7 +85,13 @@ describe('resource plans', () => {
7585
applies_to_item_ids: ['item_1', 'item_2'],
7686
applies_to_price_ids: ['price_1', 'price_2'],
7787
currency: 'currency',
78-
filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }],
88+
filters: [
89+
{
90+
field: 'price_id',
91+
operator: 'includes',
92+
values: ['string'],
93+
},
94+
],
7995
is_invoice_level: true,
8096
price_type: 'usage',
8197
},
@@ -87,7 +103,12 @@ describe('resource plans', () => {
87103
metadata: { foo: 'string' },
88104
net_terms: 0,
89105
plan_phases: [
90-
{ order: 0, align_billing_with_phase_start_date: true, duration: 1, duration_unit: 'daily' },
106+
{
107+
order: 0,
108+
align_billing_with_phase_start_date: true,
109+
duration: 1,
110+
duration_unit: 'daily',
111+
},
91112
],
92113
status: 'active',
93114
});

0 commit comments

Comments
 (0)