oneentry 1.0.113 → 1.0.115

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/README.md CHANGED
@@ -3359,15 +3359,18 @@ Example return:
3359
3359
  "items": [
3360
3360
  {
3361
3361
  "id": 1764,
3362
- "localizeInfos": {
3363
- "en_US": {
3364
- "title": "Collection 1"
3362
+ "formData": [
3363
+ {
3364
+ "marker": "naimenovanie_1",
3365
+ "type": "string",
3366
+ "value": "Name"
3365
3367
  }
3366
- },
3367
- "identifier": "collection",
3368
- "formId": 1,
3369
- "attributeSetId": "1",
3370
- "selectedAttributeMarkers": "marker1, marker2"
3368
+ ],
3369
+ "attributeSetIdentifier": "collection_form",
3370
+ "createdDate": "2025-03-02T16:17:23.970Z",
3371
+ "updatedDate": "2025-03-02T16:17:23.970Z",
3372
+ "entityType": "orders",
3373
+ "entityId": 1
3371
3374
  }
3372
3375
  ]
3373
3376
  }
@@ -3387,28 +3390,30 @@ Example return:
3387
3390
  >*Object identifier* <br>
3388
3391
  >example: 1764 <br>
3389
3392
  >
3390
- >**localizeInfos:** CommonLocalizeInfos <br>
3391
- >*Name considering localization* <br>
3392
- >example: OrderedMap { "en_US": OrderedMap { "title": "Collection 1" } } <br>
3393
+ >**formData*:** FormDataType <br>
3394
+ >*data submitted by the form attached to the collection* <br>
3395
+ >example: List [ OrderedMap { "marker": "naimenovanie_1", "type": "string", "value": "Name" } ] <br>
3393
3396
  >
3394
- >**identifier:** string <br>
3395
- >*Text identifier for record field* <br>
3396
- >example: collection <br>
3397
- >default: marker <br>
3397
+ >**attributeSetIdentifier:** string <br>
3398
+ >*text identifier of the attribute set used* <br>
3399
+ >example: collection_form <br>
3398
3400
  >
3399
- >**formId:** number <br>
3400
- >*Identifier for the form used by the order storage* <br>
3401
- >example: 1 <br>
3402
- >default: <br>
3401
+ >**createdDate:** string($date-time) <br>
3402
+ >*date of record creation in the collection* <br>
3403
+ >example: 2025-03-02T16:17:23.970Z <br>
3403
3404
  >
3404
- >**attributeSetId:** string <br>
3405
- >*Identifier of the set of attributes used by the form attached to the collection* <br>
3405
+ >**updatedDate:** string($date-time) <br>
3406
+ >*date of record update in the collection* <br>
3407
+ >example: 2025-03-02T16:17:23.970Z <br>
3408
+ >
3409
+ >**entityType:** string <br>
3410
+ >*record type* <br>
3411
+ >example: orders <br>
3412
+ >
3413
+ >**entityId:** number <br>
3414
+ >*record identifier* <br>
3406
3415
  >example: 1 <br>
3407
- >default: <br>
3408
3416
  >
3409
- >**selectedAttributeMarkers:** string <br>
3410
- >*Text identifiers of form object attributes for display in the data table* <br>
3411
- >example: marker1, marker2 <br>
3412
3417
  ><br>
3413
3418
  ></details>
3414
3419
 
@@ -3446,6 +3451,59 @@ Example return:
3446
3451
  ><br>
3447
3452
  ></details>
3448
3453
 
