@snagsolutions/sdk 0.1.0-alpha.44 → 0.1.0-alpha.46

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 (135) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +18 -16
  3. package/index.d.mts +4 -4
  4. package/index.d.ts +4 -4
  5. package/index.d.ts.map +1 -1
  6. package/index.js +1 -1
  7. package/index.js.map +1 -1
  8. package/index.mjs +1 -1
  9. package/index.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/assets.d.ts +7 -1
  12. package/resources/assets.d.ts.map +1 -1
  13. package/resources/auctions/auctions.d.ts +266 -0
  14. package/resources/auctions/auctions.d.ts.map +1 -0
  15. package/resources/auctions/auctions.js +62 -0
  16. package/resources/auctions/auctions.js.map +1 -0
  17. package/resources/auctions/auctions.mjs +35 -0
  18. package/resources/auctions/auctions.mjs.map +1 -0
  19. package/resources/auctions/index.d.ts +3 -0
  20. package/resources/auctions/index.d.ts.map +1 -0
  21. package/resources/auctions/index.js +9 -0
  22. package/resources/auctions/index.js.map +1 -0
  23. package/resources/auctions/index.mjs +4 -0
  24. package/resources/auctions/index.mjs.map +1 -0
  25. package/resources/auctions/website-user-attributes/index.d.ts +3 -0
  26. package/resources/auctions/website-user-attributes/index.d.ts.map +1 -0
  27. package/resources/auctions/website-user-attributes/index.js +9 -0
  28. package/resources/auctions/website-user-attributes/index.js.map +1 -0
  29. package/resources/auctions/website-user-attributes/index.mjs +4 -0
  30. package/resources/auctions/website-user-attributes/index.mjs.map +1 -0
  31. package/resources/auctions/website-user-attributes/values.d.ts +94 -0
  32. package/resources/auctions/website-user-attributes/values.d.ts.map +1 -0
  33. package/resources/auctions/website-user-attributes/values.js +21 -0
  34. package/resources/auctions/website-user-attributes/values.js.map +1 -0
  35. package/resources/auctions/website-user-attributes/values.mjs +17 -0
  36. package/resources/auctions/website-user-attributes/values.mjs.map +1 -0
  37. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +108 -0
  38. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts.map +1 -0
  39. package/resources/auctions/website-user-attributes/website-user-attributes.js +58 -0
  40. package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -0
  41. package/resources/auctions/website-user-attributes/website-user-attributes.mjs +31 -0
  42. package/resources/auctions/website-user-attributes/website-user-attributes.mjs.map +1 -0
  43. package/resources/auctions/website-user-attributes.d.ts +2 -0
  44. package/resources/auctions/website-user-attributes.d.ts.map +1 -0
  45. package/resources/auctions/website-user-attributes.js +19 -0
  46. package/resources/auctions/website-user-attributes.js.map +1 -0
  47. package/resources/auctions/website-user-attributes.mjs +3 -0
  48. package/resources/auctions/website-user-attributes.mjs.map +1 -0
  49. package/resources/auctions.d.ts +1 -133
  50. package/resources/auctions.d.ts.map +1 -1
  51. package/resources/auctions.js +15 -22
  52. package/resources/auctions.js.map +1 -1
  53. package/resources/auctions.mjs +1 -20
  54. package/resources/auctions.mjs.map +1 -1
  55. package/resources/index.d.ts +2 -2
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js +1 -1
  58. package/resources/index.js.map +1 -1
  59. package/resources/index.mjs +1 -1
  60. package/resources/index.mjs.map +1 -1
  61. package/resources/loyalty/index.d.ts +1 -1
  62. package/resources/loyalty/index.d.ts.map +1 -1
  63. package/resources/loyalty/index.js +2 -2
  64. package/resources/loyalty/index.js.map +1 -1
  65. package/resources/loyalty/index.mjs +1 -1
  66. package/resources/loyalty/index.mjs.map +1 -1
  67. package/resources/loyalty/loyalty.d.ts +3 -3
  68. package/resources/loyalty/loyalty.d.ts.map +1 -1
  69. package/resources/loyalty/loyalty.js +2 -2
  70. package/resources/loyalty/loyalty.js.map +1 -1
  71. package/resources/loyalty/loyalty.mjs +2 -2
  72. package/resources/loyalty/loyalty.mjs.map +1 -1
  73. package/resources/loyalty/rules.d.ts +10 -3
  74. package/resources/loyalty/rules.d.ts.map +1 -1
  75. package/resources/loyalty/rules.js +4 -4
  76. package/resources/loyalty/rules.js.map +1 -1
  77. package/resources/loyalty/rules.mjs +4 -4
  78. package/resources/loyalty/rules.mjs.map +1 -1
  79. package/resources/loyalty/transactions/index.d.ts +3 -0
  80. package/resources/loyalty/transactions/index.d.ts.map +1 -0
  81. package/resources/loyalty/transactions/index.js +9 -0
  82. package/resources/loyalty/transactions/index.js.map +1 -0
  83. package/resources/loyalty/transactions/index.mjs +4 -0
  84. package/resources/loyalty/transactions/index.mjs.map +1 -0
  85. package/resources/loyalty/transactions/rule-statuses.d.ts +104 -0
  86. package/resources/loyalty/transactions/rule-statuses.d.ts.map +1 -0
  87. package/resources/loyalty/transactions/rule-statuses.js +22 -0
  88. package/resources/loyalty/transactions/rule-statuses.js.map +1 -0
  89. package/resources/loyalty/transactions/rule-statuses.mjs +18 -0
  90. package/resources/loyalty/transactions/rule-statuses.mjs.map +1 -0
  91. package/resources/loyalty/transactions/transactions.d.ts +288 -0
  92. package/resources/loyalty/transactions/transactions.d.ts.map +1 -0
  93. package/resources/loyalty/transactions/transactions.js +58 -0
  94. package/resources/loyalty/transactions/transactions.js.map +1 -0
  95. package/resources/loyalty/transactions/transactions.mjs +31 -0
  96. package/resources/loyalty/transactions/transactions.mjs.map +1 -0
  97. package/resources/loyalty/transactions.d.ts +1 -253
  98. package/resources/loyalty/transactions.d.ts.map +1 -1
  99. package/resources/loyalty/transactions.js +15 -18
  100. package/resources/loyalty/transactions.js.map +1 -1
  101. package/resources/loyalty/transactions.mjs +1 -16
  102. package/resources/loyalty/transactions.mjs.map +1 -1
  103. package/resources/users/index.d.ts +1 -1
  104. package/resources/users/index.d.ts.map +1 -1
  105. package/resources/users/index.js.map +1 -1
  106. package/resources/users/index.mjs.map +1 -1
  107. package/resources/users/users.d.ts +60 -1
  108. package/resources/users/users.d.ts.map +1 -1
  109. package/resources/users/users.js +9 -0
  110. package/resources/users/users.js.map +1 -1
  111. package/resources/users/users.mjs +9 -0
  112. package/resources/users/users.mjs.map +1 -1
  113. package/src/index.ts +17 -1
  114. package/src/resources/assets.ts +8 -1
  115. package/src/resources/auctions/auctions.ts +417 -0
  116. package/src/resources/auctions/index.ts +18 -0
  117. package/src/resources/auctions/website-user-attributes/index.ts +18 -0
  118. package/src/resources/auctions/website-user-attributes/values.ts +137 -0
  119. package/src/resources/auctions/website-user-attributes/website-user-attributes.ts +183 -0
  120. package/src/resources/auctions/website-user-attributes.ts +3 -0
  121. package/src/resources/auctions.ts +1 -207
  122. package/src/resources/index.ts +11 -1
  123. package/src/resources/loyalty/index.ts +3 -1
  124. package/src/resources/loyalty/loyalty.ts +6 -2
  125. package/src/resources/loyalty/rules.ts +20 -4
  126. package/src/resources/loyalty/transactions/index.ts +18 -0
  127. package/src/resources/loyalty/transactions/rule-statuses.ts +160 -0
  128. package/src/resources/loyalty/transactions/transactions.ts +515 -0
  129. package/src/resources/loyalty/transactions.ts +1 -448
  130. package/src/resources/users/index.ts +4 -0
  131. package/src/resources/users/users.ts +88 -0
  132. package/src/version.ts +1 -1
  133. package/version.d.ts +1 -1
  134. package/version.js +1 -1
  135. package/version.mjs +1 -1
