@marteye/studiojs 1.1.25 → 1.1.26

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,90 @@
1
+ import { HttpClient } from "../net/http";
2
+ import { Application } from "../types";
3
+ export interface CreateApplicationPayload {
4
+ displayName: string;
5
+ phoneNumber?: string;
6
+ email?: string;
7
+ address: {
8
+ firstLine: string;
9
+ secondLine?: string;
10
+ county?: string;
11
+ postCode: string;
12
+ };
13
+ dateOfMarteyeAccountCreation?: string;
14
+ hasWonLotsOnMarteye?: boolean;
15
+ isApprovedAtOtherMarkets?: boolean;
16
+ marteyeUid: string;
17
+ notes?: string;
18
+ }
19
+ export interface UpdateApplicationPayload {
20
+ displayName?: string;
21
+ phoneNumber?: string;
22
+ email?: string;
23
+ address?: {
24
+ firstLine?: string;
25
+ secondLine?: string;
26
+ county?: string;
27
+ postCode?: string;
28
+ };
29
+ notes?: string;
30
+ }
31
+ export interface ListApplicationsOptions {
32
+ lastId?: string;
33
+ status?: "pending" | "approved" | "rejected";
34
+ }
35
+ export interface ListApplicationsResponse {
36
+ applications: Application[];
37
+ lastId: string | null;
38
+ hasMore: boolean;
39
+ }
40
+ export default function create(httpClient: HttpClient): {
41
+ /**
42
+ * List applications for a market with optional filtering
43
+ * @param marketId - ID of the market
44
+ * @param options - Optional query parameters for filtering and pagination
45
+ * @returns Paginated list of applications
46
+ */
47
+ list: (marketId: string, options?: ListApplicationsOptions) => Promise<ListApplicationsResponse>;
48
+ /**
49
+ * Get a single application by ID
50
+ * @param marketId - ID of the market
51
+ * @param applicationId - ID of the application
52
+ * @returns The application details
53
+ */
54
+ get: (marketId: string, applicationId: string) => Promise<Application>;
55
+ /**
56
+ * Create a new application
57
+ * @param marketId - ID of the market
58
+ * @param applicationData - The application data
59
+ * @returns The created application
60
+ */
61
+ create: (marketId: string, applicationData: CreateApplicationPayload) => Promise<Application>;
62
+ /**
63
+ * Update an existing application
64
+ * @param marketId - ID of the market
65
+ * @param applicationId - ID of the application to update
66
+ * @param updateData - The fields to update
67
+ * @returns The updated application
68
+ * @throws Error if the application is already approved or rejected
69
+ */
70
+ update: (marketId: string, applicationId: string, updateData: UpdateApplicationPayload) => Promise<Application>;
71
+ /**
72
+ * Approve an application
73
+ * @param marketId - ID of the market
74
+ * @param applicationId - ID of the application to approve
75
+ * @param notes - Optional notes for the approval
76
+ * @returns The approved application
77
+ * @throws Error if the application is not in pending status
78
+ */
79
+ approve: (marketId: string, applicationId: string, notes?: string) => Promise<Application>;
80
+ /**
81
+ * Reject an application
82
+ * @param marketId - ID of the market
83
+ * @param applicationId - ID of the application to reject
84
+ * @param notes - Optional notes for the rejection
85
+ * @returns The rejected application
86
+ * @throws Error if the application is not in pending status
87
+ */
88
+ reject: (marketId: string, applicationId: string, notes?: string) => Promise<Application>;
89
+ };
90
+ export type Applications = ReturnType<typeof create>;
@@ -133,6 +133,14 @@ export default function resources(httpClient: HttpClient): {
133
133
  actions: {
134
134
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
135
135
  };
136
+ applications: {
137
+ list: (marketId: string, options?: import("./resources/applications").ListApplicationsOptions) => Promise<import("./resources/applications").ListApplicationsResponse>;
138
+ get: (marketId: string, applicationId: string) => Promise<import("./types").Application>;
139
+ create: (marketId: string, applicationData: import("./resources/applications").CreateApplicationPayload) => Promise<import("./types").Application>;
140
+ update: (marketId: string, applicationId: string, updateData: import("./resources/applications").UpdateApplicationPayload) => Promise<import("./types").Application>;
141
+ approve: (marketId: string, applicationId: string, notes?: string) => Promise<import("./types").Application>;
142
+ reject: (marketId: string, applicationId: string, notes?: string) => Promise<import("./types").Application>;
143
+ };
136
144
  settings: {
137
145
  get: (marketId: string) => Promise<import("./types").SettingsMarketDefaults>;
138
146
  };
package/dist/studio.d.ts CHANGED
@@ -142,6 +142,14 @@ export declare function Studio(info?: {
142
142
  actions: {
143
143
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
144
144
  };
145
+ applications: {
146
+ list: (marketId: string, options?: import("./resources/applications").ListApplicationsOptions) => Promise<import("./resources/applications").ListApplicationsResponse>;
147
+ get: (marketId: string, applicationId: string) => Promise<import("./types").Application>;
148
+ create: (marketId: string, applicationData: import("./resources/applications").CreateApplicationPayload) => Promise<import("./types").Application>;
149
+ update: (marketId: string, applicationId: string, updateData: import("./resources/applications").UpdateApplicationPayload) => Promise<import("./types").Application>;
150
+ approve: (marketId: string, applicationId: string, notes?: string) => Promise<import("./types").Application>;
151
+ reject: (marketId: string, applicationId: string, notes?: string) => Promise<import("./types").Application>;
152
+ };
145
153
  settings: {
146
154
  get: (marketId: string) => Promise<import("./types").SettingsMarketDefaults>;
147
155
  };
package/dist/types.d.ts CHANGED
@@ -565,6 +565,31 @@ export interface CustomerFromSearch extends Omit<Customer, "createdAt" | "update
565
565
  lastItemPurchaseDate?: number;
566
566
  lastItemSaleDate?: number;
567
567
  }
568
+ export interface Application {
569
+ id: string;
570
+ createdAt: Timestamp;
571
+ updatedAt: Timestamp;
572
+ marketId: string;
573
+ status: "pending" | "approved" | "rejected";
574
+ displayName: string;
575
+ phoneNumber?: string;
576
+ email?: string;
577
+ address: {
578
+ firstLine: string;
579
+ secondLine?: string;
580
+ county?: string;
581
+ postCode: string;
582
+ };
583
+ dateOfMarteyeAccountCreation?: Timestamp;
584
+ hasWonLotsOnMarteye?: boolean;
585
+ isApprovedAtOtherMarkets?: boolean;
586
+ marteyeUid: string;
587
+ notes?: string;
588
+ approvedBy?: string;
589
+ rejectedBy?: string;
590
+ approvedAt?: Timestamp;
591
+ rejectedAt?: Timestamp;
592
+ }
568
593
  export interface Address {
569
594
  id: string;
570
595
  nickname?: string;
@@ -656,6 +681,14 @@ interface Adjustment {
656
681
  ceilingInCents?: number;
657
682
  } | null;
658
683
  fixedAmountInCents?: number | null;
684
+ ladder?: {
685
+ steps: {
686
+ percentageValue?: number;
687
+ upToAmountInCents?: number | null;
688
+ }[];
689
+ floorInCents?: number;
690
+ ceilingInCents?: number;
691
+ };
659
692
  }
660
693
  export interface LineItemAdjustmentConfiguration extends AdjustmentsConfiguration {
661
694
  adjustment: Adjustment & {
@@ -819,6 +852,7 @@ export interface Invoice extends Omit<Omit<Omit<Omit<DraftInvoice, "ledgerAccoun
819
852
  sales: {
820
853
  id: string;
821
854
  name?: string;
855
+ startsAt?: Timestamp;
822
856
  }[];
823
857
  transactionIds?: string[];
824
858
  status: "draft" | "issued" | "void" | "imported" | "paid";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marteye/studiojs",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "MartEye Studio JavaScript SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",