@passly-nl/data 1.4.0 → 1.4.2
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 +27 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +98 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/adapter/EventAdapter.ts +2 -1
- package/src/adapter/ProductAdapter.ts +6 -1
- package/src/adapter/PublicShopAdapter.ts +4 -1
- package/src/dto/event/AppTeamDto.ts +11 -1
- package/src/dto/product/ProductDto.ts +52 -2
- package/src/dto/publicShop/PublicShopProductDto.ts +33 -2
- package/src/service/MerchantEventAppTeamService.ts +2 -1
- package/src/service/MerchantEventAppTeamsService.ts +3 -2
- package/src/service/MerchantEventProductService.ts +5 -2
- package/src/service/MerchantEventStockPoolsService.ts +23 -0
- package/src/types/product.ts +7 -0
package/dist/index.mjs
CHANGED
|
@@ -1332,6 +1332,12 @@ let AppTeamDto = class AppTeamDto {
|
|
|
1332
1332
|
set merchant(value) {
|
|
1333
1333
|
this.#merchant = value;
|
|
1334
1334
|
}
|
|
1335
|
+
get productIds() {
|
|
1336
|
+
return this.#productIds;
|
|
1337
|
+
}
|
|
1338
|
+
set productIds(value) {
|
|
1339
|
+
this.#productIds = value;
|
|
1340
|
+
}
|
|
1335
1341
|
#id;
|
|
1336
1342
|
#name;
|
|
1337
1343
|
#secret;
|
|
@@ -1340,7 +1346,8 @@ let AppTeamDto = class AppTeamDto {
|
|
|
1340
1346
|
#creator;
|
|
1341
1347
|
#event;
|
|
1342
1348
|
#merchant;
|
|
1343
|
-
|
|
1349
|
+
#productIds;
|
|
1350
|
+
constructor(id, name, secret, checkinCount, checkoutCount, creator, event, merchant, productIds) {
|
|
1344
1351
|
this.#id = id;
|
|
1345
1352
|
this.#name = name;
|
|
1346
1353
|
this.#secret = secret;
|
|
@@ -1349,6 +1356,7 @@ let AppTeamDto = class AppTeamDto {
|
|
|
1349
1356
|
this.#creator = creator;
|
|
1350
1357
|
this.#event = event;
|
|
1351
1358
|
this.#merchant = merchant;
|
|
1359
|
+
this.#productIds = productIds;
|
|
1352
1360
|
}
|
|
1353
1361
|
};
|
|
1354
1362
|
AppTeamDto = __decorate([dto], AppTeamDto);
|
|
@@ -3976,6 +3984,36 @@ let ProductDto = class ProductDto {
|
|
|
3976
3984
|
set ticketsReleasedOn(value) {
|
|
3977
3985
|
this.#ticketsReleasedOn = value;
|
|
3978
3986
|
}
|
|
3987
|
+
get showWhenUnavailable() {
|
|
3988
|
+
return this.#showWhenUnavailable;
|
|
3989
|
+
}
|
|
3990
|
+
set showWhenUnavailable(value) {
|
|
3991
|
+
this.#showWhenUnavailable = value;
|
|
3992
|
+
}
|
|
3993
|
+
get saleStartsOn() {
|
|
3994
|
+
return this.#saleStartsOn;
|
|
3995
|
+
}
|
|
3996
|
+
set saleStartsOn(value) {
|
|
3997
|
+
this.#saleStartsOn = value;
|
|
3998
|
+
}
|
|
3999
|
+
get saleEndsOn() {
|
|
4000
|
+
return this.#saleEndsOn;
|
|
4001
|
+
}
|
|
4002
|
+
set saleEndsOn(value) {
|
|
4003
|
+
this.#saleEndsOn = value;
|
|
4004
|
+
}
|
|
4005
|
+
get availability() {
|
|
4006
|
+
return this.#availability;
|
|
4007
|
+
}
|
|
4008
|
+
set availability(value) {
|
|
4009
|
+
this.#availability = value;
|
|
4010
|
+
}
|
|
4011
|
+
get sold() {
|
|
4012
|
+
return this.#sold;
|
|
4013
|
+
}
|
|
4014
|
+
set sold(value) {
|
|
4015
|
+
this.#sold = value;
|
|
4016
|
+
}
|
|
3979
4017
|
#id;
|
|
3980
4018
|
#type;
|
|
3981
4019
|
#name;
|
|
@@ -3993,7 +4031,12 @@ let ProductDto = class ProductDto {
|
|
|
3993
4031
|
#image;
|
|
3994
4032
|
#images;
|
|
3995
4033
|
#ticketsReleasedOn;
|
|
3996
|
-
|
|
4034
|
+
#showWhenUnavailable;
|
|
4035
|
+
#saleStartsOn;
|
|
4036
|
+
#saleEndsOn;
|
|
4037
|
+
#availability;
|
|
4038
|
+
#sold;
|
|
4039
|
+
constructor(id, type, name, description, price, maxQuantity, isActive, isPersonalizationRequired, isSwappable, isTimeslotted, timeSlots, remainingStock, stock, hasSales, image, images, ticketsReleasedOn, showWhenUnavailable, saleStartsOn, saleEndsOn, availability, sold) {
|
|
3997
4040
|
this.#id = id;
|
|
3998
4041
|
this.#type = type;
|
|
3999
4042
|
this.#name = name;
|
|
@@ -4011,6 +4054,11 @@ let ProductDto = class ProductDto {
|
|
|
4011
4054
|
this.#image = image;
|
|
4012
4055
|
this.#images = images;
|
|
4013
4056
|
this.#ticketsReleasedOn = ticketsReleasedOn;
|
|
4057
|
+
this.#showWhenUnavailable = showWhenUnavailable;
|
|
4058
|
+
this.#saleStartsOn = saleStartsOn;
|
|
4059
|
+
this.#saleEndsOn = saleEndsOn;
|
|
4060
|
+
this.#availability = availability;
|
|
4061
|
+
this.#sold = sold;
|
|
4014
4062
|
}
|
|
4015
4063
|
};
|
|
4016
4064
|
ProductDto = __decorate([dto], ProductDto);
|
|
@@ -4578,6 +4626,24 @@ let PublicShopProductDto = class PublicShopProductDto {
|
|
|
4578
4626
|
set images(value) {
|
|
4579
4627
|
this.#images = value;
|
|
4580
4628
|
}
|
|
4629
|
+
get availability() {
|
|
4630
|
+
return this.#availability;
|
|
4631
|
+
}
|
|
4632
|
+
set availability(value) {
|
|
4633
|
+
this.#availability = value;
|
|
4634
|
+
}
|
|
4635
|
+
get saleStartsOn() {
|
|
4636
|
+
return this.#saleStartsOn;
|
|
4637
|
+
}
|
|
4638
|
+
set saleStartsOn(value) {
|
|
4639
|
+
this.#saleStartsOn = value;
|
|
4640
|
+
}
|
|
4641
|
+
get saleEndsOn() {
|
|
4642
|
+
return this.#saleEndsOn;
|
|
4643
|
+
}
|
|
4644
|
+
set saleEndsOn(value) {
|
|
4645
|
+
this.#saleEndsOn = value;
|
|
4646
|
+
}
|
|
4581
4647
|
#id;
|
|
4582
4648
|
#type;
|
|
4583
4649
|
#name;
|
|
@@ -4589,7 +4655,10 @@ let PublicShopProductDto = class PublicShopProductDto {
|
|
|
4589
4655
|
#timeSlots;
|
|
4590
4656
|
#image;
|
|
4591
4657
|
#images;
|
|
4592
|
-
|
|
4658
|
+
#availability;
|
|
4659
|
+
#saleStartsOn;
|
|
4660
|
+
#saleEndsOn;
|
|
4661
|
+
constructor(id, type, name, description, price, maxQuantity, isActive, isTimeslotted, timeSlots, image, images, availability, saleStartsOn, saleEndsOn) {
|
|
4593
4662
|
this.#id = id;
|
|
4594
4663
|
this.#type = type;
|
|
4595
4664
|
this.#name = name;
|
|
@@ -4601,6 +4670,9 @@ let PublicShopProductDto = class PublicShopProductDto {
|
|
|
4601
4670
|
this.#timeSlots = timeSlots;
|
|
4602
4671
|
this.#image = image;
|
|
4603
4672
|
this.#images = images;
|
|
4673
|
+
this.#availability = availability;
|
|
4674
|
+
this.#saleStartsOn = saleStartsOn;
|
|
4675
|
+
this.#saleEndsOn = saleEndsOn;
|
|
4604
4676
|
}
|
|
4605
4677
|
};
|
|
4606
4678
|
PublicShopProductDto = __decorate([dto], PublicShopProductDto);
|
|
@@ -8148,7 +8220,7 @@ EmailTemplateAdapter = __decorate([adapter], EmailTemplateAdapter);
|
|
|
8148
8220
|
var _EventAdapter;
|
|
8149
8221
|
let EventAdapter = _EventAdapter = class EventAdapter {
|
|
8150
8222
|
static parseAppTeam(data) {
|
|
8151
|
-
return new AppTeamDto(data.id, data.name, data.secret, data.checkin_count, data.checkout_count, optional_default(data.creator, AuthAdapter.parseUser), optional_default(data.event, _EventAdapter.parseEvent), optional_default(data.merchant, MerchantAdapter.parseMerchant));
|
|
8223
|
+
return new AppTeamDto(data.id, data.name, data.secret, data.checkin_count, data.checkout_count, optional_default(data.creator, AuthAdapter.parseUser), optional_default(data.event, _EventAdapter.parseEvent), optional_default(data.merchant, MerchantAdapter.parseMerchant), (data.products ?? []).map((product) => product.id));
|
|
8152
8224
|
}
|
|
8153
8225
|
static parseEvent(data) {
|
|
8154
8226
|
return new EventDto(data.id, data.name, data.description, DateTimeAdapter.parseDateTime(data.starts_on), DateTimeAdapter.parseDateTime(data.ends_on), data.minimum_age, data.status, optional_default(data.address, AddressAdapter.parseAddress), optional_default(data.header_file, FileSystemAdapter.parsePicture), DateTimeAdapter.parseDateTime(data.created_on), DateTimeAdapter.parseDateTime(data.updated_on));
|
|
@@ -8367,7 +8439,7 @@ PaymentAdapter = _PaymentAdapter = __decorate([adapter], PaymentAdapter);
|
|
|
8367
8439
|
//#region src/adapter/ProductAdapter.ts
|
|
8368
8440
|
let ProductAdapter = class ProductAdapter {
|
|
8369
8441
|
static parseProduct(data) {
|
|
8370
|
-
return new ProductDto(data.id, data.type, data.name, data.description, optional_default(data.price, PaymentAdapter.parseCost), data.max_quantity, data.is_active, data.is_personalization_required, data.is_swappable, data.is_timeslotted, optionalArray_default(data.time_slots, EventAdapter.parseTimeSlot) ?? [], data.remaining_stock, optional_default(data.stock_pool, EventAdapter.parseStockPool), data.has_sales, optional_default(data.image, FileSystemAdapter.parsePicture), optionalArray_default(data.images, FileSystemAdapter.parsePicture), optional_default(data.tickets_released_on, DateTimeAdapter.parseDateTime));
|
|
8442
|
+
return new ProductDto(data.id, data.type, data.name, data.description, optional_default(data.price, PaymentAdapter.parseCost), data.max_quantity, data.is_active, data.is_personalization_required, data.is_swappable, data.is_timeslotted, optionalArray_default(data.time_slots, EventAdapter.parseTimeSlot) ?? [], data.remaining_stock, optional_default(data.stock_pool, EventAdapter.parseStockPool), data.has_sales, optional_default(data.image, FileSystemAdapter.parsePicture), optionalArray_default(data.images, FileSystemAdapter.parsePicture), optional_default(data.tickets_released_on, DateTimeAdapter.parseDateTime), data.show_when_unavailable, optional_default(data.sale_starts_on, DateTimeAdapter.parseDateTime), optional_default(data.sale_ends_on, DateTimeAdapter.parseDateTime), data.availability, data.sold);
|
|
8371
8443
|
}
|
|
8372
8444
|
};
|
|
8373
8445
|
ProductAdapter = __decorate([adapter], ProductAdapter);
|
|
@@ -8410,7 +8482,7 @@ let PublicShopAdapter = _PublicShopAdapter = class PublicShopAdapter {
|
|
|
8410
8482
|
return new PublicShopMerchantDto(data.id, data.name);
|
|
8411
8483
|
}
|
|
8412
8484
|
static parsePublicShopProduct(data) {
|
|
8413
|
-
return new PublicShopProductDto(data.id, data.type, data.name, data.description, PaymentAdapter.parseCost(data.price), data.max_quantity, data.is_active, data.is_timeslotted, optionalArray_default(data.time_slots, _PublicShopAdapter.parsePublicShopTimeSlot), optional_default(data.image, FileSystemAdapter.parsePicture), optionalArray_default(data.images, FileSystemAdapter.parsePicture));
|
|
8485
|
+
return new PublicShopProductDto(data.id, data.type, data.name, data.description, PaymentAdapter.parseCost(data.price), data.max_quantity, data.is_active, data.is_timeslotted, optionalArray_default(data.time_slots, _PublicShopAdapter.parsePublicShopTimeSlot), optional_default(data.image, FileSystemAdapter.parsePicture), optionalArray_default(data.images, FileSystemAdapter.parsePicture), data.availability, optional_default(data.sale_starts_on, DateTimeAdapter.parseDateTime), optional_default(data.sale_ends_on, DateTimeAdapter.parseDateTime));
|
|
8414
8486
|
}
|
|
8415
8487
|
static parsePublicShopReservation(data) {
|
|
8416
8488
|
return new PublicShopReservationDto(data.id, DateTimeAdapter.parseDateTime(data.created_on), DateTimeAdapter.parseDateTime(data.expires_on), data.products.map(_PublicShopAdapter.parsePublicShopReservationProduct));
|
|
@@ -9027,7 +9099,10 @@ var MerchantEventAppTeamService = class extends BaseService {
|
|
|
9027
9099
|
return await this.request(`/merchants/${merchantId}/events/${eventId}/app-teams/${appTeamId}`).method("delete").bearerToken().queryString(QueryString.builder().append("language", "nl")).runAdapter(CommonAdapter.parseStatusResponse);
|
|
9028
9100
|
}
|
|
9029
9101
|
async patch(merchantId, eventId, appTeamId, appTeam) {
|
|
9030
|
-
return await this.request(`/merchants/${merchantId}/events/${eventId}/app-teams/${appTeamId}`).method("patch").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({
|
|
9102
|
+
return await this.request(`/merchants/${merchantId}/events/${eventId}/app-teams/${appTeamId}`).method("patch").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({
|
|
9103
|
+
name: appTeam.name,
|
|
9104
|
+
product_ids: appTeam.productIds
|
|
9105
|
+
}).runAdapter(EventAdapter.parseAppTeam);
|
|
9031
9106
|
}
|
|
9032
9107
|
};
|
|
9033
9108
|
|
|
@@ -9037,8 +9112,11 @@ var MerchantEventAppTeamsService = class extends BaseService {
|
|
|
9037
9112
|
async get(merchantId, eventId, params) {
|
|
9038
9113
|
return await this.request(`/merchants/${merchantId}/events/${eventId}/app-teams`).method("get").bearerToken().queryString(buildListQuery_default(params)).runPaginatedAdapter(EventAdapter.parseAppTeam);
|
|
9039
9114
|
}
|
|
9040
|
-
async post(merchantId, eventId, name) {
|
|
9041
|
-
return await this.request(`/merchants/${merchantId}/events/${eventId}/app-teams`).method("post").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({
|
|
9115
|
+
async post(merchantId, eventId, name, productIds = []) {
|
|
9116
|
+
return await this.request(`/merchants/${merchantId}/events/${eventId}/app-teams`).method("post").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({
|
|
9117
|
+
name,
|
|
9118
|
+
product_ids: productIds
|
|
9119
|
+
}).runAdapter(EventAdapter.parseAppTeam);
|
|
9042
9120
|
}
|
|
9043
9121
|
};
|
|
9044
9122
|
|
|
@@ -9059,12 +9137,15 @@ var MerchantEventProductService = class extends BaseService {
|
|
|
9059
9137
|
description
|
|
9060
9138
|
}).runAdapter(ProductAdapter.parseProduct);
|
|
9061
9139
|
}
|
|
9062
|
-
async patchSales(merchantId, eventId, productId, price, maxQuantity, isSwappable, ticketsReleasedOn) {
|
|
9140
|
+
async patchSales(merchantId, eventId, productId, price, maxQuantity, isSwappable, ticketsReleasedOn, showWhenUnavailable, saleStartsOn, saleEndsOn) {
|
|
9063
9141
|
return await this.request(`/merchants/${merchantId}/events/${eventId}/products/${productId}/sales`).method("patch").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({
|
|
9064
9142
|
price,
|
|
9065
9143
|
max_quantity: maxQuantity,
|
|
9066
9144
|
is_swappable: isSwappable,
|
|
9067
|
-
tickets_released_on: ticketsReleasedOn?.toISO() ?? null
|
|
9145
|
+
tickets_released_on: ticketsReleasedOn?.toISO() ?? null,
|
|
9146
|
+
show_when_unavailable: showWhenUnavailable,
|
|
9147
|
+
sale_starts_on: saleStartsOn?.toISO() ?? null,
|
|
9148
|
+
sale_ends_on: saleEndsOn?.toISO() ?? null
|
|
9068
9149
|
}).runAdapter(ProductAdapter.parseProduct);
|
|
9069
9150
|
}
|
|
9070
9151
|
async patchValidity(merchantId, eventId, productId, timeSlotIds) {
|
|
@@ -9352,6 +9433,12 @@ var MerchantEventStockPoolsService = class extends BaseService {
|
|
|
9352
9433
|
async getSelectOptions(merchantId, eventId, searchQuery = null, ids = null) {
|
|
9353
9434
|
return await this.request(`/merchants/${merchantId}/events/${eventId}/stock-pools/select-options`).method("get").queryString(QueryString.builder().append("language", "nl").appendArray("ids[]", ids).append("searchQuery", searchQuery)).bearerToken().runArrayAdapter(FluxAdapter.parseFluxFormSelectEntry);
|
|
9354
9435
|
}
|
|
9436
|
+
async getSingle(merchantId, eventId, stockPoolId) {
|
|
9437
|
+
return await this.request(`/merchants/${merchantId}/events/${eventId}/stock-pools/${stockPoolId}`).method("get").queryString(QueryString.builder().append("language", "nl")).bearerToken().runAdapter(EventAdapter.parseStockPool);
|
|
9438
|
+
}
|
|
9439
|
+
async patch(merchantId, eventId, stockPoolId, stock) {
|
|
9440
|
+
return await this.request(`/merchants/${merchantId}/events/${eventId}/stock-pools/${stockPoolId}`).method("patch").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({ stock }).runAdapter(EventAdapter.parseStockPool);
|
|
9441
|
+
}
|
|
9355
9442
|
async post(merchantId, eventId, name, stock) {
|
|
9356
9443
|
return await this.request(`/merchants/${merchantId}/events/${eventId}/stock-pools`).method("post").bearerToken().queryString(QueryString.builder().append("language", "nl")).body({
|
|
9357
9444
|
name,
|