3454
+ ### IntegrationCollections.getICollectionRowsByMarker(marker, langCode)
3455
+
3456
+ ```js
3457
+ const result = await IntegrationCollections.getICollectionRowsByMarker('test_collection');
3458
+ ```
3459
+
3460
+ ><details><br>
3461
+ ><summary>Schema</summary>
3462
+ >
3463
+ >**marker*:** string <br>
3464
+ >*Collection text identifier* <br>
3465
+ >example: test_collection <br>
3466
+ >
3467
+ >**langCode:** string <br>
3468
+ >*Language code* <br>
3469
+ >example: en_US <br>
3470
+ ><br>
3471
+ ></details>
3472
+
3473
+ Getting all records from the collection.
3474
+
3475
+ Example return:
3476
+
3477
+ ```json
3478
+ {
3479
+ "items": [
3480
+ {
3481
+ "id": 2,
3482
+ "entityId": null,
3483
+ "entityType": null,
3484
+ "createdDate": "2025-01-30T01:28:19.906Z",
3485
+ "updatedDate": "2025-01-30T01:28:19.906Z",
3486
+ "formData": [{ "marker": "c_marker", "type": "string", "value": "Value" }],
3487
+ "attributeSetIdentifier": null,
3488
+ },
3489
+ ],
3490
+ "total": 1,
3491
+ }
3492
+ ```
3493
+
3494
+ ><details><br>
3495
+ ><summary>Schema</summary>
3496
+ >
3497
+ >**total:** number <br>
3498
+ >*Total number of found records* <br>
3499
+ >example: 100 <br>
3500
+ >
3501
+ >**items:** ICollectionRow[] <br>
3502
+ >*Object identifier* <br>
3503
+ >example: 2 <br>
3504
+ >
3505
+ ></details>
3506
+
3449
3507
  ### IntegrationCollections.getICollectionRowByMarkerAndId(marker, id, langCode)
3450
3508
 
3451
3509
  ```js
@@ -5429,6 +5487,8 @@ const { Payments } = defineOneEntry('your-url');
5429
5487
 
5430
5488
  ### Payments.getSessions(offset, limit)
5431
5489
 
5490
+ Get list of payment sessions.
5491
+
5432
5492
  ```js
5433
5493
  const value = await Payments.getSessions()
5434
5494
  ```
@@ -5536,6 +5596,8 @@ Example return:
5536
5596
 
5537
5597
  ### Payments.getSessionById(id)
5538
5598
 
5599
+ Get a single payment session object by its identifier.
5600
+
5539
5601
  ```js
5540
5602
  const value = await Payments.getSessionById(1764)
5541
5603
  ```
@@ -5561,8 +5623,8 @@ Example return:
5561
5623
  "status": "completed",
5562
5624
  "orderId": 1,
5563
5625
  "paymentAccountId": 1,
5564
- "paymentUrl": "https://checkout.stripe.com/c/pay/cs_test_a1iOHnSWAmeN3SN5IgYtPv8Fzv48vGUmKxFuhxD0FOjkOaTAlgiwNY9OYW#fid2BXKsdWBEZmZqcGtxJz8nZGZmcVo0VTZjazFUb2Z8YEBRYkxHJyknZHVsTmB8Jz8ndW5acWB2cVowNEpKcW43TVVBa1NSMU5ST3JfY3VcRGlRSUR8cVx0XFxOXG9Cbn1oM1V0QUExR0RRRnJwV0FCYlNcXUtGdGtzcndgcmJxQVNkQnxvcDBTY0ZpUjZCd319UTU1ME5rXDJIVjYnKSdjd2poVmB3c2B3Jz9xd3BgKSdpZHxqcHFRfHVgJz8ndmxrYmlgWmxxYGgnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl",
5565
- "clientSecret": "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH"
5626
+ "paymentUrl": "https://checkout.stripe.com/c/pay/cs...",
5627
+ "clientSecret": "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret..."
5566
5628
  }
5567
5629
  ```
5568
5630
 
@@ -5632,6 +5694,163 @@ Example return:
5632
5694
  ><br>
5633
5695
  ></details>
5634
5696
 
