@usethrottle/api-client 5.20.0 → 5.22.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 (42) hide show
  1. package/dist/generated/index.d.ts +2 -0
  2. package/dist/generated/index.d.ts.map +1 -1
  3. package/dist/generated/index.js +2 -0
  4. package/dist/generated/index.js.map +1 -1
  5. package/dist/generated/services/CustomerGroupsService.d.ts +297 -0
  6. package/dist/generated/services/CustomerGroupsService.d.ts.map +1 -0
  7. package/dist/generated/services/CustomerGroupsService.js +182 -0
  8. package/dist/generated/services/CustomerGroupsService.js.map +1 -0
  9. package/dist/generated/services/CustomersService.d.ts +179 -1
  10. package/dist/generated/services/CustomersService.d.ts.map +1 -1
  11. package/dist/generated/services/CustomersService.js +59 -1
  12. package/dist/generated/services/CustomersService.js.map +1 -1
  13. package/dist/generated/services/DefaultService.d.ts +10 -4
  14. package/dist/generated/services/DefaultService.d.ts.map +1 -1
  15. package/dist/generated/services/DefaultService.js +18 -4
  16. package/dist/generated/services/DefaultService.js.map +1 -1
  17. package/dist/generated/services/DiscountsService.d.ts +60 -1
  18. package/dist/generated/services/DiscountsService.d.ts.map +1 -1
  19. package/dist/generated/services/DiscountsService.js.map +1 -1
  20. package/dist/generated/services/FormsService.d.ts +265 -0
  21. package/dist/generated/services/FormsService.d.ts.map +1 -0
  22. package/dist/generated/services/FormsService.js +185 -0
  23. package/dist/generated/services/FormsService.js.map +1 -0
  24. package/dist/generated/services/OrdersService.d.ts +152 -0
  25. package/dist/generated/services/OrdersService.d.ts.map +1 -1
  26. package/dist/generated/services/OrdersService.js +56 -0
  27. package/dist/generated/services/OrdersService.js.map +1 -1
  28. package/dist/generated/services/PaymentsService.d.ts +152 -0
  29. package/dist/generated/services/PaymentsService.d.ts.map +1 -1
  30. package/dist/generated/services/PaymentsService.js +57 -1
  31. package/dist/generated/services/PaymentsService.js.map +1 -1
  32. package/dist/generated/services/QuotesService.d.ts +212 -0
  33. package/dist/generated/services/QuotesService.d.ts.map +1 -1
  34. package/dist/generated/services/QuotesService.js +81 -0
  35. package/dist/generated/services/QuotesService.js.map +1 -1
  36. package/dist/generated/services/SubscriptionsService.d.ts +152 -0
  37. package/dist/generated/services/SubscriptionsService.d.ts.map +1 -1
  38. package/dist/generated/services/SubscriptionsService.js +56 -0
  39. package/dist/generated/services/SubscriptionsService.js.map +1 -1
  40. package/dist/generated/services/WebhooksOutboundService.d.ts +3 -3
  41. package/dist/generated/services/WebhooksOutboundService.d.ts.map +1 -1
  42. package/package.json +3 -3
