@cjavdev/believe 0.15.1 → 0.17.0

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 (44) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/client.d.mts +6 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/biscuits.d.mts +1 -1
  12. package/resources/biscuits.d.mts.map +1 -1
  13. package/resources/biscuits.d.ts +1 -1
  14. package/resources/biscuits.d.ts.map +1 -1
  15. package/resources/index.d.mts +1 -0
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +1 -0
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +3 -1
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +1 -0
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/quotes.d.mts +1 -1
  24. package/resources/quotes.d.mts.map +1 -1
  25. package/resources/quotes.d.ts +1 -1
  26. package/resources/quotes.d.ts.map +1 -1
  27. package/resources/ticket-sales.d.mts +224 -0
  28. package/resources/ticket-sales.d.mts.map +1 -0
  29. package/resources/ticket-sales.d.ts +224 -0
  30. package/resources/ticket-sales.d.ts.map +1 -0
  31. package/resources/ticket-sales.js +92 -0
  32. package/resources/ticket-sales.js.map +1 -0
  33. package/resources/ticket-sales.mjs +88 -0
  34. package/resources/ticket-sales.mjs.map +1 -0
  35. package/src/client.ts +24 -0
  36. package/src/resources/biscuits.ts +1 -1
  37. package/src/resources/index.ts +9 -0
  38. package/src/resources/quotes.ts +5 -1
  39. package/src/resources/ticket-sales.ts +303 -0
  40. package/src/version.ts +1 -1
  41. package/version.d.mts +1 -1
  42. package/version.d.ts +1 -1
  43. package/version.js +1 -1
  44. package/version.mjs +1 -1
@@ -0,0 +1,88 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { SkipLimitPage } from "../core/pagination.mjs";
4
+ import { buildHeaders } from "../internal/headers.mjs";
5
+ import { path } from "../internal/utils/path.mjs";
6
+ /**
7
+ * Ticket sales with 300 records for practicing pagination, filtering, and financial data
8
+ */
9
+ export class TicketSales extends APIResource {
10
+ /**
11
+ * Record a new ticket sale.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const ticketSale = await client.ticketSales.create({
16
+ * buyer_name: 'Mae Green',
17
+ * currency: 'GBP',
18
+ * discount: '9.00',
19
+ * match_id: 'match-001',
20
+ * purchase_method: 'online',
21
+ * quantity: 2,
22
+ * subtotal: '90.00',
23
+ * tax: '16.20',
24
+ * total: '97.20',
25
+ * unit_price: '45.00',
26
+ * });
27
+ * ```
28
+ */
29
+ create(body, options) {
30
+ return this._client.post('/ticket-sales', { body, ...options });
31
+ }
32
+ /**
33
+ * Retrieve detailed information about a specific ticket sale.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const ticketSale = await client.ticketSales.retrieve(
38
+ * 'ticket_sale_id',
39
+ * );
40
+ * ```
41
+ */
42
+ retrieve(ticketSaleID, options) {
43
+ return this._client.get(path `/ticket-sales/${ticketSaleID}`, options);
44
+ }
45
+ /**
46
+ * Update specific fields of an existing ticket sale.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const ticketSale = await client.ticketSales.update(
51
+ * 'ticket_sale_id',
52
+ * );
53
+ * ```
54
+ */
55
+ update(ticketSaleID, body, options) {
56
+ return this._client.patch(path `/ticket-sales/${ticketSaleID}`, { body, ...options });
57
+ }
58
+ /**
59
+ * Get a paginated list of all ticket sales with optional filtering. With 300
60
+ * records, this endpoint is ideal for practicing pagination.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * // Automatically fetches more pages as needed.
65
+ * for await (const ticketSale of client.ticketSales.list()) {
66
+ * // ...
67
+ * }
68
+ * ```
69
+ */
70
+ list(query = {}, options) {
71
+ return this._client.getAPIList('/ticket-sales', (SkipLimitPage), { query, ...options });
72
+ }
73
+ /**
74
+ * Remove a ticket sale from the database.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * await client.ticketSales.delete('ticket_sale_id');
79
+ * ```
80
+ */
81
+ delete(ticketSaleID, options) {
82
+ return this._client.delete(path `/ticket-sales/${ticketSaleID}`, {
83
+ ...options,
84
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
85
+ });
86
+ }
87
+ }
88
+ //# sourceMappingURL=ticket-sales.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticket-sales.mjs","sourceRoot":"","sources":["../src/resources/ticket-sales.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAe,aAAa,EAA4B;OACxD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,YAAoB,EACpB,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,iBAAiB,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,aAAyB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,YAAoB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,iBAAiB,YAAY,EAAE,EAAE;YAC9D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -92,6 +92,15 @@ import {
92
92
  TeamMemberUpdateResponse,
