oneentry 1.0.134 → 1.0.136
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/base/syncModules.d.ts +19 -0
- package/dist/base/syncModules.js +138 -17
- package/dist/forms-data/formsDataApi.d.ts +23 -1
- package/dist/forms-data/formsDataApi.js +31 -0
- package/dist/forms-data/formsDataInterfaces.d.ts +45 -13
- package/dist/orders/ordersInterfaces.d.ts +2 -1
- package/dist/payments/paymentsApi.d.ts +0 -10
- package/dist/payments/paymentsApi.js +0 -13
- package/dist/payments/paymentsInterfaces.d.ts +0 -10
- package/package.json +2 -2
|
@@ -78,6 +78,25 @@ export default abstract class SyncModules {
|
|
|
78
78
|
* @returns {any} Schedules with added time intervals.
|
|
79
79
|
*/
|
|
80
80
|
_addTimeIntervalsToSchedules(schedules: any[]): any;
|
|
81
|
+
/**
|
|
82
|
+
* Generates intervals for a specific date for form schedules.
|
|
83
|
+
* @param {Date} date - The date for which to generate intervals.
|
|
84
|
+
* @param {object} interval - The interval configuration.
|
|
85
|
+
* @param {boolean} interval.inEveryWeek - Indicates whether the schedule is weekly.
|
|
86
|
+
* @param {boolean} interval.inEveryMonth - Indicates whether the schedule is monthly.
|
|
87
|
+
* @param {any[]} timeIntervals - The time intervals to process.
|
|
88
|
+
* @param {Set<Array<string>>} utcIntervals - A set to store unique intervals.
|
|
89
|
+
*/
|
|
90
|
+
protected _generateIntervalsForFormDate(date: Date, interval: {
|
|
91
|
+
inEveryWeek: boolean;
|
|
92
|
+
inEveryMonth: boolean;
|
|
93
|
+
}, timeIntervals: any[], utcIntervals: Set<Array<string>>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Adds time intervals to form schedules (different structure).
|
|
96
|
+
* @param {any[]} intervals - The intervals to process.
|
|
97
|
+
* @returns {any} Intervals with added time intervals.
|
|
98
|
+
*/
|
|
99
|
+
_addTimeIntervalsToFormSchedules(intervals: any[]): any;
|
|
81
100
|
/**
|
|
82
101
|
* Normalizes attributes within the data.
|
|
83
102
|
* @param {any} data - The data to normalize.
|
package/dist/base/syncModules.js
CHANGED
|
@@ -258,13 +258,124 @@ class SyncModules {
|
|
|
258
258
|
});
|
|
259
259
|
return schedules;
|
|
260
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Generates intervals for a specific date for form schedules.
|
|
263
|
+
* @param {Date} date - The date for which to generate intervals.
|
|
264
|
+
* @param {object} interval - The interval configuration.
|
|
265
|
+
* @param {boolean} interval.inEveryWeek - Indicates whether the schedule is weekly.
|
|
266
|
+
* @param {boolean} interval.inEveryMonth - Indicates whether the schedule is monthly.
|
|
267
|
+
* @param {any[]} timeIntervals - The time intervals to process.
|
|
268
|
+
* @param {Set<Array<string>>} utcIntervals - A set to store unique intervals.
|
|
269
|
+
*/
|
|
270
|
+
_generateIntervalsForFormDate(date, interval, timeIntervals, utcIntervals) {
|
|
271
|
+
const generateTimeSlotsForDate = (currentDate) => {
|
|
272
|
+
timeIntervals.forEach((timeInterval) => {
|
|
273
|
+
let currentStart = timeInterval.start;
|
|
274
|
+
const endTime = timeInterval.end;
|
|
275
|
+
while (currentStart.hours < endTime.hours ||
|
|
276
|
+
(currentStart.hours === endTime.hours &&
|
|
277
|
+
currentStart.minutes < endTime.minutes)) {
|
|
278
|
+
const intervalStart = new Date(currentDate);
|
|
279
|
+
intervalStart.setUTCHours(currentStart.hours, currentStart.minutes, 0, 0);
|
|
280
|
+
const nextMinutes = currentStart.minutes + timeInterval.period;
|
|
281
|
+
const nextHours = currentStart.hours + Math.floor(nextMinutes / 60);
|
|
282
|
+
const minutes = nextMinutes % 60;
|
|
283
|
+
if (nextHours > endTime.hours ||
|
|
284
|
+
(nextHours === endTime.hours && minutes > endTime.minutes)) {
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
const intervalEnd = new Date(currentDate);
|
|
288
|
+
intervalEnd.setUTCHours(nextHours, minutes, 0, 0);
|
|
289
|
+
utcIntervals.add([
|
|
290
|
+
intervalStart.toISOString(),
|
|
291
|
+
intervalEnd.toISOString(),
|
|
292
|
+
]);
|
|
293
|
+
currentStart = { hours: nextHours, minutes };
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
// Handle weekly schedules
|
|
298
|
+
if (interval.inEveryWeek && !interval.inEveryMonth) {
|
|
299
|
+
let currentDate = new Date(date);
|
|
300
|
+
const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
|
|
301
|
+
while (currentDate <= endOfMonth) {
|
|
302
|
+
generateTimeSlotsForDate(currentDate);
|
|
303
|
+
currentDate = this._addDays(currentDate, 7);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
// Handle monthly schedules
|
|
307
|
+
if (interval.inEveryMonth && !interval.inEveryWeek) {
|
|
308
|
+
const startDate = new Date(date);
|
|
309
|
+
const targetDayOfMonth = startDate.getUTCDate();
|
|
310
|
+
const numberOfMonths = 12;
|
|
311
|
+
for (let i = 0; i < numberOfMonths; i++) {
|
|
312
|
+
const currentDate = new Date(startDate);
|
|
313
|
+
currentDate.setUTCMonth(currentDate.getUTCMonth() + i);
|
|
314
|
+
currentDate.setUTCDate(targetDayOfMonth);
|
|
315
|
+
if (currentDate.getUTCMonth() !== (startDate.getUTCMonth() + i) % 12) {
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
generateTimeSlotsForDate(currentDate);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
// Handle both weekly and monthly schedules
|
|
322
|
+
if (interval.inEveryMonth && interval.inEveryWeek) {
|
|
323
|
+
const startDate = new Date(date);
|
|
324
|
+
const targetDayOfWeek = startDate.getUTCDay();
|
|
325
|
+
const numberOfMonths = 12;
|
|
326
|
+
for (let i = 0; i < numberOfMonths; i++) {
|
|
327
|
+
const currentDate = new Date(startDate);
|
|
328
|
+
currentDate.setUTCMonth(currentDate.getUTCMonth() + i);
|
|
329
|
+
currentDate.setUTCDate(1);
|
|
330
|
+
const daysUntilTargetDay = (targetDayOfWeek - currentDate.getUTCDay() + 7) % 7;
|
|
331
|
+
currentDate.setUTCDate(currentDate.getUTCDate() + daysUntilTargetDay);
|
|
332
|
+
while (currentDate.getUTCMonth() ===
|
|
333
|
+
(startDate.getUTCMonth() + i) % 12) {
|
|
334
|
+
generateTimeSlotsForDate(currentDate);
|
|
335
|
+
currentDate.setUTCDate(currentDate.getUTCDate() + 7);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Adds time intervals to form schedules (different structure).
|
|
342
|
+
* @param {any[]} intervals - The intervals to process.
|
|
343
|
+
* @returns {any} Intervals with added time intervals.
|
|
344
|
+
*/
|
|
345
|
+
_addTimeIntervalsToFormSchedules(intervals) {
|
|
346
|
+
intervals.forEach((interval) => {
|
|
347
|
+
var _a, _b;
|
|
348
|
+
if (!interval.intervals || !Array.isArray(interval.intervals)) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
const utcIntervals = new Set();
|
|
352
|
+
const startDate = new Date(interval.range[0]);
|
|
353
|
+
const endDate = new Date(interval.range[1]);
|
|
354
|
+
const isSameDay = startDate.toISOString() === endDate.toISOString();
|
|
355
|
+
const intervalConfig = {
|
|
356
|
+
inEveryWeek: (_a = interval.inEveryWeek) !== null && _a !== void 0 ? _a : false,
|
|
357
|
+
inEveryMonth: (_b = interval.inEveryMonth) !== null && _b !== void 0 ? _b : false,
|
|
358
|
+
};
|
|
359
|
+
if (isSameDay) {
|
|
360
|
+
this._generateIntervalsForFormDate(startDate, intervalConfig, interval.intervals, utcIntervals);
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
for (let currentDate = new Date(startDate); currentDate <= endDate; currentDate = this._addDays(currentDate, 1)) {
|
|
364
|
+
this._generateIntervalsForFormDate(currentDate, intervalConfig, interval.intervals, utcIntervals);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
interval.timeIntervals = Array.from(utcIntervals).sort();
|
|
368
|
+
});
|
|
369
|
+
return intervals;
|
|
370
|
+
}
|
|
261
371
|
/**
|
|
262
372
|
* Normalizes attributes within the data.
|
|
263
373
|
* @param {any} data - The data to normalize.
|
|
264
374
|
* @returns {any} Normalized attributes.
|
|
265
375
|
*/
|
|
266
376
|
_normalizeAttr(data) {
|
|
267
|
-
|
|
377
|
+
var _a;
|
|
378
|
+
// For regular attributes collections - pages, products, etc.
|
|
268
379
|
if ('attributeValues' in data) {
|
|
269
380
|
for (const attr in data.attributeValues) {
|
|
270
381
|
const d = data.attributeValues[attr];
|
|
@@ -288,33 +399,43 @@ class SyncModules {
|
|
|
288
399
|
attributeValues: this._sortAttributes(data.attributeValues),
|
|
289
400
|
};
|
|
290
401
|
}
|
|
291
|
-
// for forms attributes
|
|
402
|
+
// for forms attributes - forms attributes collections
|
|
292
403
|
if ('attributes' in data) {
|
|
293
404
|
const d = data.attributes;
|
|
294
|
-
// console.log('Schedules:: ', JSON.stringify(d));
|
|
295
405
|
for (const attr in d) {
|
|
296
406
|
// Normalize numbers
|
|
297
|
-
if (d[attr].type === 'integer' || d[attr].type === 'float') {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
407
|
+
// if (d[attr].type === 'integer' || d[attr].type === 'float') {
|
|
408
|
+
// const numValue = Number(d[attr].value);
|
|
409
|
+
// d[attr].value = isNaN(numValue) ? null : numValue;
|
|
410
|
+
// }
|
|
301
411
|
// Add time intervals
|
|
302
412
|
if (d[attr].type === 'timeInterval') {
|
|
303
|
-
|
|
304
|
-
// console.log('Schedules:: ', JSON.stringify(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
413
|
+
const intervals = (_a = d[attr].localizeInfos) === null || _a === void 0 ? void 0 : _a.intervals;
|
|
414
|
+
// console.log('Schedules:: ', JSON.stringify(intervals));
|
|
415
|
+
if (intervals && Array.isArray(intervals) && intervals.length > 0) {
|
|
416
|
+
const result = this._addTimeIntervalsToFormSchedules(intervals);
|
|
417
|
+
d[attr].localizeInfos.intervals = result;
|
|
418
|
+
}
|
|
309
419
|
}
|
|
310
420
|
}
|
|
311
421
|
return data;
|
|
312
422
|
}
|
|
313
|
-
//
|
|
314
|
-
if ('
|
|
315
|
-
//
|
|
423
|
+
// For single attribute - for attribute sets
|
|
424
|
+
if ('type' in data) {
|
|
425
|
+
// Normalize numbers
|
|
426
|
+
if (data.type === 'integer' || data.type === 'float') {
|
|
427
|
+
const numValue = Number(data.value);
|
|
428
|
+
data.value = isNaN(numValue) ? null : numValue;
|
|
429
|
+
}
|
|
430
|
+
// Add time intervals
|
|
431
|
+
if (data.type === 'timeInterval') {
|
|
432
|
+
const schedules = data.value;
|
|
433
|
+
if (Array.isArray(schedules) && schedules.length > 0) {
|
|
434
|
+
const result = this._addTimeIntervalsToSchedules(schedules);
|
|
435
|
+
data.value = result;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
316
438
|
}
|
|
317
|
-
// console.log('Schedules:: ', JSON.stringify(data));
|
|
318
439
|
return data;
|
|
319
440
|
}
|
|
320
441
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AsyncModules from '../base/asyncModules';
|
|
2
2
|
import type StateModule from '../base/stateModule';
|
|
3
3
|
import type { IError } from '../base/utils';
|
|
4
|
-
import type { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IPostFormResponse } from './formsDataInterfaces';
|
|
4
|
+
import type { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IPostFormResponse, IUpdateFormsData } from './formsDataInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with form data
|
|
7
7
|
* @handle /api/content/form-data
|
|
@@ -81,4 +81,26 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
|
81
81
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
82
82
|
*/
|
|
83
83
|
getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: object, isExtended?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
|
|
84
|
+
/**
|
|
85
|
+
* Update one object of form data by id.
|
|
86
|
+
* @handleName updateFormsDataByid
|
|
87
|
+
* @param {number} id - ID of the form data. Example: 1.
|
|
88
|
+
* @returns {IUpdateFormsData | IError} Returns an object containing the updated form data or an error object if there was an issue.
|
|
89
|
+
*/
|
|
90
|
+
updateFormsDataByid(id: number, body?: object): Promise<IUpdateFormsData | IError>;
|
|
91
|
+
/**
|
|
92
|
+
* Update form data status by id.
|
|
93
|
+
* @handleName updateFormsDataStatusByid
|
|
94
|
+
* @param {number} id - ID of the form data. Example: 1.
|
|
95
|
+
* @param {object} body - Request body.
|
|
96
|
+
* @returns {boolean | IError} Returns an object containing the updated form data or an error object if there was an issue.
|
|
97
|
+
*/
|
|
98
|
+
updateFormsDataStatusByid(id: number, body?: object): Promise<boolean | IError>;
|
|
99
|
+
/**
|
|
100
|
+
* Delete one object of form data by id.
|
|
101
|
+
* @handleName deleteFormsDataByid
|
|
102
|
+
* @param {number} id - ID of the form data. Example: 1.
|
|
103
|
+
* @returns {boolean | IError} Returns an object containing the deleted form data or an error object if there was an issue.
|
|
104
|
+
*/
|
|
105
|
+
deleteFormsDataByid(id: number): Promise<boolean | IError>;
|
|
84
106
|
}
|
|
@@ -147,5 +147,36 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
147
147
|
const result = await this._fetchPost(`/marker/${marker}?formModuleConfigId=${formModuleConfigId}&isExtended=${isExtended}&langCode=${langCode}&offset=${offset}&limit=${limit}`, body);
|
|
148
148
|
return this._dataPostProcess(result, langCode);
|
|
149
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Update one object of form data by id.
|
|
152
|
+
* @handleName updateFormsDataByid
|
|
153
|
+
* @param {number} id - ID of the form data. Example: 1.
|
|
154
|
+
* @returns {IUpdateFormsData | IError} Returns an object containing the updated form data or an error object if there was an issue.
|
|
155
|
+
*/
|
|
156
|
+
async updateFormsDataByid(id, body = {}) {
|
|
157
|
+
const result = await this._fetchPut(`/${id}`, body);
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Update form data status by id.
|
|
162
|
+
* @handleName updateFormsDataStatusByid
|
|
163
|
+
* @param {number} id - ID of the form data. Example: 1.
|
|
164
|
+
* @param {object} body - Request body.
|
|
165
|
+
* @returns {boolean | IError} Returns an object containing the updated form data or an error object if there was an issue.
|
|
166
|
+
*/
|
|
167
|
+
async updateFormsDataStatusByid(id, body = {}) {
|
|
168
|
+
const result = await this._fetchPut(`/${id}/update-status`, body);
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Delete one object of form data by id.
|
|
173
|
+
* @handleName deleteFormsDataByid
|
|
174
|
+
* @param {number} id - ID of the form data. Example: 1.
|
|
175
|
+
* @returns {boolean | IError} Returns an object containing the deleted form data or an error object if there was an issue.
|
|
176
|
+
*/
|
|
177
|
+
async deleteFormsDataByid(id) {
|
|
178
|
+
const result = await this._fetchDelete(`/${id}`);
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
150
181
|
}
|
|
151
182
|
exports.default = FormsDataApi;
|
|
@@ -72,7 +72,7 @@ interface IFormsData {
|
|
|
72
72
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
73
73
|
* @description This method retrieves form data by its marker.
|
|
74
74
|
*/
|
|
75
|
-
getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: object, isNested?: number, langCode?: string, offset?: number, limit?: number): Promise<
|
|
75
|
+
getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: object, isNested?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Represents the structure of a form data entity.
|
|
@@ -130,9 +130,10 @@ interface IFormsDataEntity {
|
|
|
130
130
|
* @property {null | number} parentId - The unique identifier of the parent form page. Example: 123.
|
|
131
131
|
* @property {string} formIdentifier - The identifier of the page. Example: "contact_form".
|
|
132
132
|
* @property {number} depth - Example: 1.
|
|
133
|
-
* @property {string | null}
|
|
134
|
-
* @property {string | null}
|
|
135
|
-
* @property {string | null}
|
|
133
|
+
* @property {string | null} ip - Ip. Example: '127.0.0.1'.
|
|
134
|
+
* @property {string | null} fingerprint - Fingerprint. Example: 'fingerprint'.
|
|
135
|
+
* @property {string | null} status - Status. Example: 'approved'.
|
|
136
|
+
* @property {string | null} userIdentifier - Text identifier (marker) of the user. Example: "admin".
|
|
136
137
|
* @property {FormDataType[]} formData - Form data.
|
|
137
138
|
* @example
|
|
138
139
|
[
|
|
@@ -142,11 +143,13 @@ interface IFormsDataEntity {
|
|
|
142
143
|
"value": "Test"
|
|
143
144
|
}
|
|
144
145
|
]
|
|
145
|
-
* @property {string | null}
|
|
146
|
+
* @property {string | null} attributeSetIdentifier - Text identifier (marker) of the used attribute set. Example: "product_attributes".
|
|
146
147
|
* @property {Date | string} time - The identifier of the form. Example: "2023-10-01T12:00:00Z".
|
|
147
|
-
* @property {string}
|
|
148
|
-
* @property {boolean}
|
|
149
|
-
* @property {number}
|
|
148
|
+
* @property {string} entityIdentifier - Text identifier (marker) of the entity. Example: "test".
|
|
149
|
+
* @property {boolean} isUserAdmin - Is user admin. Example: true.
|
|
150
|
+
* @property {number} formModuleConfigId - Form module config Id. Example: 2.
|
|
151
|
+
* @property {number} moduleIdentifier - Form module config Id. Example: 2.
|
|
152
|
+
* @property {number} entityId - Form module config Id. Example: 2.
|
|
150
153
|
* @description This interface defines the structure of a form data entity, including its identifiers, form data, and optional attributes.
|
|
151
154
|
*/
|
|
152
155
|
interface IFormByMarkerDataEntity {
|
|
@@ -154,15 +157,18 @@ interface IFormByMarkerDataEntity {
|
|
|
154
157
|
parentId: null | number;
|
|
155
158
|
formIdentifier: string;
|
|
156
159
|
depth: number;
|
|
157
|
-
ip
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
ip: string | null;
|
|
161
|
+
fingerprint: string | null;
|
|
162
|
+
status: string | null;
|
|
163
|
+
userIdentifier: string | null;
|
|
160
164
|
formData: FormDataType[];
|
|
161
|
-
attributeSetIdentifier
|
|
165
|
+
attributeSetIdentifier: string | null;
|
|
162
166
|
time: Date | string;
|
|
163
167
|
entityIdentifier: string;
|
|
164
168
|
isUserAdmin: boolean;
|
|
165
169
|
formModuleConfigId: number;
|
|
170
|
+
moduleIdentifier: string;
|
|
171
|
+
entityId: number;
|
|
166
172
|
}
|
|
167
173
|
/**
|
|
168
174
|
* Represents a collection of form data entities.
|
|
@@ -255,6 +261,32 @@ interface IPostFormResponse {
|
|
|
255
261
|
formData: FormDataType[];
|
|
256
262
|
};
|
|
257
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Represents the structure of the response after updating form data.
|
|
266
|
+
* @interface IUpdateFormsData
|
|
267
|
+
* @property {number} id - The unique identifier of the form page. Example: 12345.
|
|
268
|
+
* @property {string} formIdentifier - The identifier of the form. Example: "contact_form".
|
|
269
|
+
* @property {string} time - The time of the form submit. Example: "2023-10-01T12:00:00Z".
|
|
270
|
+
* @property {FormDataType[]} formData - Form fields data.
|
|
271
|
+
* @property {string} userIdentifier - The user identifier. Example: null.
|
|
272
|
+
* @property {string} entityIdentifier - The entity identifier. Example: "blog".
|
|
273
|
+
* @property {any} parentId - The parent identifier. Example: null.
|
|
274
|
+
* @property {string} fingerprint - The fingerprint of the form. Example: null.
|
|
275
|
+
* @property {boolean} isUserAdmin - Is user admin. Example: false.
|
|
276
|
+
* @property {number} formModuleId - The form module identifier. Example: 2.
|
|
277
|
+
*/
|
|
278
|
+
interface IUpdateFormsData {
|
|
279
|
+
id: number;
|
|
280
|
+
formIdentifier: string;
|
|
281
|
+
time: string;
|
|
282
|
+
formData: FormDataType[];
|
|
283
|
+
userIdentifier: string;
|
|
284
|
+
entityIdentifier: string;
|
|
285
|
+
parentId: null | number;
|
|
286
|
+
fingerprint: null | string;
|
|
287
|
+
isUserAdmin: boolean;
|
|
288
|
+
formModuleId: number;
|
|
289
|
+
}
|
|
258
290
|
/**
|
|
259
291
|
* Contains an array of data form objects with the following values
|
|
260
292
|
*/
|
|
@@ -490,4 +522,4 @@ interface IBodyTypeRadioButtonList {
|
|
|
490
522
|
};
|
|
491
523
|
}>;
|
|
492
524
|
}
|
|
493
|
-
export type { FormDataType, IBodyPostFormData, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFormByMarkerDataEntity, IFormDataEntity, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IPostFormResponse, };
|
|
525
|
+
export type { FormDataType, IBodyPostFormData, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFormByMarkerDataEntity, IFormDataEntity, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IPostFormResponse, IUpdateFormsData, };
|
|
@@ -419,7 +419,8 @@ interface IOrderByMarkerEntity {
|
|
|
419
419
|
currency: string;
|
|
420
420
|
paymentAccountIdentifier?: string;
|
|
421
421
|
paymentAccountLocalizeInfos?: Record<string, any>;
|
|
422
|
+
paymentUrl: null | string;
|
|
422
423
|
products: IOrderProducts[];
|
|
423
|
-
isCompleted: boolean;
|
|
424
|
+
isCompleted: null | boolean;
|
|
424
425
|
}
|
|
425
426
|
export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, IOrderByMarkerEntity, IOrderData, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IPaymentAccountIdentifiers, IPicture, };
|
|
@@ -79,14 +79,4 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
|
|
|
79
79
|
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
80
80
|
*/
|
|
81
81
|
getAccountById(id: number): Promise<IAccountsEntity | IError>;
|
|
82
|
-
/**
|
|
83
|
-
* Webhook for payment account.
|
|
84
|
-
* @handleName webhookByMarker
|
|
85
|
-
* @param {string} marker - marker. Example: "stripe".
|
|
86
|
-
* @returns {boolean} Returns true if the webhook was processed successfully.
|
|
87
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
88
|
-
* @description This method requires user authorization.
|
|
89
|
-
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
90
|
-
*/
|
|
91
|
-
webhookByMarker(marker: string): Promise<boolean | IError>;
|
|
92
82
|
}
|
|
@@ -108,18 +108,5 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
108
108
|
const result = await this._fetchGet(`/accounts/${id}`);
|
|
109
109
|
return this._normalizeData(result);
|
|
110
110
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Webhook for payment account.
|
|
113
|
-
* @handleName webhookByMarker
|
|
114
|
-
* @param {string} marker - marker. Example: "stripe".
|
|
115
|
-
* @returns {boolean} Returns true if the webhook was processed successfully.
|
|
116
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
117
|
-
* @description This method requires user authorization.
|
|
118
|
-
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
119
|
-
*/
|
|
120
|
-
async webhookByMarker(marker) {
|
|
121
|
-
const result = await this._fetchPost(`/webhook/${marker}`, {});
|
|
122
|
-
return result;
|
|
123
|
-
}
|
|
124
111
|
}
|
|
125
112
|
exports.default = PaymentsApi;
|
|
@@ -72,16 +72,6 @@ interface IPaymentsApi {
|
|
|
72
72
|
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
73
73
|
*/
|
|
74
74
|
getAccountById(id: number): Promise<IAccountsEntity | IError>;
|
|
75
|
-
/**
|
|
76
|
-
* Webhook for payment account.
|
|
77
|
-
* @handleName webhookByMarker
|
|
78
|
-
* @param {string} marker - marker. Example: "stripe".
|
|
79
|
-
* @returns {boolean} Returns true if the webhook was processed successfully.
|
|
80
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
81
|
-
* @description This method requires user authorization.
|
|
82
|
-
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
83
|
-
*/
|
|
84
|
-
webhookByMarker(marker: string): Promise<boolean | IError>;
|
|
85
75
|
}
|
|
86
76
|
/**
|
|
87
77
|
* @interface ISessionsEntity
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.136",
|
|
4
4
|
"description": "OneEntry NPM package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@jest/globals": "^30.2.0",
|
|
49
49
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
50
50
|
"@types/jest": "^30.0.0",
|
|
51
|
-
"@types/node": "^25.0.
|
|
51
|
+
"@types/node": "^25.0.3",
|
|
52
52
|
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
53
53
|
"@typescript-eslint/parser": "^8.50.0",
|
|
54
54
|
"eslint": "^9.39.2",
|