@bzbs/react-api-client 1.4.8 → 1.4.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 +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -44,6 +44,11 @@ type RequestOptions = {
|
|
|
44
44
|
data?: any;
|
|
45
45
|
baseUrl?: string;
|
|
46
46
|
};
|
|
47
|
+
type CrossPlatformFile = File | {
|
|
48
|
+
uri: string;
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
} | object;
|
|
47
52
|
declare class BaseService {
|
|
48
53
|
private client;
|
|
49
54
|
private baseUrl;
|
|
@@ -63,6 +68,7 @@ declare class BaseService {
|
|
|
63
68
|
[key: string]: string;
|
|
64
69
|
};
|
|
65
70
|
setBaseUrl(baseUrl: string): this;
|
|
71
|
+
static createFormData(data: Record<string, any>, fileKey?: string, file?: CrossPlatformFile): FormData;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
interface LoginResponse {
|
|
@@ -3109,4 +3115,4 @@ declare class BzbsService {
|
|
|
3109
3115
|
setLineUrl(lineUrl: string): this;
|
|
3110
3116
|
}
|
|
3111
3117
|
|
|
3112
|
-
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
|
3118
|
+
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type CrossPlatformFile, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,11 @@ type RequestOptions = {
|
|
|
44
44
|
data?: any;
|
|
45
45
|
baseUrl?: string;
|
|
46
46
|
};
|
|
47
|
+
type CrossPlatformFile = File | {
|
|
48
|
+
uri: string;
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
} | object;
|
|
47
52
|
declare class BaseService {
|
|
48
53
|
private client;
|
|
49
54
|
private baseUrl;
|
|
@@ -63,6 +68,7 @@ declare class BaseService {
|
|
|
63
68
|
[key: string]: string;
|
|
64
69
|
};
|
|
65
70
|
setBaseUrl(baseUrl: string): this;
|
|
71
|
+
static createFormData(data: Record<string, any>, fileKey?: string, file?: CrossPlatformFile): FormData;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
interface LoginResponse {
|
|
@@ -3109,4 +3115,4 @@ declare class BzbsService {
|
|
|
3109
3115
|
setLineUrl(lineUrl: string): this;
|
|
3110
3116
|
}
|
|
3111
3117
|
|
|
3112
|
-
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
|
3118
|
+
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type CrossPlatformFile, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
package/dist/index.js
CHANGED
|
@@ -200,6 +200,18 @@ var BaseService = class {
|
|
|
200
200
|
this.baseUrl = baseUrl;
|
|
201
201
|
return this;
|
|
202
202
|
}
|
|
203
|
+
static createFormData(data, fileKey, file) {
|
|
204
|
+
const formData = new FormData();
|
|
205
|
+
for (const key in data) {
|
|
206
|
+
if (data[key]) {
|
|
207
|
+
formData.append(key, data[key]);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (file) {
|
|
211
|
+
formData.append(fileKey != null ? fileKey : "data", file);
|
|
212
|
+
}
|
|
213
|
+
return formData;
|
|
214
|
+
}
|
|
203
215
|
};
|
|
204
216
|
|
|
205
217
|
// src/api/auth/auth-api.ts
|
|
@@ -1809,8 +1821,7 @@ var ProfileApi = class extends BaseService {
|
|
|
1809
1821
|
return __async(this, null, function* () {
|
|
1810
1822
|
return yield this.post(
|
|
1811
1823
|
"profile/me",
|
|
1812
|
-
__spreadValues({
|
|
1813
|
-
data: params.profileImage,
|
|
1824
|
+
BaseService.createFormData(__spreadValues({
|
|
1814
1825
|
firstname: params.firstName,
|
|
1815
1826
|
lastname: params.lastName,
|
|
1816
1827
|
contact_number: params.contactNumber,
|
|
@@ -1858,7 +1869,7 @@ var ProfileApi = class extends BaseService {
|
|
|
1858
1869
|
occupation: params.occupation,
|
|
1859
1870
|
remark: params.remark,
|
|
1860
1871
|
displayname: params.displayName
|
|
1861
|
-
}, params.options),
|
|
1872
|
+
}, params.options), "data", params.profileImage),
|
|
1862
1873
|
{
|
|
1863
1874
|
headers: __spreadValues({
|
|
1864
1875
|
"Content-Type": "multipart/form-data"
|