@foxy.io/sdk 1.8.1 → 1.9.1

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.
@@ -0,0 +1,5 @@
1
+ import type { Graph } from '../../core';
2
+
3
+ export interface DownloadUrl extends Graph {
4
+ curie: 'fx:download_url';
5
+ }
@@ -0,0 +1,30 @@
1
+ import type { DownloadUrl } from './download_url';
2
+ import type { Graph } from '../../core';
3
+ import type { User } from './user';
4
+
5
+ export interface Report extends Graph {
6
+ curie: 'fx:report';
7
+
8
+ links: {
9
+ 'self': Report;
10
+ 'fx:download_url': DownloadUrl;
11
+ 'fx:user': User;
12
+ };
13
+
14
+ props: {
15
+ /** The type of report generated, indicating the content of the report. `complete` includes transaction details, summaries, coupon usage, subscription forecasts, and more. `customers` is for exporting customers to import elsewhere. `customers_ltv` includes the lifetime value per customer. */
16
+ name: 'complete' | 'customers' | 'customers_ltv';
17
+ /** In the event a report changes significantly, a new version of the report may be available. Leave this empty to retrieve the latest version, or pass a 1 to request a specific version. In the future, additional versions of each named report may be available. */
18
+ version: '1';
19
+ /** Current status of the report. Possible values include `queued`, `error`, and `ready`. */
20
+ status: 'queued' | 'error' | 'ready';
21
+ /** A timestamp in the `YYYY-MM-DD HH:MM:SS` format, for the start of the reporting period, for your store's configured timezone. Note that any offset will be ignored, and the datetime passed in will be used as your store's configured timezone. */
22
+ datetime_start: string;
23
+ /** Same as `datetime_start`, but for the end of the report's timeframe. Note that you likely want to pass `23:59:59` as the time portion, or you may inadvertently miss data from the last day of the reporting period. */
24
+ datetime_end: string;
25
+ /** The date this resource was created. */
26
+ date_created: string | null;
27
+ /** The date this resource was last modified. */
28
+ date_modified: string | null;
29
+ };
30
+ }
@@ -0,0 +1,10 @@
1
+ import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
2
+ import type { Graph } from '../../core';
3
+ import type { Report } from './report';
4
+
5
+ export interface Reports extends Graph {
6
+ curie: 'fx:reports';
7
+ links: CollectionGraphLinks<Reports>;
8
+ props: CollectionGraphProps;
9
+ child: Report;
10
+ }
@@ -17,6 +17,7 @@ import type { ItemCategories } from './item_categories';
17
17
  import type { PaymentMethodSets } from './payment_method_sets';
18
18
  import type { ProcessSubscriptionWebhook } from './process_subscription_webhook';
19
19
  import type { ReceiptTemplates } from './receipt_templates';
20
+ import type { Reports } from './reports';
20
21
  import type { StoreVersion } from './store_version';
21
22
  import type { SubscriptionSettings } from './subscription_settings';
22
23
  import type { Subscriptions } from './subscriptions';
