@passly-nl/data 1.3.4 → 1.3.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/dist/index.d.mts +46 -30
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +64 -43
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -12
- package/src/dto/aiUsage/AiUsagePeriodDto.ts +4 -4
- package/src/dto/statistics/InsightsResponseDto.ts +4 -4
- package/src/service/AdminMerchantsService.ts +5 -6
- package/src/service/MerchantBuyerService.ts +4 -5
- package/src/service/MerchantBuyersService.ts +5 -6
- package/src/service/MerchantContractService.ts +4 -5
- package/src/service/MerchantDiscountCodesService.ts +4 -12
- package/src/service/MerchantEmailTemplatesService.ts +5 -6
- package/src/service/MerchantEventAppTeamsService.ts +4 -5
- package/src/service/MerchantEventEmailTemplatesService.ts +5 -6
- package/src/service/MerchantEventProductsService.ts +4 -5
- package/src/service/MerchantEventShopsService.ts +4 -5
- package/src/service/MerchantEventStockPoolsService.ts +4 -5
- package/src/service/MerchantEventTicketTemplatesService.ts +4 -7
- package/src/service/MerchantEventTimeSlotsService.ts +14 -1
- package/src/service/MerchantEventsService.ts +17 -5
- package/src/service/MerchantFinanceInvoicesService.ts +5 -6
- package/src/service/MerchantOrdersService.ts +5 -15
- package/src/service/MerchantShopsService.ts +5 -6
- package/src/service/MerchantTicketsService.ts +5 -15
- package/src/service/MerchantUsersService.ts +4 -6
- package/src/service/PublicShopService.ts +1 -1
- package/src/types/index.ts +1 -0
- package/src/types/list.ts +12 -0
- package/src/util/buildListQuery.ts +48 -0
- package/src/util/index.ts +1 -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.3.
|
|
4
|
+
"version": "1.3.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/basmilius",
|
|
@@ -50,22 +50,16 @@
|
|
|
50
50
|
"./*": "./*"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@basmilius/http-client": "^3.
|
|
54
|
-
"@flux-ui/types": "^3.0.0-next.
|
|
55
|
-
"@fortawesome/fontawesome-common-types": "^7.2.0",
|
|
53
|
+
"@basmilius/http-client": "^3.38.0",
|
|
54
|
+
"@flux-ui/types": "^3.0.0-next.72",
|
|
56
55
|
"@types/luxon": "^3.7.1",
|
|
57
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
56
|
+
"@typescript/native-preview": "^7.0.0-dev.20260527.1",
|
|
58
57
|
"luxon": "^3.7.2",
|
|
59
58
|
"tsdown": "^0.22.0"
|
|
60
59
|
},
|
|
61
60
|
"peerDependencies": {
|
|
62
|
-
"@basmilius/http-client": "^3.
|
|
63
|
-
"@flux-ui/types": "^3.0.0-next.
|
|
64
|
-
"@fortawesome/fontawesome-common-types": "^7.2.0",
|
|
61
|
+
"@basmilius/http-client": "^3.38.0",
|
|
62
|
+
"@flux-ui/types": "^3.0.0-next.72",
|
|
65
63
|
"luxon": "^3.7.2"
|
|
66
|
-
},
|
|
67
|
-
"overrides": {
|
|
68
|
-
"@disabled-basmilius/http-client": "link:@basmilius/http-client",
|
|
69
|
-
"@disabled-flux-ui/types": "link:@flux-ui/types"
|
|
70
64
|
}
|
|
71
65
|
}
|
|
@@ -52,11 +52,11 @@ export class AiUsagePeriodDto {
|
|
|
52
52
|
this.#lastEventOn = value;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
get features(): AiUsageFeatureStatusDto[] {
|
|
55
|
+
get features(): AiUsageFeatureStatusDto[] | null {
|
|
56
56
|
return this.#features;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
set features(value: AiUsageFeatureStatusDto[]) {
|
|
59
|
+
set features(value: AiUsageFeatureStatusDto[] | null) {
|
|
60
60
|
this.#features = value;
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -66,9 +66,9 @@ export class AiUsagePeriodDto {
|
|
|
66
66
|
#limitTokens: number | null;
|
|
67
67
|
#percentage: number;
|
|
68
68
|
#lastEventOn: DateTime | null;
|
|
69
|
-
#features: AiUsageFeatureStatusDto[];
|
|
69
|
+
#features: AiUsageFeatureStatusDto[] | null;
|
|
70
70
|
|
|
71
|
-
constructor(periodStart: DateTime | null, periodEnd: DateTime | null, tokensUsed: number, limitTokens: number | null, percentage: number, lastEventOn: DateTime | null, features: AiUsageFeatureStatusDto[]) {
|
|
71
|
+
constructor(periodStart: DateTime | null, periodEnd: DateTime | null, tokensUsed: number, limitTokens: number | null, percentage: number, lastEventOn: DateTime | null, features: AiUsageFeatureStatusDto[] | null) {
|
|
72
72
|
this.#periodStart = periodStart;
|
|
73
73
|
this.#periodEnd = periodEnd;
|
|
74
74
|
this.#tokensUsed = tokensUsed;
|
|
@@ -20,11 +20,11 @@ export class InsightsResponseDto {
|
|
|
20
20
|
this.#language = value;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
get cards(): InsightDto[] {
|
|
23
|
+
get cards(): InsightDto[] | null {
|
|
24
24
|
return this.#cards;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
set cards(value: InsightDto[]) {
|
|
27
|
+
set cards(value: InsightDto[] | null) {
|
|
28
28
|
this.#cards = value;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -38,10 +38,10 @@ export class InsightsResponseDto {
|
|
|
38
38
|
|
|
39
39
|
#insightsEnabled: boolean;
|
|
40
40
|
#language: InsightLanguage;
|
|
41
|
-
#cards: InsightDto[];
|
|
41
|
+
#cards: InsightDto[] | null;
|
|
42
42
|
#lastGeneratedOn: string | null;
|
|
43
43
|
|
|
44
|
-
constructor(insightsEnabled: boolean, language: InsightLanguage, cards: InsightDto[], lastGeneratedOn: string | null) {
|
|
44
|
+
constructor(insightsEnabled: boolean, language: InsightLanguage, cards: InsightDto[] | null, lastGeneratedOn: string | null) {
|
|
45
45
|
this.#insightsEnabled = insightsEnabled;
|
|
46
46
|
this.#language = language;
|
|
47
47
|
this.#cards = cards;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { type BaseResponse, BaseService, type Paginated
|
|
1
|
+
import { type BaseResponse, BaseService, type Paginated } from '@basmilius/http-client';
|
|
2
2
|
import { MerchantAdapter } from '#data/adapter';
|
|
3
3
|
import { MerchantDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
|
|
5
7
|
export class AdminMerchantsService extends BaseService {
|
|
6
|
-
async get(
|
|
8
|
+
async get(params: ListParams): Promise<BaseResponse<Paginated<MerchantDto>>> {
|
|
7
9
|
return await this
|
|
8
10
|
.request('/admin/merchants')
|
|
9
11
|
.method('get')
|
|
10
|
-
.queryString(
|
|
11
|
-
.append('language', 'nl')
|
|
12
|
-
.append('offset', offset)
|
|
13
|
-
.append('limit', limit))
|
|
12
|
+
.queryString(buildListQuery(params))
|
|
14
13
|
.bearerToken()
|
|
15
14
|
.runPaginatedAdapter(MerchantAdapter.parseMerchant);
|
|
16
15
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/http-client';
|
|
2
2
|
import { BuyerAdapter, OrderAdapter } from '#data/adapter';
|
|
3
3
|
import type { BuyerDto, OrderDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
|
|
5
7
|
export class MerchantBuyerService extends BaseService {
|
|
6
8
|
async get(merchantId: string, buyerId: string): Promise<BaseResponse<BuyerDto>> {
|
|
@@ -23,15 +25,12 @@ export class MerchantBuyerService extends BaseService {
|
|
|
23
25
|
.runAdapter(OrderAdapter.parseOrder);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
async getOrders(merchantId: string, buyerId: string,
|
|
28
|
+
async getOrders(merchantId: string, buyerId: string, params: ListParams): Promise<BaseResponse<Paginated<OrderDto>>> {
|
|
27
29
|
return await this
|
|
28
30
|
.request(`/merchants/${merchantId}/buyers/${buyerId}/orders`)
|
|
29
31
|
.method('get')
|
|
30
32
|
.bearerToken()
|
|
31
|
-
.queryString(
|
|
32
|
-
.append('language', 'nl')
|
|
33
|
-
.append('offset', offset)
|
|
34
|
-
.append('limit', limit))
|
|
33
|
+
.queryString(buildListQuery(params))
|
|
35
34
|
.runPaginatedAdapter(OrderAdapter.parseOrder);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { BaseResponse, BaseService, Paginated
|
|
1
|
+
import { BaseResponse, BaseService, Paginated } from '@basmilius/http-client';
|
|
2
2
|
import { BuyerAdapter } from '#data/adapter';
|
|
3
3
|
import type { BuyerDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
|
|
5
7
|
export class MerchantBuyersService extends BaseService {
|
|
6
|
-
async get(merchantId: string,
|
|
8
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<BuyerDto>>> {
|
|
7
9
|
return await this
|
|
8
10
|
.request(`/merchants/${merchantId}/buyers`)
|
|
9
11
|
.method('get')
|
|
10
|
-
.queryString(
|
|
11
|
-
.append('language', 'nl')
|
|
12
|
-
.append('offset', offset)
|
|
13
|
-
.append('limit', limit))
|
|
12
|
+
.queryString(buildListQuery(params))
|
|
14
13
|
.bearerToken()
|
|
15
14
|
.runPaginatedAdapter(BuyerAdapter.parseBuyer);
|
|
16
15
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/http-client';
|
|
2
2
|
import { MerchantAdapter } from '#data/adapter';
|
|
3
3
|
import type { ContractDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
import type { DateTime } from 'luxon';
|
|
5
7
|
|
|
6
8
|
export class MerchantContractService extends BaseService {
|
|
7
|
-
async get(merchantId: string,
|
|
9
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<ContractDto>>> {
|
|
8
10
|
return await this
|
|
9
11
|
.request(`/merchants/${merchantId}/contracts`)
|
|
10
12
|
.method('get')
|
|
11
13
|
.bearerToken()
|
|
12
|
-
.queryString(
|
|
13
|
-
.append('language', 'nl')
|
|
14
|
-
.append('offset', offset)
|
|
15
|
-
.append('limit', limit))
|
|
14
|
+
.queryString(buildListQuery(params))
|
|
16
15
|
.runPaginatedAdapter(MerchantAdapter.parseContract);
|
|
17
16
|
}
|
|
18
17
|
|
|
@@ -2,24 +2,16 @@ import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/ht
|
|
|
2
2
|
import type { DateTime } from 'luxon';
|
|
3
3
|
import { DiscountCodeAdapter } from '#data/adapter';
|
|
4
4
|
import type { DiscountCodeDto } from '#data/dto';
|
|
5
|
-
import type { DiscountCodeType } from '#data/types';
|
|
5
|
+
import type { DiscountCodeType, ListParams } from '#data/types';
|
|
6
|
+
import { buildListQuery } from '#data/util';
|
|
6
7
|
|
|
7
8
|
export class MerchantDiscountCodesService extends BaseService {
|
|
8
|
-
async get(merchantId: string,
|
|
9
|
-
const qs = QueryString.builder()
|
|
10
|
-
.append('language', 'nl')
|
|
11
|
-
.append('offset', offset)
|
|
12
|
-
.append('limit', limit);
|
|
13
|
-
|
|
14
|
-
if (eventId !== null) {
|
|
15
|
-
qs.append('event_id', eventId);
|
|
16
|
-
}
|
|
17
|
-
|
|
9
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<DiscountCodeDto>>> {
|
|
18
10
|
return await this
|
|
19
11
|
.request(`/merchants/${merchantId}/discount-codes`)
|
|
20
12
|
.method('get')
|
|
21
13
|
.bearerToken()
|
|
22
|
-
.queryString(
|
|
14
|
+
.queryString(buildListQuery(params))
|
|
23
15
|
.runPaginatedAdapter(DiscountCodeAdapter.parseDiscountCode);
|
|
24
16
|
}
|
|
25
17
|
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { BaseResponse, BaseService, Paginated
|
|
1
|
+
import { BaseResponse, BaseService, Paginated } from '@basmilius/http-client';
|
|
2
2
|
import { EmailTemplateAdapter } from '#data/adapter';
|
|
3
3
|
import type { EmailTemplateDto } from '#data/dto';
|
|
4
|
-
import type { EmailTemplateLanguage, EmailTemplateType } from '#data/types';
|
|
4
|
+
import type { EmailTemplateLanguage, EmailTemplateType, ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
5
6
|
|
|
6
7
|
export class MerchantEmailTemplatesService extends BaseService {
|
|
7
|
-
async get(merchantId: string,
|
|
8
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<EmailTemplateDto>>> {
|
|
8
9
|
return await this
|
|
9
10
|
.request(`/merchants/${merchantId}/email-templates`)
|
|
10
11
|
.method('get')
|
|
11
12
|
.bearerToken()
|
|
12
|
-
.queryString(
|
|
13
|
-
.append('offset', offset)
|
|
14
|
-
.append('limit', limit))
|
|
13
|
+
.queryString(buildListQuery(params))
|
|
15
14
|
.runPaginatedAdapter(EmailTemplateAdapter.parseEmailTemplate);
|
|
16
15
|
}
|
|
17
16
|
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { type BaseResponse, BaseService, type Paginated, QueryString } from '@basmilius/http-client';
|
|
2
2
|
import { EventAdapter } from '#data/adapter';
|
|
3
3
|
import type { AppTeamDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
|
|
5
7
|
export class MerchantEventAppTeamsService extends BaseService {
|
|
6
|
-
async get(merchantId: string, eventId: string,
|
|
8
|
+
async get(merchantId: string, eventId: string, params: ListParams): Promise<BaseResponse<Paginated<AppTeamDto>>> {
|
|
7
9
|
return await this
|
|
8
10
|
.request(`/merchants/${merchantId}/events/${eventId}/app-teams`)
|
|
9
11
|
.method('get')
|
|
10
12
|
.bearerToken()
|
|
11
|
-
.queryString(
|
|
12
|
-
.append('language', 'nl')
|
|
13
|
-
.append('offset', offset)
|
|
14
|
-
.append('limit', limit))
|
|
13
|
+
.queryString(buildListQuery(params))
|
|
15
14
|
.runPaginatedAdapter(EventAdapter.parseAppTeam);
|
|
16
15
|
}
|
|
17
16
|
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { BaseResponse, BaseService, Paginated
|
|
1
|
+
import { BaseResponse, BaseService, Paginated } from '@basmilius/http-client';
|
|
2
2
|
import { EmailTemplateAdapter } from '#data/adapter';
|
|
3
3
|
import type { EmailTemplateDto } from '#data/dto';
|
|
4
|
-
import type { EmailTemplateLanguage, EmailTemplateType } from '#data/types';
|
|
4
|
+
import type { EmailTemplateLanguage, EmailTemplateType, ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
5
6
|
|
|
6
7
|
export class MerchantEventEmailTemplatesService extends BaseService {
|
|
7
|
-
async get(merchantId: string, eventId: string,
|
|
8
|
+
async get(merchantId: string, eventId: string, params: ListParams): Promise<BaseResponse<Paginated<EmailTemplateDto>>> {
|
|
8
9
|
return await this
|
|
9
10
|
.request(`/merchants/${merchantId}/events/${eventId}/email-templates`)
|
|
10
11
|
.method('get')
|
|
11
12
|
.bearerToken()
|
|
12
|
-
.queryString(
|
|
13
|
-
.append('offset', offset)
|
|
14
|
-
.append('limit', limit))
|
|
13
|
+
.queryString(buildListQuery(params))
|
|
15
14
|
.runPaginatedAdapter(EmailTemplateAdapter.parseEmailTemplate);
|
|
16
15
|
}
|
|
17
16
|
|
|
@@ -3,17 +3,16 @@ import type { FluxFormSelectEntry } from '@flux-ui/types';
|
|
|
3
3
|
import type { DateTime } from 'luxon';
|
|
4
4
|
import { FluxAdapter, ProductAdapter } from '#data/adapter';
|
|
5
5
|
import type { ProductDto } from '#data/dto';
|
|
6
|
+
import type { ListParams } from '#data/types';
|
|
7
|
+
import { buildListQuery } from '#data/util';
|
|
6
8
|
|
|
7
9
|
export class MerchantEventProductsService extends BaseService {
|
|
8
|
-
async get(merchantId: string, eventId: string,
|
|
10
|
+
async get(merchantId: string, eventId: string, params: ListParams): Promise<BaseResponse<Paginated<ProductDto>>> {
|
|
9
11
|
return await this
|
|
10
12
|
.request(`/merchants/${merchantId}/events/${eventId}/products`)
|
|
11
13
|
.method('get')
|
|
12
14
|
.bearerToken()
|
|
13
|
-
.queryString(
|
|
14
|
-
.append('language', 'nl')
|
|
15
|
-
.append('offset', offset)
|
|
16
|
-
.append('limit', limit))
|
|
15
|
+
.queryString(buildListQuery(params))
|
|
17
16
|
.runPaginatedAdapter(ProductAdapter.parseProduct);
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -2,16 +2,15 @@ import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/ht
|
|
|
2
2
|
import type { DateTime } from 'luxon';
|
|
3
3
|
import { CommonAdapter, EventAdapter } from '#data/adapter';
|
|
4
4
|
import type { ShopDto, StatusResponseDto } from '#data/dto';
|
|
5
|
+
import type { ListParams } from '#data/types';
|
|
6
|
+
import { buildListQuery } from '#data/util';
|
|
5
7
|
|
|
6
8
|
export class MerchantEventShopsService extends BaseService {
|
|
7
|
-
async get(merchantId: string, eventId: string,
|
|
9
|
+
async get(merchantId: string, eventId: string, params: ListParams): Promise<BaseResponse<Paginated<ShopDto>>> {
|
|
8
10
|
return await this
|
|
9
11
|
.request(`/merchants/${merchantId}/events/${eventId}/shops`)
|
|
10
12
|
.method('get')
|
|
11
|
-
.queryString(
|
|
12
|
-
.append('language', 'nl')
|
|
13
|
-
.append('offset', offset)
|
|
14
|
-
.append('limit', limit))
|
|
13
|
+
.queryString(buildListQuery(params))
|
|
15
14
|
.bearerToken()
|
|
16
15
|
.runPaginatedAdapter(EventAdapter.parseShop);
|
|
17
16
|
}
|
|
@@ -2,16 +2,15 @@ import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/ht
|
|
|
2
2
|
import type { FluxFormSelectEntry } from '@flux-ui/types';
|
|
3
3
|
import { EventAdapter, FluxAdapter } from '#data/adapter';
|
|
4
4
|
import type { StockOverviewDto, StockPoolDto } from '#data/dto';
|
|
5
|
+
import type { ListParams } from '#data/types';
|
|
6
|
+
import { buildListQuery } from '#data/util';
|
|
5
7
|
|
|
6
8
|
export class MerchantEventStockPoolsService extends BaseService {
|
|
7
|
-
async get(merchantId: string, eventId: string,
|
|
9
|
+
async get(merchantId: string, eventId: string, params: ListParams): Promise<BaseResponse<Paginated<StockPoolDto>>> {
|
|
8
10
|
return await this
|
|
9
11
|
.request(`/merchants/${merchantId}/events/${eventId}/stock-pools`)
|
|
10
12
|
.method('get')
|
|
11
|
-
.queryString(
|
|
12
|
-
.append('language', 'nl')
|
|
13
|
-
.append('offset', offset)
|
|
14
|
-
.append('limit', limit))
|
|
13
|
+
.queryString(buildListQuery(params))
|
|
15
14
|
.bearerToken()
|
|
16
15
|
.runPaginatedAdapter(EventAdapter.parseStockPool);
|
|
17
16
|
}
|
|
@@ -2,18 +2,15 @@ import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/ht
|
|
|
2
2
|
import type { FluxFormSelectEntry } from '@flux-ui/types';
|
|
3
3
|
import { EventAdapter, FluxAdapter } from '#data/adapter';
|
|
4
4
|
import type { TicketTemplateDto } from '#data/dto';
|
|
5
|
-
import type { TicketTemplateType } from '#data/types';
|
|
6
|
-
import { jsonBlob } from '#data/util';
|
|
5
|
+
import type { ListParams, TicketTemplateType } from '#data/types';
|
|
6
|
+
import { buildListQuery, jsonBlob } from '#data/util';
|
|
7
7
|
|
|
8
8
|
export class MerchantEventTicketTemplatesService extends BaseService {
|
|
9
|
-
async get(merchantId: string, eventId: string,
|
|
9
|
+
async get(merchantId: string, eventId: string, params: ListParams): Promise<BaseResponse<Paginated<TicketTemplateDto>>> {
|
|
10
10
|
return await this
|
|
11
11
|
.request(`/merchants/${merchantId}/events/${eventId}/ticket-templates`)
|
|
12
12
|
.method('get')
|
|
13
|
-
.queryString(
|
|
14
|
-
.append('language', 'nl')
|
|
15
|
-
.append('offset', offset)
|
|
16
|
-
.append('limit', limit))
|
|
13
|
+
.queryString(buildListQuery(params))
|
|
17
14
|
.bearerToken()
|
|
18
15
|
.runPaginatedAdapter(EventAdapter.parseTicketTemplate);
|
|
19
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/http-client';
|
|
2
|
+
import type { FluxFormSelectEntry } from '@flux-ui/types';
|
|
2
3
|
import type { DateTime } from 'luxon';
|
|
3
|
-
import { EventAdapter } from '#data/adapter';
|
|
4
|
+
import { EventAdapter, FluxAdapter } from '#data/adapter';
|
|
4
5
|
import type { TimeSlotDto } from '#data/dto';
|
|
5
6
|
|
|
6
7
|
export class MerchantEventTimeSlotsService extends BaseService {
|
|
@@ -16,6 +17,18 @@ export class MerchantEventTimeSlotsService extends BaseService {
|
|
|
16
17
|
.runPaginatedAdapter(EventAdapter.parseTimeSlot);
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
async getSelectOptions(merchantId: string, eventId: string, searchQuery: string | null = null, ids: string[] | null = null): Promise<BaseResponse<FluxFormSelectEntry[]>> {
|
|
21
|
+
return await this
|
|
22
|
+
.request(`/merchants/${merchantId}/events/${eventId}/time-slots/select-options`)
|
|
23
|
+
.method('get')
|
|
24
|
+
.queryString(QueryString.builder()
|
|
25
|
+
.append('language', 'nl')
|
|
26
|
+
.appendArray('ids[]', ids)
|
|
27
|
+
.append('searchQuery', searchQuery))
|
|
28
|
+
.bearerToken()
|
|
29
|
+
.runArrayAdapter(FluxAdapter.parseFluxFormSelectEntry);
|
|
30
|
+
}
|
|
31
|
+
|
|
19
32
|
async create(merchantId: string, eventId: string, fromTime: DateTime, toTime: DateTime, label: string | null = null): Promise<BaseResponse<TimeSlotDto>> {
|
|
20
33
|
return await this
|
|
21
34
|
.request(`/merchants/${merchantId}/events/${eventId}/time-slots`)
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/http-client';
|
|
2
|
+
import type { FluxFormSelectEntry } from '@flux-ui/types';
|
|
2
3
|
import type { DateTime } from 'luxon';
|
|
3
|
-
import { EventAdapter } from '#data/adapter';
|
|
4
|
+
import { EventAdapter, FluxAdapter } from '#data/adapter';
|
|
4
5
|
import type { EventDto } from '#data/dto';
|
|
6
|
+
import type { ListParams } from '#data/types';
|
|
7
|
+
import { buildListQuery } from '#data/util';
|
|
5
8
|
|
|
6
9
|
export class MerchantEventsService extends BaseService {
|
|
7
|
-
async get(merchantId: string,
|
|
10
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<EventDto>>> {
|
|
8
11
|
return await this
|
|
9
12
|
.request(`/merchants/${merchantId}/events`)
|
|
10
13
|
.method('get')
|
|
11
14
|
.bearerToken()
|
|
15
|
+
.queryString(buildListQuery(params))
|
|
16
|
+
.runPaginatedAdapter(EventAdapter.parseEvent);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async getSelectOptions(merchantId: string, searchQuery: string | null = null, ids: string[] | null = null): Promise<BaseResponse<FluxFormSelectEntry[]>> {
|
|
20
|
+
return await this
|
|
21
|
+
.request(`/merchants/${merchantId}/events/select-options`)
|
|
22
|
+
.method('get')
|
|
12
23
|
.queryString(QueryString.builder()
|
|
13
24
|
.append('language', 'nl')
|
|
14
|
-
.
|
|
15
|
-
.append('
|
|
16
|
-
.
|
|
25
|
+
.appendArray('ids[]', ids)
|
|
26
|
+
.append('searchQuery', searchQuery))
|
|
27
|
+
.bearerToken()
|
|
28
|
+
.runArrayAdapter(FluxAdapter.parseFluxFormSelectEntry);
|
|
17
29
|
}
|
|
18
30
|
|
|
19
31
|
async post(merchantId: string, name: string, description: string, startsOn: DateTime, endsOn: DateTime, minimumAge: number): Promise<BaseResponse<EventDto>> {
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { BaseResponse, BaseService, Paginated
|
|
1
|
+
import { BaseResponse, BaseService, Paginated } from '@basmilius/http-client';
|
|
2
2
|
import { FinanceAdapter } from '#data/adapter';
|
|
3
3
|
import type { InvoiceDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
|
|
5
7
|
export class MerchantFinanceInvoicesService extends BaseService {
|
|
6
|
-
async get(merchantId: string,
|
|
8
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<InvoiceDto>>> {
|
|
7
9
|
return await this
|
|
8
10
|
.request(`/merchants/${merchantId}/finance/invoices`)
|
|
9
11
|
.method('get')
|
|
10
12
|
.bearerToken()
|
|
11
|
-
.queryString(
|
|
12
|
-
.append('language', 'nl')
|
|
13
|
-
.append('offset', offset)
|
|
14
|
-
.append('limit', limit))
|
|
13
|
+
.queryString(buildListQuery(params))
|
|
15
14
|
.runPaginatedAdapter(FinanceAdapter.parseInvoice);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import { BaseResponse, BaseService, Paginated
|
|
1
|
+
import { BaseResponse, BaseService, Paginated } from '@basmilius/http-client';
|
|
2
2
|
import { OrderAdapter } from '#data/adapter';
|
|
3
3
|
import type { OrderDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
|
|
5
7
|
export class MerchantOrdersService extends BaseService {
|
|
6
|
-
async get(merchantId: string,
|
|
7
|
-
const query = QueryString
|
|
8
|
-
.builder()
|
|
9
|
-
.append('language', 'nl')
|
|
10
|
-
.append('offset', offset)
|
|
11
|
-
.append('limit', limit);
|
|
12
|
-
|
|
13
|
-
if (filter) {
|
|
14
|
-
Object
|
|
15
|
-
.entries(filter)
|
|
16
|
-
.forEach(([key, value]) => query.append(key, value));
|
|
17
|
-
}
|
|
18
|
-
|
|
8
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<OrderDto>>> {
|
|
19
9
|
return await this
|
|
20
10
|
.request(`/merchants/${merchantId}/orders`)
|
|
21
11
|
.method('get')
|
|
22
|
-
.queryString(
|
|
12
|
+
.queryString(buildListQuery(params))
|
|
23
13
|
.bearerToken()
|
|
24
14
|
.runPaginatedAdapter(OrderAdapter.parseOrder);
|
|
25
15
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { BaseResponse, BaseService, Paginated
|
|
1
|
+
import { BaseResponse, BaseService, Paginated } from '@basmilius/http-client';
|
|
2
2
|
import { EventAdapter } from '#data/adapter';
|
|
3
3
|
import type { ShopDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
|
|
5
7
|
export class MerchantShopsService extends BaseService {
|
|
6
|
-
async get(merchantId: string,
|
|
8
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<ShopDto>>> {
|
|
7
9
|
return await this
|
|
8
10
|
.request(`/merchants/${merchantId}/shops`)
|
|
9
11
|
.method('get')
|
|
10
|
-
.queryString(
|
|
11
|
-
.append('language', 'nl')
|
|
12
|
-
.append('offset', offset)
|
|
13
|
-
.append('limit', limit))
|
|
12
|
+
.queryString(buildListQuery(params))
|
|
14
13
|
.bearerToken()
|
|
15
14
|
.runPaginatedAdapter(EventAdapter.parseShop);
|
|
16
15
|
}
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import { BaseResponse, BaseService, Paginated
|
|
1
|
+
import { BaseResponse, BaseService, Paginated } from '@basmilius/http-client';
|
|
2
2
|
import { TicketAdapter } from '#data/adapter';
|
|
3
3
|
import type { TicketDto } from '#data/dto';
|
|
4
|
+
import type { ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
4
6
|
|
|
5
7
|
export class MerchantTicketsService extends BaseService {
|
|
6
|
-
async get(merchantId: string,
|
|
7
|
-
const query = QueryString
|
|
8
|
-
.builder()
|
|
9
|
-
.append('language', 'nl')
|
|
10
|
-
.append('offset', offset)
|
|
11
|
-
.append('limit', limit);
|
|
12
|
-
|
|
13
|
-
if (filter) {
|
|
14
|
-
Object
|
|
15
|
-
.entries(filter)
|
|
16
|
-
.forEach(([key, value]) => query.append(key, value));
|
|
17
|
-
}
|
|
18
|
-
|
|
8
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<TicketDto>>> {
|
|
19
9
|
return await this
|
|
20
10
|
.request(`/merchants/${merchantId}/tickets`)
|
|
21
11
|
.method('get')
|
|
22
|
-
.queryString(
|
|
12
|
+
.queryString(buildListQuery(params))
|
|
23
13
|
.bearerToken()
|
|
24
14
|
.runPaginatedAdapter(TicketAdapter.parseTicket);
|
|
25
15
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { BaseResponse, BaseService, Paginated, QueryString } from '@basmilius/http-client';
|
|
2
2
|
import { MerchantAdapter } from '#data/adapter';
|
|
3
3
|
import type { InvitationDto, MerchantUserDto } from '#data/dto';
|
|
4
|
-
import type { Claim } from '#data/types';
|
|
4
|
+
import type { Claim, ListParams } from '#data/types';
|
|
5
|
+
import { buildListQuery } from '#data/util';
|
|
5
6
|
|
|
6
7
|
export class MerchantUsersService extends BaseService {
|
|
7
|
-
async get(merchantId: string,
|
|
8
|
+
async get(merchantId: string, params: ListParams): Promise<BaseResponse<Paginated<MerchantUserDto>>> {
|
|
8
9
|
return await this
|
|
9
10
|
.request(`/merchants/${merchantId}/users`)
|
|
10
11
|
.method('get')
|
|
11
|
-
.queryString(
|
|
12
|
-
.append('language', 'nl')
|
|
13
|
-
.append('offset', offset)
|
|
14
|
-
.append('limit', limit))
|
|
12
|
+
.queryString(buildListQuery(params))
|
|
15
13
|
.bearerToken()
|
|
16
14
|
.runPaginatedAdapter(MerchantAdapter.parseMerchantUser);
|
|
17
15
|
}
|
|
@@ -33,7 +33,7 @@ export class PublicShopService extends BaseService {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
async buy(shopId: string, reservationId: string, firstName: string, lastName: string, email: string, phoneNumber: string, dateOfBirth: DateTime | null, gender: Gender | null, addressCity: string | null, addressCountry: string | null, addressNumber: string | null, addressPostalCode: string | null, addressStreet: string | null, attribution: MarketingAttributionDto | null = null): Promise<BaseResponse<OrderDto>> {
|
|
36
|
-
let address: Record<string, string | null> = null;
|
|
36
|
+
let address: Record<string, string | null> | null = null;
|
|
37
37
|
|
|
38
38
|
addressCity = emptyNull(addressCity);
|
|
39
39
|
addressCountry = emptyNull(addressCountry);
|
package/src/types/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type * from './general';
|
|
|
10
10
|
export type * from './event';
|
|
11
11
|
export type * from './finance';
|
|
12
12
|
export type * from './insights';
|
|
13
|
+
export type * from './list';
|
|
13
14
|
export type * from './milestone';
|
|
14
15
|
export type * from './order';
|
|
15
16
|
export type * from './payment';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DateTime } from 'luxon';
|
|
2
|
+
|
|
3
|
+
export type FilterValueSingle = string | number | boolean | DateTime | null;
|
|
4
|
+
export type FilterValue = FilterValueSingle | FilterValueSingle[];
|
|
5
|
+
export type Filters = Record<string, FilterValue>;
|
|
6
|
+
|
|
7
|
+
export type ListParams = {
|
|
8
|
+
readonly offset: number;
|
|
9
|
+
readonly limit: number;
|
|
10
|
+
readonly filters?: Filters;
|
|
11
|
+
readonly search?: string;
|
|
12
|
+
};
|