@passly-nl/data 1.4.2 → 1.4.3
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 +12 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +46 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/adapter/EventAdapter.ts +3 -1
- package/src/adapter/PublicShopAdapter.ts +3 -1
- package/src/dto/event/ShopDesignDto.ts +22 -1
- package/src/dto/publicShop/PublicShopDesignDto.ts +22 -1
- package/src/service/MerchantEventShopService.ts +28 -3
package/dist/index.mjs
CHANGED
|
@@ -1558,13 +1558,29 @@ let ShopDesignDto = class ShopDesignDto {
|
|
|
1558
1558
|
set primaryColor(value) {
|
|
1559
1559
|
this.#primaryColor = value;
|
|
1560
1560
|
}
|
|
1561
|
+
get background() {
|
|
1562
|
+
return this.#background;
|
|
1563
|
+
}
|
|
1564
|
+
set background(value) {
|
|
1565
|
+
this.#background = value;
|
|
1566
|
+
}
|
|
1567
|
+
get backgroundScrim() {
|
|
1568
|
+
return this.#backgroundScrim;
|
|
1569
|
+
}
|
|
1570
|
+
set backgroundScrim(value) {
|
|
1571
|
+
this.#backgroundScrim = value;
|
|
1572
|
+
}
|
|
1561
1573
|
#backgroundColor;
|
|
1562
1574
|
#foregroundColor;
|
|
1563
1575
|
#primaryColor;
|
|
1564
|
-
|
|
1576
|
+
#background;
|
|
1577
|
+
#backgroundScrim;
|
|
1578
|
+
constructor(backgroundColor, foregroundColor, primaryColor, background, backgroundScrim) {
|
|
1565
1579
|
this.#backgroundColor = backgroundColor;
|
|
1566
1580
|
this.#foregroundColor = foregroundColor;
|
|
1567
1581
|
this.#primaryColor = primaryColor;
|
|
1582
|
+
this.#background = background;
|
|
1583
|
+
this.#backgroundScrim = backgroundScrim;
|
|
1568
1584
|
}
|
|
1569
1585
|
};
|
|
1570
1586
|
ShopDesignDto = __decorate([dto], ShopDesignDto);
|
|
@@ -4140,13 +4156,29 @@ let PublicShopDesignDto = class PublicShopDesignDto {
|
|
|
4140
4156
|
set primaryColor(value) {
|
|
4141
4157
|
this.#primaryColor = value;
|
|
4142
4158
|
}
|
|
4159
|
+
get background() {
|
|
4160
|
+
return this.#background;
|
|
4161
|
+
}
|
|
4162
|
+
set background(value) {
|
|
4163
|
+
this.#background = value;
|
|
4164
|
+
}
|
|
4165
|
+
get backgroundScrim() {
|
|
4166
|
+
return this.#backgroundScrim;
|
|
4167
|
+
}
|
|
4168
|
+
set backgroundScrim(value) {
|
|
4169
|
+
this.#backgroundScrim = value;
|
|
4170
|
+
}
|
|
4143
4171
|
#backgroundColor;
|
|
4144
4172
|
#foregroundColor;
|
|
4145
4173
|
#primaryColor;
|
|
4146
|
-
|
|
4174
|
+
#background;
|
|
4175
|
+
#backgroundScrim;
|
|
4176
|
+
constructor(backgroundColor, foregroundColor, primaryColor, background, backgroundScrim) {
|
|
4147
4177
|
this.#backgroundColor = backgroundColor;
|
|
4148
4178
|
this.#foregroundColor = foregroundColor;
|
|
4149
4179
|
this.#primaryColor = primaryColor;
|
|
4180
|
+
this.#background = background;
|
|
4181
|
+
this.#backgroundScrim = backgroundScrim;
|
|
4150
4182
|
}
|
|
4151
4183
|
};
|
|
4152
4184
|
PublicShopDesignDto = __decorate([dto], PublicShopDesignDto);
|
|
@@ -8235,7 +8267,7 @@ let EventAdapter = _EventAdapter = class EventAdapter {
|
|
|
8235
8267
|
return new ShopDto(data.id, data.name, data.is_published, data.password, optional_default(data.starts_on, DateTimeAdapter.parseDateTime), optional_default(data.ends_on, DateTimeAdapter.parseDateTime), data.field_address, data.field_address_mode, data.field_birthdate, data.field_gender, data.field_phone_number, data.status, optional_default(data.design, _EventAdapter.parseShopDesign), optional_default(data.event, _EventAdapter.parseEvent), optional_default(data.merchant, MerchantAdapter.parseMerchant));
|
|
8236
8268
|
}
|
|
8237
8269
|
static parseShopDesign(data) {
|
|
8238
|
-
return new ShopDesignDto(data.background_color, data.foreground_color, data.primary_color);
|
|
8270
|
+
return new ShopDesignDto(data.background_color, data.foreground_color, data.primary_color, optional_default(data.background, FileSystemAdapter.parsePicture), data.background_scrim ?? 0);
|
|
8239
8271
|
}
|
|
8240
8272
|
static parseShopElement(data) {
|
|
8241
8273
|
switch (data.type) {
|
|
@@ -8461,7 +8493,7 @@ let PublicShopAdapter = _PublicShopAdapter = class PublicShopAdapter {
|
|
|
8461
8493
|
return new PublicShopDto(data.id, data.name, DateTimeAdapter.parseDateTime(data.starts_on), DateTimeAdapter.parseDateTime(data.ends_on), data.field_address, data.field_address_mode, data.field_birthdate, data.field_gender, data.field_phone_number, optional_default(data.design, _PublicShopAdapter.parsePublicShopDesign), optionalArray_default(data.elements, _PublicShopAdapter.parsePublicShopElement), _PublicShopAdapter.parsePublicShopEvent(data.event), _PublicShopAdapter.parsePublicShopMerchant(data.merchant));
|
|
8462
8494
|
}
|
|
8463
8495
|
static parsePublicShopDesign(data) {
|
|
8464
|
-
return new PublicShopDesignDto(data.background_color, data.foreground_color, data.primary_color);
|
|
8496
|
+
return new PublicShopDesignDto(data.background_color, data.foreground_color, data.primary_color, optional_default(data.background, FileSystemAdapter.parsePicture), data.background_scrim ?? 0);
|
|
8465
8497
|
}
|
|
8466
8498
|
static parsePublicShopElement(data) {
|
|
8467
8499
|
switch (data.type) {
|
|
@@ -9383,7 +9415,8 @@ var MerchantEventShopService = class extends BaseService {
|
|
|
9383
9415
|
return await this.request(`/merchants/${merchantId}/events/${eventId}/shops/${shopId}/design`).method("patch").queryString(QueryString.builder().append("language", "nl")).bearerToken().body({
|
|
9384
9416
|
background_color: design.backgroundColor,
|
|
9385
9417
|
foreground_color: design.foregroundColor,
|
|
9386
|
-
primary_color: design.primaryColor
|
|
9418
|
+
primary_color: design.primaryColor,
|
|
9419
|
+
background_scrim: design.backgroundScrim
|
|
9387
9420
|
}).runAdapter(EventAdapter.parseShopDesign);
|
|
9388
9421
|
}
|
|
9389
9422
|
async patchElements(merchantId, eventId, shopId, elements) {
|
|
@@ -9398,9 +9431,17 @@ var MerchantEventShopService = class extends BaseService {
|
|
|
9398
9431
|
field_phone_number: shop.fieldPhoneNumber
|
|
9399
9432
|
}).runAdapter(EventAdapter.parseShop);
|
|
9400
9433
|
}
|
|
9434
|
+
async postBackground(merchantId, eventId, shopId, picture) {
|
|
9435
|
+
const data = new FormData();
|
|
9436
|
+
data.append("file", picture);
|
|
9437
|
+
return await this.request(`/merchants/${merchantId}/events/${eventId}/shops/${shopId}/design/background`).method("post").queryString(QueryString.builder().append("language", "nl")).bearerToken().body(data).runAdapter(CommonAdapter.parseStatusResponse);
|
|
9438
|
+
}
|
|
9401
9439
|
async postShortlink(merchantId, eventId, shopId) {
|
|
9402
9440
|
return await this.request(`/merchants/${merchantId}/events/${eventId}/shops/${shopId}/shortlink`).method("post").queryString(QueryString.builder().append("language", "nl")).bearerToken().runAdapter(ShortlinkAdapter.parse);
|
|
9403
9441
|
}
|
|
9442
|
+
async deleteBackground(merchantId, eventId, shopId) {
|
|
9443
|
+
return await this.request(`/merchants/${merchantId}/events/${eventId}/shops/${shopId}/design/background`).method("delete").queryString(QueryString.builder().append("language", "nl")).bearerToken().runAdapter(CommonAdapter.parseStatusResponse);
|
|
9444
|
+
}
|
|
9404
9445
|
};
|
|
9405
9446
|
|
|
9406
9447
|
//#endregion
|