5697
+ ### Payments.getSessionByOrderId(id)
5698
+
5699
+ Get one payment session object by order identifier 🔐
5700
+
5701
+ ```js
5702
+ const value = await Payments.getSessionByOrderId(1764)
5703
+ ```
5704
+
5705
+ ><details><br>
5706
+ ><summary>Schema</summary>
5707
+ >
5708
+ >**id*:** number <br>
5709
+ >*Identifier of the retrieved payment session object* <br>
5710
+ >example: 1764 <br>
5711
+ ><br>
5712
+ ></details>
5713
+
5714
+ This method...
5715
+
5716
+ Example return:
5717
+
5718
+ ```json
5719
+ {
5720
+ "id": 1764,
5721
+ "createdDate": "2025-03-02T21:56:53.600Z",
5722
+ "updatedDate": "2025-03-02T21:56:53.600Z",
5723
+ "type": "session",
5724
+ "status": "completed",
5725
+ "orderId": 1,
5726
+ "paymentAccountId": 1,
5727
+ "paymentUrl": "https://checkout.stripe.com/c/pay/cs_...",
5728
+ "clientSecret": "pi_3MtwBwLkdIwHu7ix28a3tq..."
5729
+ }
5730
+ ```
5731
+
5732
+ ><details><br>
5733
+ ><summary>Schema</summary>
5734
+ >
5735
+ >**id:** number <br>
5736
+ >*object identifier* <br>
5737
+ >example: 1764 <br>
5738
+ >
5739
+ >**createdDate:** string($date-time) <br>
5740
+ >*Object creation date* <br>
5741
+ >
5742
+ >**updatedDate:** string($date-time) <br>
5743
+ >*Object modification date* <br>
5744
+ >
5745
+ >**type*:** string <br>
5746
+ >*Session type Enum: [ session, intent ]* <br>
5747
+ >example: session <br>
5748
+ >
5749
+ >**status*:** string <br>
5750
+ >*Payment status Enum: [ waiting, completed, canceled, expired ]* <br>
5751
+ >example: completed <br>
5752
+ >
5753
+ >**orderId*:** number <br>
5754
+ >*Order ID* <br>
5755
+ >example: 1 <br>
5756
+ >
5757
+ >**paymentAccountId*:** number <br>
5758
+ >*Payment account ID* <br>
5759
+ >example: 1 <br>
5760
+ >
5761
+ >**paymentUrl*:** string <br>
5762
+ >*Payment link* <br>
5763
+ >example: https://checkout.stripe.com/c/pay/cs_... <br>
5764
+ >
5765
+ >**clientSecret:** string <br>
5766
+ >*Secret key* <br>
5767
+ >example: pi_3MtwBwLkdIwHu7ix28a3tqPa_secret... <br>
5768
+ >
5769
+ ><br>
5770
+ ></details>
5771
+
5772
+ ### Payments.updateSessionById(id, body)
5773
+
5774
+ This method Update payment session 🔐
5775
+
5776
+ ```js
5777
+ const body = {
5778
+ "status": "completed",
5779
+ "paymentUrl": "https://www.paypal.com/checkoutnow?token=6TC49050A66458205"
5780
+ };
5781
+ const value = await Payments.updateSessionById(10, body)
5782
+ ```
5783
+
5784
+ ><details><br>
5785
+ ><summary>Schema (body)</summary>
5786
+ >
5787
+ >**status:** string <br>
5788
+ >*payment status Enum: [ waiting, completed, canceled, expired ]* <br>
5789
+ >example: completed <br>
5790
+ >
5791
+ >**paymentUrl*:** string <br>
5792
+ >*payment link* <br>
5793
+ >example: https://www.paypal.com/checkoutnow?token=6TC49050A66458205 <br>
5794
+ >
5795
+ ><br>
5796
+ ></details>
5797
+
5798
+ Example return:
5799
+
5800
+ ```json
5801
+ {
5802
+ "id": 1764,
5803
+ "createdDate": "2025-03-02T22:11:25.315Z",
5804
+ "updatedDate": "2025-03-02T22:11:25.315Z",
5805
+ "type": "session",
5806
+ "status": "completed",
5807
+ "orderId": 1,
5808
+ "paymentAccountId": 1,
5809
+ "paymentUrl": "https://checkout.stripe.com/c/pay/cs_test_a1iOHnSWAmeN3SN5IgYtPv8Fzv48vGUmKxFuhxD0FOjkOaTAlgiwNY9OYW#fid2BXKsdWBEZmZqcGtxJz8nZGZmcVo0VTZjazFUb2Z8YEBRYkxHJyknZHVsTmB8Jz8ndW5acWB2cVowNEpKcW43TVVBa1NSMU5ST3JfY3VcRGlRSUR8cVx0XFxOXG9Cbn1oM1V0QUExR0RRRnJwV0FCYlNcXUtGdGtzcndgcmJxQVNkQnxvcDBTY0ZpUjZCd319UTU1ME5rXDJIVjYnKSdjd2poVmB3c2B3Jz9xd3BgKSdpZHxqcHFRfHVgJz8ndmxrYmlgWmxxYGgnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl",
5810
+ "clientSecret": "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH"
5811
+ }
5812
+ ```
5813
+
5814
+ ><details><br>
5815
+ ><summary>Schema</summary>
5816
+ >
5817
+ >**id*:** number <br>
5818
+ >*Object ID* <br>
5819
+ >example: 1764 <br>
5820
+ >
5821
+ >**createdDate:** string($date-time) <br>
5822
+ >*Object creation date* <br>
5823
+ >
5824
+ >**updatedDate:** string($date-time) <br>
5825
+ >*Object modification date* <br>
5826
+ >
5827
+ >**type*:** string <br>
5828
+ >*Session type Enum: [ session, intent ]* <br>
5829
+ >example: session <br>
5830
+ >
5831
+ >**status*:** string <br>
5832
+ >*Payment status Enum: [ waiting, completed, canceled, expired ]* <br>
5833
+ >example: completed <br>
5834
+ >
5835
+ >**orderId*:** number <br>
5836
+ >*Order ID* <br>
5837
+ >example: 1 <br>
5838
+ >
5839
+ >**paymentAccountId*:** number <br>
5840
+ >*Payment account ID* <br>
5841
+ >example: 1 <br>
5842
+ >
5843
+ >**paymentUrl*:** string <br>
5844
+ >*Payment link* <br>
5845
+ >example: https://checkout.stripe.com/c/pay/cs_... <br>
5846
+ >
5847
+ >**clientSecret:** string <br>
5848
+ >*Secret key* <br>
5849
+ >example: pi_3MtwBwLkdIwHu7i... <br>
5850
+ >
5851
+ ><br>
5852
+ ></details>
5853
+
5635
5854
  ### Payments.createSession(orderId, type, automaticTaxEnabled)
