@use-stall/types 0.1.3 → 0.1.5

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,5 @@ 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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-stall/types",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Type declarations for Stall SDKs",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
@@ -22,14 +22,8 @@ type ModuleKey =
22
22
  | "fulfillment_types" // Like delivery, pickup, etc.
23
23
  | "fulfillment_providers" // Providers third party or custom like DHL, FedEx, UPS, etc.
24
24
  | "fulfillments"; // Individual fulfillment instances for an order
25
-
26
- export type IntegrationConnectionType =
27
- | "connector"
28
- | "payments"
29
- | "fulfillments"
30
- | "fiscalizations";
31
25
 
32
- export interface IntegrationModulesType {
26
+ export interface ConnectorModulesType {
33
27
  [key in ModuleKey]: {
34
28
  supported: boolean;
35
29
  actions: {
@@ -41,28 +35,26 @@ export interface IntegrationModulesType {
41
35
  };
42
36
  }
43
37
 
44
- export interface IntegrationType {
38
+ export interface ConnectorIntegrationType {
45
39
  id: string;
46
40
  version: string;
47
41
  name: string;
48
- type: IntegrationConnectionType;
49
42
  description: string;
50
43
  logo: string;
51
- modules: IntegrationModulesType;
44
+ modules: ConnectorModulesType;
52
45
  authentication: {
53
46
  type: "basic" | "bearer" | "api_key" | "none";
54
47
  ttl_type: "permanent" | "session";
55
48
  ttl_value: number; // TTL value in minutes
56
49
  };
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
50
+ integration_url: string;
51
+ integration_docs: string;
59
52
  active: boolean;
60
53
  }
61
54
 
62
- export interface IntegrationConfigurationType {
55
+ export interface ConnectorConfigurationType {
63
56
  id: string;
64
57
  integration_id: string;
65
- type: IntegrationConnectionType;
66
58
  created_at: number;
67
59
  updated_at: number;
68
60
  configuration: {
@@ -72,14 +64,12 @@ export interface IntegrationConfigurationType {
72
64
  token: string; // For bearer authentication
73
65
  api_key_header: string; // For API key authentication or Custom header
74
66
  api_key_value: string; // For API key authentication or Custom header
75
- [key: string]: any;
76
67
  };
77
68
  }
78
69
 
79
- export interface IntegrationRequestType {
70
+ export interface ConnectorIntegrationRequestType {
80
71
  id: string;
81
72
  organization: string;
82
73
  integration: string;
83
74
  created_at: number;
84
- type: IntegrationConnectionType;
85
75
  }
@@ -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
@@ -5,8 +5,9 @@ export type MethodsType =
5
5
  | "payment_link"
6
6
  | "qr_code"
7
7
  | "mobile_money"
8
+ | "connector_payments"
8
9
  | "cash"
9
- | "manual";
10
+ | "manual" // same as Square other option;
10
11
 
11
12
  export interface PaymentProviderType {
12
13
  id: string;
@@ -14,11 +15,13 @@ export interface PaymentProviderType {
14
15
  description: string;
15
16
  logo: string;
16
17
  supported_methods: PaymentMethodType[];
18
+ supported_countries: string[];
17
19
  }
18
20
 
19
21
  export interface PaymentMethodType {
20
22
  type: MethodsType;
21
23
  offline_support: boolean;
24
+ instant_clear: boolean; // whether the payment is cleared instantly like cash or custom
22
25
  }
23
26
 
24
27
  export type PaymentCollectionStatus =
@@ -32,6 +35,8 @@ export type PaymentCollectionStatus =
32
35
 
33
36
  export interface PaymentCollectionType {
34
37
  id: string;
38
+ organization: string;
39
+ location: string;
35
40
  created_at: string;
36
41
  updated_at: string;
37
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 {