@@ -38,6 +39,8 @@ export interface Store extends Graph {
38
39
  'fx:users': Users;
39
40
  /** List of taxes configured for this store. */
40
41
  'fx:taxes': Taxes;
42
+ /** List of reports for this store. */
43
+ 'fx:reports': Reports;
41
44
  /** List of coupons available in this store. */
42
45
  'fx:coupons': Coupons;
43
46
  /** List of customers of this store. */
@@ -0,0 +1,43 @@
1
+ import type { Graph } from '../../core';
2
+ import type { Store } from './store';
3
+ import type { WebhookLogs } from './webhook_logs';
4
+ import type { WebhookStatuses } from './webhook_statuses';
5
+ import type { Webhooks } from './webhooks';
6
+
7
+ export interface Webhook extends Graph {
8
+ curie: 'fx:webhook';
9
+
10
+ links: {
11
+ /** This resource. */
12
+ 'self': Webhook;
13
+ /** Store this webhook was created in. */
14
+ 'fx:store': Store;
15
+ /** List of all webhooks for the store. */
16
+ 'fx:webhooks': Webhooks;
17
+ /** List of all webhook delivery attempts and their current states. */
18
+ 'fx:statuses': WebhookStatuses;
19
+ /** List of all endpoint responses received during webhook delivery attempts. */
20
+ 'fx:logs': WebhookLogs;
21
+ };
22
+
23
+ props: {
24
+ /** The type of this webhook. Required. */
25
+ format: 'json' | 'webflow' | 'zapier';
26
+ /** The version of this webhook. Should not be modified unless you have specific instructions from Foxy. Default value is 2. */
27
+ version: number;
28
+ /** The name of this webhook. Required. 255 characters or less. */
29
+ name: string;
30
+ /** The endpoint where we will send the webhook data. 1000 characters or less. */
31
+ url: string | null;
32
+ /** The webhook payload mirrors the API, and you can include more or less data according to your needs (using `zoom` and other modifiers). 1000 characters or less. Something like `zoom=items,items:options,customer`. */
33
+ query: string | null;
34
+ /** The JSON webhooks are encrypted in certain situations. This key is also used to generate a signature to verify the integrity of the payload. 1000 characters or less. */
35
+ encryption_key: string | null;
36
+ /** The type of resource to observe changes on. */
37
+ event_resource: ('subscription' | 'transaction' | 'customer')[];
38
+ /** The date this resource was created. */
39
+ date_created: string | null;
40
+ /** The date this resource was last modified. */
41
+ date_modified: string | null;
42
+ };
43
+ }
@@ -0,0 +1,42 @@
1
+ import type { Customer } from './customer';
2
+ import type { Graph } from '../../core';
3
+ import type { Store } from './store';
4
+ import type { Subscription } from './subscription';
5
+ import type { Transaction } from './transaction';
6
+ import type { Webhook } from './webhook';
7
+
8
+ export interface WebhookLog extends Graph {
9
+ curie: 'fx:webhook_log';
10
+
11
+ links: {
12
+ /** This resource. */
13
+ 'self': WebhookLog;
14
+ /** The store this webhook status is associated with. */
15
+ 'fx:store': Store;
16
+ /** The webhook this status is associated with. */
17
+ 'fx:webhook': Webhook;
18
+ /** The resource changes in which have triggered the webhook. */
19
+ 'fx:resource': Transaction | Subscription | Customer;
20
+ };
21
+
22
+ props: {
23
+ /** The type of resource changes were observed on. */
24
+ resource_type: 'subscription' | 'transaction' | 'customer';
25
+ /** The ID of the resource changes in which have triggered the webhook. */
26
+ resource_id: number;
27
+ /** The ID of the webhook this status is associated with. */
28
+ webhook_id: number;
29
+ /** The code received from the server the webhook was sent to. */
30
+ response_code: string;
31
+ /** The content received from the server the webhook was sent to. */
32
+ response_body: string | null;
33
+ /** The date this resource was created. */
34
+ date_created: string | null;
35
+ /** The date this resource was last modified. */
36
+ date_modified: string | null;
37
+ };
38
+
39
+ zooms: {
40
+ webhook?: Webhook;
41
+ };
42
+ }
@@ -0,0 +1,10 @@
1
+ import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
2
+ import type { Graph } from '../../core';
3
+ import type { WebhookLog } from './webhook_log';
4
+
5
+ export interface WebhookLogs extends Graph {
6
+ curie: 'fx:webhook_logs';
7
+ links: CollectionGraphLinks<WebhookLogs>;
8
+ props: CollectionGraphProps;
9
+ child: WebhookLog;
10
+ }
@@ -0,0 +1,40 @@
1
+ import type { Customer } from './customer';
2
+ import type { Graph } from '../../core';
3
+ import type { Store } from './store';
4
+ import type { Subscription } from './subscription';
5
+ import type { Transaction } from './transaction';
6
+ import type { Webhook } from './webhook';
7
+
8
+ export interface WebhookStatus extends Graph {
9
+ curie: 'fx:webhook_status';
10
+
11
+ links: {
12
+ /** This resource. */
13
+ 'self': WebhookStatus;
14
+ /** The store this webhook status is associated with. */
15
+ 'fx:store': Store;
16
+ /** The webhook this status is associated with. */
17
+ 'fx:webhook': Webhook;
18
+ /** The resource changes in which have triggered the webhook. */
19
+ 'fx:resource': Transaction | Subscription | Customer;
20
+ };
21
+
22
+ props: {
23
+ /** The type of resource changes were observed on. */
24
+ resource_type: 'subscription' | 'transaction' | 'customer';
25
+ /** The ID of the resource changes in which have triggered the webhook. */
26
+ resource_id: number;
27
+ /** The ID of the webhook this status is associated with. */
28
+ webhook_id: number;
29
+ /** The current state of this attempt. */
30
+ status: 'pending' | 'failed' | 'successful';
31
+ /** The date this resource was created. */
32
+ date_created: string | null;
33
+ /** The date this resource was last modified. */
34
+ date_modified: string | null;
35
+ };
36
+
37
+ zooms: {
38
+ webhook?: Webhook;
39
+ };
40
+ }
@@ -0,0 +1,10 @@
1
+ import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
2
+ import type { Graph } from '../../core';
3
+ import type { WebhookStatus } from './webhook_status';
4
+
5
+ export interface WebhookStatuses extends Graph {
6
+ curie: 'fx:webhook_statuses';
7
+ links: CollectionGraphLinks<WebhookStatuses>;
8
+ props: CollectionGraphProps;
9
+ child: WebhookStatus;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
2
+ import type { Graph } from '../../core';
3
+ import type { Webhook } from './webhook';
4
+
5
+ export interface Webhooks extends Graph {
6
+ curie: 'fx:webhooks';
7
+ links: CollectionGraphLinks<Webhooks>;
8
+ props: CollectionGraphProps;
9
+ child: Webhook;
10
+ }
@@ -109,9 +109,12 @@ export * from './Graph/receipt_template';
109
109
  export * from './Graph/receipt_templates';
110
110
  export * from './Graph/refund';
111
111
  export * from './Graph/regions';
112
+ export * from './Graph/report';
113
+ export * from './Graph/download_url';
112
114
  export * from './Graph/reporting';
113
115
  export * from './Graph/reporting_email_exists';
114
116
  export * from './Graph/reporting_store_domain_exists';
117
+ export * from './Graph/reports';
115
118
  export * from './Graph/send_emails';
116
119
  export * from './Graph/shipment';
117
120
  export * from './Graph/shipments';
@@ -155,3 +158,9 @@ export * from './Graph/user_access';
155
158
  export * from './Graph/user_accesses';
156
159
  export * from './Graph/users';
157
160
  export * from './Graph/void';
161
+ export * from './Graph/webhook_log';
162
+ export * from './Graph/webhook_logs';
163
+ export * from './Graph/webhook_status';
164
+ export * from './Graph/webhook_statuses';
165
+ export * from './Graph/webhook';
166
+ export * from './Graph/webhooks';
@@ -12,8 +12,6 @@ export interface Attribute extends Graph {
12
12
  };
13
13
 
14
14
  props: {
15
- /** Controls who can see this attribute. Only public attributes are accessible via this API. */
16
- visibility: 'public';
17
15
  /** The name of this attribute. */
18
16
  name: string;
19
17
  /** The value of this attribute. */
@@ -0,0 +1,24 @@
1
+ import type { Graph } from '../../core';
2
+ import type { Transaction } from './transaction';
3
+
4
+ export interface CustomField extends Graph {
5
+ curie: 'fx:custom_field';
6
+
7
+ links: {
8
+ /** This resource. */
9
+ 'self': CustomField;
10
+ /** Transaction this custom field is linked to. */
11
+ 'fx:transaction': Transaction;
12
+ };
13
+
14
+ props: {
15
+ /** The name of the custom field. */
16
+ name: string;
17
+ /** The value of this custom field. */
18
+ value: string;
19
+ /** The date this resource was created. */
20
+ date_created: string | null;
21
+ /** The date this resource was last modified. */
22
+ date_modified: string | null;
23
+ };
24
+ }
@@ -0,0 +1,10 @@
1
+ import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
2
+ import type { CustomField } from './custom_field';
3
+ import type { Graph } from '../../core';
4
+
5
+ export interface CustomFields extends Graph {
6
+ curie: 'fx:custom_fields';
7
+ links: CollectionGraphLinks<CustomFields>;
8
+ props: CollectionGraphProps;
9
+ child: CustomField;
10
+ }
@@ -1,4 +1,5 @@
1
1
  import type { Attributes } from './attributes';
2
+ import type { CustomFields } from './custom_fields';
2
3
  import type { Graph as Customer } from './index';
3
4
  import type { Graph } from '../../core';
4
5
  import type { Items } from './items';
@@ -15,6 +16,8 @@ export interface Transaction extends Graph {
15
16
  'fx:customer': Customer;
16
17
  /** List of custom attributes on this transaction. */
17
18
  'fx:attributes': Attributes;
19
+ /** List of custom fields on this transaction. */
20
+ 'fx:custom_fields': CustomFields;
18
21
  /** List of items for this transaction. */
19
22
  'fx:items': Items;
20
23
  };
@@ -71,6 +74,7 @@ export interface Transaction extends Graph {
71
74
  };
72
75
 
73
76
  zooms: {
77
+ custom_fields?: CustomFields;
74
78
  attributes: Attributes;
75
79
  customer?: Customer;
76
80
  items?: Items;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foxy.io/sdk",
3
3
  "type": "commonjs",
4
- "version": "1.8.1",
4
+ "version": "1.9.1",
5
5
  "description": "Universal SDK for a full server-side and a limited in-browser access to Foxy hAPI.",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/esm/index.js",