@use-stall/types 0.1.4 → 0.1.6

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/index.d.ts CHANGED
@@ -22,5 +22,6 @@ export * from "./src/taxes";
22
22
  export * from "./src/users";
23
23
  export * from "./src/fulfillment";
24
24
  export * from "./src/extensions";
25
- export * from "./src/integrations";
25
+ export * from "./src/connectors";
26
26
  export * from "./src/pin-auth";
27
+ export * from "./src/integrations";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-stall/types",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Type declarations for Stall SDKs",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
@@ -0,0 +1,68 @@
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 interface ConnectorModulesType {
27
+ [key in ModuleKey]: {
28
+ supported: boolean;
29
+ actions: {
30
+ create: boolean;
31
+ read: boolean;
32
+ update: boolean;
33
+ delete: boolean;
34
+ };
35
+ };
36
+ }
37
+
38
+ export interface ConnectorIntegrationType {
39
+ id: string;
40
+ version: string;
41
+ name: string;
42
+ description: string;
43
+ logo: string;
44
+ modules: ConnectorModulesType;
45
+ authentication: {
46
+ type: "basic" | "bearer" | "api_key" | "none";
47
+ ttl_type: "permanent" | "session";
48
+ ttl_value: number; // TTL value in minutes
49
+ };
50
+ integration_url: string;
51
+ integration_docs: string;
52
+ active: boolean;
53
+ }
54
+
55
+ export interface ConnectorConfigurationType {
56
+ id: string;
57
+ integration_id: string;
58
+ created_at: number;
59
+ updated_at: number;
60
+ configuration: {
61
+ endpoint: string; // The endpoint URL
62
+ username: string; // For basic authentication
63
+ password: string; // For basic authentication
64
+ token: string; // For bearer authentication
65
+ api_key_header: string; // For API key authentication or Custom header
66
+ api_key_value: string; // For API key authentication or Custom header
67
+ };
68
+ }
@@ -1,85 +1,7 @@
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
- id: string;
64
- integration_id: string;
65
- type: IntegrationConnectionType;
66
- created_at: number;
67
- updated_at: number;
68
- configuration: {
69
- endpoint: string; // The endpoint URL
70
- username: string; // For basic authentication
71
- password: string; // For basic authentication
72
- token: string; // For bearer authentication
73
- api_key_header: string; // For API key authentication or Custom header
74
- api_key_value: string; // For API key authentication or Custom header
75
- [key: string]: any;
76
- };
77
- }
78
1
 
79
2
  export interface IntegrationRequestType {
80
3
  id: string;
81
4
  organization: string;
82
5
  integration: string;
83
6
  created_at: number;
84
- type: IntegrationConnectionType;
85
- }
7
+ }
@@ -1,3 +1,5 @@
1
+ import type { ConnectorConfigurationType } from "./connectors";
2
+
1
3
  export interface OrganizationType {
2
4
  id: string;
3
5
  business_type: string;
@@ -19,15 +21,10 @@ export interface OrganizationType {
19
21
  subscription: string;
20
22
  };
21
23
  logo: string;
22
- integrations: {
23
- connector: boolean;
24
- payments: boolean;
25
- fulfillments: boolean;
26
- fiscalizations: boolean;
27
- };
28
24
  emails: string[]; // Other email addresses with access, the primary one is the one with matching the owner uid
29
25
  created_at: number;
30
26
  updated_at: number;
27
+ connector?: ConnectorConfigurationType;
31
28
  }
32
29
 
33
30
  export interface ReceiptType {
package/src/payments.d.ts CHANGED
@@ -7,7 +7,7 @@ export type MethodsType =
7
7
  | "mobile_money"
8
8
  | "connector_payments"
9
9
  | "cash"
10
- | "manual";
10
+ | "manual" // same as Square other option;
11
11
 
12
12
  export interface PaymentProviderType {
13
13
  id: string;
@@ -21,6 +21,7 @@ export interface PaymentProviderType {
21
21
  export interface PaymentMethodType {
22
22
  type: MethodsType;
23
23
  offline_support: boolean;
24
+ instant_clear: boolean; // whether the payment is cleared instantly like cash or custom
24
25
  }
25
26
 
26
27
  export type PaymentCollectionStatus =
@@ -34,6 +35,8 @@ export type PaymentCollectionStatus =
34
35
 
35
36
  export interface PaymentCollectionType {
36
37
  id: string;
38
+ organization: string;
39
+ location: string;
37
40
  created_at: string;
38
41
  updated_at: string;
39
42
  status: PaymentCollectionStatus;
package/src/users.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ModuleKey } from "./integrations";
1
+ import type { ModuleKey } from "./connectors";
2
2
  import { AuthObject } from "./pin-auth";
3
3
 
4
4
  export interface UserType {