@passly-nl/data 1.0.0-rc.0 → 1.0.0-rc.10
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/dist/index.d.mts +103 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -5
- package/src/adapter/EventAdapter.ts +16 -2
- package/src/adapter/MerchantDashboardAdapter.ts +2 -1
- package/src/adapter/PublicShopAdapter.ts +1 -0
- package/src/adapter/ServiceAdapter.ts +13 -0
- package/src/adapter/ShortlinkAdapter.ts +17 -0
- package/src/adapter/index.ts +2 -0
- package/src/dto/event/AppTeamDto.ts +89 -0
- package/src/dto/event/ShopDto.ts +12 -2
- package/src/dto/event/index.ts +1 -0
- package/src/dto/index.ts +2 -0
- package/src/dto/publicShop/PublicShopDto.ts +12 -2
- package/src/dto/service/ServiceInfoDto.ts +38 -0
- package/src/dto/service/index.ts +1 -0
- package/src/dto/shortlink/ShortlinkDto.ts +69 -0
- package/src/dto/shortlink/index.ts +1 -0
- package/src/service/MerchantEventAppTeamService.ts +38 -0
- package/src/service/MerchantEventAppTeamsService.ts +30 -0
- package/src/service/MerchantEventShopService.ts +26 -2
- package/src/service/MerchantService.ts +3 -3
- package/src/service/MerchantShopService.ts +35 -0
- package/src/service/MerchantShopsService.ts +17 -0
- package/src/service/MerchantStatisticsService.ts +11 -1
- package/src/service/PublicOrderService.ts +9 -0
- package/src/service/PublicShopService.ts +22 -2
- package/src/service/ServicesService.ts +10 -0
- package/src/service/index.ts +4 -0
- package/src/types/event.ts +5 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@passly-nl/data",
|
|
3
3
|
"description": "API implementation for Passly.",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/basmilius",
|
|
@@ -50,15 +50,19 @@
|
|
|
50
50
|
"./*": "./*"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@basmilius/http-client": "^3.
|
|
53
|
+
"@basmilius/http-client": "^3.10.0",
|
|
54
54
|
"@flux-ui/types": "^3.0.0-next.28",
|
|
55
55
|
"@fortawesome/fontawesome-common-types": "^7.2.0",
|
|
56
|
-
"apexcharts": "^5.
|
|
56
|
+
"apexcharts": "^5.10.1",
|
|
57
57
|
"luxon": "^3.7.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/luxon": "^3.7.1",
|
|
61
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
62
|
-
"tsdown": "^0.21.0-beta.
|
|
61
|
+
"@typescript/native-preview": "^7.0.0-dev.20260305.1",
|
|
62
|
+
"tsdown": "^0.21.0-beta.5"
|
|
63
|
+
},
|
|
64
|
+
"overrides": {
|
|
65
|
+
"@disabled-basmilius/http-client": "link:@basmilius/http-client",
|
|
66
|
+
"@disabled-flux-ui/types": "link:@flux-ui/types"
|
|
63
67
|
}
|
|
64
68
|
}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { adapter, ForeignData } from '@basmilius/http-client';
|
|
2
|
-
import { AddressAdapter, DateTimeAdapter, FileSystemAdapter, MerchantAdapter, PaymentAdapter, ProductAdapter } from '#data/adapter';
|
|
3
|
-
import { EventAvailabilityDto, EventCountersDto, EventDto, EventStatisticsAttendanceDto, EventStatisticsBuyerTotalsDto, EventStatisticsFinancialDto, EventStatisticsOrdersDto, EventStatisticsOrderTotalsDto, EventStatisticsScansDto, EventStatisticsScansPerAppTeamDto, EventStatisticsScanTotalsDto, EventStatisticsSwapTotalsDto, ShopDesignDto, ShopDto, ShopElementButtonDto, ShopElementDividerDto, ShopElementDto, ShopElementHeadingDto, ShopElementNoticeDto, ShopElementProductDto, ShopElementTextDto, StockOverviewDto, StockOverviewItemDto, StockPoolDto, TicketTemplateDto } from '#data/dto';
|
|
2
|
+
import { AddressAdapter, AuthAdapter, DateTimeAdapter, FileSystemAdapter, MerchantAdapter, PaymentAdapter, ProductAdapter } from '#data/adapter';
|
|
3
|
+
import { AppTeamDto, EventAvailabilityDto, EventCountersDto, EventDto, EventStatisticsAttendanceDto, EventStatisticsBuyerTotalsDto, EventStatisticsFinancialDto, EventStatisticsOrdersDto, EventStatisticsOrderTotalsDto, EventStatisticsScansDto, EventStatisticsScansPerAppTeamDto, EventStatisticsScanTotalsDto, EventStatisticsSwapTotalsDto, ShopDesignDto, ShopDto, ShopElementButtonDto, ShopElementDividerDto, ShopElementDto, ShopElementHeadingDto, ShopElementNoticeDto, ShopElementProductDto, ShopElementTextDto, StockOverviewDto, StockOverviewItemDto, StockPoolDto, TicketTemplateDto } from '#data/dto';
|
|
4
4
|
import { optional } from '#data/util';
|
|
5
5
|
|
|
6
6
|
@adapter
|
|
7
7
|
export class EventAdapter {
|
|
8
|
+
static parseAppTeam(data: ForeignData): AppTeamDto {
|
|
9
|
+
return new AppTeamDto(
|
|
10
|
+
data.id,
|
|
11
|
+
data.name,
|
|
12
|
+
data.secret,
|
|
13
|
+
data.checkin_count,
|
|
14
|
+
data.checkout_count,
|
|
15
|
+
optional(data.creator, AuthAdapter.parseUser),
|
|
16
|
+
optional(data.event, EventAdapter.parseEvent),
|
|
17
|
+
optional(data.merchant, MerchantAdapter.parseMerchant)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
static parseEvent(data: ForeignData): EventDto {
|
|
9
22
|
return new EventDto(
|
|
10
23
|
data.id,
|
|
@@ -48,6 +61,7 @@ export class EventAdapter {
|
|
|
48
61
|
optional(data.starts_on, DateTimeAdapter.parseDateTime),
|
|
49
62
|
optional(data.ends_on, DateTimeAdapter.parseDateTime),
|
|
50
63
|
data.field_address,
|
|
64
|
+
data.field_address_mode,
|
|
51
65
|
data.field_birthdate,
|
|
52
66
|
data.field_gender,
|
|
53
67
|
data.field_phone_number,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { adapter, ForeignData } from '@basmilius/http-client';
|
|
2
2
|
import { DateTimeAdapter, FileSystemAdapter } from '#data/adapter';
|
|
3
3
|
import { MerchantDashboardKeyMetricsDto, MerchantDashboardUpcomingEventDto } from '#data/dto';
|
|
4
|
+
import { optional } from '#data/util';
|
|
4
5
|
|
|
5
6
|
@adapter
|
|
6
7
|
export class MerchantDashboardAdapter {
|
|
@@ -18,7 +19,7 @@ export class MerchantDashboardAdapter {
|
|
|
18
19
|
data.id,
|
|
19
20
|
data.name,
|
|
20
21
|
data.description,
|
|
21
|
-
|
|
22
|
+
optional(data.header_file, FileSystemAdapter.parsePicture),
|
|
22
23
|
data.status,
|
|
23
24
|
DateTimeAdapter.parseDateTime(data.starts_on),
|
|
24
25
|
data.tickets_sold,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { adapter, type ForeignData } from '@basmilius/http-client';
|
|
2
|
+
import { ServiceInfoDto } from '#data/dto';
|
|
3
|
+
|
|
4
|
+
@adapter
|
|
5
|
+
export class ServiceAdapter {
|
|
6
|
+
static parseInfo(data: ForeignData): ServiceInfoDto {
|
|
7
|
+
return new ServiceInfoDto(
|
|
8
|
+
data.connecting_ip,
|
|
9
|
+
data.country,
|
|
10
|
+
data.ray
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { adapter, type ForeignData } from '@basmilius/http-client';
|
|
2
|
+
import { DateTimeAdapter } from '#data/adapter';
|
|
3
|
+
import { ShortlinkDto } from '#data/dto';
|
|
4
|
+
|
|
5
|
+
@adapter
|
|
6
|
+
export class ShortlinkAdapter {
|
|
7
|
+
static parse(data: ForeignData): ShortlinkDto {
|
|
8
|
+
return new ShortlinkDto(
|
|
9
|
+
data.id,
|
|
10
|
+
data.identifier,
|
|
11
|
+
data.hits,
|
|
12
|
+
data.link,
|
|
13
|
+
data.target,
|
|
14
|
+
DateTimeAdapter.parseDateTime(data.createdOn)
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/adapter/index.ts
CHANGED
|
@@ -15,6 +15,8 @@ export * from './ProductAdapter';
|
|
|
15
15
|
export * from './PublicPayAdapter';
|
|
16
16
|
export * from './PublicShopAdapter';
|
|
17
17
|
export * from './ReservationAdapter';
|
|
18
|
+
export * from './ServiceAdapter';
|
|
19
|
+
export * from './ShortlinkAdapter';
|
|
18
20
|
export * from './StatisticsAdapter';
|
|
19
21
|
export * from './StatisticsBuyersAdapter';
|
|
20
22
|
export * from './StatisticsEventsAdapter';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import { type EventDto, type MerchantDto, type UserDto } from '#data/dto';
|
|
3
|
+
|
|
4
|
+
@dto
|
|
5
|
+
export class AppTeamDto {
|
|
6
|
+
get id(): string {
|
|
7
|
+
return this.#id;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
set id(value: string) {
|
|
11
|
+
this.#id = value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get name(): string {
|
|
15
|
+
return this.#name;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set name(value: string) {
|
|
19
|
+
this.#name = value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get secret(): string {
|
|
23
|
+
return this.#secret;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set secret(value: string) {
|
|
27
|
+
this.#secret = value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get checkinCount(): number {
|
|
31
|
+
return this.#checkinCount;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set checkinCount(value: number) {
|
|
35
|
+
this.#checkinCount = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get checkoutCount(): number {
|
|
39
|
+
return this.#checkoutCount;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set checkoutCount(value: number) {
|
|
43
|
+
this.#checkoutCount = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get creator(): UserDto {
|
|
47
|
+
return this.#creator;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
set creator(value: UserDto) {
|
|
51
|
+
this.#creator = value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get event(): EventDto {
|
|
55
|
+
return this.#event;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
set event(value: EventDto) {
|
|
59
|
+
this.#event = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get merchant(): MerchantDto {
|
|
63
|
+
return this.#merchant;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set merchant(value: MerchantDto) {
|
|
67
|
+
this.#merchant = value;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#id: string;
|
|
71
|
+
#name: string;
|
|
72
|
+
#secret: string;
|
|
73
|
+
#checkinCount: number;
|
|
74
|
+
#checkoutCount: number;
|
|
75
|
+
#creator: UserDto;
|
|
76
|
+
#event: EventDto;
|
|
77
|
+
#merchant: MerchantDto;
|
|
78
|
+
|
|
79
|
+
constructor(id: string, name: string, secret: string, checkinCount: number, checkoutCount: number, creator: UserDto, event: EventDto, merchant: MerchantDto) {
|
|
80
|
+
this.#id = id;
|
|
81
|
+
this.#name = name;
|
|
82
|
+
this.#secret = secret;
|
|
83
|
+
this.#checkinCount = checkinCount;
|
|
84
|
+
this.#checkoutCount = checkoutCount;
|
|
85
|
+
this.#creator = creator;
|
|
86
|
+
this.#event = event;
|
|
87
|
+
this.#merchant = merchant;
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/dto/event/ShopDto.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dto } from '@basmilius/http-client';
|
|
2
2
|
import type { DateTime } from 'luxon';
|
|
3
3
|
import type { EventDto, MerchantDto, ShopDesignDto } from '#data/dto';
|
|
4
|
-
import type { ShopFieldRequirement, ShopStatus } from '#data/types';
|
|
4
|
+
import type { ShopAddressMode, ShopFieldRequirement, ShopStatus } from '#data/types';
|
|
5
5
|
|
|
6
6
|
@dto
|
|
7
7
|
export class ShopDto {
|
|
@@ -61,6 +61,14 @@ export class ShopDto {
|
|
|
61
61
|
this.#fieldAddress = value;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
get fieldAddressMode(): ShopAddressMode {
|
|
65
|
+
return this.#fieldAddressMode;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
set fieldAddressMode(value: ShopAddressMode) {
|
|
69
|
+
this.#fieldAddressMode = value;
|
|
70
|
+
}
|
|
71
|
+
|
|
64
72
|
get fieldBirthdate(): ShopFieldRequirement {
|
|
65
73
|
return this.#fieldBirthdate;
|
|
66
74
|
}
|
|
@@ -124,6 +132,7 @@ export class ShopDto {
|
|
|
124
132
|
#startsOn: DateTime | null;
|
|
125
133
|
#endsOn: DateTime | null;
|
|
126
134
|
#fieldAddress: ShopFieldRequirement;
|
|
135
|
+
#fieldAddressMode: ShopAddressMode;
|
|
127
136
|
#fieldBirthdate: ShopFieldRequirement;
|
|
128
137
|
#fieldGender: ShopFieldRequirement;
|
|
129
138
|
#fieldPhoneNumber: ShopFieldRequirement;
|
|
@@ -132,7 +141,7 @@ export class ShopDto {
|
|
|
132
141
|
#event: EventDto;
|
|
133
142
|
#merchant: MerchantDto;
|
|
134
143
|
|
|
135
|
-
constructor(id: string, name: string, isPublished: boolean, password: string, startsOn: DateTime | null, endsOn: DateTime | null, fieldAddress: ShopFieldRequirement, fieldBirthdate: ShopFieldRequirement, fieldGender: ShopFieldRequirement, fieldPhoneNumber: ShopFieldRequirement, status: ShopStatus, design: ShopDesignDto, event: EventDto, merchant: MerchantDto) {
|
|
144
|
+
constructor(id: string, name: string, isPublished: boolean, password: string, startsOn: DateTime | null, endsOn: DateTime | null, fieldAddress: ShopFieldRequirement, fieldAddressMode: ShopAddressMode, fieldBirthdate: ShopFieldRequirement, fieldGender: ShopFieldRequirement, fieldPhoneNumber: ShopFieldRequirement, status: ShopStatus, design: ShopDesignDto, event: EventDto, merchant: MerchantDto) {
|
|
136
145
|
this.#id = id;
|
|
137
146
|
this.#name = name;
|
|
138
147
|
this.#isPublished = isPublished;
|
|
@@ -140,6 +149,7 @@ export class ShopDto {
|
|
|
140
149
|
this.#startsOn = startsOn;
|
|
141
150
|
this.#endsOn = endsOn;
|
|
142
151
|
this.#fieldAddress = fieldAddress;
|
|
152
|
+
this.#fieldAddressMode = fieldAddressMode;
|
|
143
153
|
this.#fieldBirthdate = fieldBirthdate;
|
|
144
154
|
this.#fieldGender = fieldGender;
|
|
145
155
|
this.#fieldPhoneNumber = fieldPhoneNumber;
|
package/src/dto/event/index.ts
CHANGED
package/src/dto/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dto } from '@basmilius/http-client';
|
|
2
2
|
import type { DateTime } from 'luxon';
|
|
3
3
|
import type { PublicShopDesignDto, PublicShopElementDto, PublicShopEventDto, PublicShopMerchantDto } from '#data/dto';
|
|
4
|
-
import type { ShopFieldRequirement } from '#data/types';
|
|
4
|
+
import type { ShopAddressMode, ShopFieldRequirement } from '#data/types';
|
|
5
5
|
|
|
6
6
|
@dto
|
|
7
7
|
export class PublicShopDto {
|
|
@@ -45,6 +45,14 @@ export class PublicShopDto {
|
|
|
45
45
|
this.#fieldAddress = value;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
get fieldAddressMode(): ShopAddressMode {
|
|
49
|
+
return this.#fieldAddressMode;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
set fieldAddressMode(value: ShopAddressMode) {
|
|
53
|
+
this.#fieldAddressMode = value;
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
get fieldBirthdate(): ShopFieldRequirement {
|
|
49
57
|
return this.#fieldBirthdate;
|
|
50
58
|
}
|
|
@@ -106,6 +114,7 @@ export class PublicShopDto {
|
|
|
106
114
|
#startsOn: DateTime;
|
|
107
115
|
#endsOn: DateTime;
|
|
108
116
|
#fieldAddress: ShopFieldRequirement;
|
|
117
|
+
#fieldAddressMode: ShopAddressMode;
|
|
109
118
|
#fieldBirthdate: ShopFieldRequirement;
|
|
110
119
|
#fieldGender: ShopFieldRequirement;
|
|
111
120
|
#fieldPhoneNumber: ShopFieldRequirement;
|
|
@@ -114,12 +123,13 @@ export class PublicShopDto {
|
|
|
114
123
|
#event: PublicShopEventDto;
|
|
115
124
|
#merchant: PublicShopMerchantDto;
|
|
116
125
|
|
|
117
|
-
constructor(id: string, name: string, startsOn: DateTime, endsOn: DateTime, fieldAddress: ShopFieldRequirement, fieldBirthdate: ShopFieldRequirement, fieldGender: ShopFieldRequirement, fieldPhoneNumber: ShopFieldRequirement, design: PublicShopDesignDto, elements: PublicShopElementDto[] | null, event: PublicShopEventDto, merchant: PublicShopMerchantDto) {
|
|
126
|
+
constructor(id: string, name: string, startsOn: DateTime, endsOn: DateTime, fieldAddress: ShopFieldRequirement, fieldAddressMode: ShopAddressMode, fieldBirthdate: ShopFieldRequirement, fieldGender: ShopFieldRequirement, fieldPhoneNumber: ShopFieldRequirement, design: PublicShopDesignDto, elements: PublicShopElementDto[] | null, event: PublicShopEventDto, merchant: PublicShopMerchantDto) {
|
|
118
127
|
this.#id = id;
|
|
119
128
|
this.#name = name;
|
|
120
129
|
this.#startsOn = startsOn;
|
|
121
130
|
this.#endsOn = endsOn;
|
|
122
131
|
this.#fieldAddress = fieldAddress;
|
|
132
|
+
this.#fieldAddressMode = fieldAddressMode;
|
|
123
133
|
this.#fieldBirthdate = fieldBirthdate;
|
|
124
134
|
this.#fieldGender = fieldGender;
|
|
125
135
|
this.#fieldPhoneNumber = fieldPhoneNumber;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
|
|
3
|
+
@dto
|
|
4
|
+
export class ServiceInfoDto {
|
|
5
|
+
get connectingIp(): string {
|
|
6
|
+
return this.#connectingIp;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
set connectingIp(value: string) {
|
|
10
|
+
this.#connectingIp = value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get country(): string | null {
|
|
14
|
+
return this.#country;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
set country(value: string | null) {
|
|
18
|
+
this.#country = value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get ray(): string | null {
|
|
22
|
+
return this.#ray;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set ray(value: string | null) {
|
|
26
|
+
this.#ray = value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#connectingIp: string;
|
|
30
|
+
#country: string | null;
|
|
31
|
+
#ray: string | null;
|
|
32
|
+
|
|
33
|
+
constructor(connectingIp: string, country: string | null, ray: string | null) {
|
|
34
|
+
this.#connectingIp = connectingIp;
|
|
35
|
+
this.#country = country;
|
|
36
|
+
this.#ray = ray;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ServiceInfoDto';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { DateTime } from 'luxon';
|
|
3
|
+
|
|
4
|
+
@dto
|
|
5
|
+
export class ShortlinkDto {
|
|
6
|
+
get id(): string {
|
|
7
|
+
return this.#id;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
set id(value: string) {
|
|
11
|
+
this.#id = value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get identifier(): string {
|
|
15
|
+
return this.#identifier;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set identifier(value: string) {
|
|
19
|
+
this.#identifier = value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get hits(): number {
|
|
23
|
+
return this.#hits;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set hits(value: number) {
|
|
27
|
+
this.#hits = value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get link(): string {
|
|
31
|
+
return this.#link;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set link(value: string) {
|
|
35
|
+
this.#link = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get target(): string {
|
|
39
|
+
return this.#target;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set target(value: string) {
|
|
43
|
+
this.#target = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get createdOn(): DateTime {
|
|
47
|
+
return this.#createdOn;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
set createdOn(value: DateTime) {
|
|
51
|
+
this.#createdOn = value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
#id: string;
|
|
55
|
+
#identifier: string;
|
|
56
|
+
#hits: number;
|
|
57
|
+
#link: string;
|
|
58
|
+
#target: string;
|
|
59
|
+
#createdOn: DateTime;
|
|
60
|
+
|
|
61
|
+
constructor(id: string, identifier: string, hits: number, link: string, target: string, createdOn: DateTime) {
|
|
62
|
+
this.#id = id;
|
|
63
|
+
this.#identifier = identifier;
|
|
64
|
+
this.#hits = hits;
|
|
65
|
+
this.#link = link;
|
|
66
|
+
this.#target = target;
|
|
67
|
+
this.#createdOn = createdOn;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ShortlinkDto';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type BaseResponse, BaseService, QueryString } from '@basmilius/http-client';
|
|
2
|
+
import { CommonAdapter, EventAdapter } from '#data/adapter';
|
|
3
|
+
import type { AppTeamDto, StatusResponseDto } from '#data/dto';
|
|
4
|
+
|
|
5
|
+
export class MerchantEventAppTeamService extends BaseService {
|
|
6
|
+
async get(merchantId: string, eventId: string, appTeamId: string): Promise<BaseResponse<AppTeamDto>> {
|
|
7
|
+
return await this
|
|
8
|
+
.request(`/merchants/${merchantId}/events/${eventId}/app-teams/${appTeamId}`)
|
|
9
|
+
.method('get')
|
|
10
|
+
.bearerToken()
|
|
11
|
+
.queryString(QueryString.builder()
|
|
12
|
+
.append('language', 'nl'))
|
|
13
|
+
.runAdapter(EventAdapter.parseAppTeam);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async delete(merchantId: string, eventId: string, appTeamId: string): Promise<BaseResponse<StatusResponseDto>> {
|
|
17
|
+
return await this
|
|
18
|
+
.request(`/merchants/${merchantId}/events/${eventId}/app-teams/${appTeamId}`)
|
|
19
|
+
.method('delete')
|
|
20
|
+
.bearerToken()
|
|
21
|
+
.queryString(QueryString.builder()
|
|
22
|
+
.append('language', 'nl'))
|
|
23
|
+
.runAdapter(CommonAdapter.parseStatusResponse);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async patch(merchantId: string, eventId: string, appTeamId: string, appTeam: AppTeamDto): Promise<BaseResponse<AppTeamDto>> {
|
|
27
|
+
return await this
|
|
28
|
+
.request(`/merchants/${merchantId}/events/${eventId}/app-teams/${appTeamId}`)
|
|
29
|
+
.method('patch')
|
|
30
|
+
.bearerToken()
|
|
31
|
+
.queryString(QueryString.builder()
|
|
32
|
+
.append('language', 'nl'))
|
|
33
|
+
.body({
|
|
34
|
+
name: appTeam.name
|
|
35
|
+
})
|
|
36
|
+
.runAdapter(EventAdapter.parseAppTeam);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type BaseResponse, BaseService, type Paginated, QueryString } from '@basmilius/http-client';
|
|
2
|
+
import { EventAdapter } from '#data/adapter';
|
|
3
|
+
import type { AppTeamDto } from '#data/dto';
|
|
4
|
+
|
|
5
|
+
export class MerchantEventAppTeamsService extends BaseService {
|
|
6
|
+
async get(merchantId: string, eventId: string, offset: number, limit: number): Promise<BaseResponse<Paginated<AppTeamDto>>> {
|
|
7
|
+
return await this
|
|
8
|
+
.request(`/merchants/${merchantId}/events/${eventId}/app-teams`)
|
|
9
|
+
.method('get')
|
|
10
|
+
.bearerToken()
|
|
11
|
+
.queryString(QueryString.builder()
|
|
12
|
+
.append('language', 'nl')
|
|
13
|
+
.append('offset', offset)
|
|
14
|
+
.append('limit', limit))
|
|
15
|
+
.runPaginatedAdapter(EventAdapter.parseAppTeam);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async post(merchantId: string, eventId: string, name: string): Promise<BaseResponse<AppTeamDto>> {
|
|
19
|
+
return await this
|
|
20
|
+
.request(`/merchants/${merchantId}/events/${eventId}/app-teams`)
|
|
21
|
+
.method('post')
|
|
22
|
+
.bearerToken()
|
|
23
|
+
.queryString(QueryString.builder()
|
|
24
|
+
.append('language', 'nl'))
|
|
25
|
+
.body({
|
|
26
|
+
name
|
|
27
|
+
})
|
|
28
|
+
.runAdapter(EventAdapter.parseAppTeam);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseResponse, BaseService, QueryString } from '@basmilius/http-client';
|
|
2
|
-
import { EventAdapter } from '#data/adapter';
|
|
3
|
-
import type { ShopDesignDto, ShopDto, ShopElementDto } from '#data/dto';
|
|
2
|
+
import { EventAdapter, ShortlinkAdapter } from '#data/adapter';
|
|
3
|
+
import type { ShopDesignDto, ShopDto, ShopElementDto, ShortlinkDto } from '#data/dto';
|
|
4
4
|
|
|
5
5
|
export class MerchantEventShopService extends BaseService {
|
|
6
6
|
async get(merchantId: string, eventId: string, shopId: string): Promise<BaseResponse<ShopDto>> {
|
|
@@ -23,6 +23,16 @@ export class MerchantEventShopService extends BaseService {
|
|
|
23
23
|
.runArrayAdapter(EventAdapter.parseShopElement);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
async getShortlink(merchantId: string, eventId: string, shopId: string): Promise<BaseResponse<ShortlinkDto>> {
|
|
27
|
+
return await this
|
|
28
|
+
.request(`/merchants/${merchantId}/events/${eventId}/shops/${shopId}/shortlink`)
|
|
29
|
+
.method('get')
|
|
30
|
+
.queryString(QueryString.builder()
|
|
31
|
+
.append('language', 'nl'))
|
|
32
|
+
.bearerToken()
|
|
33
|
+
.runAdapter(ShortlinkAdapter.parse);
|
|
34
|
+
}
|
|
35
|
+
|
|
26
36
|
async patch(merchantId: string, eventId: string, shop: ShopDto): Promise<BaseResponse<ShopDto>> {
|
|
27
37
|
return await this
|
|
28
38
|
.request(`/merchants/${merchantId}/events/${eventId}/shops/${shop.id}`)
|
|
@@ -44,6 +54,8 @@ export class MerchantEventShopService extends BaseService {
|
|
|
44
54
|
return await this
|
|
45
55
|
.request(`/merchants/${merchantId}/events/${eventId}/shops/${shopId}/design`)
|
|
46
56
|
.method('patch')
|
|
57
|
+
.queryString(QueryString.builder()
|
|
58
|
+
.append('language', 'nl'))
|
|
47
59
|
.bearerToken()
|
|
48
60
|
.body({
|
|
49
61
|
background_color: design.backgroundColor,
|
|
@@ -57,10 +69,22 @@ export class MerchantEventShopService extends BaseService {
|
|
|
57
69
|
return await this
|
|
58
70
|
.request(`/merchants/${merchantId}/events/${eventId}/shops/${shopId}/elements`)
|
|
59
71
|
.method('patch')
|
|
72
|
+
.queryString(QueryString.builder()
|
|
73
|
+
.append('language', 'nl'))
|
|
60
74
|
.bearerToken()
|
|
61
75
|
.body({
|
|
62
76
|
elements
|
|
63
77
|
})
|
|
64
78
|
.runArrayAdapter(EventAdapter.parseShopElement);
|
|
65
79
|
}
|
|
80
|
+
|
|
81
|
+
async postShortlink(merchantId: string, eventId: string, shopId: string): Promise<BaseResponse<ShortlinkDto>> {
|
|
82
|
+
return await this
|
|
83
|
+
.request(`/merchants/${merchantId}/events/${eventId}/shops/${shopId}/shortlink`)
|
|
84
|
+
.method('post')
|
|
85
|
+
.queryString(QueryString.builder()
|
|
86
|
+
.append('language', 'nl'))
|
|
87
|
+
.bearerToken()
|
|
88
|
+
.runAdapter(ShortlinkAdapter.parse);
|
|
89
|
+
}
|
|
66
90
|
}
|
|
@@ -15,14 +15,14 @@ export class MerchantService extends BaseService {
|
|
|
15
15
|
.runAdapter(MerchantAdapter.parseMerchant);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async
|
|
18
|
+
async getAccountManagers(merchantId: string): Promise<BaseResponse<UserDto[]>> {
|
|
19
19
|
return await this
|
|
20
|
-
.request(`/merchants/${merchantId}/account-
|
|
20
|
+
.request(`/merchants/${merchantId}/account-managers`)
|
|
21
21
|
.method('get')
|
|
22
22
|
.queryString(QueryString.builder()
|
|
23
23
|
.append('language', 'nl'))
|
|
24
24
|
.bearerToken()
|
|
25
|
-
.
|
|
25
|
+
.runArrayAdapter(AuthAdapter.parseUser);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async getClaims(merchantId: string): Promise<BaseResponse<Claim[]>> {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BaseResponse, BaseService, QueryString } from '@basmilius/http-client';
|
|
2
|
+
import { EventAdapter, PublicShopAdapter } from '#data/adapter';
|
|
3
|
+
import type { PublicShopDto, ShopDto, ShopElementDto } from '#data/dto';
|
|
4
|
+
|
|
5
|
+
export class MerchantShopService extends BaseService {
|
|
6
|
+
async get(merchantId: string, shopId: string): Promise<BaseResponse<ShopDto>> {
|
|
7
|
+
return await this
|
|
8
|
+
.request(`/merchants/${merchantId}/shops/${shopId}`)
|
|
9
|
+
.method('get')
|
|
10
|
+
.queryString(QueryString.builder()
|
|
11
|
+
.append('language', 'nl'))
|
|
12
|
+
.bearerToken()
|
|
13
|
+
.runAdapter(EventAdapter.parseShop);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async getElements(merchantId: string, shopId: string): Promise<BaseResponse<ShopElementDto[]>> {
|
|
17
|
+
return await this
|
|
18
|
+
.request(`/merchants/${merchantId}/shops/${shopId}/elements`)
|
|
19
|
+
.method('get')
|
|
20
|
+
.queryString(QueryString.builder()
|
|
21
|
+
.append('language', 'nl'))
|
|
22
|
+
.bearerToken()
|
|
23
|
+
.runArrayAdapter(EventAdapter.parseShopElement);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async getPreview(merchantId: string, shopId: string): Promise<BaseResponse<PublicShopDto>> {
|
|
27
|
+
return await this
|
|
28
|
+
.request(`/merchants/${merchantId}/shops/${shopId}/preview`)
|
|
29
|
+
.method('get')
|
|
30
|
+
.queryString(QueryString.builder()
|
|
31
|
+
.append('language', 'nl'))
|
|
32
|
+
.bearerToken()
|
|
33
|
+
.runAdapter(PublicShopAdapter.parsePublicShop);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/http-client';
|
|
2
|
+
import { EventAdapter } from '#data/adapter';
|
|
3
|
+
import type { ShopDto } from '#data/dto';
|
|
4
|
+
|
|
5
|
+
export class MerchantShopsService extends BaseService {
|
|
6
|
+
async get(merchantId: string, offset: number, limit: number): Promise<BaseResponse<Paginated<ShopDto>>> {
|
|
7
|
+
return await this
|
|
8
|
+
.request(`/merchants/${merchantId}/shops`)
|
|
9
|
+
.method('get')
|
|
10
|
+
.queryString(QueryString.builder()
|
|
11
|
+
.append('language', 'nl')
|
|
12
|
+
.append('offset', offset)
|
|
13
|
+
.append('limit', limit))
|
|
14
|
+
.bearerToken()
|
|
15
|
+
.runPaginatedAdapter(EventAdapter.parseShop);
|
|
16
|
+
}
|
|
17
|
+
}
|