@@ -0,0 +1,265 @@
1
+ import type { CancelablePromise } from '../core/CancelablePromise.js';
2
+ export declare class FormsService {
3
+ /**
4
+ * Create a site form. Requires `forms:write`.
5
+ * @param requestBody
6
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
7
+ * @returns any Default Response
8
+ * @throws ApiError
9
+ */
10
+ static postApiV1Forms(requestBody: {
11
+ name: string;
12
+ /**
13
+ * Addresses emailed on each submission. Team members get mail right away; any other address is sent a confirmation link first. Empty = no email.
14
+ */
15
+ notifyEmails?: Array<string>;
16
+ /**
17
+ * Origins such as https://www.example.com. Empty accepts any origin.
18
+ */
19
+ allowedOrigins?: Array<string>;
20
+ /**
21
+ * Where a plain HTML post goes after submitting.
22
+ */
23
+ redirectUrl?: string | null;
24
+ }, xThrottleEnvironmentId?: string): CancelablePromise<{
25
+ data?: {
26
+ id?: string;
27
+ name?: string;
28
+ /**
29
+ * frm_… identifier the form posts to. Not a secret.
30
+ */
31
+ publicKey?: string;
32
+ isActive?: boolean;
33
+ notifyEmails?: Array<string>;
34
+ /**
35
+ * notifyEmails outside the workspace team that have not confirmed yet. They receive nothing until they do.
36
+ */
37
+ pendingEmails?: Array<string>;
38
+ allowedOrigins?: Array<string>;
39
+ redirectUrl?: string | null;
40
+ createdAt?: string;
41
+ updatedAt?: string;
42
+ };
43
+ meta?: {
44
+ /**
45
+ * `req_<uuid>`, or a client-supplied id matching `^[A-Za-z0-9_-]{8,128}$`.
46
+ */
47
+ requestId?: string;
48
+ pagination?: {
49
+ cursor?: string | null;
50
+ hasMore?: boolean;
51
+ };
52
+ };
53
+ }>;
54
+ /**
55
+ * List the environment's site forms, newest first. Requires `forms:read`.
56
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
57
+ * @returns any Default Response
58
+ * @throws ApiError
59
+ */
60
+ static getApiV1Forms(xThrottleEnvironmentId?: string): CancelablePromise<{
61
+ data?: Array<{
62
+ id?: string;
63
+ name?: string;
64
+ /**
65
+ * frm_… identifier the form posts to. Not a secret.
66
+ */
67
+ publicKey?: string;
68
+ isActive?: boolean;
69
+ notifyEmails?: Array<string>;
70
+ /**
71
+ * notifyEmails outside the workspace team that have not confirmed yet. They receive nothing until they do.
72
+ */
73
+ pendingEmails?: Array<string>;
74
+ allowedOrigins?: Array<string>;
75
+ redirectUrl?: string | null;
76
+ createdAt?: string;
77
+ updatedAt?: string;
78
+ }>;
79
+ meta?: {
80
+ /**
81
+ * `req_<uuid>`, or a client-supplied id matching `^[A-Za-z0-9_-]{8,128}$`.
82
+ */
83
+ requestId?: string;
84
+ pagination?: {
85
+ cursor?: string | null;
86
+ hasMore?: boolean;
87
+ };
88
+ };
89
+ }>;
90
+ /**
91
+ * Get a site form. Requires `forms:read`.
92
+ * @param id Form id (UUID).
93
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
94
+ * @returns any Default Response
95
+ * @throws ApiError
96
+ */
97
+ static getApiV1Forms1(id: string, xThrottleEnvironmentId?: string): CancelablePromise<{
98
+ data?: {
99
+ id?: string;
100
+ name?: string;
101
+ /**
102
+ * frm_… identifier the form posts to. Not a secret.
103
+ */
104
+ publicKey?: string;
105
+ isActive?: boolean;
106
+ notifyEmails?: Array<string>;
107
+ /**
108
+ * notifyEmails outside the workspace team that have not confirmed yet. They receive nothing until they do.
109
+ */
110
+ pendingEmails?: Array<string>;
111
+ allowedOrigins?: Array<string>;
112
+ redirectUrl?: string | null;
113
+ createdAt?: string;
114
+ updatedAt?: string;
115
+ };
116
+ meta?: {
117
+ /**
118
+ * `req_<uuid>`, or a client-supplied id matching `^[A-Za-z0-9_-]{8,128}$`.
119
+ */
120
+ requestId?: string;
121
+ pagination?: {
122
+ cursor?: string | null;
123
+ hasMore?: boolean;
124
+ };
125
+ };
126
+ }>;
127
+ /**
128
+ * Update a site form. Requires `forms:write`.
129
+ * @param id Form id (UUID).
130
+ * @param requestBody
131
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
132
+ * @returns any Default Response
133
+ * @throws ApiError
134
+ */
135
+ static patchApiV1Forms(id: string, requestBody: {
136
+ name?: string;
137
+ /**
138
+ * false stops the form accepting submissions.
139
+ */
140
+ isActive?: boolean;
141
+ /**
142
+ * Addresses emailed on each submission. Team members get mail right away; any other address is sent a confirmation link first. Empty = no email.
143
+ */
144
+ notifyEmails?: Array<string>;
145
+ /**
146
+ * Origins such as https://www.example.com. Empty accepts any origin.
147
+ */
148
+ allowedOrigins?: Array<string>;
149
+ /**
150
+ * Where a plain HTML post goes after submitting.
151
+ */
152
+ redirectUrl?: string | null;
153
+ }, xThrottleEnvironmentId?: string): CancelablePromise<{
154
+ data?: {
155
+ id?: string;
156
+ name?: string;
157
+ /**
158
+ * frm_… identifier the form posts to. Not a secret.
159
+ */
160
+ publicKey?: string;
161
+ isActive?: boolean;
162
+ notifyEmails?: Array<string>;
163
+ /**
164
+ * notifyEmails outside the workspace team that have not confirmed yet. They receive nothing until they do.
165
+ */
166
+ pendingEmails?: Array<string>;
167
+ allowedOrigins?: Array<string>;
168
+ redirectUrl?: string | null;
169
+ createdAt?: string;
170
+ updatedAt?: string;
171
+ };
172
+ meta?: {
173
+ /**
174
+ * `req_<uuid>`, or a client-supplied id matching `^[A-Za-z0-9_-]{8,128}$`.
175
+ */
176
+ requestId?: string;
177
+ pagination?: {
178
+ cursor?: string | null;
179
+ hasMore?: boolean;
180
+ };
181
+ };
182
+ }>;
183
+ /**
184
+ * List a site form's submissions, newest first. Pass `meta.pagination.cursor` back as `cursor` for the next page. Requires `forms:read`.
185
+ * @param id Form id (UUID).
186
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
187
+ * @param limit Default 50.
188
+ * @param cursor
189
+ * @returns any Default Response
190
+ * @throws ApiError
191
+ */
192
+ static getApiV1FormsSubmissions(id: string, xThrottleEnvironmentId?: string, limit?: number, cursor?: string): CancelablePromise<{
193
+ data?: Array<{
194
+ id?: string;
195
+ formId?: string;
196
+ /**
197
+ * The fields as posted.
198
+ */
199
+ data?: Record<string, any>;
200
+ origin?: string | null;
201
+ /**
202
+ * Overall notification email outcome: a failure or bounce first, otherwise the least-progressed recipient. `queued` = waiting to go out, `sent` = handed to the mail provider, `delivered` = accepted by the recipient mail server, `skipped` = nothing was sent.
203
+ */
204
+ emailStatus?: 'queued' | 'sent' | 'delivered' | 'bounced' | 'failed' | 'skipped';
205
+ /**
206
+ * One entry per notification email. Empty when nothing was sent.
207
+ */
208
+ emails?: Array<{
209
+ email?: string;
210
+ status?: 'queued' | 'sent' | 'delivered' | 'bounced' | 'failed' | 'skipped';
211
+ }>;
212
+ createdAt?: string;
213
+ }>;
214
+ meta?: {
215
+ /**
216
+ * `req_<uuid>`, or a client-supplied id matching `^[A-Za-z0-9_-]{8,128}$`.
217
+ */
218
+ requestId?: string;
219
+ pagination?: {
220
+ cursor?: string | null;
221
+ hasMore?: boolean;
222
+ };
223
+ };
224
+ }>;
225
+ /**
226
+ * Submit a site form from a web page. No API key. Accepts a plain HTML form post (answered with a 303 to the form redirectUrl, or a thank-you page) or JSON. Any field names; values are text, numbers, true/false or lists of those. Fields starting with `_` are not stored, and a filled `_gotcha` is treated as spam. Notification emails go only to the addresses set on the form.
227
+ * @param publicKey The form's frm_ key.
228
+ * @param requestBody
229
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
230
+ * @returns any Default Response
231
+ * @throws ApiError
232
+ */
233
+ static postApiV1FormSubmissions(publicKey: string, requestBody: Record<string, any>, xThrottleEnvironmentId?: string): CancelablePromise<{
234
+ data?: {
235
+ submitted?: boolean;
236
+ };
237
+ meta?: {
238
+ /**
239
+ * `req_<uuid>`, or a client-supplied id matching `^[A-Za-z0-9_-]{8,128}$`.
240
+ */
241
+ requestId?: string;
242
+ pagination?: {
243
+ cursor?: string | null;
244
+ hasMore?: boolean;
245
+ };
246
+ };
247
+ }>;
248
+ /**
249
+ * HTML page behind the link in a notification-address confirmation email. Shows a Confirm button; does not confirm by itself (mail scanners open links).
250
+ * @param token The sfc_ token from the confirmation email.
251
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
252
+ * @returns any Default Response
253
+ * @throws ApiError
254
+ */
255
+ static getApiV1FormEmailConfirmations(token: string, xThrottleEnvironmentId?: string): CancelablePromise<any>;
256
+ /**
257
+ * Confirm a notification address (the Confirm button on the page). Answers an HTML page.
258
+ * @param token The sfc_ token from the confirmation email.
259
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
260
+ * @returns any Default Response
261
+ * @throws ApiError
262
+ */
263
+ static postApiV1FormEmailConfirmations(token: string, xThrottleEnvironmentId?: string): CancelablePromise<any>;
264
+ }
265
+ //# sourceMappingURL=FormsService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormsService.d.ts","sourceRoot":"","sources":["../../../src/generated/services/FormsService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,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CAAC,EAAE;YACH,SAAS,CAAC,EAAE,OAAO,CAAC;SACvB,CAAC;QACF,IAAI,CAAC,EAAE;YACH;;eAEG;YACH,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE;gBACT,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;gBACvB,OAAO,CAAC,EAAE,OAAO,CAAC;aACrB,CAAC;SACL,CAAC;KACL,CAAC;IAmBF;;;;;;OAMG;WACW,8BAA8B,CACxC,KAAK,EAAE,MAAM,EACb,sBAAsB,CAAC,EAAE,MAAM,GAChC,iBAAiB,CAAC,GAAG,CAAC;IAYzB;;;;;;OAMG;WACW,+BAA+B,CACzC,KAAK,EAAE,MAAM,EACb,sBAAsB,CAAC,EAAE,MAAM,GAChC,iBAAiB,CAAC,GAAG,CAAC;CAY5B"}
@@ -0,0 +1,185 @@
1
+ import { OpenAPI } from '../core/OpenAPI.js';
2
+ import { request as __request } from '../core/request.js';
3
+ export class FormsService {
4
+ /**
5
+ * Create a site form. Requires `forms:write`.
6
+ * @param requestBody
7
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
8
+ * @returns any Default Response
9
+ * @throws ApiError
10
+ */
11
+ static postApiV1Forms(requestBody, xThrottleEnvironmentId) {
12
+ return __request(OpenAPI, {
13
+ method: 'POST',
14
+ url: '/api/v1/forms',
15
+ headers: {
16
+ 'X-Throttle-Environment-Id': xThrottleEnvironmentId,
17
+ },
18
+ body: requestBody,
19
+ mediaType: 'application/json',
20
+ errors: {
21
+ 400: `Invalid request — the body, query, or path failed validation. See \`error.details\`.`,
22
+ 429: `\`too_many_confirmations\`: more than 20 confirmation emails in a day.`,
23
+ },
24
+ });
25
+ }
26
+ /**
27
+ * List the environment's site forms, newest first. Requires `forms:read`.
28
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
29
+ * @returns any Default Response
30
+ * @throws ApiError
31
+ */
32
+ static getApiV1Forms(xThrottleEnvironmentId) {
33
+ return __request(OpenAPI, {
34
+ method: 'GET',
35
+ url: '/api/v1/forms',
36
+ headers: {
37
+ 'X-Throttle-Environment-Id': xThrottleEnvironmentId,
38
+ },
39
+ });
40
+ }
41
+ /**
42
+ * Get a site form. Requires `forms:read`.
43
+ * @param id Form id (UUID).
44
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
45
+ * @returns any Default Response
46
+ * @throws ApiError
47
+ */
48
+ static getApiV1Forms1(id, xThrottleEnvironmentId) {
49
+ return __request(OpenAPI, {
50
+ method: 'GET',
51
+ url: '/api/v1/forms/{id}',
52
+ path: {
53
+ 'id': id,
54
+ },
55
+ headers: {
56
+ 'X-Throttle-Environment-Id': xThrottleEnvironmentId,
57
+ },
58
+ errors: {
59
+ 404: `\`not_found\`: no such form in this environment.`,
60
+ },
61
+ });
62
+ }
63
+ /**
64
+ * Update a site form. Requires `forms:write`.
65
+ * @param id Form id (UUID).
66
+ * @param requestBody
67
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
68
+ * @returns any Default Response
69
+ * @throws ApiError
70
+ */
71
+ static patchApiV1Forms(id, requestBody, xThrottleEnvironmentId) {
72
+ return __request(OpenAPI, {
73
+ method: 'PATCH',
74
+ url: '/api/v1/forms/{id}',
75
+ path: {
76
+ 'id': id,
77
+ },
78
+ headers: {
79
+ 'X-Throttle-Environment-Id': xThrottleEnvironmentId,
80
+ },
81
+ body: requestBody,
82
+ mediaType: 'application/json',
83
+ errors: {
84
+ 400: `Invalid request — the body, query, or path failed validation. See \`error.details\`.`,
85
+ 404: `\`not_found\`: no such form in this environment.`,
86
+ 429: `\`too_many_confirmations\`: more than 20 confirmation emails in a day.`,
87
+ },
88
+ });
89
+ }
90
+ /**
91
+ * List a site form's submissions, newest first. Pass `meta.pagination.cursor` back as `cursor` for the next page. Requires `forms:read`.
92
+ * @param id Form id (UUID).
93
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
94
+ * @param limit Default 50.
95
+ * @param cursor
96
+ * @returns any Default Response
97
+ * @throws ApiError
98
+ */
99
+ static getApiV1FormsSubmissions(id, xThrottleEnvironmentId, limit, cursor) {
100
+ return __request(OpenAPI, {
101
+ method: 'GET',
102
+ url: '/api/v1/forms/{id}/submissions',
103
+ path: {
104
+ 'id': id,
105
+ },
106
+ headers: {
107
+ 'X-Throttle-Environment-Id': xThrottleEnvironmentId,
108
+ },
109
+ query: {
110
+ 'limit': limit,
111
+ 'cursor': cursor,
112
+ },
113
+ errors: {
114
+ 400: `Invalid request — the body, query, or path failed validation. See \`error.details\`.`,
115
+ 404: `\`not_found\`: no such form in this environment.`,
116
+ },
117
+ });
118
+ }
119
+ /**
120
+ * Submit a site form from a web page. No API key. Accepts a plain HTML form post (answered with a 303 to the form redirectUrl, or a thank-you page) or JSON. Any field names; values are text, numbers, true/false or lists of those. Fields starting with `_` are not stored, and a filled `_gotcha` is treated as spam. Notification emails go only to the addresses set on the form.
121
+ * @param publicKey The form's frm_ key.
122
+ * @param requestBody
123
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
124
+ * @returns any Default Response
125
+ * @throws ApiError
126
+ */
127
+ static postApiV1FormSubmissions(publicKey, requestBody, xThrottleEnvironmentId) {
128
+ return __request(OpenAPI, {
129
+ method: 'POST',
130
+ url: '/api/v1/form-submissions/{publicKey}',
131
+ path: {
132
+ 'publicKey': publicKey,
133
+ },
134
+ headers: {
135
+ 'X-Throttle-Environment-Id': xThrottleEnvironmentId,
136
+ },
137
+ body: requestBody,
138
+ mediaType: 'application/json',
139
+ errors: {
140
+ 400: `\`empty_submission\` or \`invalid_submission\`.`,
141
+ 403: `\`origin_not_allowed\`: the post came from a site not on allowedOrigins.`,
142
+ 404: `\`form_not_found\`: unknown key, or the form is turned off.`,
143
+ },
144
+ });
145
+ }
146
+ /**
147
+ * HTML page behind the link in a notification-address confirmation email. Shows a Confirm button; does not confirm by itself (mail scanners open links).
148
+ * @param token The sfc_ token from the confirmation email.
149
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
150
+ * @returns any Default Response
151
+ * @throws ApiError
152
+ */
153
+ static getApiV1FormEmailConfirmations(token, xThrottleEnvironmentId) {
154
+ return __request(OpenAPI, {
155
+ method: 'GET',
156
+ url: '/api/v1/form-email-confirmations/{token}',
157
+ path: {
158
+ 'token': token,
159
+ },
160
+ headers: {
161
+ 'X-Throttle-Environment-Id': xThrottleEnvironmentId,
162
+ },
163
+ });
164
+ }
165
+ /**
166
+ * Confirm a notification address (the Confirm button on the page). Answers an HTML page.
167
+ * @param token The sfc_ token from the confirmation email.
168
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
169
+ * @returns any Default Response
170
+ * @throws ApiError
171
+ */
172
+ static postApiV1FormEmailConfirmations(token, xThrottleEnvironmentId) {
173
+ return __request(OpenAPI, {
174
+ method: 'POST',
175
+ url: '/api/v1/form-email-confirmations/{token}',
176
+ path: {
177
+ 'token': token,
178
+ },
179
+ headers: {
180
+ 'X-Throttle-Environment-Id': xThrottleEnvironmentId,
181
+ },
182
+ });
183
+ }
184
+ }
185
+ //# sourceMappingURL=FormsService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormsService.js","sourceRoot":"","sources":["../../../src/generated/services/FormsService.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,MAAM,OAAO,YAAY;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gBACF,OAAO,EAAE,KAAK;aACjB;YACD,OAAO,EAAE;gBACL,2BAA2B,EAAE,sBAAsB;aACtD;SACJ,CAAC,CAAC;IACP,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,+BAA+B,CACzC,KAAa,EACb,sBAA+B;QAE/B,OAAO,SAAS,CAAC,OAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,0CAA0C;YAC/C,IAAI,EAAE;gBACF,OAAO,EAAE,KAAK;aACjB;YACD,OAAO,EAAE;gBACL,2BAA2B,EAAE,sBAAsB;aACtD;SACJ,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -4282,5 +4282,157 @@ export declare class OrdersService {
4282
4282
  }>;
