@use-stall/types 0.0.3 → 0.0.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-stall/types",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Type declarations for Stall SDKs",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
@@ -0,0 +1,83 @@
1
+ type ModuleKey =
2
+ | "products"
3
+ | "variants"
4
+ | "collections"
5
+ | "categories"
6
+ | "tags"
7
+ | "inventory_levels" // For products with stock tracking
8
+ | "inventory_history" // History of inventory levels at a specific point in time
9
+ | "coupons"
10
+ | "gift_cards"
11
+ | "orders"
12
+ | "order_notes" // Activities related to order
13
+ | "refunds" // Activities related to refunds
14
+ | "payment_providers"
15
+ | "payments" // Create, Read, Update, Delete, Webhooks
16
+ | "receipts" // These are not tax invoices but rather and indication of a successful payment
17
+ | "tax_regions" // can be tax class or groups in other data sources
18
+ | "tax_rates"
19
+ | "customers"
20
+ | "locations" // Can be stock locations, warehouses, or any other location-related data
21
+ | "sessions_tracking" // This will be used for cash tracking and tracking the POS/Flex user
22
+ | "fulfillment_types" // Like delivery, pickup, etc.
23
+ | "fulfillment_providers" // Providers third party or custom like DHL, FedEx, UPS, etc.
24
+ | "fulfillments"; // Individual fulfillment instances for an order
25
+
26
+ export type IntegrationConnectionType =
27
+ | "connector"
28
+ | "payments"
29
+ | "fulfillments"
30
+ | "fiscalizations";
31
+
32
+ export interface IntegrationModulesType {
33
+ [key in ModuleKey]: {
34
+ supported: boolean;
35
+ actions: {
36
+ create: boolean;
37
+ read: boolean;
38
+ update: boolean;
39
+ delete: boolean;
40
+ };
41
+ };
42
+ }
43
+
44
+ export interface IntegrationType {
45
+ id: string;
46
+ version: string;
47
+ name: string;
48
+ type: IntegrationConnectionType;
49
+ description: string;
50
+ logo: string;
51
+ modules: IntegrationModulesType;
52
+ authentication: {
53
+ type: "basic" | "bearer" | "api_key" | "none";
54
+ ttl_type: "permanent" | "session";
55
+ ttl_value: number; // TTL value in minutes
56
+ };
57
+ integration_url: string; // Where to redirect the users to connect their account
58
+ integration_docs: string; // Where to redirect the users to learn how to connect their account
59
+ active: boolean;
60
+ }
61
+
62
+ export interface IntegrationConfigurationType {
63
+ integration_id: string;
64
+ type: IntegrationConnectionType;
65
+ created_at: number;
66
+ updated_at: number;
67
+ configuration: {
68
+ endpoint: string; // The endpoint URL
69
+ username: string; // For basic authentication
70
+ password: string; // For basic authentication
71
+ token: string; // For bearer authentication
72
+ api_key_header: string; // For API key authentication or Custom header
73
+ api_key_value: string; // For API key authentication or Custom header
74
+ };
75
+ }
76
+
77
+ export interface IntegrationRequestType {
78
+ id: string;
79
+ organization: string;
80
+ integration: string;
81
+ created_at: number;
82
+ type: IntegrationConnectionType;
83
+ }