5636
5855
 
5637
5856
  ```js
@@ -34,7 +34,7 @@ interface IPosition {
34
34
  * @property {string} [identifier] - The textual identifier for the record field.
35
35
  * @property {number} [attributeSetId] - The identifier of the attribute set being used.
36
36
  * @property {boolean} [isSync] - Indication of page indexing.
37
- * @property {Record<string, any>} [attributesSets] - The attributes with values used by the object.
37
+ * @property {Record<string, any>} [attributeValues] - The attributes with values used by the object.
38
38
  * @property {number} [position] - The position of the object.
39
39
  */
40
40
  interface IAdminEntity {
@@ -42,7 +42,7 @@ interface IAdminEntity {
42
42
  identifier: string;
43
43
  attributeSetId: number | null;
44
44
  isSync: boolean;
45
- attributesSets: Record<string, any>;
45
+ attributeValues: Record<string, any>;
46
46
  position: number | null;
47
47
  [key: string]: any;
48
48
  }
@@ -53,10 +53,15 @@ interface IAttributesSetsEntity {
53
53
  /**
54
54
  * Represents an interface object of IAttributeSetsEntity.
55
55
  *
56
- * @property {number} id
57
- * @property {string} identifier
58
- * @property {boolean} isVisible
59
- * @property {number} position
56
+ * @property {number} id -
57
+ * @property {string} identifier -
58
+ * @property {boolean} isVisible -
59
+ * @property {any} schema -
60
+ * @property {string} title -
61
+ * @property {any} type -
62
+ * @property {number} typeId -
63
+ * @property {string} updatedDate -
64
+ * @property {number} version -
60
65
  */
61
66
  interface IAttributeSetsEntity {
62
67
  id: number;
@@ -54,6 +54,15 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
54
54
  validateICollectionMarker(marker: string): Promise<{
55
55
  valid: boolean;
56
56
  } | IError>;
57
+ /**
58
+ * Getting all records from the collection.
59
+ *
60
+ * @param {string} [marker] - Collection text identifier
61
+ * @param {string} [langCode] - Language code.
62
+ *
63
+ * @returns Returns CollectionRowEntity object.
64
+ */
65
+ getICollectionRowsByMarker(marker: string, langCode?: string): Promise<any | IError>;
57
66
  /**
58
67
  * Getting one record from the collection.
59
68
  *
@@ -75,6 +75,18 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
75
75
  const result = await this._fetchGet(`/marker-validation/${marker}/`);
76
76
  return this._dataPostProcess(result);
77
77
  }
78
+ /**
79
+ * Getting all records from the collection.
80
+ *
81
+ * @param {string} [marker] - Collection text identifier
82
+ * @param {string} [langCode] - Language code.
83
+ *
84
+ * @returns Returns CollectionRowEntity object.
85
+ */
86
+ async getICollectionRowsByMarker(marker, langCode = this.state.lang) {
87
+ const result = await this._fetchGet(`/marker/${marker}/rows/?langCode=${langCode}`);
88
+ return this._dataPostProcess(result, langCode);
89
+ }
78
90
  /**
79
91
  * Getting one record from the collection.
80
92
  *
@@ -80,6 +80,8 @@ interface ICollectionRow {
80
80
  id: number;
81
81
  createdDate: string;
82
82
  updatedDate: string;
83
+ entityId: any;
84
+ entityType: any;
83
85
  formData: ICollectionFormData[];
84
86
  attributeSetIdentifier: string | null;
85
87
  total?: string;
@@ -28,6 +28,26 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
28
28
  * @returns Returns a single payment session object.
29
29
  */
30
30
  getSessionById(id: number): Promise<ISessionEntity | IError>;
31
+ /**
32
+ * Get one payment session object by order identifier 🔐
33
+ *
34
+ * @param id - order identifier
35
+ * @returns
36
+ */
37
+ getSessionByOrderId(id: number): Promise<IAccountsEntity | IError>;
38
+ /**
39
+ * Update payment session 🔐
40
+ *
41
+ * @param id - order identifier
42
+ * @param body - Request body
43
+ *
44
+ * @param body.status
45
+ * @param body.paymentUrl
46
+ */
47
+ updateSessionById(id: number, body: {
48
+ status: string;
49
+ paymentUrl: string;
50
+ }): Promise<any | IError>;
31
51
  /**
32
52
  * Creation of payment session.
33
53
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
@@ -41,6 +41,29 @@ class PaymentsApi extends asyncModules_1.default {
41
41
  const result = await this._fetchGet(`/sessions/${id}`);
42
42
  return result;
43
43
  }
44
+ /**
45
+ * Get one payment session object by order identifier 🔐
46
+ *
47
+ * @param id - order identifier
48
+ * @returns
49
+ */
50
+ async getSessionByOrderId(id) {
51
+ const result = await this._fetchGet(`/sessions/order/${id}`);
52
+ return result;
53
+ }
54
+ /**
55
+ * Update payment session 🔐
56
+ *
57
+ * @param id - order identifier
58
+ * @param body - Request body
59
+ *
60
+ * @param body.status
61
+ * @param body.paymentUrl
62
+ */
63
+ async updateSessionById(id, body) {
64
+ const result = await this._fetchPut(`/sessions/${id}`, body);
65
+ return this._normalizeData(result);
66
+ }
44
67
  /**
45
68
  * Creation of payment session.
46
69
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
@@ -29,5 +29,6 @@ interface IProductStatusEntity {
29
29
  version: number;
30
30
  identifier: string;
31
31
  localizeInfos: Record<string, any>;
32
+ isDefault: boolean;
32
33
  }
33
34
  export type { IProductStatusEntity, IProductStatuses };
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.113",
3
+ "version": "1.0.115",
4
4
  "description": "OneEntry NPM package",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
- "type": "module",
8
7
  "files": [
9
8
  "/dist"
10
9
  ],
@@ -49,8 +48,8 @@
49
48
  "@types/eslint-config-prettier": "^6.11.3",
50
49
  "@types/jest": "^29.5.14",
51
50
  "@types/node": "^22.13.4",
52
- "@typescript-eslint/eslint-plugin": "^8.24.0",
53
- "@typescript-eslint/parser": "^8.24.0",
51
+ "@typescript-eslint/eslint-plugin": "^8.24.1",
52
+ "@typescript-eslint/parser": "^8.24.1",
54
53
  "eslint": "^8.57.1",
55
54
  "eslint-config-prettier": "^10.0.1",
56
55
  "eslint-plugin-import": "^2.31.0",