@snagsolutions/sdk 0.1.0-alpha.172 → 0.1.0-alpha.174

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 (97) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/index.d.mts +2 -2
  3. package/index.d.ts +2 -2
  4. package/index.d.ts.map +1 -1
  5. package/index.js.map +1 -1
  6. package/index.mjs +1 -1
  7. package/index.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/auctions/auctions.d.ts +2 -2
  10. package/resources/auctions/auctions.d.ts.map +1 -1
  11. package/resources/auctions/auctions.js.map +1 -1
  12. package/resources/auctions/auctions.mjs.map +1 -1
  13. package/resources/auctions/index.d.ts +1 -1
  14. package/resources/auctions/index.d.ts.map +1 -1
  15. package/resources/auctions/index.js.map +1 -1
  16. package/resources/auctions/index.mjs.map +1 -1
  17. package/resources/auctions/website-user-attributes/index.d.ts +2 -2
  18. package/resources/auctions/website-user-attributes/index.d.ts.map +1 -1
  19. package/resources/auctions/website-user-attributes/index.js.map +1 -1
  20. package/resources/auctions/website-user-attributes/index.mjs +1 -1
  21. package/resources/auctions/website-user-attributes/index.mjs.map +1 -1
  22. package/resources/auctions/website-user-attributes/values.d.ts +47 -1
  23. package/resources/auctions/website-user-attributes/values.d.ts.map +1 -1
  24. package/resources/auctions/website-user-attributes/values.js +14 -0
  25. package/resources/auctions/website-user-attributes/values.js.map +1 -1
  26. package/resources/auctions/website-user-attributes/values.mjs +14 -0
  27. package/resources/auctions/website-user-attributes/values.mjs.map +1 -1
  28. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +43 -3
  29. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts.map +1 -1
  30. package/resources/auctions/website-user-attributes/website-user-attributes.js +7 -0
  31. package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -1
  32. package/resources/auctions/website-user-attributes/website-user-attributes.mjs +7 -0
  33. package/resources/auctions/website-user-attributes/website-user-attributes.mjs.map +1 -1
  34. package/resources/index.d.ts +1 -1
  35. package/resources/index.d.ts.map +1 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -1
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/loyalty/index.d.ts +1 -1
  40. package/resources/loyalty/index.d.ts.map +1 -1
  41. package/resources/loyalty/index.js.map +1 -1
  42. package/resources/loyalty/index.mjs.map +1 -1
  43. package/resources/loyalty/loyalty.d.ts +2 -2
  44. package/resources/loyalty/loyalty.d.ts.map +1 -1
  45. package/resources/loyalty/loyalty.js.map +1 -1
  46. package/resources/loyalty/loyalty.mjs.map +1 -1
  47. package/resources/loyalty/rule-groups.d.ts +1 -1
  48. package/resources/loyalty/rule-groups.d.ts.map +1 -1
  49. package/resources/loyalty/rules.d.ts +22 -6
  50. package/resources/loyalty/rules.d.ts.map +1 -1
  51. package/resources/loyalty/transactions/index.d.ts +1 -1
  52. package/resources/loyalty/transactions/index.d.ts.map +1 -1
  53. package/resources/loyalty/transactions/index.js.map +1 -1
  54. package/resources/loyalty/transactions/index.mjs.map +1 -1
  55. package/resources/loyalty/transactions/transactions.d.ts +120 -2
  56. package/resources/loyalty/transactions/transactions.d.ts.map +1 -1
  57. package/resources/loyalty/transactions/transactions.js +15 -0
  58. package/resources/loyalty/transactions/transactions.js.map +1 -1
  59. package/resources/loyalty/transactions/transactions.mjs +15 -0
  60. package/resources/loyalty/transactions/transactions.mjs.map +1 -1
  61. package/resources/websites/index.d.ts +2 -2
  62. package/resources/websites/index.d.ts.map +1 -1
  63. package/resources/websites/index.js.map +1 -1
  64. package/resources/websites/index.mjs +2 -2
  65. package/resources/websites/index.mjs.map +1 -1
  66. package/resources/websites/website-collections.d.ts +90 -0
  67. package/resources/websites/website-collections.d.ts.map +1 -1
  68. package/resources/websites/website-collections.js +37 -0
  69. package/resources/websites/website-collections.js.map +1 -1
  70. package/resources/websites/website-collections.mjs +37 -0
  71. package/resources/websites/website-collections.mjs.map +1 -1
  72. package/resources/websites/websites.d.ts +105 -3
  73. package/resources/websites/websites.d.ts.map +1 -1
  74. package/resources/websites/websites.js +13 -0
  75. package/resources/websites/websites.js.map +1 -1
  76. package/resources/websites/websites.mjs +14 -1
  77. package/resources/websites/websites.mjs.map +1 -1
  78. package/src/index.ts +9 -1
  79. package/src/resources/auctions/auctions.ts +4 -0
  80. package/src/resources/auctions/index.ts +2 -0
  81. package/src/resources/auctions/website-user-attributes/index.ts +9 -1
  82. package/src/resources/auctions/website-user-attributes/values.ts +69 -1
  83. package/src/resources/auctions/website-user-attributes/website-user-attributes.ts +71 -1
  84. package/src/resources/index.ts +7 -1
  85. package/src/resources/loyalty/index.ts +2 -0
  86. package/src/resources/loyalty/loyalty.ts +4 -0
  87. package/src/resources/loyalty/rule-groups.ts +1 -0
  88. package/src/resources/loyalty/rules.ts +26 -4
  89. package/src/resources/loyalty/transactions/index.ts +2 -0
  90. package/src/resources/loyalty/transactions/transactions.ts +153 -0
  91. package/src/resources/websites/index.ts +13 -2
  92. package/src/resources/websites/website-collections.ts +183 -1
  93. package/src/resources/websites/websites.ts +141 -3
  94. package/src/version.ts +1 -1
  95. package/version.d.ts +1 -1
  96. package/version.js +1 -1
  97. package/version.mjs +1 -1
