@communecter/cocolight-api-client 1.0.13 → 1.0.14

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.
@@ -12,7 +12,7 @@ export const DraftStateMixin = {
12
12
  * @param {Object} [options={}] - options
13
13
  * @returns {Proxy}
14
14
  */
15
- createDraftProxy(apiClient, server = {}, draft = {}, allowedFields = [], transforms = {}, options = {}) {
15
+ _createDraftProxy(apiClient, server = {}, draft = {}, allowedFields = [], transforms = {}, options = {}) {
16
16
  return new Proxy({}, {
17
17
  get: (_, prop) => {
18
18
  const val = prop in draft ? draft[prop] : server[prop];
@@ -96,7 +96,7 @@ export const DraftStateMixin = {
96
96
  return [...new Set(fields)];
97
97
  },
98
98
 
99
- buildDraftAndProxy({ data = {}, serverData = null, constant, apiClient, transforms = {}, throwOnError = true, removeFields = [] }) {
99
+ _buildDraftAndProxy({ data = {}, serverData = null, constant, apiClient, transforms = {}, throwOnError = true, removeFields = [] }) {
100
100
  const constants = Array.isArray(constant) ? constant : [constant];
101
101
  const combinedSchema = {
102
102
  allOf: [],
@@ -138,12 +138,12 @@ export const DraftStateMixin = {
138
138
  if (transformed !== undefined) draft[key] = transformed;
139
139
  }
140
140
 
141
- const proxy = this.createDraftProxy(apiClient, serverData, draft, allowed, transforms, { throwOnError });
141
+ const proxy = this._createDraftProxy(apiClient, serverData, draft, allowed, transforms, { throwOnError });
142
142
 
143
143
  return { draft, proxy };
144
144
  },
145
145
 
146
- extractChangedFieldsFromSchema(apiClient, constant, data = {}, getInitialDraft, removeFields = []) {
146
+ _extractChangedFieldsFromSchema(apiClient, constant, data = {}, getInitialDraft, removeFields = []) {
147
147
  const schema = apiClient.getRequestSchema(constant);
148
148
  let allowed = this._extractWritableFields(schema, data);
149
149
  const changed = {};
@@ -101,7 +101,7 @@ export const EntityMixin = {
101
101
  * Constant : PROFIL_IMAGE
102
102
  */
103
103
  async updateImageProfil({ profil_avatar: image }) {
104
- image = await this.validateImage(image);
104
+ image = await this._validateImage(image);
105
105
  const data = { pathParams: { folder: this.getEntityType(), ownerId: this.id }, profil_avatar: image };
106
106
  return this.callIsConnected(() => this.endpointApi.profilImage(data));
107
107
  }
@@ -87,7 +87,7 @@ export const UtilMixin = {
87
87
  return await this.callIsConnected(param, data);
88
88
  },
89
89
 
90
- async validateImage(imageInput){
90
+ async _validateImage(imageInput){
91
91
  const image = await this._validateUploadInput(imageInput, {
92
92
  allowedMimeTypes: ["image/jpeg", "image/png", "image/jpg"],
93
93
  expectedType: "image"
@@ -95,7 +95,7 @@ export const UtilMixin = {
95
95
  return image;
96
96
  },
97
97
 
98
- async validateFile(fileInput){
98
+ async _validateFile(fileInput){
99
99
  const file = await this._validateUploadInput(fileInput, {
100
100
  allowedMimeTypes: ["application/pdf", "text/plain", "text/csv"],
101
101
  expectedType: "file"