4283
4283
  };
4284
4284
  }>;
4285
+ /**
4286
+ * What happened to this order and who did it, newest first. Includes the order's payments, fulfillments and returns. Entries come from the audit log, trimmed to fields that are safe for anyone who can read the record.
4287
+ * @param id
4288
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
4289
+ * @param limit
4290
+ * @param cursor `meta.pagination.cursor` from the previous page.
4291
+ * @returns any Default Response
4292
+ * @throws ApiError
4293
+ */
4294
+ static getApiV1OrdersActivity(id: string, xThrottleEnvironmentId?: string, limit?: number, cursor?: string): CancelablePromise<{
4295
+ data: Array<{
4296
+ id: string;
4297
+ at: string;
4298
+ /**
4299
+ * `audit`: an action taken through Throttle, from the audit log. `integration`: an entry an integration posted with `POST …/activity`.
4300
+ */
4301
+ source: 'audit' | 'integration';
4302
+ /**
4303
+ * The audit action, such as `updated` or `dispute_opened`; null on integration entries.
4304
+ */
4305
+ action: string | null;
4306
+ /**
4307
+ * The record the entry is about. An order's history also includes its payments, fulfillments and returns.
4308
+ */
4309
+ subjectType: string;
4310
+ subjectId: string | null;
4311
+ actor: {
4312
+ kind: 'member' | 'api_key' | 'extension' | 'connected_app' | 'system';
4313
+ /**
4314
+ * Who did it, as recorded at the time. A team member is named without their email unless the caller is signed in to the dashboard.
4315
+ */
4316
+ label: string;
4317
+ };
4318
+ /**
4319
+ * A readable summary, such as "Ship-to address changed".
4320
+ */
4321
+ title: string;
4322
+ /**
4323
+ * Integration entries: the poster's detail text.
4324
+ */
4325
+ detail?: string | null;
4326
+ /**
4327
+ * The request fields an update changed.
4328
+ */
4329
+ fields?: Array<string> | null;
4330
+ reason?: string | null;
4331
+ from?: string | null;
4332
+ to?: string | null;
4333
+ status?: string | null;
4334
+ /**
4335
+ * Minor units of `currency`.
4336
+ */
4337
+ amount?: number | null;
4338
+ currency?: CurrencyCode | null;
4339
+ /**
4340
+ * Integration entries: an https link the poster gave.
4341
+ */
4342
+ url?: string | null;
4343
+ }>;
4344
+ meta: {
4345
+ /**
4346
+ * `req_<uuid>`, or a client-supplied id matching `^[A-Za-z0-9_-]{8,128}$`.
4347
+ */
4348
+ requestId?: string;
4349
+ pagination?: {
4350
+ cursor?: string | null;
4351
+ hasMore?: boolean;
4352
+ };
4353
+ };
4354
+ }>;
4355
+ /**
4356
+ * Add an entry to this order's history, such as "Synced to your CRM". Needs `activity:write` and the order's read scope. The entry is credited to the calling API key, extension or connected app; it cannot be edited or deleted.
4357
+ * @param id
4358
+ * @param requestBody
4359
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
4360
+ * @returns any Default Response
4361
+ * @throws ApiError
4362
+ */
4363
+ static postApiV1OrdersActivity(id: string, requestBody: {
4364
+ /**
4365
+ * What happened, 1–200 characters.
4366
+ */
4367
+ title: string;
4368
+ /**
4369
+ * More detail, up to 2000 characters.
4370
+ */
4371
+ detail?: string;
4372
+ /**
4373
+ * A link back to your system; must start with https://.
4374
+ */
4375
+ url?: string;
4376
+ }, xThrottleEnvironmentId?: string): CancelablePromise<{
4377
+ data?: {
4378
+ id: string;
4379
+ at: string;
4380
+ /**
4381
+ * `audit`: an action taken through Throttle, from the audit log. `integration`: an entry an integration posted with `POST …/activity`.
4382
+ */
4383
+ source: 'audit' | 'integration';
4384
+ /**
4385
+ * The audit action, such as `updated` or `dispute_opened`; null on integration entries.
4386
+ */
4387
+ action: string | null;
4388
+ /**
4389
+ * The record the entry is about. An order's history also includes its payments, fulfillments and returns.
4390
+ */
4391
+ subjectType: string;
4392
+ subjectId: string | null;
4393
+ actor: {
4394
+ kind: 'member' | 'api_key' | 'extension' | 'connected_app' | 'system';
4395
+ /**
4396
+ * Who did it, as recorded at the time. A team member is named without their email unless the caller is signed in to the dashboard.
4397
+ */
4398
+ label: string;
4399
+ };
4400
+ /**
4401
+ * A readable summary, such as "Ship-to address changed".
4402
+ */
4403
+ title: string;
4404
+ /**
4405
+ * Integration entries: the poster's detail text.
4406
+ */
4407
+ detail?: string | null;
4408
+ /**
4409
+ * The request fields an update changed.
4410
+ */
4411
+ fields?: Array<string> | null;
4412
+ reason?: string | null;
4413
+ from?: string | null;
4414
+ to?: string | null;
4415
+ status?: string | null;
4416
+ /**
4417
+ * Minor units of `currency`.
4418
+ */
4419
+ amount?: number | null;
4420
+ currency?: CurrencyCode | null;
4421
+ /**
4422
+ * Integration entries: an https link the poster gave.
4423
+ */
4424
+ url?: string | null;
4425
+ };
4426
+ meta?: {
4427
+ /**
4428
+ * `req_<uuid>`, or a client-supplied id matching `^[A-Za-z0-9_-]{8,128}$`.
4429
+ */
4430
+ requestId?: string;
4431
+ pagination?: {
4432
+ cursor?: string | null;
4433
+ hasMore?: boolean;
4434
+ };
4435
+ };
4436
+ }>;
4285
4437
  }
4286
4438
  //# sourceMappingURL=OrdersService.d.ts.map