@devite/shopware-client 1.6.0 → 1.7.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/dist/index.cjs +103 -84
- package/dist/index.d.cts +10 -6
- package/dist/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.mjs +103 -84
- package/dist/types/clients/admin/DocumentClient.d.ts +1 -0
- package/dist/types/clients/admin/OrderClient.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -300,7 +300,7 @@ function createRestEndpoint(client, resourceIdentifier, dataName) {
|
|
|
300
300
|
search: (criteria) => requestEndpoint(
|
|
301
301
|
client,
|
|
302
302
|
HTTPRequestMethod.POST,
|
|
303
|
-
|
|
303
|
+
`/search/${resourceIdentifier}`,
|
|
304
304
|
200,
|
|
305
305
|
`search ${dataName}`,
|
|
306
306
|
void 0,
|
|
@@ -379,7 +379,7 @@ function createRestEndpoint(client, resourceIdentifier, dataName) {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
class AppClient extends Client {
|
|
382
|
-
apps = createRestEndpoint(this, "
|
|
382
|
+
apps = createRestEndpoint(this, "app", "app");
|
|
383
383
|
actionButtons = createRestEndpoint(
|
|
384
384
|
this,
|
|
385
385
|
"app-action-button",
|
|
@@ -390,13 +390,13 @@ class AppClient extends Client {
|
|
|
390
390
|
"app-administration-snippet",
|
|
391
391
|
"app administration snippet"
|
|
392
392
|
);
|
|
393
|
-
cmsBlocks = createRestEndpoint(this, "
|
|
393
|
+
cmsBlocks = createRestEndpoint(this, "app-cms-block", "app cms block");
|
|
394
394
|
flowActions = createRestEndpoint(
|
|
395
395
|
this,
|
|
396
396
|
"app-flow-action",
|
|
397
397
|
"app flow action"
|
|
398
398
|
);
|
|
399
|
-
flowEvents = createRestEndpoint(this, "
|
|
399
|
+
flowEvents = createRestEndpoint(this, "app-flow-event", "app flow event");
|
|
400
400
|
paymentMethods = createRestEndpoint(
|
|
401
401
|
this,
|
|
402
402
|
"app-payment-method",
|
|
@@ -412,30 +412,30 @@ class AppClient extends Client {
|
|
|
412
412
|
"app-shipping-method",
|
|
413
413
|
"app shipping method"
|
|
414
414
|
);
|
|
415
|
-
templates = createRestEndpoint(this, "
|
|
415
|
+
templates = createRestEndpoint(this, "app-template", "app template");
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
let CategoryClient$1 = class CategoryClient extends Client {
|
|
419
|
-
categories = createRestEndpoint(this, "
|
|
420
|
-
mainCategories = createRestEndpoint(this, "
|
|
419
|
+
categories = createRestEndpoint(this, "category", "category");
|
|
420
|
+
mainCategories = createRestEndpoint(this, "main-category", "main category");
|
|
421
421
|
};
|
|
422
422
|
|
|
423
423
|
let ContentClient$1 = class ContentClient extends Client {
|
|
424
|
-
cmsBlocks = createRestEndpoint(this, "
|
|
425
|
-
cmsPages = createRestEndpoint(this, "
|
|
426
|
-
cmsSections = createRestEndpoint(this, "
|
|
427
|
-
cmsSlots = createRestEndpoint(this, "
|
|
428
|
-
landingPages = createRestEndpoint(this, "
|
|
429
|
-
themes = createRestEndpoint(this, "
|
|
424
|
+
cmsBlocks = createRestEndpoint(this, "cms-block", "cms block");
|
|
425
|
+
cmsPages = createRestEndpoint(this, "cms-page", "cms page");
|
|
426
|
+
cmsSections = createRestEndpoint(this, "cms-section", "cms section");
|
|
427
|
+
cmsSlots = createRestEndpoint(this, "cms-slot", "cms slot");
|
|
428
|
+
landingPages = createRestEndpoint(this, "landing-page", "landing page");
|
|
429
|
+
themes = createRestEndpoint(this, "theme", "theme");
|
|
430
430
|
};
|
|
431
431
|
|
|
432
432
|
let CountryClient$1 = class CountryClient extends Client {
|
|
433
|
-
countries = createRestEndpoint(this, "
|
|
434
|
-
states = createRestEndpoint(this, "
|
|
433
|
+
countries = createRestEndpoint(this, "country", "country");
|
|
434
|
+
states = createRestEndpoint(this, "country-state", "country-state");
|
|
435
435
|
};
|
|
436
436
|
|
|
437
437
|
class CountryClient extends Client {
|
|
438
|
-
currencies = createRestEndpoint(this, "
|
|
438
|
+
currencies = createRestEndpoint(this, "currency", "currency");
|
|
439
439
|
currencyRoundings = createRestEndpoint(
|
|
440
440
|
this,
|
|
441
441
|
"currency-country-rounding",
|
|
@@ -444,7 +444,7 @@ class CountryClient extends Client {
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
class CustomDataClient extends Client {
|
|
447
|
-
entities = createRestEndpoint(this, "
|
|
447
|
+
entities = createRestEndpoint(this, "custom-entity", "custom entity");
|
|
448
448
|
fieldSets = createRestEndpoint(
|
|
449
449
|
this,
|
|
450
450
|
"custom-field-set",
|
|
@@ -455,7 +455,7 @@ class CustomDataClient extends Client {
|
|
|
455
455
|
"custom-field-set-relation",
|
|
456
456
|
"custom field set relation"
|
|
457
457
|
);
|
|
458
|
-
fields = createRestEndpoint(this, "
|
|
458
|
+
fields = createRestEndpoint(this, "custom-field", "custom field");
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
class CustomerClient extends Client {
|
|
@@ -474,9 +474,9 @@ class CustomerClient extends Client {
|
|
|
474
474
|
throw new ShopwareError("Failed to generate impersonation token", response);
|
|
475
475
|
}
|
|
476
476
|
/** Rest Endpoints **/
|
|
477
|
-
customers = createRestEndpoint(this, "
|
|
478
|
-
addresses = createRestEndpoint(this, "
|
|
479
|
-
groups = createRestEndpoint(this, "
|
|
477
|
+
customers = createRestEndpoint(this, "customer", "customer");
|
|
478
|
+
addresses = createRestEndpoint(this, "address", "customer address");
|
|
479
|
+
groups = createRestEndpoint(this, "customer-group", "customer group");
|
|
480
480
|
recoveries = createRestEndpoint(
|
|
481
481
|
this,
|
|
482
482
|
"customer-recovery",
|
|
@@ -495,7 +495,7 @@ class CustomerClient extends Client {
|
|
|
495
495
|
}
|
|
496
496
|
|
|
497
497
|
class DeliveryTimeClient extends Client {
|
|
498
|
-
deliveryTimes = createRestEndpoint(this, "
|
|
498
|
+
deliveryTimes = createRestEndpoint(this, "delivery-time", "delivery time");
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
let DocumentClient$1 = class DocumentClient extends Client {
|
|
@@ -541,8 +541,22 @@ let DocumentClient$1 = class DocumentClient extends Client {
|
|
|
541
541
|
if (response.statusCode === 200) return response.body.data;
|
|
542
542
|
throw new ShopwareError("Failed to upload file from url", response);
|
|
543
543
|
}
|
|
544
|
+
/**
|
|
545
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
546
|
+
*/
|
|
547
|
+
async download(id, deepLinkCode, download, fileType) {
|
|
548
|
+
const response = await this.get(`/_action/document/${id}/${deepLinkCode}`, {
|
|
549
|
+
query: { download, fileType },
|
|
550
|
+
headers: {
|
|
551
|
+
Accept: fileType === "pdf" ? "application/pdf" : fileType === "html" ? "text/html" : "application/octet-stream"
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
if (response.statusCode === 200)
|
|
555
|
+
return response.body.data;
|
|
556
|
+
throw new ShopwareError("Failed to download document", response);
|
|
557
|
+
}
|
|
544
558
|
/** Rest Endpoints **/
|
|
545
|
-
documents = createRestEndpoint(this, "
|
|
559
|
+
documents = createRestEndpoint(this, "document", "document");
|
|
546
560
|
documentTypes = createRestEndpoint(
|
|
547
561
|
this,
|
|
548
562
|
"document-type",
|
|
@@ -561,9 +575,9 @@ let DocumentClient$1 = class DocumentClient extends Client {
|
|
|
561
575
|
};
|
|
562
576
|
|
|
563
577
|
class FlowClient extends Client {
|
|
564
|
-
flows = createRestEndpoint(this, "
|
|
565
|
-
sequences = createRestEndpoint(this, "
|
|
566
|
-
flowTemplates = createRestEndpoint(this, "
|
|
578
|
+
flows = createRestEndpoint(this, "flow", "flow");
|
|
579
|
+
sequences = createRestEndpoint(this, "flow-sequence", "flow sequence");
|
|
580
|
+
flowTemplates = createRestEndpoint(this, "flow-template", "flow template");
|
|
567
581
|
}
|
|
568
582
|
|
|
569
583
|
class ImportExportClient extends Client {
|
|
@@ -585,12 +599,12 @@ class ImportExportClient extends Client {
|
|
|
585
599
|
}
|
|
586
600
|
|
|
587
601
|
class IntegrationClient extends Client {
|
|
588
|
-
integrations = createRestEndpoint(this, "
|
|
602
|
+
integrations = createRestEndpoint(this, "integration", "integration");
|
|
589
603
|
}
|
|
590
604
|
|
|
591
605
|
class LocaleClient extends Client {
|
|
592
|
-
locales = createRestEndpoint(this, "
|
|
593
|
-
languages = createRestEndpoint(this, "
|
|
606
|
+
locales = createRestEndpoint(this, "locale", "locale");
|
|
607
|
+
languages = createRestEndpoint(this, "language", "language");
|
|
594
608
|
}
|
|
595
609
|
|
|
596
610
|
class MailClient extends Client {
|
|
@@ -635,7 +649,7 @@ class MailClient extends Client {
|
|
|
635
649
|
"header-footer",
|
|
636
650
|
"mail header/footer"
|
|
637
651
|
);
|
|
638
|
-
templates = createRestEndpoint(this, "
|
|
652
|
+
templates = createRestEndpoint(this, "template", "mail template");
|
|
639
653
|
templateTypes = createRestEndpoint(
|
|
640
654
|
this,
|
|
641
655
|
"template-type",
|
|
@@ -672,13 +686,13 @@ class MediaClient extends Client {
|
|
|
672
686
|
throw new ShopwareError("Failed to upload asset from url", response);
|
|
673
687
|
}
|
|
674
688
|
/** Rest Endpoints **/
|
|
675
|
-
media = createRestEndpoint(this, "
|
|
689
|
+
media = createRestEndpoint(this, "media", "media");
|
|
676
690
|
defaultFolders = createRestEndpoint(
|
|
677
691
|
this,
|
|
678
692
|
"media-default-folder",
|
|
679
693
|
"default media folder"
|
|
680
694
|
);
|
|
681
|
-
folders = createRestEndpoint(this, "
|
|
695
|
+
folders = createRestEndpoint(this, "media-folder", "media folder");
|
|
682
696
|
folderConfigs = createRestEndpoint(
|
|
683
697
|
this,
|
|
684
698
|
"media-folder-configuration",
|
|
@@ -705,7 +719,7 @@ let NewsletterClient$1 = class NewsletterClient extends Client {
|
|
|
705
719
|
};
|
|
706
720
|
|
|
707
721
|
class NumberRangeClient extends Client {
|
|
708
|
-
numberRanges = createRestEndpoint(this, "
|
|
722
|
+
numberRanges = createRestEndpoint(this, "number-range", "number range");
|
|
709
723
|
numberRangeSalesChannels = createRestEndpoint(
|
|
710
724
|
this,
|
|
711
725
|
"number-range-sales-channel",
|
|
@@ -735,7 +749,7 @@ let OrderClient$1 = class OrderClient extends Client {
|
|
|
735
749
|
});
|
|
736
750
|
if (response.statusCode === 200)
|
|
737
751
|
return response.body.data;
|
|
738
|
-
throw new ShopwareError("Failed to download merged
|
|
752
|
+
throw new ShopwareError("Failed to download merged documents", response);
|
|
739
753
|
}
|
|
740
754
|
/**
|
|
741
755
|
* @param documentTypeName - The `technicalName` of the document type.
|
|
@@ -749,18 +763,6 @@ let OrderClient$1 = class OrderClient extends Client {
|
|
|
749
763
|
if (response.statusCode === 200) return;
|
|
750
764
|
throw new ShopwareError("Failed to create documents", response);
|
|
751
765
|
}
|
|
752
|
-
/**
|
|
753
|
-
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
754
|
-
*/
|
|
755
|
-
async download(id, deepLinkCode, download) {
|
|
756
|
-
const response = await this.get(`/_action/document/${id}/download/${deepLinkCode}`, {
|
|
757
|
-
query: { download },
|
|
758
|
-
headers: { Accept: "application/octet-stream" }
|
|
759
|
-
});
|
|
760
|
-
if (response.statusCode === 200)
|
|
761
|
-
return response.body.data;
|
|
762
|
-
throw new ShopwareError("Failed to download merged document", response);
|
|
763
|
-
}
|
|
764
766
|
/** Order Management **/
|
|
765
767
|
/**
|
|
766
768
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
@@ -819,16 +821,16 @@ let OrderClient$1 = class OrderClient extends Client {
|
|
|
819
821
|
throw new ShopwareError("Failed to transition delivery state", response);
|
|
820
822
|
}
|
|
821
823
|
/** Rest Endpoints **/
|
|
822
|
-
orders = createRestEndpoint(this, "
|
|
823
|
-
addresses = createRestEndpoint(this, "
|
|
824
|
-
customers = createRestEndpoint(this, "
|
|
825
|
-
deliveries = createRestEndpoint(this, "
|
|
824
|
+
orders = createRestEndpoint(this, "order", "order");
|
|
825
|
+
addresses = createRestEndpoint(this, "order-address", "order address");
|
|
826
|
+
customers = createRestEndpoint(this, "order-customer", "order customer");
|
|
827
|
+
deliveries = createRestEndpoint(this, "order-delivery", "order delivery");
|
|
826
828
|
deliveryPositions = createRestEndpoint(
|
|
827
829
|
this,
|
|
828
830
|
"order-delivery-position",
|
|
829
831
|
"order delivery position"
|
|
830
832
|
);
|
|
831
|
-
lineItems = createRestEndpoint(this, "
|
|
833
|
+
lineItems = createRestEndpoint(this, "order-line-item", "order line item");
|
|
832
834
|
lineItemDownloads = createRestEndpoint(
|
|
833
835
|
this,
|
|
834
836
|
"order-line-item-download",
|
|
@@ -865,11 +867,11 @@ class PaymentMethodClient extends Client {
|
|
|
865
867
|
}
|
|
866
868
|
|
|
867
869
|
class PluginClient extends Client {
|
|
868
|
-
plugins = createRestEndpoint(this, "
|
|
870
|
+
plugins = createRestEndpoint(this, "plugin", "plugin");
|
|
869
871
|
}
|
|
870
872
|
|
|
871
873
|
let ProductClient$1 = class ProductClient extends Client {
|
|
872
|
-
products = createRestEndpoint(this, "
|
|
874
|
+
products = createRestEndpoint(this, "product", "product");
|
|
873
875
|
configuratorSettings = createRestEndpoint(
|
|
874
876
|
this,
|
|
875
877
|
"product-configurator-setting",
|
|
@@ -890,7 +892,7 @@ let ProductClient$1 = class ProductClient extends Client {
|
|
|
890
892
|
"product-download",
|
|
891
893
|
"product download"
|
|
892
894
|
);
|
|
893
|
-
exports = createRestEndpoint(this, "
|
|
895
|
+
exports = createRestEndpoint(this, "product-export", "product export");
|
|
894
896
|
featureSets = createRestEndpoint(
|
|
895
897
|
this,
|
|
896
898
|
"product-feature-set",
|
|
@@ -906,9 +908,9 @@ let ProductClient$1 = class ProductClient extends Client {
|
|
|
906
908
|
"product-manufacturer",
|
|
907
909
|
"product manufacturer"
|
|
908
910
|
);
|
|
909
|
-
media = createRestEndpoint(this, "
|
|
910
|
-
prices = createRestEndpoint(this, "
|
|
911
|
-
reviews = createRestEndpoint(this, "
|
|
911
|
+
media = createRestEndpoint(this, "product-media", "product media");
|
|
912
|
+
prices = createRestEndpoint(this, "product-price", "product price");
|
|
913
|
+
reviews = createRestEndpoint(this, "product-review", "product review");
|
|
912
914
|
searchConfigs = createRestEndpoint(
|
|
913
915
|
this,
|
|
914
916
|
"product-search-config",
|
|
@@ -924,8 +926,8 @@ let ProductClient$1 = class ProductClient extends Client {
|
|
|
924
926
|
"product-search-keyword",
|
|
925
927
|
"product search keyword"
|
|
926
928
|
);
|
|
927
|
-
sortings = createRestEndpoint(this, "
|
|
928
|
-
streams = createRestEndpoint(this, "
|
|
929
|
+
sortings = createRestEndpoint(this, "product-sorting", "product sorting");
|
|
930
|
+
streams = createRestEndpoint(this, "product-stream", "product stream");
|
|
929
931
|
streamFilters = createRestEndpoint(
|
|
930
932
|
this,
|
|
931
933
|
"product-stream-filter",
|
|
@@ -939,8 +941,8 @@ let ProductClient$1 = class ProductClient extends Client {
|
|
|
939
941
|
};
|
|
940
942
|
|
|
941
943
|
class PromotionClient extends Client {
|
|
942
|
-
promotions = createRestEndpoint(this, "
|
|
943
|
-
discounts = createRestEndpoint(this, "
|
|
944
|
+
promotions = createRestEndpoint(this, "promotion", "promotion");
|
|
945
|
+
discounts = createRestEndpoint(this, "promotion-discount", "discount");
|
|
944
946
|
discountPrices = createRestEndpoint(
|
|
945
947
|
this,
|
|
946
948
|
"promotion-discount-price",
|
|
@@ -977,12 +979,12 @@ class PropertyGroupClient extends Client {
|
|
|
977
979
|
}
|
|
978
980
|
|
|
979
981
|
class RuleClient extends Client {
|
|
980
|
-
rules = createRestEndpoint(this, "
|
|
981
|
-
conditions = createRestEndpoint(this, "
|
|
982
|
+
rules = createRestEndpoint(this, "rule", "rule");
|
|
983
|
+
conditions = createRestEndpoint(this, "rule-condition", "rule condition");
|
|
982
984
|
}
|
|
983
985
|
|
|
984
986
|
class SalesChannelClient extends Client {
|
|
985
|
-
salesChannels = createRestEndpoint(this, "
|
|
987
|
+
salesChannels = createRestEndpoint(this, "sales-channel", "sales channel");
|
|
986
988
|
analytics = createRestEndpoint(
|
|
987
989
|
this,
|
|
988
990
|
"sales-channel-analytics",
|
|
@@ -1001,19 +1003,19 @@ class SalesChannelClient extends Client {
|
|
|
1001
1003
|
}
|
|
1002
1004
|
|
|
1003
1005
|
class SalutationClient extends Client {
|
|
1004
|
-
salutations = createRestEndpoint(this, "
|
|
1006
|
+
salutations = createRestEndpoint(this, "salutation", "salutation");
|
|
1005
1007
|
}
|
|
1006
1008
|
|
|
1007
1009
|
class ScriptClient extends Client {
|
|
1008
|
-
scripts = createRestEndpoint(this, "
|
|
1010
|
+
scripts = createRestEndpoint(this, "script", "script");
|
|
1009
1011
|
}
|
|
1010
1012
|
|
|
1011
1013
|
class SecurityClient extends Client {
|
|
1012
|
-
aclRoles = createRestEndpoint(this, "
|
|
1014
|
+
aclRoles = createRestEndpoint(this, "acl-role", "acl role");
|
|
1013
1015
|
}
|
|
1014
1016
|
|
|
1015
1017
|
let SeoClient$1 = class SeoClient extends Client {
|
|
1016
|
-
urls = createRestEndpoint(this, "
|
|
1018
|
+
urls = createRestEndpoint(this, "seo-url", "seo url");
|
|
1017
1019
|
urlTemplates = createRestEndpoint(
|
|
1018
1020
|
this,
|
|
1019
1021
|
"seo-url-template",
|
|
@@ -1035,12 +1037,12 @@ class ShippingMethodClient extends Client {
|
|
|
1035
1037
|
}
|
|
1036
1038
|
|
|
1037
1039
|
class SnippetClient extends Client {
|
|
1038
|
-
snippets = createRestEndpoint(this, "
|
|
1039
|
-
sets = createRestEndpoint(this, "
|
|
1040
|
+
snippets = createRestEndpoint(this, "snippet", "snippet");
|
|
1041
|
+
sets = createRestEndpoint(this, "snippet-set", "snippet set");
|
|
1040
1042
|
}
|
|
1041
1043
|
|
|
1042
1044
|
class StateMachineClient extends Client {
|
|
1043
|
-
stateMachines = createRestEndpoint(this, "
|
|
1045
|
+
stateMachines = createRestEndpoint(this, "state-machine", "state machine");
|
|
1044
1046
|
states = createRestEndpoint(
|
|
1045
1047
|
this,
|
|
1046
1048
|
"state-machine-state",
|
|
@@ -1224,8 +1226,8 @@ let SystemClient$1 = class SystemClient extends Client {
|
|
|
1224
1226
|
throw new ShopwareError("Failed to clear invalidated caches", response);
|
|
1225
1227
|
}
|
|
1226
1228
|
/** Rest Endpoints **/
|
|
1227
|
-
logsEntries = createRestEndpoint(this, "
|
|
1228
|
-
notifications = createRestEndpoint(this, "
|
|
1229
|
+
logsEntries = createRestEndpoint(this, "log-entry", "log entry");
|
|
1230
|
+
notifications = createRestEndpoint(this, "notification", "notification");
|
|
1229
1231
|
configEntries = createRestEndpoint(
|
|
1230
1232
|
this,
|
|
1231
1233
|
"system-config",
|
|
@@ -1239,29 +1241,29 @@ let SystemClient$1 = class SystemClient extends Client {
|
|
|
1239
1241
|
};
|
|
1240
1242
|
|
|
1241
1243
|
class TagClient extends Client {
|
|
1242
|
-
tags = createRestEndpoint(this, "
|
|
1244
|
+
tags = createRestEndpoint(this, "tag", "tag");
|
|
1243
1245
|
}
|
|
1244
1246
|
|
|
1245
1247
|
class TaxClient extends Client {
|
|
1246
|
-
taxes = createRestEndpoint(this, "
|
|
1247
|
-
providers = createRestEndpoint(this, "
|
|
1248
|
-
rules = createRestEndpoint(this, "
|
|
1249
|
-
ruleTypes = createRestEndpoint(this, "
|
|
1248
|
+
taxes = createRestEndpoint(this, "tax", "tax");
|
|
1249
|
+
providers = createRestEndpoint(this, "tax-provider", "tax provider");
|
|
1250
|
+
rules = createRestEndpoint(this, "tax-rule", "tax rule");
|
|
1251
|
+
ruleTypes = createRestEndpoint(this, "tax-rule-type", "tax rule type");
|
|
1250
1252
|
}
|
|
1251
1253
|
|
|
1252
1254
|
class UnitClient extends Client {
|
|
1253
|
-
units = createRestEndpoint(this, "
|
|
1255
|
+
units = createRestEndpoint(this, "unit", "unit");
|
|
1254
1256
|
}
|
|
1255
1257
|
|
|
1256
1258
|
class UserClient extends Client {
|
|
1257
|
-
users = createRestEndpoint(this, "
|
|
1259
|
+
users = createRestEndpoint(this, "user", "user");
|
|
1258
1260
|
accessKeys = createRestEndpoint(this, "user-access-key", "user access key");
|
|
1259
|
-
userConfigs = createRestEndpoint(this, "
|
|
1260
|
-
userRecoveries = createRestEndpoint(this, "
|
|
1261
|
+
userConfigs = createRestEndpoint(this, "user-config", "user config");
|
|
1262
|
+
userRecoveries = createRestEndpoint(this, "user-recovery", "user recovery");
|
|
1261
1263
|
}
|
|
1262
1264
|
|
|
1263
1265
|
class WebhookClient extends Client {
|
|
1264
|
-
webhooks = createRestEndpoint(this, "
|
|
1266
|
+
webhooks = createRestEndpoint(this, "webhook", "webhook");
|
|
1265
1267
|
eventLogs = createRestEndpoint(
|
|
1266
1268
|
this,
|
|
1267
1269
|
"webhook-event-log",
|
|
@@ -1963,7 +1965,7 @@ class DocumentClient extends Client {
|
|
|
1963
1965
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1964
1966
|
*/
|
|
1965
1967
|
async download(id, deepLinkCode) {
|
|
1966
|
-
const response = await this.
|
|
1968
|
+
const response = await this.get(
|
|
1967
1969
|
`/document/download/${id}/${deepLinkCode}`,
|
|
1968
1970
|
this.client.withContextToken()
|
|
1969
1971
|
);
|
|
@@ -1971,6 +1973,23 @@ class DocumentClient extends Client {
|
|
|
1971
1973
|
return response.body.data;
|
|
1972
1974
|
throw new ShopwareError("Failed to download document", response);
|
|
1973
1975
|
}
|
|
1976
|
+
/**
|
|
1977
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1978
|
+
*/
|
|
1979
|
+
async downloadAsGuest(id, deepLinkCode, email, billingAddressZipCode) {
|
|
1980
|
+
const response = await this.post(
|
|
1981
|
+
`/document/download/${id}/${deepLinkCode}`,
|
|
1982
|
+
this.client.withContextToken({
|
|
1983
|
+
body: new JsonPayload({
|
|
1984
|
+
email,
|
|
1985
|
+
zipcode: billingAddressZipCode
|
|
1986
|
+
})
|
|
1987
|
+
})
|
|
1988
|
+
);
|
|
1989
|
+
if (response.statusCode === 200)
|
|
1990
|
+
return response.body.data;
|
|
1991
|
+
throw new ShopwareError("Failed to download document as guest", response);
|
|
1992
|
+
}
|
|
1974
1993
|
}
|
|
1975
1994
|
|
|
1976
1995
|
class GatewayClient extends Client {
|
package/dist/index.d.cts
CHANGED
|
@@ -38,7 +38,7 @@ import { CustomerRecovery as CustomerRecovery$1 } from '#types/api/admin/custome
|
|
|
38
38
|
import { CustomerWishlist as CustomerWishlist$1 } from '#types/api/admin/customer/wishlist/CustomerWishlist';
|
|
39
39
|
import { CustomerWishlistProduct as CustomerWishlistProduct$1 } from '#types/api/admin/customer/wishlist/CustomerWishlistProduct';
|
|
40
40
|
import { DeliveryTime as DeliveryTime$1 } from '#types/api/admin/DeliveryTime';
|
|
41
|
-
import { NumberReservationResponse, UploadResponse } from '#types/clients/admin/DocumentClient';
|
|
41
|
+
import { NumberReservationResponse, UploadResponse, DownloadResponse } from '#types/clients/admin/DocumentClient';
|
|
42
42
|
import { ShopwareDocument as ShopwareDocument$1 } from '#types/api/admin/document/ShopwareDocument';
|
|
43
43
|
import { ShopwareDocumentType as ShopwareDocumentType$1 } from '#types/api/admin/document/ShopwareDocumentType';
|
|
44
44
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$1 } from '#types/api/admin/document/baseConfig/ShopwareDocumentBaseConfig';
|
|
@@ -121,7 +121,7 @@ import { MediaThumbnail as MediaThumbnail$2 } from '#types/api/store/media/Media
|
|
|
121
121
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$2 } from '#types/api/store/document/ShopwareDocumentBaseConfig';
|
|
122
122
|
import { ShopwareDocumentType as ShopwareDocumentType$2 } from '#types/api/store/document/ShopwareDocumentType';
|
|
123
123
|
import { ShopwareDocument as ShopwareDocument$2 } from '#types/api/store/document/ShopwareDocument';
|
|
124
|
-
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest,
|
|
124
|
+
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
125
125
|
import { Order as Order$2 } from '#types/api/admin/order/Order';
|
|
126
126
|
import { OrderAddress as OrderAddress$2 } from '#types/api/admin/order/OrderAddress';
|
|
127
127
|
import { OrderCustomer as OrderCustomer$2 } from '#types/api/admin/order/OrderCustomer';
|
|
@@ -1228,6 +1228,10 @@ declare class DocumentClient$1 extends Client {
|
|
|
1228
1228
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1229
1229
|
*/
|
|
1230
1230
|
uploadFromUrl(id: string, extension: string, url: string, fileName?: string): Promise<UploadResponse>;
|
|
1231
|
+
/**
|
|
1232
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1233
|
+
*/
|
|
1234
|
+
download(id: string, deepLinkCode: string, download?: boolean, fileType?: string): Promise<DownloadResponse>;
|
|
1231
1235
|
/** Rest Endpoints **/
|
|
1232
1236
|
documents: {
|
|
1233
1237
|
getList: (query?: Criteria) => Promise<{
|
|
@@ -3777,10 +3781,6 @@ declare class OrderClient$1 extends Client {
|
|
|
3777
3781
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3778
3782
|
*/
|
|
3779
3783
|
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<void>;
|
|
3780
|
-
/**
|
|
3781
|
-
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3782
|
-
*/
|
|
3783
|
-
download(id: string, deepLinkCode: string, download?: boolean): Promise<DownloadResponse>;
|
|
3784
3784
|
/** Order Management **/
|
|
3785
3785
|
/**
|
|
3786
3786
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
@@ -5940,6 +5940,10 @@ declare class DocumentClient extends Client {
|
|
|
5940
5940
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
5941
5941
|
*/
|
|
5942
5942
|
download(id: string, deepLinkCode: string): Promise<DocumentDownloadResponse>;
|
|
5943
|
+
/**
|
|
5944
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
5945
|
+
*/
|
|
5946
|
+
downloadAsGuest(id: string, deepLinkCode: string, email: string, billingAddressZipCode: string): Promise<DocumentDownloadResponse>;
|
|
5943
5947
|
}
|
|
5944
5948
|
|
|
5945
5949
|
declare class GatewayClient extends Client {
|
package/dist/index.d.mts
CHANGED
|
@@ -38,7 +38,7 @@ import { CustomerRecovery as CustomerRecovery$1 } from '#types/api/admin/custome
|
|
|
38
38
|
import { CustomerWishlist as CustomerWishlist$1 } from '#types/api/admin/customer/wishlist/CustomerWishlist';
|
|
39
39
|
import { CustomerWishlistProduct as CustomerWishlistProduct$1 } from '#types/api/admin/customer/wishlist/CustomerWishlistProduct';
|
|
40
40
|
import { DeliveryTime as DeliveryTime$1 } from '#types/api/admin/DeliveryTime';
|
|
41
|
-
import { NumberReservationResponse, UploadResponse } from '#types/clients/admin/DocumentClient';
|
|
41
|
+
import { NumberReservationResponse, UploadResponse, DownloadResponse } from '#types/clients/admin/DocumentClient';
|
|
42
42
|
import { ShopwareDocument as ShopwareDocument$1 } from '#types/api/admin/document/ShopwareDocument';
|
|
43
43
|
import { ShopwareDocumentType as ShopwareDocumentType$1 } from '#types/api/admin/document/ShopwareDocumentType';
|
|
44
44
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$1 } from '#types/api/admin/document/baseConfig/ShopwareDocumentBaseConfig';
|
|
@@ -121,7 +121,7 @@ import { MediaThumbnail as MediaThumbnail$2 } from '#types/api/store/media/Media
|
|
|
121
121
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$2 } from '#types/api/store/document/ShopwareDocumentBaseConfig';
|
|
122
122
|
import { ShopwareDocumentType as ShopwareDocumentType$2 } from '#types/api/store/document/ShopwareDocumentType';
|
|
123
123
|
import { ShopwareDocument as ShopwareDocument$2 } from '#types/api/store/document/ShopwareDocument';
|
|
124
|
-
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest,
|
|
124
|
+
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
125
125
|
import { Order as Order$2 } from '#types/api/admin/order/Order';
|
|
126
126
|
import { OrderAddress as OrderAddress$2 } from '#types/api/admin/order/OrderAddress';
|
|
127
127
|
import { OrderCustomer as OrderCustomer$2 } from '#types/api/admin/order/OrderCustomer';
|
|
@@ -1228,6 +1228,10 @@ declare class DocumentClient$1 extends Client {
|
|
|
1228
1228
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1229
1229
|
*/
|
|
1230
1230
|
uploadFromUrl(id: string, extension: string, url: string, fileName?: string): Promise<UploadResponse>;
|
|
1231
|
+
/**
|
|
1232
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1233
|
+
*/
|
|
1234
|
+
download(id: string, deepLinkCode: string, download?: boolean, fileType?: string): Promise<DownloadResponse>;
|
|
1231
1235
|
/** Rest Endpoints **/
|
|
1232
1236
|
documents: {
|
|
1233
1237
|
getList: (query?: Criteria) => Promise<{
|
|
@@ -3777,10 +3781,6 @@ declare class OrderClient$1 extends Client {
|
|
|
3777
3781
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3778
3782
|
*/
|
|
3779
3783
|
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<void>;
|
|
3780
|
-
/**
|
|
3781
|
-
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3782
|
-
*/
|
|
3783
|
-
download(id: string, deepLinkCode: string, download?: boolean): Promise<DownloadResponse>;
|
|
3784
3784
|
/** Order Management **/
|
|
3785
3785
|
/**
|
|
3786
3786
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
@@ -5940,6 +5940,10 @@ declare class DocumentClient extends Client {
|
|
|
5940
5940
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
5941
5941
|
*/
|
|
5942
5942
|
download(id: string, deepLinkCode: string): Promise<DocumentDownloadResponse>;
|
|
5943
|
+
/**
|
|
5944
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
5945
|
+
*/
|
|
5946
|
+
downloadAsGuest(id: string, deepLinkCode: string, email: string, billingAddressZipCode: string): Promise<DocumentDownloadResponse>;
|
|
5943
5947
|
}
|
|
5944
5948
|
|
|
5945
5949
|
declare class GatewayClient extends Client {
|
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ import { CustomerRecovery as CustomerRecovery$1 } from '#types/api/admin/custome
|
|
|
38
38
|
import { CustomerWishlist as CustomerWishlist$1 } from '#types/api/admin/customer/wishlist/CustomerWishlist';
|
|
39
39
|
import { CustomerWishlistProduct as CustomerWishlistProduct$1 } from '#types/api/admin/customer/wishlist/CustomerWishlistProduct';
|
|
40
40
|
import { DeliveryTime as DeliveryTime$1 } from '#types/api/admin/DeliveryTime';
|
|
41
|
-
import { NumberReservationResponse, UploadResponse } from '#types/clients/admin/DocumentClient';
|
|
41
|
+
import { NumberReservationResponse, UploadResponse, DownloadResponse } from '#types/clients/admin/DocumentClient';
|
|
42
42
|
import { ShopwareDocument as ShopwareDocument$1 } from '#types/api/admin/document/ShopwareDocument';
|
|
43
43
|
import { ShopwareDocumentType as ShopwareDocumentType$1 } from '#types/api/admin/document/ShopwareDocumentType';
|
|
44
44
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$1 } from '#types/api/admin/document/baseConfig/ShopwareDocumentBaseConfig';
|
|
@@ -121,7 +121,7 @@ import { MediaThumbnail as MediaThumbnail$2 } from '#types/api/store/media/Media
|
|
|
121
121
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$2 } from '#types/api/store/document/ShopwareDocumentBaseConfig';
|
|
122
122
|
import { ShopwareDocumentType as ShopwareDocumentType$2 } from '#types/api/store/document/ShopwareDocumentType';
|
|
123
123
|
import { ShopwareDocument as ShopwareDocument$2 } from '#types/api/store/document/ShopwareDocument';
|
|
124
|
-
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest,
|
|
124
|
+
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
125
125
|
import { Order as Order$2 } from '#types/api/admin/order/Order';
|
|
126
126
|
import { OrderAddress as OrderAddress$2 } from '#types/api/admin/order/OrderAddress';
|
|
127
127
|
import { OrderCustomer as OrderCustomer$2 } from '#types/api/admin/order/OrderCustomer';
|
|
@@ -1228,6 +1228,10 @@ declare class DocumentClient$1 extends Client {
|
|
|
1228
1228
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1229
1229
|
*/
|
|
1230
1230
|
uploadFromUrl(id: string, extension: string, url: string, fileName?: string): Promise<UploadResponse>;
|
|
1231
|
+
/**
|
|
1232
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1233
|
+
*/
|
|
1234
|
+
download(id: string, deepLinkCode: string, download?: boolean, fileType?: string): Promise<DownloadResponse>;
|
|
1231
1235
|
/** Rest Endpoints **/
|
|
1232
1236
|
documents: {
|
|
1233
1237
|
getList: (query?: Criteria) => Promise<{
|
|
@@ -3777,10 +3781,6 @@ declare class OrderClient$1 extends Client {
|
|
|
3777
3781
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3778
3782
|
*/
|
|
3779
3783
|
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<void>;
|
|
3780
|
-
/**
|
|
3781
|
-
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3782
|
-
*/
|
|
3783
|
-
download(id: string, deepLinkCode: string, download?: boolean): Promise<DownloadResponse>;
|
|
3784
3784
|
/** Order Management **/
|
|
3785
3785
|
/**
|
|
3786
3786
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
@@ -5940,6 +5940,10 @@ declare class DocumentClient extends Client {
|
|
|
5940
5940
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
5941
5941
|
*/
|
|
5942
5942
|
download(id: string, deepLinkCode: string): Promise<DocumentDownloadResponse>;
|
|
5943
|
+
/**
|
|
5944
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
5945
|
+
*/
|
|
5946
|
+
downloadAsGuest(id: string, deepLinkCode: string, email: string, billingAddressZipCode: string): Promise<DocumentDownloadResponse>;
|
|
5943
5947
|
}
|
|
5944
5948
|
|
|
5945
5949
|
declare class GatewayClient extends Client {
|
package/dist/index.mjs
CHANGED
|
@@ -298,7 +298,7 @@ function createRestEndpoint(client, resourceIdentifier, dataName) {
|
|
|
298
298
|
search: (criteria) => requestEndpoint(
|
|
299
299
|
client,
|
|
300
300
|
HTTPRequestMethod.POST,
|
|
301
|
-
|
|
301
|
+
`/search/${resourceIdentifier}`,
|
|
302
302
|
200,
|
|
303
303
|
`search ${dataName}`,
|
|
304
304
|
void 0,
|
|
@@ -377,7 +377,7 @@ function createRestEndpoint(client, resourceIdentifier, dataName) {
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
class AppClient extends Client {
|
|
380
|
-
apps = createRestEndpoint(this, "
|
|
380
|
+
apps = createRestEndpoint(this, "app", "app");
|
|
381
381
|
actionButtons = createRestEndpoint(
|
|
382
382
|
this,
|
|
383
383
|
"app-action-button",
|
|
@@ -388,13 +388,13 @@ class AppClient extends Client {
|
|
|
388
388
|
"app-administration-snippet",
|
|
389
389
|
"app administration snippet"
|
|
390
390
|
);
|
|
391
|
-
cmsBlocks = createRestEndpoint(this, "
|
|
391
|
+
cmsBlocks = createRestEndpoint(this, "app-cms-block", "app cms block");
|
|
392
392
|
flowActions = createRestEndpoint(
|
|
393
393
|
this,
|
|
394
394
|
"app-flow-action",
|
|
395
395
|
"app flow action"
|
|
396
396
|
);
|
|
397
|
-
flowEvents = createRestEndpoint(this, "
|
|
397
|
+
flowEvents = createRestEndpoint(this, "app-flow-event", "app flow event");
|
|
398
398
|
paymentMethods = createRestEndpoint(
|
|
399
399
|
this,
|
|
400
400
|
"app-payment-method",
|
|
@@ -410,30 +410,30 @@ class AppClient extends Client {
|
|
|
410
410
|
"app-shipping-method",
|
|
411
411
|
"app shipping method"
|
|
412
412
|
);
|
|
413
|
-
templates = createRestEndpoint(this, "
|
|
413
|
+
templates = createRestEndpoint(this, "app-template", "app template");
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
let CategoryClient$1 = class CategoryClient extends Client {
|
|
417
|
-
categories = createRestEndpoint(this, "
|
|
418
|
-
mainCategories = createRestEndpoint(this, "
|
|
417
|
+
categories = createRestEndpoint(this, "category", "category");
|
|
418
|
+
mainCategories = createRestEndpoint(this, "main-category", "main category");
|
|
419
419
|
};
|
|
420
420
|
|
|
421
421
|
let ContentClient$1 = class ContentClient extends Client {
|
|
422
|
-
cmsBlocks = createRestEndpoint(this, "
|
|
423
|
-
cmsPages = createRestEndpoint(this, "
|
|
424
|
-
cmsSections = createRestEndpoint(this, "
|
|
425
|
-
cmsSlots = createRestEndpoint(this, "
|
|
426
|
-
landingPages = createRestEndpoint(this, "
|
|
427
|
-
themes = createRestEndpoint(this, "
|
|
422
|
+
cmsBlocks = createRestEndpoint(this, "cms-block", "cms block");
|
|
423
|
+
cmsPages = createRestEndpoint(this, "cms-page", "cms page");
|
|
424
|
+
cmsSections = createRestEndpoint(this, "cms-section", "cms section");
|
|
425
|
+
cmsSlots = createRestEndpoint(this, "cms-slot", "cms slot");
|
|
426
|
+
landingPages = createRestEndpoint(this, "landing-page", "landing page");
|
|
427
|
+
themes = createRestEndpoint(this, "theme", "theme");
|
|
428
428
|
};
|
|
429
429
|
|
|
430
430
|
let CountryClient$1 = class CountryClient extends Client {
|
|
431
|
-
countries = createRestEndpoint(this, "
|
|
432
|
-
states = createRestEndpoint(this, "
|
|
431
|
+
countries = createRestEndpoint(this, "country", "country");
|
|
432
|
+
states = createRestEndpoint(this, "country-state", "country-state");
|
|
433
433
|
};
|
|
434
434
|
|
|
435
435
|
class CountryClient extends Client {
|
|
436
|
-
currencies = createRestEndpoint(this, "
|
|
436
|
+
currencies = createRestEndpoint(this, "currency", "currency");
|
|
437
437
|
currencyRoundings = createRestEndpoint(
|
|
438
438
|
this,
|
|
439
439
|
"currency-country-rounding",
|
|
@@ -442,7 +442,7 @@ class CountryClient extends Client {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
class CustomDataClient extends Client {
|
|
445
|
-
entities = createRestEndpoint(this, "
|
|
445
|
+
entities = createRestEndpoint(this, "custom-entity", "custom entity");
|
|
446
446
|
fieldSets = createRestEndpoint(
|
|
447
447
|
this,
|
|
448
448
|
"custom-field-set",
|
|
@@ -453,7 +453,7 @@ class CustomDataClient extends Client {
|
|
|
453
453
|
"custom-field-set-relation",
|
|
454
454
|
"custom field set relation"
|
|
455
455
|
);
|
|
456
|
-
fields = createRestEndpoint(this, "
|
|
456
|
+
fields = createRestEndpoint(this, "custom-field", "custom field");
|
|
457
457
|
}
|
|
458
458
|
|
|
459
459
|
class CustomerClient extends Client {
|
|
@@ -472,9 +472,9 @@ class CustomerClient extends Client {
|
|
|
472
472
|
throw new ShopwareError("Failed to generate impersonation token", response);
|
|
473
473
|
}
|
|
474
474
|
/** Rest Endpoints **/
|
|
475
|
-
customers = createRestEndpoint(this, "
|
|
476
|
-
addresses = createRestEndpoint(this, "
|
|
477
|
-
groups = createRestEndpoint(this, "
|
|
475
|
+
customers = createRestEndpoint(this, "customer", "customer");
|
|
476
|
+
addresses = createRestEndpoint(this, "address", "customer address");
|
|
477
|
+
groups = createRestEndpoint(this, "customer-group", "customer group");
|
|
478
478
|
recoveries = createRestEndpoint(
|
|
479
479
|
this,
|
|
480
480
|
"customer-recovery",
|
|
@@ -493,7 +493,7 @@ class CustomerClient extends Client {
|
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
class DeliveryTimeClient extends Client {
|
|
496
|
-
deliveryTimes = createRestEndpoint(this, "
|
|
496
|
+
deliveryTimes = createRestEndpoint(this, "delivery-time", "delivery time");
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
let DocumentClient$1 = class DocumentClient extends Client {
|
|
@@ -539,8 +539,22 @@ let DocumentClient$1 = class DocumentClient extends Client {
|
|
|
539
539
|
if (response.statusCode === 200) return response.body.data;
|
|
540
540
|
throw new ShopwareError("Failed to upload file from url", response);
|
|
541
541
|
}
|
|
542
|
+
/**
|
|
543
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
544
|
+
*/
|
|
545
|
+
async download(id, deepLinkCode, download, fileType) {
|
|
546
|
+
const response = await this.get(`/_action/document/${id}/${deepLinkCode}`, {
|
|
547
|
+
query: { download, fileType },
|
|
548
|
+
headers: {
|
|
549
|
+
Accept: fileType === "pdf" ? "application/pdf" : fileType === "html" ? "text/html" : "application/octet-stream"
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
if (response.statusCode === 200)
|
|
553
|
+
return response.body.data;
|
|
554
|
+
throw new ShopwareError("Failed to download document", response);
|
|
555
|
+
}
|
|
542
556
|
/** Rest Endpoints **/
|
|
543
|
-
documents = createRestEndpoint(this, "
|
|
557
|
+
documents = createRestEndpoint(this, "document", "document");
|
|
544
558
|
documentTypes = createRestEndpoint(
|
|
545
559
|
this,
|
|
546
560
|
"document-type",
|
|
@@ -559,9 +573,9 @@ let DocumentClient$1 = class DocumentClient extends Client {
|
|
|
559
573
|
};
|
|
560
574
|
|
|
561
575
|
class FlowClient extends Client {
|
|
562
|
-
flows = createRestEndpoint(this, "
|
|
563
|
-
sequences = createRestEndpoint(this, "
|
|
564
|
-
flowTemplates = createRestEndpoint(this, "
|
|
576
|
+
flows = createRestEndpoint(this, "flow", "flow");
|
|
577
|
+
sequences = createRestEndpoint(this, "flow-sequence", "flow sequence");
|
|
578
|
+
flowTemplates = createRestEndpoint(this, "flow-template", "flow template");
|
|
565
579
|
}
|
|
566
580
|
|
|
567
581
|
class ImportExportClient extends Client {
|
|
@@ -583,12 +597,12 @@ class ImportExportClient extends Client {
|
|
|
583
597
|
}
|
|
584
598
|
|
|
585
599
|
class IntegrationClient extends Client {
|
|
586
|
-
integrations = createRestEndpoint(this, "
|
|
600
|
+
integrations = createRestEndpoint(this, "integration", "integration");
|
|
587
601
|
}
|
|
588
602
|
|
|
589
603
|
class LocaleClient extends Client {
|
|
590
|
-
locales = createRestEndpoint(this, "
|
|
591
|
-
languages = createRestEndpoint(this, "
|
|
604
|
+
locales = createRestEndpoint(this, "locale", "locale");
|
|
605
|
+
languages = createRestEndpoint(this, "language", "language");
|
|
592
606
|
}
|
|
593
607
|
|
|
594
608
|
class MailClient extends Client {
|
|
@@ -633,7 +647,7 @@ class MailClient extends Client {
|
|
|
633
647
|
"header-footer",
|
|
634
648
|
"mail header/footer"
|
|
635
649
|
);
|
|
636
|
-
templates = createRestEndpoint(this, "
|
|
650
|
+
templates = createRestEndpoint(this, "template", "mail template");
|
|
637
651
|
templateTypes = createRestEndpoint(
|
|
638
652
|
this,
|
|
639
653
|
"template-type",
|
|
@@ -670,13 +684,13 @@ class MediaClient extends Client {
|
|
|
670
684
|
throw new ShopwareError("Failed to upload asset from url", response);
|
|
671
685
|
}
|
|
672
686
|
/** Rest Endpoints **/
|
|
673
|
-
media = createRestEndpoint(this, "
|
|
687
|
+
media = createRestEndpoint(this, "media", "media");
|
|
674
688
|
defaultFolders = createRestEndpoint(
|
|
675
689
|
this,
|
|
676
690
|
"media-default-folder",
|
|
677
691
|
"default media folder"
|
|
678
692
|
);
|
|
679
|
-
folders = createRestEndpoint(this, "
|
|
693
|
+
folders = createRestEndpoint(this, "media-folder", "media folder");
|
|
680
694
|
folderConfigs = createRestEndpoint(
|
|
681
695
|
this,
|
|
682
696
|
"media-folder-configuration",
|
|
@@ -703,7 +717,7 @@ let NewsletterClient$1 = class NewsletterClient extends Client {
|
|
|
703
717
|
};
|
|
704
718
|
|
|
705
719
|
class NumberRangeClient extends Client {
|
|
706
|
-
numberRanges = createRestEndpoint(this, "
|
|
720
|
+
numberRanges = createRestEndpoint(this, "number-range", "number range");
|
|
707
721
|
numberRangeSalesChannels = createRestEndpoint(
|
|
708
722
|
this,
|
|
709
723
|
"number-range-sales-channel",
|
|
@@ -733,7 +747,7 @@ let OrderClient$1 = class OrderClient extends Client {
|
|
|
733
747
|
});
|
|
734
748
|
if (response.statusCode === 200)
|
|
735
749
|
return response.body.data;
|
|
736
|
-
throw new ShopwareError("Failed to download merged
|
|
750
|
+
throw new ShopwareError("Failed to download merged documents", response);
|
|
737
751
|
}
|
|
738
752
|
/**
|
|
739
753
|
* @param documentTypeName - The `technicalName` of the document type.
|
|
@@ -747,18 +761,6 @@ let OrderClient$1 = class OrderClient extends Client {
|
|
|
747
761
|
if (response.statusCode === 200) return;
|
|
748
762
|
throw new ShopwareError("Failed to create documents", response);
|
|
749
763
|
}
|
|
750
|
-
/**
|
|
751
|
-
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
752
|
-
*/
|
|
753
|
-
async download(id, deepLinkCode, download) {
|
|
754
|
-
const response = await this.get(`/_action/document/${id}/download/${deepLinkCode}`, {
|
|
755
|
-
query: { download },
|
|
756
|
-
headers: { Accept: "application/octet-stream" }
|
|
757
|
-
});
|
|
758
|
-
if (response.statusCode === 200)
|
|
759
|
-
return response.body.data;
|
|
760
|
-
throw new ShopwareError("Failed to download merged document", response);
|
|
761
|
-
}
|
|
762
764
|
/** Order Management **/
|
|
763
765
|
/**
|
|
764
766
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
@@ -817,16 +819,16 @@ let OrderClient$1 = class OrderClient extends Client {
|
|
|
817
819
|
throw new ShopwareError("Failed to transition delivery state", response);
|
|
818
820
|
}
|
|
819
821
|
/** Rest Endpoints **/
|
|
820
|
-
orders = createRestEndpoint(this, "
|
|
821
|
-
addresses = createRestEndpoint(this, "
|
|
822
|
-
customers = createRestEndpoint(this, "
|
|
823
|
-
deliveries = createRestEndpoint(this, "
|
|
822
|
+
orders = createRestEndpoint(this, "order", "order");
|
|
823
|
+
addresses = createRestEndpoint(this, "order-address", "order address");
|
|
824
|
+
customers = createRestEndpoint(this, "order-customer", "order customer");
|
|
825
|
+
deliveries = createRestEndpoint(this, "order-delivery", "order delivery");
|
|
824
826
|
deliveryPositions = createRestEndpoint(
|
|
825
827
|
this,
|
|
826
828
|
"order-delivery-position",
|
|
827
829
|
"order delivery position"
|
|
828
830
|
);
|
|
829
|
-
lineItems = createRestEndpoint(this, "
|
|
831
|
+
lineItems = createRestEndpoint(this, "order-line-item", "order line item");
|
|
830
832
|
lineItemDownloads = createRestEndpoint(
|
|
831
833
|
this,
|
|
832
834
|
"order-line-item-download",
|
|
@@ -863,11 +865,11 @@ class PaymentMethodClient extends Client {
|
|
|
863
865
|
}
|
|
864
866
|
|
|
865
867
|
class PluginClient extends Client {
|
|
866
|
-
plugins = createRestEndpoint(this, "
|
|
868
|
+
plugins = createRestEndpoint(this, "plugin", "plugin");
|
|
867
869
|
}
|
|
868
870
|
|
|
869
871
|
let ProductClient$1 = class ProductClient extends Client {
|
|
870
|
-
products = createRestEndpoint(this, "
|
|
872
|
+
products = createRestEndpoint(this, "product", "product");
|
|
871
873
|
configuratorSettings = createRestEndpoint(
|
|
872
874
|
this,
|
|
873
875
|
"product-configurator-setting",
|
|
@@ -888,7 +890,7 @@ let ProductClient$1 = class ProductClient extends Client {
|
|
|
888
890
|
"product-download",
|
|
889
891
|
"product download"
|
|
890
892
|
);
|
|
891
|
-
exports = createRestEndpoint(this, "
|
|
893
|
+
exports = createRestEndpoint(this, "product-export", "product export");
|
|
892
894
|
featureSets = createRestEndpoint(
|
|
893
895
|
this,
|
|
894
896
|
"product-feature-set",
|
|
@@ -904,9 +906,9 @@ let ProductClient$1 = class ProductClient extends Client {
|
|
|
904
906
|
"product-manufacturer",
|
|
905
907
|
"product manufacturer"
|
|
906
908
|
);
|
|
907
|
-
media = createRestEndpoint(this, "
|
|
908
|
-
prices = createRestEndpoint(this, "
|
|
909
|
-
reviews = createRestEndpoint(this, "
|
|
909
|
+
media = createRestEndpoint(this, "product-media", "product media");
|
|
910
|
+
prices = createRestEndpoint(this, "product-price", "product price");
|
|
911
|
+
reviews = createRestEndpoint(this, "product-review", "product review");
|
|
910
912
|
searchConfigs = createRestEndpoint(
|
|
911
913
|
this,
|
|
912
914
|
"product-search-config",
|
|
@@ -922,8 +924,8 @@ let ProductClient$1 = class ProductClient extends Client {
|
|
|
922
924
|
"product-search-keyword",
|
|
923
925
|
"product search keyword"
|
|
924
926
|
);
|
|
925
|
-
sortings = createRestEndpoint(this, "
|
|
926
|
-
streams = createRestEndpoint(this, "
|
|
927
|
+
sortings = createRestEndpoint(this, "product-sorting", "product sorting");
|
|
928
|
+
streams = createRestEndpoint(this, "product-stream", "product stream");
|
|
927
929
|
streamFilters = createRestEndpoint(
|
|
928
930
|
this,
|
|
929
931
|
"product-stream-filter",
|
|
@@ -937,8 +939,8 @@ let ProductClient$1 = class ProductClient extends Client {
|
|
|
937
939
|
};
|
|
938
940
|
|
|
939
941
|
class PromotionClient extends Client {
|
|
940
|
-
promotions = createRestEndpoint(this, "
|
|
941
|
-
discounts = createRestEndpoint(this, "
|
|
942
|
+
promotions = createRestEndpoint(this, "promotion", "promotion");
|
|
943
|
+
discounts = createRestEndpoint(this, "promotion-discount", "discount");
|
|
942
944
|
discountPrices = createRestEndpoint(
|
|
943
945
|
this,
|
|
944
946
|
"promotion-discount-price",
|
|
@@ -975,12 +977,12 @@ class PropertyGroupClient extends Client {
|
|
|
975
977
|
}
|
|
976
978
|
|
|
977
979
|
class RuleClient extends Client {
|
|
978
|
-
rules = createRestEndpoint(this, "
|
|
979
|
-
conditions = createRestEndpoint(this, "
|
|
980
|
+
rules = createRestEndpoint(this, "rule", "rule");
|
|
981
|
+
conditions = createRestEndpoint(this, "rule-condition", "rule condition");
|
|
980
982
|
}
|
|
981
983
|
|
|
982
984
|
class SalesChannelClient extends Client {
|
|
983
|
-
salesChannels = createRestEndpoint(this, "
|
|
985
|
+
salesChannels = createRestEndpoint(this, "sales-channel", "sales channel");
|
|
984
986
|
analytics = createRestEndpoint(
|
|
985
987
|
this,
|
|
986
988
|
"sales-channel-analytics",
|
|
@@ -999,19 +1001,19 @@ class SalesChannelClient extends Client {
|
|
|
999
1001
|
}
|
|
1000
1002
|
|
|
1001
1003
|
class SalutationClient extends Client {
|
|
1002
|
-
salutations = createRestEndpoint(this, "
|
|
1004
|
+
salutations = createRestEndpoint(this, "salutation", "salutation");
|
|
1003
1005
|
}
|
|
1004
1006
|
|
|
1005
1007
|
class ScriptClient extends Client {
|
|
1006
|
-
scripts = createRestEndpoint(this, "
|
|
1008
|
+
scripts = createRestEndpoint(this, "script", "script");
|
|
1007
1009
|
}
|
|
1008
1010
|
|
|
1009
1011
|
class SecurityClient extends Client {
|
|
1010
|
-
aclRoles = createRestEndpoint(this, "
|
|
1012
|
+
aclRoles = createRestEndpoint(this, "acl-role", "acl role");
|
|
1011
1013
|
}
|
|
1012
1014
|
|
|
1013
1015
|
let SeoClient$1 = class SeoClient extends Client {
|
|
1014
|
-
urls = createRestEndpoint(this, "
|
|
1016
|
+
urls = createRestEndpoint(this, "seo-url", "seo url");
|
|
1015
1017
|
urlTemplates = createRestEndpoint(
|
|
1016
1018
|
this,
|
|
1017
1019
|
"seo-url-template",
|
|
@@ -1033,12 +1035,12 @@ class ShippingMethodClient extends Client {
|
|
|
1033
1035
|
}
|
|
1034
1036
|
|
|
1035
1037
|
class SnippetClient extends Client {
|
|
1036
|
-
snippets = createRestEndpoint(this, "
|
|
1037
|
-
sets = createRestEndpoint(this, "
|
|
1038
|
+
snippets = createRestEndpoint(this, "snippet", "snippet");
|
|
1039
|
+
sets = createRestEndpoint(this, "snippet-set", "snippet set");
|
|
1038
1040
|
}
|
|
1039
1041
|
|
|
1040
1042
|
class StateMachineClient extends Client {
|
|
1041
|
-
stateMachines = createRestEndpoint(this, "
|
|
1043
|
+
stateMachines = createRestEndpoint(this, "state-machine", "state machine");
|
|
1042
1044
|
states = createRestEndpoint(
|
|
1043
1045
|
this,
|
|
1044
1046
|
"state-machine-state",
|
|
@@ -1222,8 +1224,8 @@ let SystemClient$1 = class SystemClient extends Client {
|
|
|
1222
1224
|
throw new ShopwareError("Failed to clear invalidated caches", response);
|
|
1223
1225
|
}
|
|
1224
1226
|
/** Rest Endpoints **/
|
|
1225
|
-
logsEntries = createRestEndpoint(this, "
|
|
1226
|
-
notifications = createRestEndpoint(this, "
|
|
1227
|
+
logsEntries = createRestEndpoint(this, "log-entry", "log entry");
|
|
1228
|
+
notifications = createRestEndpoint(this, "notification", "notification");
|
|
1227
1229
|
configEntries = createRestEndpoint(
|
|
1228
1230
|
this,
|
|
1229
1231
|
"system-config",
|
|
@@ -1237,29 +1239,29 @@ let SystemClient$1 = class SystemClient extends Client {
|
|
|
1237
1239
|
};
|
|
1238
1240
|
|
|
1239
1241
|
class TagClient extends Client {
|
|
1240
|
-
tags = createRestEndpoint(this, "
|
|
1242
|
+
tags = createRestEndpoint(this, "tag", "tag");
|
|
1241
1243
|
}
|
|
1242
1244
|
|
|
1243
1245
|
class TaxClient extends Client {
|
|
1244
|
-
taxes = createRestEndpoint(this, "
|
|
1245
|
-
providers = createRestEndpoint(this, "
|
|
1246
|
-
rules = createRestEndpoint(this, "
|
|
1247
|
-
ruleTypes = createRestEndpoint(this, "
|
|
1246
|
+
taxes = createRestEndpoint(this, "tax", "tax");
|
|
1247
|
+
providers = createRestEndpoint(this, "tax-provider", "tax provider");
|
|
1248
|
+
rules = createRestEndpoint(this, "tax-rule", "tax rule");
|
|
1249
|
+
ruleTypes = createRestEndpoint(this, "tax-rule-type", "tax rule type");
|
|
1248
1250
|
}
|
|
1249
1251
|
|
|
1250
1252
|
class UnitClient extends Client {
|
|
1251
|
-
units = createRestEndpoint(this, "
|
|
1253
|
+
units = createRestEndpoint(this, "unit", "unit");
|
|
1252
1254
|
}
|
|
1253
1255
|
|
|
1254
1256
|
class UserClient extends Client {
|
|
1255
|
-
users = createRestEndpoint(this, "
|
|
1257
|
+
users = createRestEndpoint(this, "user", "user");
|
|
1256
1258
|
accessKeys = createRestEndpoint(this, "user-access-key", "user access key");
|
|
1257
|
-
userConfigs = createRestEndpoint(this, "
|
|
1258
|
-
userRecoveries = createRestEndpoint(this, "
|
|
1259
|
+
userConfigs = createRestEndpoint(this, "user-config", "user config");
|
|
1260
|
+
userRecoveries = createRestEndpoint(this, "user-recovery", "user recovery");
|
|
1259
1261
|
}
|
|
1260
1262
|
|
|
1261
1263
|
class WebhookClient extends Client {
|
|
1262
|
-
webhooks = createRestEndpoint(this, "
|
|
1264
|
+
webhooks = createRestEndpoint(this, "webhook", "webhook");
|
|
1263
1265
|
eventLogs = createRestEndpoint(
|
|
1264
1266
|
this,
|
|
1265
1267
|
"webhook-event-log",
|
|
@@ -1961,7 +1963,7 @@ class DocumentClient extends Client {
|
|
|
1961
1963
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1962
1964
|
*/
|
|
1963
1965
|
async download(id, deepLinkCode) {
|
|
1964
|
-
const response = await this.
|
|
1966
|
+
const response = await this.get(
|
|
1965
1967
|
`/document/download/${id}/${deepLinkCode}`,
|
|
1966
1968
|
this.client.withContextToken()
|
|
1967
1969
|
);
|
|
@@ -1969,6 +1971,23 @@ class DocumentClient extends Client {
|
|
|
1969
1971
|
return response.body.data;
|
|
1970
1972
|
throw new ShopwareError("Failed to download document", response);
|
|
1971
1973
|
}
|
|
1974
|
+
/**
|
|
1975
|
+
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
1976
|
+
*/
|
|
1977
|
+
async downloadAsGuest(id, deepLinkCode, email, billingAddressZipCode) {
|
|
1978
|
+
const response = await this.post(
|
|
1979
|
+
`/document/download/${id}/${deepLinkCode}`,
|
|
1980
|
+
this.client.withContextToken({
|
|
1981
|
+
body: new JsonPayload({
|
|
1982
|
+
email,
|
|
1983
|
+
zipcode: billingAddressZipCode
|
|
1984
|
+
})
|
|
1985
|
+
})
|
|
1986
|
+
);
|
|
1987
|
+
if (response.statusCode === 200)
|
|
1988
|
+
return response.body.data;
|
|
1989
|
+
throw new ShopwareError("Failed to download document as guest", response);
|
|
1990
|
+
}
|
|
1972
1991
|
}
|
|
1973
1992
|
|
|
1974
1993
|
class GatewayClient extends Client {
|
|
@@ -13,7 +13,6 @@ export type DocumentListCreateRequest = Array<{
|
|
|
13
13
|
referencedDocumentId?: string;
|
|
14
14
|
config?: ShopwareDocumentBaseConfig;
|
|
15
15
|
}>;
|
|
16
|
-
export type DownloadResponse = Blob;
|
|
17
16
|
/** Order Management **/
|
|
18
17
|
export interface StateTransitionRequest {
|
|
19
18
|
sendMail?: boolean;
|