@passly-nl/data 1.0.0-beta.5 → 1.0.0-rc.1

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@passly-nl/data",
3
3
  "description": "API implementation for Passly.",
4
- "version": "1.0.0-beta.5",
4
+ "version": "1.0.0-rc.1",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
@@ -30,7 +30,8 @@
30
30
  "provenance": true
31
31
  },
32
32
  "scripts": {
33
- "build": "tsgo --noEmit && tsdown"
33
+ "build": "tsgo --noEmit && tsdown",
34
+ "dev": "tsdown --watch"
34
35
  },
35
36
  "main": "./dist/index.mjs",
36
37
  "types": "./dist/index.d.mts",
@@ -49,15 +50,15 @@
49
50
  "./*": "./*"
50
51
  },
51
52
  "dependencies": {
52
- "@basmilius/http-client": "^3.7.1",
53
- "@flux-ui/types": "^3.0.0-next.26",
53
+ "@basmilius/http-client": "^3.8.0",
54
+ "@flux-ui/types": "^3.0.0-next.28",
54
55
  "@fortawesome/fontawesome-common-types": "^7.2.0",
55
56
  "apexcharts": "^5.6.0",
56
57
  "luxon": "^3.7.2"
57
58
  },
58
59
  "devDependencies": {
59
60
  "@types/luxon": "^3.7.1",
60
- "@typescript/native-preview": "^7.0.0-dev.20260226.1",
61
+ "@typescript/native-preview": "^7.0.0-dev.20260227.1",
61
62
  "tsdown": "^0.21.0-beta.2"
62
63
  }
63
64
  }
@@ -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,
@@ -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
+ }
@@ -1,3 +1,4 @@
1
+ export * from './AppTeamDto';
1
2
  export * from './EventAvailabilityDto';
2
3
  export * from './EventCountersDto';
3
4
  export * from './EventDto';
@@ -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
+ }
@@ -5,6 +5,8 @@ export * from './MerchantsService';
5
5
  export * from './MerchantBuyerService';
6
6
  export * from './MerchantBuyersService';
7
7
  export * from './MerchantDashboardService';
8
+ export * from './MerchantEventAppTeamService';
9
+ export * from './MerchantEventAppTeamsService';
8
10
  export * from './MerchantEventProductService';
9
11
  export * from './MerchantEventProductsService';
10
12
  export * from './MerchantEventService';