93
93
  TeamMembers,
94
94
  } from './resources/team-members';
95
+ import {
96
+ PurchaseMethod,
97
+ TicketSale,
98
+ TicketSaleCreateParams,
99
+ TicketSaleListParams,
100
+ TicketSaleUpdateParams,
101
+ TicketSales,
102
+ TicketSalesSkipLimitPage,
103
+ } from './resources/ticket-sales';
95
104
  import { GetWelcomeResponse } from './resources/top-level';
96
105
  import { Version, VersionRetrieveResponse } from './resources/version';
97
106
  import {
@@ -936,6 +945,10 @@ export class Believe {
936
945
  * Register webhook endpoints and trigger events for testing
937
946
  */
938
947
  webhooks: API.Webhooks = new API.Webhooks(this);
948
+ /**
949
+ * Ticket sales with 300 records for practicing pagination, filtering, and financial data
950
+ */
951
+ ticketSales: API.TicketSales = new API.TicketSales(this);
939
952
  health: API.Health = new API.Health(this);
940
953
  version: API.Version = new API.Version(this);
941
954
  client: API.Client = new API.Client(this);
@@ -956,6 +969,7 @@ Believe.PepTalk = PepTalk;
956
969
  Believe.Stream = Stream;
957
970
  Believe.TeamMembers = TeamMembers;
958
971
  Believe.Webhooks = Webhooks;
972
+ Believe.TicketSales = TicketSales;
959
973
  Believe.Health = Health;
960
974
  Believe.Version = Version;
961
975
  Believe.Client = Client;
@@ -1121,6 +1135,16 @@ export declare namespace Believe {
1121
1135
  type WebhookTriggerEventParams as WebhookTriggerEventParams,
1122
1136
  };
1123
1137
 
1138
+ export {
1139
+ TicketSales as TicketSales,
1140
+ type PurchaseMethod as PurchaseMethod,
1141
+ type TicketSale as TicketSale,
1142
+ type TicketSalesSkipLimitPage as TicketSalesSkipLimitPage,
1143
+ type TicketSaleCreateParams as TicketSaleCreateParams,
1144
+ type TicketSaleUpdateParams as TicketSaleUpdateParams,
1145
+ type TicketSaleListParams as TicketSaleListParams,
1146
+ };
1147
+
1124
1148
  export { Health as Health, type HealthCheckResponse as HealthCheckResponse };
1125
1149
 
1126
1150
  export { Version as Version, type VersionRetrieveResponse as VersionRetrieveResponse };
@@ -85,7 +85,7 @@ export interface Biscuit {
85
85
  /**
86
86
  * Type of biscuit
87
87
  */
88
- type: 'classic' | 'shortbread' | 'chocolate_chip' | 'oatmeal_raisin';
88
+ type: 'classic' | 'shortbread' | 'chocolate_chip' | 'oatmeal_raisin' | 'snickerdoodle' | 'lemon_drizzle';
89
89
 
90
90
  /**
91
91
  * How warm and fresh (1-10)
@@ -103,6 +103,15 @@ export {
103
103
  type TeamListParams,
104
104
  type TeamsSkipLimitPage,
105
105
  } from './teams/teams';
106
+ export {
107
+ TicketSales,
108
+ type PurchaseMethod,
109
+ type TicketSale,
110
+ type TicketSaleCreateParams,
111
+ type TicketSaleUpdateParams,
112
+ type TicketSaleListParams,
113
+ type TicketSalesSkipLimitPage,
114
+ } from './ticket-sales';
106
115
  export { Version, type VersionRetrieveResponse } from './version';
107
116
  export {
108
117
  Webhooks,
@@ -289,7 +289,11 @@ export type QuoteTheme =
289
289
  | 'confidence'
290
290
  | 'conflict'
291
291
  | 'honesty'
292
- | 'integrity';
292
+ | 'integrity'
293
+ | 'intimidation'
294
+ | 'ambition'
295
+ | 'narcissism'
296
+ | 'maturity';
293
297
 
294
298
  export interface QuoteCreateParams {
295
299
  /**
@@ -0,0 +1,303 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { PagePromise, SkipLimitPage, type SkipLimitPageParams } from '../core/pagination';
6
+ import { buildHeaders } from '../internal/headers';
7
+ import { RequestOptions } from '../internal/request-options';
8
+ import { path } from '../internal/utils/path';
9
+
10
+ /**
11
+ * Ticket sales with 300 records for practicing pagination, filtering, and financial data
12
+ */
13
+ export class TicketSales extends APIResource {
14
+ /**
15
+ * Record a new ticket sale.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const ticketSale = await client.ticketSales.create({
20
+ * buyer_name: 'Mae Green',
21
+ * currency: 'GBP',
22
+ * discount: '9.00',
23
+ * match_id: 'match-001',
24
+ * purchase_method: 'online',
25
+ * quantity: 2,
26
+ * subtotal: '90.00',
27
+ * tax: '16.20',
28
+ * total: '97.20',
29
+ * unit_price: '45.00',
30
+ * });
31
+ * ```
32
+ */
33
+ create(body: TicketSaleCreateParams, options?: RequestOptions): APIPromise<TicketSale> {
34
+ return this._client.post('/ticket-sales', { body, ...options });
35
+ }
36
+
37
+ /**
38
+ * Retrieve detailed information about a specific ticket sale.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const ticketSale = await client.ticketSales.retrieve(
43
+ * 'ticket_sale_id',
44
+ * );
45
+ * ```
46
+ */
47
+ retrieve(ticketSaleID: string, options?: RequestOptions): APIPromise<TicketSale> {
48
+ return this._client.get(path`/ticket-sales/${ticketSaleID}`, options);
49
+ }
50
+
51
+ /**
52
+ * Update specific fields of an existing ticket sale.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const ticketSale = await client.ticketSales.update(
57
+ * 'ticket_sale_id',
58
+ * );
59
+ * ```
60
+ */
61
+ update(
62
+ ticketSaleID: string,
63
+ body: TicketSaleUpdateParams,
64
+ options?: RequestOptions,
65
+ ): APIPromise<TicketSale> {
66
+ return this._client.patch(path`/ticket-sales/${ticketSaleID}`, { body, ...options });
67
+ }
68
+
69
+ /**
70
+ * Get a paginated list of all ticket sales with optional filtering. With 300
71
+ * records, this endpoint is ideal for practicing pagination.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * // Automatically fetches more pages as needed.
76
+ * for await (const ticketSale of client.ticketSales.list()) {
77
+ * // ...
78
+ * }
79
+ * ```
80
+ */
81
+ list(
82
+ query: TicketSaleListParams | null | undefined = {},
83
+ options?: RequestOptions,
84
+ ): PagePromise<TicketSalesSkipLimitPage, TicketSale> {
85
+ return this._client.getAPIList('/ticket-sales', SkipLimitPage<TicketSale>, { query, ...options });
86
+ }
87
+
88
+ /**
89
+ * Remove a ticket sale from the database.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * await client.ticketSales.delete('ticket_sale_id');
94
+ * ```
95
+ */
96
+ delete(ticketSaleID: string, options?: RequestOptions): APIPromise<void> {
97
+ return this._client.delete(path`/ticket-sales/${ticketSaleID}`, {
98
+ ...options,
99
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
100
+ });
101
+ }
102
+ }
103
+
104
+ export type TicketSalesSkipLimitPage = SkipLimitPage<TicketSale>;
105
+
106
+ /**
107
+ * How the ticket was purchased.
108
+ */
109
+ export type PurchaseMethod = 'online' | 'box_office' | 'will_call' | 'phone';
110
+
111
+ /**
112
+ * Full ticket sale model with ID.
113
+ */
114
+ export interface TicketSale {
115
+ /**
116
+ * Unique identifier
117
+ */
118
+ id: string;
119
+
120
+ /**
121
+ * Name of the ticket buyer
122
+ */
123
+ buyer_name: string;
124
+
125
+ /**
126
+ * Currency code (GBP, USD, or EUR)
127
+ */
128
+ currency: string;
129
+
130
+ /**
131
+ * Discount amount applied from coupon
132
+ */
133
+ discount: string;
134
+
135
+ /**
136
+ * ID of the match
137
+ */
138
+ match_id: string;
139
+
140
+ /**
141
+ * How the ticket was purchased
142
+ */
143
+ purchase_method: PurchaseMethod;
144
+
145
+ /**
146
+ * Number of tickets purchased
147
+ */
148
+ quantity: number;
149
+
150
+ /**
151
+ * Subtotal before discount and tax (unit_price \* quantity)
152
+ */
153
+ subtotal: string;
154
+
155
+ /**
156
+ * Tax amount (20% UK VAT on discounted subtotal)
157
+ */
158
+ tax: string;
159
+
160
+ /**
161
+ * Final total (subtotal - discount + tax)
162
+ */
163
+ total: string;
164
+
165
+ /**
166
+ * Price per ticket (decimal string)
167
+ */
168
+ unit_price: string;
169
+
170
+ /**
171
+ * Email of the ticket buyer
172
+ */
173
+ buyer_email?: string | null;
174
+
175
+ /**
176
+ * Coupon code applied, if any
177
+ */
178
+ coupon_code?: string | null;
179
+ }
180
+
181
+ export interface TicketSaleCreateParams {
182
+ /**
183
+ * Name of the ticket buyer
184
+ */
185
+ buyer_name: string;
186
+
187
+ /**
188
+ * Currency code (GBP, USD, or EUR)
189
+ */
190
+ currency: string;
191
+
192
+ /**
193
+ * Discount amount applied from coupon
194
+ */
195
+ discount: string;
196
+
197
+ /**
198
+ * ID of the match
199
+ */
200
+ match_id: string;
201
+
202
+ /**
203
+ * How the ticket was purchased
204
+ */
205
+ purchase_method: PurchaseMethod;
206
+
207
+ /**
208
+ * Number of tickets purchased
209
+ */
210
+ quantity: number;
211
+
212
+ /**
213
+ * Subtotal before discount and tax (unit_price \* quantity)
214
+ */
215
+ subtotal: string;
216
+
217
+ /**
218
+ * Tax amount (20% UK VAT on discounted subtotal)
219
+ */
220
+ tax: string;
221
+
222
+ /**
223
+ * Final total (subtotal - discount + tax)
224
+ */
225
+ total: string;
226
+
227
+ /**
228
+ * Price per ticket (decimal string)
229
+ */
230
+ unit_price: string;
231
+
232
+ /**
233
+ * Email of the ticket buyer
234
+ */
235
+ buyer_email?: string | null;
236
+
237
+ /**
238
+ * Coupon code applied, if any
239
+ */
240
+ coupon_code?: string | null;
241
+ }
242
+
243
+ export interface TicketSaleUpdateParams {
244
+ buyer_email?: string | null;
245
+
246
+ buyer_name?: string | null;
247
+
248
+ coupon_code?: string | null;
249
+
250
+ currency?: string | null;
251
+
252
+ discount?: string | null;
253
+
254
+ match_id?: string | null;
255
+
256
+ /**
257
+ * How the ticket was purchased.
258
+ */
259
+ purchase_method?: PurchaseMethod | null;
260
+
261
+ quantity?: number | null;
262
+
263
+ subtotal?: string | null;
264
+
265
+ tax?: string | null;
266
+
267
+ total?: string | null;
268
+
269
+ unit_price?: string | null;
270
+ }
271
+
272
+ export interface TicketSaleListParams extends SkipLimitPageParams {
273
+ /**
274
+ * Filter by coupon code (use 'none' for sales without coupons)
275
+ */
276
+ coupon_code?: string | null;
277
+
278
+ /**
279
+ * Filter by currency (GBP, USD, EUR)
280
+ */
281
+ currency?: string | null;
282
+
283
+ /**
284
+ * Filter by match ID
285
+ */
286
+ match_id?: string | null;
287
+
288
+ /**
289
+ * Filter by purchase method
290
+ */
291
+ purchase_method?: PurchaseMethod | null;
292
+ }
293
+
294
+ export declare namespace TicketSales {
295
+ export {
296
+ type PurchaseMethod as PurchaseMethod,
297
+ type TicketSale as TicketSale,
298
+ type TicketSalesSkipLimitPage as TicketSalesSkipLimitPage,
299
+ type TicketSaleCreateParams as TicketSaleCreateParams,
300
+ type TicketSaleUpdateParams as TicketSaleUpdateParams,
301
+ type TicketSaleListParams as TicketSaleListParams,
302
+ };
303
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.15.1'; // x-release-please-version
1
+ export const VERSION = '0.17.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.15.1";
1
+ export declare const VERSION = "0.17.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.15.1";
1
+ export declare const VERSION = "0.17.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.15.1'; // x-release-please-version
4
+ exports.VERSION = '0.17.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.15.1'; // x-release-please-version
1
+ export const VERSION = '0.17.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map