merchi_sdk_js 0.10.0 → 0.12.0
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/package.json +1 -1
- package/src/category.js +2 -0
- package/src/domain.js +134 -0
package/package.json
CHANGED
package/src/category.js
CHANGED
|
@@ -12,6 +12,8 @@ export function Category() {
|
|
|
12
12
|
addPropertyTo(this, 'id');
|
|
13
13
|
addPropertyTo(this, 'name');
|
|
14
14
|
addPropertyTo(this, 'position');
|
|
15
|
+
addPropertyTo(this, 'description');
|
|
16
|
+
addPropertyTo(this, 'descriptionShort');
|
|
15
17
|
addPropertyTo(this, 'showDashboard');
|
|
16
18
|
addPropertyTo(this, 'showPublic');
|
|
17
19
|
addPropertyTo(this, 'showPublicSupplierResell');
|
package/src/domain.js
CHANGED
|
@@ -271,6 +271,15 @@ export function Domain() {
|
|
|
271
271
|
* @property {string} [updatedAt]
|
|
272
272
|
*/
|
|
273
273
|
|
|
274
|
+
/**
|
|
275
|
+
* @typedef {Object} StorefrontGoogleIntegrations
|
|
276
|
+
* @property {string} [ga4MeasurementId]
|
|
277
|
+
* @property {string} [ga4PropertyId]
|
|
278
|
+
* @property {string} [googleAdsId]
|
|
279
|
+
* @property {string} [googleAdsConversionLabel]
|
|
280
|
+
* @property {string} [googleAdsQuoteConversionLabel]
|
|
281
|
+
*/
|
|
282
|
+
|
|
274
283
|
/**
|
|
275
284
|
* @typedef {Object} StorefrontV2Config
|
|
276
285
|
* @property {number} [id]
|
|
@@ -287,6 +296,7 @@ export function Domain() {
|
|
|
287
296
|
* @property {string|null} [repoName]
|
|
288
297
|
* @property {string|null} [vercelProjectId]
|
|
289
298
|
* @property {string|null} [lastSuccessfulCommitSha]
|
|
299
|
+
* @property {StorefrontGoogleIntegrations|null} [googleIntegrations]
|
|
290
300
|
* @property {Array<string>} [approvedStarterTemplates]
|
|
291
301
|
* @property {string} [providerMode]
|
|
292
302
|
*/
|
|
@@ -602,6 +612,130 @@ export function Domain() {
|
|
|
602
612
|
);
|
|
603
613
|
};
|
|
604
614
|
|
|
615
|
+
this.getStorefrontV2GoogleIntegrations = function (success, error) {
|
|
616
|
+
sendStorefrontRequest(
|
|
617
|
+
'/domains/' + this.id() + '/storefront_v2/google_integrations/',
|
|
618
|
+
'GET',
|
|
619
|
+
null,
|
|
620
|
+
success,
|
|
621
|
+
error
|
|
622
|
+
);
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* @param {{googleIntegrations?: StorefrontGoogleIntegrations}|StorefrontGoogleIntegrations|Function} payload
|
|
627
|
+
* @param {Function} [success]
|
|
628
|
+
* @param {Function} [error]
|
|
629
|
+
*/
|
|
630
|
+
this.saveStorefrontV2GoogleIntegrations = function (payload, success, error) {
|
|
631
|
+
var args = parsePayloadAndCallbacks(payload, success, error);
|
|
632
|
+
var body = args.payload || {};
|
|
633
|
+
if (!body.googleIntegrations && !body.google_integrations) {
|
|
634
|
+
body = {googleIntegrations: body};
|
|
635
|
+
}
|
|
636
|
+
sendStorefrontRequest(
|
|
637
|
+
'/domains/' + this.id() + '/storefront_v2/google_integrations/',
|
|
638
|
+
'POST',
|
|
639
|
+
body,
|
|
640
|
+
args.success,
|
|
641
|
+
args.error
|
|
642
|
+
);
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
this.getStorefrontV2GaStatus = function (success, error) {
|
|
646
|
+
sendStorefrontRequest(
|
|
647
|
+
'/domains/' + this.id() + '/storefront_v2/ga/status/',
|
|
648
|
+
'GET',
|
|
649
|
+
null,
|
|
650
|
+
success,
|
|
651
|
+
error
|
|
652
|
+
);
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
this.verifyStorefrontV2GaInstallation = function (success, error) {
|
|
656
|
+
sendStorefrontRequest(
|
|
657
|
+
'/domains/' + this.id() + '/storefront_v2/ga/verify/',
|
|
658
|
+
'POST',
|
|
659
|
+
null,
|
|
660
|
+
success,
|
|
661
|
+
error
|
|
662
|
+
);
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* @param {{days?: number}|Function} payload
|
|
667
|
+
* @param {Function} [success]
|
|
668
|
+
* @param {Function} [error]
|
|
669
|
+
*/
|
|
670
|
+
this.analyzeStorefrontV2Ga = function (payload, success, error) {
|
|
671
|
+
var args = parsePayloadAndCallbacks(payload, success, error);
|
|
672
|
+
sendStorefrontRequest(
|
|
673
|
+
'/domains/' + this.id() + '/storefront_v2/ga/analyze/',
|
|
674
|
+
'POST',
|
|
675
|
+
args.payload,
|
|
676
|
+
args.success,
|
|
677
|
+
args.error
|
|
678
|
+
);
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* @param {{recommendationIds: Array<string>, recommendations?: Array<Object>, narrative?: string, days?: number, startNewBranch?: boolean, branchName?: string}|Function} payload
|
|
683
|
+
* @param {Function} [success]
|
|
684
|
+
* @param {Function} [error]
|
|
685
|
+
*/
|
|
686
|
+
this.applyStorefrontV2GaRecommendations = function (payload, success, error) {
|
|
687
|
+
var args = parsePayloadAndCallbacks(payload, success, error);
|
|
688
|
+
sendStorefrontRequest(
|
|
689
|
+
'/domains/' + this.id() + '/storefront_v2/ga/apply/',
|
|
690
|
+
'POST',
|
|
691
|
+
args.payload,
|
|
692
|
+
args.success,
|
|
693
|
+
args.error
|
|
694
|
+
);
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
this.getStorefrontV2GscStatus = function (success, error) {
|
|
698
|
+
sendStorefrontRequest(
|
|
699
|
+
'/domains/' + this.id() + '/storefront_v2/gsc/status/',
|
|
700
|
+
'GET',
|
|
701
|
+
null,
|
|
702
|
+
success,
|
|
703
|
+
error
|
|
704
|
+
);
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* @param {{days?: number}|Function} payload
|
|
709
|
+
* @param {Function} [success]
|
|
710
|
+
* @param {Function} [error]
|
|
711
|
+
*/
|
|
712
|
+
this.analyzeStorefrontV2Gsc = function (payload, success, error) {
|
|
713
|
+
var args = parsePayloadAndCallbacks(payload, success, error);
|
|
714
|
+
sendStorefrontRequest(
|
|
715
|
+
'/domains/' + this.id() + '/storefront_v2/gsc/analyze/',
|
|
716
|
+
'POST',
|
|
717
|
+
args.payload,
|
|
718
|
+
args.success,
|
|
719
|
+
args.error
|
|
720
|
+
);
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* @param {{recommendationIds: Array<string>, recommendations?: Array<Object>, narrative?: string, days?: number, startNewBranch?: boolean, branchName?: string}|Function} payload
|
|
725
|
+
* @param {Function} [success]
|
|
726
|
+
* @param {Function} [error]
|
|
727
|
+
*/
|
|
728
|
+
this.applyStorefrontV2GscRecommendations = function (payload, success, error) {
|
|
729
|
+
var args = parsePayloadAndCallbacks(payload, success, error);
|
|
730
|
+
sendStorefrontRequest(
|
|
731
|
+
'/domains/' + this.id() + '/storefront_v2/gsc/apply/',
|
|
732
|
+
'POST',
|
|
733
|
+
args.payload,
|
|
734
|
+
args.success,
|
|
735
|
+
args.error
|
|
736
|
+
);
|
|
737
|
+
};
|
|
738
|
+
|
|
605
739
|
this.getStorefrontChangeRequest = function (requestId, success, error) {
|
|
606
740
|
sendStorefrontRequest(
|
|
607
741
|
'/storefront_change_requests/' + requestId + '/',
|