@@ -0,0 +1,183 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../resource';
4
+ import { isRequestOptions } from '../../../core';
5
+ import * as Core from '../../../core';
6
+ import * as ValuesAPI from './values';
7
+ import { ValueCreateParams, ValueCreateResponse, ValueListParams, ValueListResponse, Values } from './values';
8
+
9
+ export class WebsiteUserAttributes extends APIResource {
10
+ values: ValuesAPI.Values = new ValuesAPI.Values(this._client);
11
+
12
+ /**
13
+ * Create a new website user attribute
14
+ */
15
+ create(
16
+ body: WebsiteUserAttributeCreateParams,
17
+ options?: Core.RequestOptions,
18
+ ): Core.APIPromise<WebsiteUserAttributeCreateResponse> {
19
+ return this._client.post('/api/website_user_attributes', { body, ...options });
20
+ }
21
+
22
+ /**
23
+ * Get all website user attributes
24
+ */
25
+ list(
26
+ query?: WebsiteUserAttributeListParams,
27
+ options?: Core.RequestOptions,
28
+ ): Core.APIPromise<WebsiteUserAttributeListResponse>;
29
+ list(options?: Core.RequestOptions): Core.APIPromise<WebsiteUserAttributeListResponse>;
30
+ list(
31
+ query: WebsiteUserAttributeListParams | Core.RequestOptions = {},
32
+ options?: Core.RequestOptions,
33
+ ): Core.APIPromise<WebsiteUserAttributeListResponse> {
34
+ if (isRequestOptions(query)) {
35
+ return this.list({}, query);
36
+ }
37
+ return this._client.get('/api/website_user_attributes', { query, ...options });
38
+ }
39
+
40
+ /**
41
+ * Delete a website user attribute
42
+ */
43
+ delete(
44
+ pathId: string,
45
+ body: WebsiteUserAttributeDeleteParams,
46
+ options?: Core.RequestOptions,
47
+ ): Core.APIPromise<WebsiteUserAttributeDeleteResponse> {
48
+ return this._client.delete(`/api/website_user_attributes/${pathId}`, { body, ...options });
49
+ }
50
+ }
51
+
52
+ export interface WebsiteUserAttributeCreateResponse {
53
+ data: Array<WebsiteUserAttributeCreateResponse.Data>;
54
+ }
55
+
56
+ export namespace WebsiteUserAttributeCreateResponse {
57
+ export interface Data {
58
+ id: string;
59
+
60
+ createdAt: string;
61
+
62
+ deletedAt: string | null;
63
+
64
+ label: string;
65
+
66
+ organizationId: string;
67
+
68
+ updatedAt: string;
69
+
70
+ websiteId: string;
71
+ }
72
+ }
73
+
74
+ export interface WebsiteUserAttributeListResponse {
75
+ data: Array<WebsiteUserAttributeListResponse.Data>;
76
+
77
+ hasNextPage: boolean;
78
+ }
79
+
80
+ export namespace WebsiteUserAttributeListResponse {
81
+ export interface Data {
82
+ id: string;
83
+
84
+ createdAt: string;
85
+
86
+ deletedAt: string | null;
87
+
88
+ label: string;
89
+
90
+ organizationId: string;
91
+
92
+ updatedAt: string;
93
+
94
+ websiteId: string;
95
+ }
96
+ }
97
+
98
+ export interface WebsiteUserAttributeDeleteResponse {
99
+ message: string;
100
+ }
101
+
102
+ export interface WebsiteUserAttributeCreateParams {
103
+ data: Array<WebsiteUserAttributeCreateParams.Data>;
104
+
105
+ /**
106
+ * Unique identifier for the organization
107
+ */
108
+ organizationId?: string;
109
+
110
+ /**
111
+ * Unique identifier for the website
112
+ */
113
+ websiteId?: string;
114
+ }
115
+
116
+ export namespace WebsiteUserAttributeCreateParams {
117
+ export interface Data {
118
+ /**
119
+ * Label for the website user attribute
120
+ */
121
+ label: string;
122
+
123
+ /**
124
+ * Unique identifier for the website user attribute
125
+ */
126
+ id?: string;
127
+ }
128
+ }
129
+
130
+ export interface WebsiteUserAttributeListParams {
131
+ /**
132
+ * Number of website user attributes to return
133
+ */
134
+ limit?: string;
135
+
136
+ /**
137
+ * Unique identifier for the organization
138
+ */
139
+ organizationId?: string;
140
+
141
+ /**
142
+ * Unique identifier for the website
143
+ */
144
+ websiteId?: string;
145
+ }
146
+
147
+ export interface WebsiteUserAttributeDeleteParams {
148
+ /**
149
+ * Unique identifier for the website user attribute
150
+ */
151
+ body_id: string;
152
+
153
+ /**
154
+ * Unique identifier for the organization
155
+ */
156
+ organizationId: string;
157
+
158
+ /**
159
+ * Unique identifier for the website
160
+ */
161
+ websiteId: string;
162
+ }
163
+
164
+ WebsiteUserAttributes.Values = Values;
165
+
166
+ export declare namespace WebsiteUserAttributes {
167
+ export {
168
+ type WebsiteUserAttributeCreateResponse as WebsiteUserAttributeCreateResponse,
169
+ type WebsiteUserAttributeListResponse as WebsiteUserAttributeListResponse,
170
+ type WebsiteUserAttributeDeleteResponse as WebsiteUserAttributeDeleteResponse,
171
+ type WebsiteUserAttributeCreateParams as WebsiteUserAttributeCreateParams,
172
+ type WebsiteUserAttributeListParams as WebsiteUserAttributeListParams,
173
+ type WebsiteUserAttributeDeleteParams as WebsiteUserAttributeDeleteParams,
174
+ };
175
+
176
+ export {
177
+ Values as Values,
178
+ type ValueCreateResponse as ValueCreateResponse,
179
+ type ValueListResponse as ValueListResponse,
180
+ type ValueCreateParams as ValueCreateParams,
181
+ type ValueListParams as ValueListParams,
182
+ };
183
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './website-user-attributes/index';
@@ -1,209 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import { isRequestOptions } from '../core';
5
- import * as Core from '../core';
6
-
7
- export class Auctions extends APIResource {
8
- /**
9
- * Returns a list of auction bids with optional filtering and pagination.
10
- */
11
- listAuctionBids(query?: AuctionListAuctionBidsParams, options?: Core.RequestOptions): Core.APIPromise<void>;
12
- listAuctionBids(options?: Core.RequestOptions): Core.APIPromise<void>;
13
- listAuctionBids(
14
- query: AuctionListAuctionBidsParams | Core.RequestOptions = {},
15
- options?: Core.RequestOptions,
16
- ): Core.APIPromise<void> {
17
- if (isRequestOptions(query)) {
18
- return this.listAuctionBids({}, query);
19
- }
20
- return this._client.get('/api/auction_bids', {
21
- query,
22
- ...options,
23
- headers: { Accept: '*/*', ...options?.headers },
24
- });
25
- }
26
-
27
- /**
28
- * Returns a list of auctions with optional filtering and pagination.
29
- */
30
- listAuctions(options?: Core.RequestOptions): Core.APIPromise<AuctionListAuctionsResponse> {
31
- return this._client.get('/api/auctions', options);
32
- }
33
- }
34
-
35
- /**
36
- * Schema for the response when fetching auctions
37
- */
38
- export interface AuctionListAuctionsResponse {
39
- data: Array<AuctionListAuctionsResponse.Data>;
40
-
41
- hasNextPage: boolean;
42
- }
43
-
44
- export namespace AuctionListAuctionsResponse {
45
- export interface Data {
46
- id: string;
47
-
48
- auctionBids: Array<Data.AuctionBid>;
49
-
50
- auctionItems: Array<Data.AuctionItem>;
51
-
52
- biddersOwnCollectionAddresses: Array<string>;
53
-
54
- createdAt: string;
55
-
56
- currencyAddress: string | null;
57
-
58
- currencyDecimals: number;
59
-
60
- deletedAt: string | null;
61
-
62
- description: string;
63
-
64
- endsAt: string;
65
-
66
- extendedDurationInSeconds: number | null;
67
-
68
- hideBids: boolean;
69
-
70
- /**
71
- * Schema representing a loyalty currency
72
- */
73
- loyaltyCurrency: Data.LoyaltyCurrency | null;
74
-
75
- loyaltyCurrencyId: string | null;
76
-
77
- minBidAmount: string;
78
-
79
- minBidIncrement: string | null;
80
-
81
- mintingContractId: string;
82
-
83
- name: string;
84
-
85
- network: 'ethereum' | 'zksync';
86
-
87
- organizationId: string;
88
-
89
- reservePrice: string | null;
90
-
91
- signature: string;
92
-
93
- startsAt: string;
94
-
95
- status: 'in_progress' | 'completed' | 'cancelled';
96
-
97
- type: 'first_price' | 'second_price' | 'english';
98
-
99
- updatedAt: string;
100
-
101
- userId: string;
102
-
103
- websiteId: string;
104
- }
105
-
106
- export namespace Data {
107
- /**
108
- * Schema representing an auction bid
109
- */
110
- export interface AuctionBid {
111
- id: string;
112
-
113
- amount: string;
114
-
115
- createdAt: string;
116
- }
117
-
118
- export interface AuctionItem {
119
- id: string;
120
-
121
- /**
122
- * Schema representing a minting contract asset
123
- */
124
- mintingContractAsset: AuctionItem.MintingContractAsset;
125
-
126
- quantity: number;
127
-
128
- sortId: number;
129
- }
130
-
131
- export namespace AuctionItem {
132
- /**
133
- * Schema representing a minting contract asset
134
- */
135
- export interface MintingContractAsset {
136
- id: string;
137
- }
138
- }
139
-
140
- /**
141
- * Schema representing a loyalty currency
142
- */
143
- export interface LoyaltyCurrency {
144
- id: string;
145
-
146
- decimals: number;
147
-
148
- imageUrl: string | null;
149
-
150
- name: string;
151
-
152
- symbol: string;
153
- }
154
- }
155
- }
156
-
157
- export interface AuctionListAuctionBidsParams {
158
- /**
159
- * The bid ID
160
- */
161
- id?: string;
162
-
163
- /**
164
- * ID of the auction
165
- */
166
- auctionId?: string;
167
-
168
- /**
169
- * Maximum number of bids to return
170
- */
171
- limit?: number;
172
-
173
- /**
174
- * ID of the organization
175
- */
176
- organizationId?: string;
177
-
178
- /**
179
- * Pagination cursor to start after a specific bid ID
180
- */
181
- startingAfter?: string;
182
-
183
- /**
184
- * Status of the bid
185
- */
186
- status?: 'submitted' | 'accepted' | 'rejected' | 'fulfilled';
187
-
188
- /**
189
- * ID of the user who made the bid
190
- */
191
- userId?: string;
192
-
193
- /**
194
- * Wallet address of the bidder
195
- */
196
- walletAddress?: string;
197
-
198
- /**
199
- * ID of the website
200
- */
201
- websiteId?: string;
202
- }
203
-
204
- export declare namespace Auctions {
205
- export {
206
- type AuctionListAuctionsResponse as AuctionListAuctionsResponse,
207
- type AuctionListAuctionBidsParams as AuctionListAuctionBidsParams,
208
- };
209
- }
3
+ export * from './auctions/index';
@@ -1,7 +1,13 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export { Assets, type AssetCreateAssetResponse, type AssetCreateAssetParams } from './assets';
4
- export { Auctions, type AuctionListAuctionsResponse, type AuctionListAuctionBidsParams } from './auctions';
4
+ export {
5
+ Auctions,
6
+ type AuctionGetPageSectionsResponse,
7
+ type AuctionListAuctionsResponse,
8
+ type AuctionGetPageSectionsParams,
9
+ type AuctionListAuctionBidsParams,
10
+ } from './auctions/auctions';
5
11
  export { Auth, type AuthConnectAuthResponse, type AuthConnectAuthParams } from './auth';
6
12
  export { Loyalty } from './loyalty/loyalty';
7
13
  export { Minting, type MintingGetAssetsResponse, type MintingGetAssetsParams } from './minting';
@@ -15,11 +21,15 @@ export {
15
21
  type UserListResponse,
16
22
  type UserConnectResponse,
17
23
  type UserCountResponse,
24
+ type UserCreateDeviceResponse,
18
25
  type UserDisconnectResponse,
26
+ type UserVerifyResponse,
19
27
  type UserListParams,
20
28
  type UserConnectParams,
21
29
  type UserCountParams,
30
+ type UserCreateDeviceParams,
22
31
  type UserDisconnectParams,
32
+ type UserVerifyParams,
23
33
  } from './users/users';
24
34
  export {
25
35
  Websites,
@@ -92,6 +92,8 @@ export {
92
92
  Transactions,
93
93
  type TransactionCreateTransactionResponse,
94
94
  type TransactionGetTransactionEntriesResponse,
95
+ type TransactionListRuleChainsResponse,
95
96
  type TransactionCreateTransactionParams,
96
97
  type TransactionGetTransactionEntriesParams,
97
- } from './transactions';
98
+ type TransactionListRuleChainsParams,
99
+ } from './transactions/index';
@@ -97,14 +97,16 @@ import {
97
97
  RuleUpdateResponse,
98
98
  Rules,
99
99
  } from './rules';
100
- import * as TransactionsAPI from './transactions';
100
+ import * as TransactionsAPI from './transactions/transactions';
101
101
  import {
102
102
  TransactionCreateTransactionParams,
103
103
  TransactionCreateTransactionResponse,
104
104
  TransactionGetTransactionEntriesParams,
105
105
  TransactionGetTransactionEntriesResponse,
106
+ TransactionListRuleChainsParams,
107
+ TransactionListRuleChainsResponse,
106
108
  Transactions,
107
- } from './transactions';
109
+ } from './transactions/transactions';
108
110
 