@@ -1,9 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../../resource';
4
+ import { isRequestOptions } from '../../../core';
4
5
  import * as Core from '../../../core';
5
6
  import * as ValuesAPI from './values';
6
- import { ValueCreateParams, ValueCreateResponse, Values } from './values';
7
+ import { ValueCreateParams, ValueCreateResponse, ValueListParams, ValueListResponse, Values } from './values';
7
8
 
8
9
  export class WebsiteUserAttributes extends APIResource {
9
10
  values: ValuesAPI.Values = new ValuesAPI.Values(this._client);
@@ -26,6 +27,30 @@ export class WebsiteUserAttributes extends APIResource {
26
27
  return this._client.post('/api/website_user_attributes', { body, ...options });
27
28
  }
28
29
 
30
+ /**
31
+ * Get all website user attributes
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const websiteUserAttributes =
36
+ * await client.auctions.websiteUserAttributes.list();
37
+ * ```
38
+ */
39
+ list(
40
+ query?: WebsiteUserAttributeListParams,
41
+ options?: Core.RequestOptions,
42
+ ): Core.APIPromise<WebsiteUserAttributeListResponse>;
43
+ list(options?: Core.RequestOptions): Core.APIPromise<WebsiteUserAttributeListResponse>;
44
+ list(
45
+ query: WebsiteUserAttributeListParams | Core.RequestOptions = {},
46
+ options?: Core.RequestOptions,
47
+ ): Core.APIPromise<WebsiteUserAttributeListResponse> {
48
+ if (isRequestOptions(query)) {
49
+ return this.list({}, query);
50
+ }
51
+ return this._client.get('/api/website_user_attributes', { query, ...options });
52
+ }
53
+
29
54
  /**
30
55
  * Delete a website user attribute
31
56
  *
@@ -70,6 +95,30 @@ export namespace WebsiteUserAttributeCreateResponse {
70
95
  }
71
96
  }
72
97
 
98
+ export interface WebsiteUserAttributeListResponse {
99
+ data: Array<WebsiteUserAttributeListResponse.Data>;
100
+
101
+ hasNextPage: boolean;
102
+ }
103
+
104
+ export namespace WebsiteUserAttributeListResponse {
105
+ export interface Data {
106
+ id: string;
107
+
108
+ createdAt: string;
109
+
110
+ deletedAt: string | null;
111
+
112
+ label: string;
113
+
114
+ organizationId: string;
115
+
116
+ updatedAt: string;
117
+
118
+ websiteId: string;
119
+ }
120
+ }
121
+
73
122
  export interface WebsiteUserAttributeDeleteResponse {
74
123
  message: string;
75
124
  }
@@ -102,6 +151,23 @@ export namespace WebsiteUserAttributeCreateParams {
102
151
  }
103
152
  }
104
153
 
154
+ export interface WebsiteUserAttributeListParams {
155
+ /**
156
+ * Number of website user attributes to return
157
+ */
158
+ limit?: string;
159
+
160
+ /**
161
+ * Unique identifier for the organization
162
+ */
163
+ organizationId?: string;
164
+
165
+ /**
166
+ * Unique identifier for the website
167
+ */
168
+ websiteId?: string;
169
+ }
170
+
105
171
  export interface WebsiteUserAttributeDeleteParams {
106
172
  /**
107
173
  * Unique identifier for the website user attribute
@@ -124,14 +190,18 @@ WebsiteUserAttributes.Values = Values;
124
190
  export declare namespace WebsiteUserAttributes {
125
191
  export {
126
192
  type WebsiteUserAttributeCreateResponse as WebsiteUserAttributeCreateResponse,
193
+ type WebsiteUserAttributeListResponse as WebsiteUserAttributeListResponse,
127
194
  type WebsiteUserAttributeDeleteResponse as WebsiteUserAttributeDeleteResponse,
128
195
  type WebsiteUserAttributeCreateParams as WebsiteUserAttributeCreateParams,
196
+ type WebsiteUserAttributeListParams as WebsiteUserAttributeListParams,
129
197
  type WebsiteUserAttributeDeleteParams as WebsiteUserAttributeDeleteParams,
130
198
  };
131
199
 
132
200
  export {
133
201
  Values as Values,
134
202
  type ValueCreateResponse as ValueCreateResponse,
203
+ type ValueListResponse as ValueListResponse,
135
204
  type ValueCreateParams as ValueCreateParams,
205
+ type ValueListParams as ValueListParams,
136
206
  };
137
207
  }
@@ -31,4 +31,10 @@ export {
31
31
  type UserDisconnectParams,
32
32
  type UserVerifyParams,
33
33
  } from './users/users';
34
- export { Websites, type WebsiteListResponse, type WebsiteListParams } from './websites/websites';
34
+ export {
35
+ Websites,
36
+ type WebsiteCreateResponse,
37
+ type WebsiteListResponse,
38
+ type WebsiteCreateParams,
39
+ type WebsiteListParams,
40
+ } from './websites/websites';
@@ -98,6 +98,8 @@ export {
98
98
  Transactions,
99
99
  type TransactionCreateTransactionResponse,
100
100
  type TransactionGetTransactionEntriesResponse,
101
+ type TransactionListRuleChainsResponse,
101
102
  type TransactionCreateTransactionParams,
102
103
  type TransactionGetTransactionEntriesParams,
104
+ type TransactionListRuleChainsParams,
103
105
  } from './transactions/index';
@@ -110,6 +110,8 @@ import {
110
110
  TransactionCreateTransactionResponse,
111
111
  TransactionGetTransactionEntriesParams,
112
112
  TransactionGetTransactionEntriesResponse,
113
+ TransactionListRuleChainsParams,
114
+ TransactionListRuleChainsResponse,
113
115
  Transactions,
114
116
  } from './transactions/transactions';
115
117
 
@@ -157,8 +159,10 @@ export declare namespace Loyalty {
157
159
  Transactions as Transactions,
158
160
  type TransactionCreateTransactionResponse as TransactionCreateTransactionResponse,
159
161
  type TransactionGetTransactionEntriesResponse as TransactionGetTransactionEntriesResponse,
162
+ type TransactionListRuleChainsResponse as TransactionListRuleChainsResponse,
160
163
  type TransactionCreateTransactionParams as TransactionCreateTransactionParams,
161
164
  type TransactionGetTransactionEntriesParams as TransactionGetTransactionEntriesParams,
165
+ type TransactionListRuleChainsParams as TransactionListRuleChainsParams,
162
166
  };
163
167
 
164
168
  export {
@@ -253,6 +253,7 @@ export namespace RuleGroupGetRuleGroupsResponse {
253
253
  | 'post_impressions'
254
254
  | 'discord_join'
255
255
  | 'connected_youtube'
256
+ | 'stratus_function'
256
257
  | 'connected_tiktok';
257
258
  }
258
259
 
@@ -280,6 +280,7 @@ export interface RuleCreateResponse {
280
280
  | 'post_impressions'
281
281
  | 'discord_join'
282
282
  | 'connected_youtube'
283
+ | 'stratus_function'
283
284
  | 'connected_tiktok';
284
285
 
285
286
  /**
@@ -329,6 +330,11 @@ export interface RuleCreateResponse {
329
330
  */
330
331
  externalIntegrationId?: string | null;
331
332
 
333
+ /**
334
+ * Optional stratus function id for the rule
335
+ */
336
+ functionId?: string | null;
337
+
332
338
  /**
333
339
  * Whether to hide this rule in the user interface
334
340
  */
@@ -458,7 +464,7 @@ export interface RuleCreateResponse {
458
464
  showBeforeStart?: boolean;
459
465
 
460
466
  /**
461
- * Optional subscription id for the rule
467
+ * Optional stratus subscription id for the rule
462
468
  */
463
469
  subscriptionId?: string | null;
464
470
  }
@@ -1494,6 +1500,11 @@ export interface RuleUpdateResponse {
1494
1500
  */
1495
1501
  frequency?: 'none' | 'once' | 'daily' | 'weekly' | 'monthly' | 'immediately';
1496
1502
 
1503
+ /**
1504
+ * Optional stratus function id for the rule
1505
+ */
1506
+ functionId?: string | null;
1507
+
1497
1508
  /**
1498
1509
  * Whether to hide this rule in the user interface
1499
1510
  */
@@ -1623,7 +1634,7 @@ export interface RuleUpdateResponse {
1623
1634
  startTime?: string | null;
1624
1635
 
1625
1636
  /**
1626
- * Optional subscription id for the rule
1637
+ * Optional stratus subscription id for the rule
1627
1638
  */
1628
1639
  subscriptionId?: string | null;
1629
1640
  }
@@ -3939,6 +3950,7 @@ export interface RuleCreateParams {
3939
3950
  | 'post_impressions'
3940
3951
  | 'discord_join'
3941
3952
  | 'connected_youtube'
3953
+ | 'stratus_function'
3942
3954
  | 'connected_tiktok';
3943
3955
 
3944
3956
  /**
@@ -3988,6 +4000,11 @@ export interface RuleCreateParams {
3988
4000
  */
3989
4001
  externalIntegrationId?: string | null;
3990
4002
 
4003
+ /**
4004
+ * Optional stratus function id for the rule
4005
+ */
4006
+ functionId?: string | null;
4007
+
3991
4008
  /**
3992
4009
  * Whether to hide this rule in the user interface
3993
4010
  */
@@ -4117,7 +4134,7 @@ export interface RuleCreateParams {
4117
4134
  showBeforeStart?: boolean;
4118
4135
 
4119
4136
  /**
4120
- * Optional subscription id for the rule
4137
+ * Optional stratus subscription id for the rule
4121
4138
  */
4122
4139
  subscriptionId?: string | null;
4123
4140
  }
@@ -5151,6 +5168,11 @@ export interface RuleUpdateParams {
5151
5168
  */
5152
5169
  frequency?: 'none' | 'once' | 'daily' | 'weekly' | 'monthly' | 'immediately';
5153
5170
 
5171
+ /**
5172
+ * Optional stratus function id for the rule
5173
+ */
5174
+ functionId?: string | null;
5175
+
5154
5176
  /**
5155
5177
  * Whether to hide this rule in the user interface
5156
5178
  */
@@ -5280,7 +5302,7 @@ export interface RuleUpdateParams {
5280
5302
  startTime?: string | null;
5281
5303
 
5282
5304
  /**
5283
- * Optional subscription id for the rule
5305
+ * Optional stratus subscription id for the rule
5284
5306
  */
5285
5307
  subscriptionId?: string | null;
5286
5308
  }
@@ -5,6 +5,8 @@ export {
5
5
  Transactions,
6
6
  type TransactionCreateTransactionResponse,
7
7
  type TransactionGetTransactionEntriesResponse,
8
+ type TransactionListRuleChainsResponse,
8
9
  type TransactionCreateTransactionParams,
9
10
  type TransactionGetTransactionEntriesParams,
11
+ type TransactionListRuleChainsParams,
10
12
  } from './transactions';
@@ -54,6 +54,25 @@ export class Transactions extends APIResource {
54
54
  }
55
55
  return this._client.get('/api/loyalty/transaction_entries', { query, ...options });
56
56
  }
57
+
58
+ /**
59
+ * Retrieve configured loyalty rule chains
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const response =
64
+ * await client.loyalty.transactions.listRuleChains({
65
+ * organizationId: '123e4567-e89b-12d3-a456-426614174001',
66
+ * websiteId: '123e4567-e89b-12d3-a456-426614174002',
67
+ * });
68
+ * ```
69
+ */
70
+ listRuleChains(
71
+ query: TransactionListRuleChainsParams,
72
+ options?: Core.RequestOptions,
73
+ ): Core.APIPromise<TransactionListRuleChainsResponse> {
74
+ return this._client.get('/api/loyalty/rule_chains', { query, ...options });
75
+ }
57
76
  }
58
77
 
59
78
  export interface TransactionCreateTransactionResponse {
@@ -213,6 +232,114 @@ export namespace TransactionGetTransactionEntriesResponse {
213
232
  }
214
233
  }
215
234
 
235
+ export interface TransactionListRuleChainsResponse {
236
+ data: Array<TransactionListRuleChainsResponse.Data>;
237
+
238
+ hasNextPage: boolean;
239
+ }
240
+
241
+ export namespace TransactionListRuleChainsResponse {
242
+ export interface Data {
243
+ /**
244
+ * Unique identifier for the rule chain
245
+ */
246
+ id: string;
247
+
248
+ loyaltyConditions: Array<Data.LoyaltyCondition>;
249
+
250
+ /**
251
+ * Unique identifier for the loyalty rule
252
+ */
253
+ loyaltyRuleId: string;
254
+
255
+ /**
256
+ * Name of the rule chain
257
+ */
258
+ name: string;
259
+ }
260
+
261
+ export namespace Data {
262
+ export interface LoyaltyCondition {
263
+ /**
264
+ * Unique identifier for the condition
265
+ */
266
+ id: string;
267
+
268
+ /**
269
+ * Amount of the condition
270
+ */
271
+ amount: number | null;
272
+
273
+ association: Array<LoyaltyCondition.Association>;
274
+
275
+ /**
276
+ * URL of the CSV file
277
+ */
278
+ csvUrl: string | null;
279
+
280
+ /**
281
+ * Description of the condition
282
+ */
283
+ description: string | null;
284
+
285
+ /**
286
+ * Number of times the condition must be met
287
+ */
288
+ repeatCount: number | null;
289
+
290
+ /**
291
+ * Number of times the condition must be met
292
+ */
293
+ requiredCount: number | null;
294
+
295
+ /**
296
+ * Type of the condition
297
+ */
298
+ type: 'rule' | 'rules' | 'points' | 'section' | 'level' | 'api' | 'badge' | 'badges' | 'csv';
299
+ }
300
+
301
+ export namespace LoyaltyCondition {
302
+ export interface Association {
303
+ /**
304
+ * Unique identifier for the association
305
+ */
306
+ id: string;
307
+
308
+ /**
309
+ * Unique identifier for the loyalty badge
310
+ */
311
+ loyaltyBadgeId: string | null;
312
+
313
+ /**
314
+ * Unique identifier for the loyalty currency
315
+ */
316
+ loyaltyCurrencyId: string | null;
317
+
318
+ loyaltyRule: Association.LoyaltyRule | null;
319
+
320
+ /**
321
+ * Unique identifier for the loyalty rule group
322
+ */
323
+ loyaltyRuleGroupId: string | null;
324
+
325
+ /**
326
+ * Unique identifier for the loyalty rule
327
+ */
328
+ loyaltyRuleId: string | null;
329
+ }
330
+
331
+ export namespace Association {
332
+ export interface LoyaltyRule {
333
+ /**
334
+ * Name of the loyalty rule
335
+ */
336
+ name: string;
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
342
+
216
343
  export interface TransactionCreateTransactionParams {
217
344
  /**
218
345
  * Description of the loyalty transaction
@@ -364,6 +491,7 @@ export interface TransactionGetTransactionEntriesParams {
364
491
  | 'post_impressions'
365
492
  | 'discord_join'
366
493
  | 'connected_youtube'
494
+ | 'stratus_function'
367
495
  | 'connected_tiktok'
368
496
  | Array<
369
497
  | 'Bonus'
@@ -431,6 +559,7 @@ export interface TransactionGetTransactionEntriesParams {
431
559
  | 'post_impressions'
432
560
  | 'discord_join'
433
561
  | 'connected_youtube'
562
+ | 'stratus_function'
434
563
  | 'connected_tiktok'
435
564
  >;
436
565
 
@@ -502,14 +631,38 @@ export interface TransactionGetTransactionEntriesParams {
502
631
  websiteId?: string;
503
632
  }
504
633
 
634
+ export interface TransactionListRuleChainsParams {
635
+ /**
636
+ * Unique identifier for the organization
637
+ */
638
+ organizationId: string;
639
+
640
+ /**
641
+ * Unique identifier for the website
642
+ */
643
+ websiteId: string;
644
+
645
+ /**
646
+ * Number of rule chains to return
647
+ */
648
+ limit?: number;
649
+
650
+ /**
651
+ * Starting after the given rule chain ID
652
+ */
653
+ startingAfter?: string;
654
+ }
655
+
505
656
  Transactions.RuleStatuses = RuleStatuses;
506
657
 
507
658
  export declare namespace Transactions {
508
659
  export {
509
660
  type TransactionCreateTransactionResponse as TransactionCreateTransactionResponse,
510
661
  type TransactionGetTransactionEntriesResponse as TransactionGetTransactionEntriesResponse,
662
+ type TransactionListRuleChainsResponse as TransactionListRuleChainsResponse,
511
663
  type TransactionCreateTransactionParams as TransactionCreateTransactionParams,
512
664
  type TransactionGetTransactionEntriesParams as TransactionGetTransactionEntriesParams,
665
+ type TransactionListRuleChainsParams as TransactionListRuleChainsParams,
513
666
  };
514
667
 
515
668
  export {
@@ -1,6 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { WebsiteCollections } from './website-collections';
3
+ export {
4
+ WebsiteCollections,
5
+ type WebsiteCollectionListResponse,
6
+ type WebsiteCollectionCreateParams,
7
+ type WebsiteCollectionListParams,
8
+ } from './website-collections';
4
9
  export {
5
10
  WebsiteUserRoles,
6
11
  type WebsiteUserRoleListResponse,
@@ -8,4 +13,10 @@ export {
8
13
  type WebsiteUserRoleListParams,
9
14
  type WebsiteUserRoleAssignParams,
10
15
  } from './website-user-roles';
11
- export { Websites, type WebsiteListResponse, type WebsiteListParams } from './websites';
16
+ export {
17
+ Websites,
18
+ type WebsiteCreateResponse,
19
+ type WebsiteListResponse,
20
+ type WebsiteCreateParams,
21
+ type WebsiteListParams,
22
+ } from './websites';
@@ -1,5 +1,187 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
4
5
 
5
- export class WebsiteCollections extends APIResource {}
6
+ export class WebsiteCollections extends APIResource {
7
+ /**
8
+ * Creates a new collection under a website
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * await client.websites.websiteCollections.create({
13
+ * collectionAddress:
14
+ * '0x2c02efDd09B3BA1AEaDd3dCAa7aC7A37C1CBDA8A',
15
+ * name: 'x',
16
+ * network: 'abstract',
17
+ * organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
18
+ * sortId: 99999,
19
+ * websiteId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
20
+ * });
21
+ * ```
22
+ */
23
+ create(body: WebsiteCollectionCreateParams, options?: Core.RequestOptions): Core.APIPromise<void> {
24
+ return this._client.post('/api/website_collections', {
25
+ body,
26
+ ...options,
27
+ headers: { Accept: '*/*', ...options?.headers },
28
+ });
29
+ }
30
+
31
+ /**
32
+ * Retrieves collections for a specific website.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const websiteCollections =
37
+ * await client.websites.websiteCollections.list({
38
+ * websiteId: '123e4567-e89b-12d3-a456-426614174000',
39
+ * });
40
+ * ```
41
+ */
42
+ list(
43
+ query: WebsiteCollectionListParams,
44
+ options?: Core.RequestOptions,
45
+ ): Core.APIPromise<WebsiteCollectionListResponse> {
46
+ return this._client.get('/api/website_collections', { query, ...options });
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Response schema for fetching website collections
52
+ */
53
+ export interface WebsiteCollectionListResponse {
54
+ /**
55
+ * Array of websites
56
+ */
57
+ data: Array<WebsiteCollectionListResponse.Data>;
58
+
59
+ /**
60
+ * Indicates if more pages are available
61
+ */
62
+ hasNextPage: boolean;
63
+ }
64
+
65
+ export namespace WebsiteCollectionListResponse {
66
+ export interface Data {
67
+ /**
68
+ * Website Collection ID
69
+ */
70
+ id: string;
71
+ }
72
+ }
73
+
74
+ export interface WebsiteCollectionCreateParams {
75
+ collectionAddress: string;
76
+
77
+ name: string;
78
+
79
+ network:
80
+ | 'abstract'
81
+ | 'abstractTestnet'
82
+ | 'apechain'
83
+ | 'arbitrum'
84
+ | 'avalanche'
85
+ | 'avalancheFuji'
86
+ | 'base'
87
+ | 'baseSepolia'
88
+ | 'berachain'
89
+ | 'berachainArtio'
90
+ | 'berachainBepolia'
91
+ | 'binance'
92
+ | 'bscTestnet'
93
+ | 'campTestnet'
94
+ | 'fantom'
95
+ | 'fantomTestnet'
96
+ | 'flowMainnet'
97
+ | 'mainnet'
98
+ | 'nexusTestnet'
99
+ | 'optimism'
100
+ | 'polygon'
101
+ | 'polygon_mumbai'
102
+ | 'skaleNebula'
103
+ | 'skaleEuropa'
104
+ | 'skaleCalypso'
105
+ | 'solana'
106
+ | 'sophon'
107
+ | 'sophonTestnet'
108
+ | 'sui'
109
+ | 'superseed'
110
+ | 'superseedSepolia'
111
+ | 'vanar'
112
+ | 'xai'
113
+ | 'zksync'
114
+ | 'coti'
115
+ | 'cotiTestnet'
116
+ | 'morph'
117
+ | 'morphTestnet'
118
+ | 'morphHolesky'
119
+ | 'ultra'
120
+ | 'ultraTestnet'
121
+ | 'nitrograph'
122
+ | 'sepolia'
123
+ | 'optimism_sepolia'
124
+ | 'arbitrumSepolia'
125
+ | 'goerli'
126
+ | 'optimism_goerli'
127
+ | 'arbitrumGoerli'
128
+ | 'basecamp'
129
+ | 'somnia'
130
+ | 'flow_cadence';
131
+
132
+ organizationId: string;
133
+
134
+ sortId: number;
135
+
136
+ websiteId: string;
137
+
138
+ discordUrl?: string;
139
+
140
+ homeUrl?: string;
141
+
142
+ imageUrl?: string | null;
143
+
144
+ instagramUsername?: string;
145
+
146
+ royaltyFee?: number | null;
147
+
148
+ royaltyFeeAddress?: string | null;
149
+
150
+ stakingAddress?: string;
151
+
152
+ telegramUrl?: string;
153
+
154
+ themeId?: string;
155
+
156
+ twitterUsername?: string;
157
+ }
158
+
159
+ export interface WebsiteCollectionListParams {
160
+ /**
161
+ * Filter by website ID
162
+ */
163
+ websiteId: string;
164
+
165
+ /**
166
+ * Number of items to return
167
+ */
168
+ limit?: number;
169
+
170
+ /**
171
+ * Filter by organization ID
172
+ */
173
+ organizationId?: string;
174
+
175
+ /**
176
+ * Pagination cursor, start after this ID
177
+ */
178
+ startingAfter?: string;
179
+ }
180
+
181
+ export declare namespace WebsiteCollections {
182
+ export {
183
+ type WebsiteCollectionListResponse as WebsiteCollectionListResponse,
184
+ type WebsiteCollectionCreateParams as WebsiteCollectionCreateParams,
185
+ type WebsiteCollectionListParams as WebsiteCollectionListParams,
186
+ };
187
+ }