109
111
  export class Loyalty extends APIResource {
110
112
  ruleGroups: RuleGroupsAPI.RuleGroups = new RuleGroupsAPI.RuleGroups(this._client);
@@ -148,8 +150,10 @@ export declare namespace Loyalty {
148
150
  Transactions as Transactions,
149
151
  type TransactionCreateTransactionResponse as TransactionCreateTransactionResponse,
150
152
  type TransactionGetTransactionEntriesResponse as TransactionGetTransactionEntriesResponse,
153
+ type TransactionListRuleChainsResponse as TransactionListRuleChainsResponse,
151
154
  type TransactionCreateTransactionParams as TransactionCreateTransactionParams,
152
155
  type TransactionGetTransactionEntriesParams as TransactionGetTransactionEntriesParams,
156
+ type TransactionListRuleChainsParams as TransactionListRuleChainsParams,
153
157
  };
154
158
 
155
159
  export {
@@ -73,9 +73,17 @@ export class Rules extends APIResource {
73
73
  * This will return the processing status of quests for a specific user
74
74
  */
75
75
  getStatus(
76
- query: RuleGetStatusParams,
76
+ query?: RuleGetStatusParams,
77
+ options?: Core.RequestOptions,
78
+ ): Core.APIPromise<RuleGetStatusResponse>;
79
+ getStatus(options?: Core.RequestOptions): Core.APIPromise<RuleGetStatusResponse>;
80
+ getStatus(
81
+ query: RuleGetStatusParams | Core.RequestOptions = {},
77
82
  options?: Core.RequestOptions,
78
83
  ): Core.APIPromise<RuleGetStatusResponse> {
84
+ if (isRequestOptions(query)) {
85
+ return this.getStatus({}, query);
86
+ }
79
87
  return this._client.get('/api/loyalty/rules/status', { query, ...options });
80
88
  }
81
89
  }
@@ -4470,6 +4478,12 @@ export interface RuleListParams {
4470
4478
  */
4471
4479
  collectionAddress?: string;
4472
4480
 
4481
+ /**
4482
+ * If true this will only return active rules, the rules for which the startTime is
4483
+ * in the past and the endTime is in the future
4484
+ */
4485
+ isActive?: 'true' | 'false';
4486
+
4473
4487
  /**
4474
4488
  * Maximum number of records to return (max 1000)
4475
4489
  */
@@ -4546,11 +4560,13 @@ export interface RuleCompleteParams {
4546
4560
  }
4547
4561
 
4548
4562
  export interface RuleGetStatusParams {
4549
- organizationId: string;
4550
-
4551
- websiteId: string;
4563
+ organizationId?: string;
4552
4564
 
4553
4565
  userId?: string;
4566
+
4567
+ walletAddress?: string;
4568
+
4569
+ websiteId?: string;
4554
4570
  }
4555
4571
 
4556
4572
  export declare namespace Rules {
@@ -0,0 +1,18 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ RuleStatuses,
5
+ type RuleStatusUpdateResponse,
6
+ type RuleStatusListResponse,
7
+ type RuleStatusUpdateParams,
8
+ type RuleStatusListParams,
9
+ } from './rule-statuses';
10
+ export {
11
+ Transactions,
12
+ type TransactionCreateTransactionResponse,
13
+ type TransactionGetTransactionEntriesResponse,
14
+ type TransactionListRuleChainsResponse,
15
+ type TransactionCreateTransactionParams,
16
+ type TransactionGetTransactionEntriesParams,
17
+ type TransactionListRuleChainsParams,
18
+ } from './transactions';
@@ -0,0 +1,160 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../resource';
4
+ import { isRequestOptions } from '../../../core';
5
+ import * as Core from '../../../core';
6
+
7
+ export class RuleStatuses extends APIResource {
8
+ /**
9
+ * Update a loyalty rule status
10
+ */
11
+ update(
12
+ body: RuleStatusUpdateParams,
13
+ options?: Core.RequestOptions,
14
+ ): Core.APIPromise<RuleStatusUpdateResponse> {
15
+ return this._client.post('/api/loyalty/rule_statuses', { body, ...options });
16
+ }
17
+
18
+ /**
19
+ * Retrieve loyalty rule statuses
20
+ */
21
+ list(query?: RuleStatusListParams, options?: Core.RequestOptions): Core.APIPromise<RuleStatusListResponse>;
22
+ list(options?: Core.RequestOptions): Core.APIPromise<RuleStatusListResponse>;
23
+ list(
24
+ query: RuleStatusListParams | Core.RequestOptions = {},
25
+ options?: Core.RequestOptions,
26
+ ): Core.APIPromise<RuleStatusListResponse> {
27
+ if (isRequestOptions(query)) {
28
+ return this.list({}, query);
29
+ }
30
+ return this._client.get('/api/loyalty/rule_statuses', { query, ...options });
31
+ }
32
+ }
33
+
34
+ export interface RuleStatusUpdateResponse {
35
+ id: string;
36
+
37
+ createdAt: string;
38
+
39
+ loyaltyRuleId: string;
40
+
41
+ organizationId: string;
42
+
43
+ progress: number;
44
+
45
+ updatedAt: string;
46
+
47
+ userId: string;
48
+
49
+ websiteId: string;
50
+ }
51
+
52
+ export interface RuleStatusListResponse {
53
+ data: Array<RuleStatusListResponse.Data>;
54
+
55
+ hasNextPage: boolean;
56
+ }
57
+
58
+ export namespace RuleStatusListResponse {
59
+ export interface Data {
60
+ id: string;
61
+
62
+ createdAt: string;
63
+
64
+ loyaltyRuleId: string;
65
+
66
+ organizationId: string;
67
+
68
+ progress: number;
69
+
70
+ updatedAt: string;
71
+
72
+ userId: string;
73
+
74
+ websiteId: string;
75
+ }
76
+ }
77
+
78
+ export interface RuleStatusUpdateParams {
79
+ /**
80
+ * Unique identifier for the loyalty rule
81
+ */
82
+ loyaltyRuleId: string;
83
+
84
+ /**
85
+ * Increment progress of the loyalty rule
86
+ */
87
+ incProgress?: number;
88
+
89
+ /**
90
+ * Unique identifier for the organization
91
+ */
92
+ organizationId?: string;
93
+
94
+ /**
95
+ * Progress of the loyalty rule
96
+ */
97
+ progress?: number;
98
+
99
+ /**
100
+ * Unique identifier for the user, either userId or walletAddress must be provided
101
+ */
102
+ userId?: string;
103
+
104
+ /**
105
+ * Unique identifier for the wallet address, either userId or walletAddress must be
106
+ * provided
107
+ */
108
+ walletAddress?: string;
109
+
110
+ /**
111
+ * Unique identifier for the website
112
+ */
113
+ websiteId?: string;
114
+ }
115
+
116
+ export interface RuleStatusListParams {
117
+ /**
118
+ * Number of items to return
119
+ */
120
+ limit?: number | null;
121
+
122
+ /**
123
+ * Unique identifier for the loyalty rule[s]
124
+ */
125
+ loyaltyRuleId?: string | Array<string>;
126
+
127
+ /**
128
+ * Unique identifier for the organization
129
+ */
130
+ organizationId?: string;
131
+
132
+ /**
133
+ * Starting after item
134
+ */
135
+ startingAfter?: string;
136
+
137
+ /**
138
+ * User ID(s) to filter accounts by
139
+ */
140
+ userId?: string | Array<string>;
141
+
142
+ /**
143
+ * Wallet address(es) to filter accounts by
144
+ */
145
+ walletAddress?: string | Array<string>;
146
+
147
+ /**
148
+ * Unique identifier for the website
149
+ */
150
+ websiteId?: string;
151
+ }
152
+
153
+ export declare namespace RuleStatuses {
154
+ export {
155
+ type RuleStatusUpdateResponse as RuleStatusUpdateResponse,
156
+ type RuleStatusListResponse as RuleStatusListResponse,
157
+ type RuleStatusUpdateParams as RuleStatusUpdateParams,
158
+ type RuleStatusListParams as RuleStatusListParams,
159
+ };
160
+ }