@viu/emporix-sdk 4.6.7 → 4.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/CHANGELOG.md +22 -0
- package/dist/availability.cjs.map +1 -1
- package/dist/availability.js +2 -2
- package/dist/cart.cjs +3 -0
- package/dist/cart.cjs.map +1 -1
- package/dist/cart.js +2 -2
- package/dist/checkout.cjs.map +1 -1
- package/dist/checkout.js +2 -2
- package/dist/{chunk-J2AN2FMK.js → chunk-3JO2O4BY.js} +25 -14
- package/dist/chunk-3JO2O4BY.js.map +1 -0
- package/dist/{chunk-UWGGF4MC.js → chunk-4Q76UV4J.js} +6 -3
- package/dist/chunk-4Q76UV4J.js.map +1 -0
- package/dist/{chunk-RYQVMR26.js → chunk-BHNYGUSD.js} +3 -3
- package/dist/{chunk-RYQVMR26.js.map → chunk-BHNYGUSD.js.map} +1 -1
- package/dist/{chunk-IYNT5BQW.js → chunk-CXTVY4SI.js} +8 -4
- package/dist/chunk-CXTVY4SI.js.map +1 -0
- package/dist/{chunk-K4KXT6NX.js → chunk-ENMMDGUB.js} +3 -3
- package/dist/{chunk-K4KXT6NX.js.map → chunk-ENMMDGUB.js.map} +1 -1
- package/dist/{chunk-UA4BM6OP.js → chunk-EQE5WGME.js} +4 -4
- package/dist/{chunk-UA4BM6OP.js.map → chunk-EQE5WGME.js.map} +1 -1
- package/dist/{chunk-4VRUMCS2.js → chunk-PK4DQHJO.js} +4 -4
- package/dist/{chunk-4VRUMCS2.js.map → chunk-PK4DQHJO.js.map} +1 -1
- package/dist/{chunk-NFSO7WUA.js → chunk-SIGXBN4F.js} +3 -3
- package/dist/{chunk-NFSO7WUA.js.map → chunk-SIGXBN4F.js.map} +1 -1
- package/dist/{chunk-N2CE3J4M.js → chunk-U3ZIJZYH.js} +3 -3
- package/dist/{chunk-N2CE3J4M.js.map → chunk-U3ZIJZYH.js.map} +1 -1
- package/dist/{chunk-S2ERKGYL.js → chunk-ZLGLI4KC.js} +3 -3
- package/dist/{chunk-S2ERKGYL.js.map → chunk-ZLGLI4KC.js.map} +1 -1
- package/dist/{chunk-3BDDYX3V.js → chunk-ZVIEFW3X.js} +3 -3
- package/dist/{chunk-3BDDYX3V.js.map → chunk-ZVIEFW3X.js.map} +1 -1
- package/dist/{chunk-XQAOHHXL.js → chunk-ZZ3X3DDL.js} +3 -3
- package/dist/{chunk-XQAOHHXL.js.map → chunk-ZZ3X3DDL.js.map} +1 -1
- package/dist/customer.cjs.map +1 -1
- package/dist/customer.js +3 -3
- package/dist/index.cjs +62 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -34
- package/dist/index.d.ts +107 -34
- package/dist/index.js +52 -38
- package/dist/index.js.map +1 -1
- package/dist/media.cjs +3 -0
- package/dist/media.cjs.map +1 -1
- package/dist/media.js +2 -2
- package/dist/orders.cjs +6 -2
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +6 -2
- package/dist/orders.d.ts +6 -2
- package/dist/orders.js +1 -1
- package/dist/payment.cjs.map +1 -1
- package/dist/payment.js +3 -3
- package/dist/price.cjs.map +1 -1
- package/dist/price.js +2 -2
- package/dist/product.cjs +23 -12
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +193 -12
- package/dist/product.d.ts +193 -12
- package/dist/product.js +1 -1
- package/dist/segment.cjs.map +1 -1
- package/dist/segment.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-IYNT5BQW.js.map +0 -1
- package/dist/chunk-J2AN2FMK.js.map +0 -1
- package/dist/chunk-UWGGF4MC.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { LocationsService } from './chunk-IAOWDMTA.js';
|
|
2
2
|
export { LocationsService } from './chunk-IAOWDMTA.js';
|
|
3
|
-
import { MediaService } from './chunk-
|
|
4
|
-
export { MediaService } from './chunk-
|
|
5
|
-
import { OrdersService, SalesOrdersService } from './chunk-
|
|
6
|
-
export { OrdersService, SalesOrdersService } from './chunk-
|
|
7
|
-
import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-
|
|
8
|
-
export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-
|
|
9
|
-
import { PriceService } from './chunk-
|
|
10
|
-
export { PriceService } from './chunk-
|
|
11
|
-
import { ProductService } from './chunk-
|
|
12
|
-
export { ProductService } from './chunk-
|
|
13
|
-
import { SegmentService } from './chunk-
|
|
14
|
-
export { SegmentService } from './chunk-
|
|
15
|
-
import { AvailabilityService } from './chunk-
|
|
16
|
-
export { AvailabilityService } from './chunk-
|
|
17
|
-
import { CartService } from './chunk-
|
|
18
|
-
export { CartService } from './chunk-
|
|
3
|
+
import { MediaService } from './chunk-SIGXBN4F.js';
|
|
4
|
+
export { MediaService } from './chunk-SIGXBN4F.js';
|
|
5
|
+
import { OrdersService, SalesOrdersService } from './chunk-CXTVY4SI.js';
|
|
6
|
+
export { OrdersService, SalesOrdersService } from './chunk-CXTVY4SI.js';
|
|
7
|
+
import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-PK4DQHJO.js';
|
|
8
|
+
export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-PK4DQHJO.js';
|
|
9
|
+
import { PriceService } from './chunk-ENMMDGUB.js';
|
|
10
|
+
export { PriceService } from './chunk-ENMMDGUB.js';
|
|
11
|
+
import { ProductService } from './chunk-3JO2O4BY.js';
|
|
12
|
+
export { ProductService } from './chunk-3JO2O4BY.js';
|
|
13
|
+
import { SegmentService } from './chunk-U3ZIJZYH.js';
|
|
14
|
+
export { SegmentService } from './chunk-U3ZIJZYH.js';
|
|
15
|
+
import { AvailabilityService } from './chunk-ZZ3X3DDL.js';
|
|
16
|
+
export { AvailabilityService } from './chunk-ZZ3X3DDL.js';
|
|
17
|
+
import { CartService } from './chunk-ZLGLI4KC.js';
|
|
18
|
+
export { CartService } from './chunk-ZLGLI4KC.js';
|
|
19
19
|
import { CategoryService } from './chunk-KJEBG7MP.js';
|
|
20
20
|
export { CategoryService } from './chunk-KJEBG7MP.js';
|
|
21
21
|
export { iterateAll } from './chunk-W6SLZNRX.js';
|
|
22
22
|
import { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
23
23
|
export { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
24
24
|
import { requestPage } from './chunk-LKHKFF7B.js';
|
|
25
|
-
import { CheckoutService } from './chunk-
|
|
26
|
-
export { CheckoutService } from './chunk-
|
|
25
|
+
import { CheckoutService } from './chunk-BHNYGUSD.js';
|
|
26
|
+
export { CheckoutService } from './chunk-BHNYGUSD.js';
|
|
27
27
|
import { CompaniesService } from './chunk-2OTFVTG6.js';
|
|
28
28
|
export { CompaniesService } from './chunk-2OTFVTG6.js';
|
|
29
29
|
import { splitQuery, SEARCH_PAGING } from './chunk-ZWJUDXTK.js';
|
|
@@ -31,11 +31,11 @@ import { ContactsService } from './chunk-27NLS646.js';
|
|
|
31
31
|
export { ContactsService } from './chunk-27NLS646.js';
|
|
32
32
|
import { CustomerGroupsService, IamService } from './chunk-VXORPTMP.js';
|
|
33
33
|
export { CustomerGroupsService, IamService } from './chunk-VXORPTMP.js';
|
|
34
|
-
import { CustomerService } from './chunk-
|
|
35
|
-
export { CustomerService } from './chunk-
|
|
36
|
-
import './chunk-
|
|
37
|
-
import { EmporixTimeoutError, EmporixNetworkError, errorFromResponse, EmporixNotFoundError, EmporixError } from './chunk-
|
|
38
|
-
export { EmporixAuthError, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, EmporixValidationError, errorFromResponse } from './chunk-
|
|
34
|
+
import { CustomerService } from './chunk-EQE5WGME.js';
|
|
35
|
+
export { CustomerService } from './chunk-EQE5WGME.js';
|
|
36
|
+
import './chunk-ZVIEFW3X.js';
|
|
37
|
+
import { EmporixTimeoutError, EmporixNetworkError, errorFromResponse, EmporixNotFoundError, EmporixError } from './chunk-4Q76UV4J.js';
|
|
38
|
+
export { EmporixAuthError, EmporixConflictError, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, EmporixValidationError, errorFromResponse } from './chunk-4Q76UV4J.js';
|
|
39
39
|
|
|
40
40
|
// src/core/config.ts
|
|
41
41
|
var DEFAULT_HOST = "https://api.emporix.io";
|
|
@@ -948,7 +948,7 @@ var HttpClient = class {
|
|
|
948
948
|
};
|
|
949
949
|
|
|
950
950
|
// package.json
|
|
951
|
-
var version = "4.
|
|
951
|
+
var version = "4.7.0";
|
|
952
952
|
|
|
953
953
|
// src/version.ts
|
|
954
954
|
var SDK_VERSION = version;
|
|
@@ -2040,7 +2040,7 @@ var SchemaService = class {
|
|
|
2040
2040
|
auth: auth2
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
2043
|
-
/** Create a schema. */
|
|
2043
|
+
/** Create a schema. Resolves to the `201`'s id envelope — read the schema back for the rest. */
|
|
2044
2044
|
async createSchema(draft, auth2 = SERVICE8) {
|
|
2045
2045
|
return this.ctx.http.request({
|
|
2046
2046
|
method: "POST",
|
|
@@ -2050,12 +2050,12 @@ var SchemaService = class {
|
|
|
2050
2050
|
});
|
|
2051
2051
|
}
|
|
2052
2052
|
/**
|
|
2053
|
-
* Update a schema
|
|
2054
|
-
* stale version yields 409
|
|
2055
|
-
*
|
|
2053
|
+
* Update a schema; resolves on the `204`. The upstream API requires
|
|
2054
|
+
* `draft.metadata.version`; a stale version yields a 409
|
|
2055
|
+
* (`EmporixConflictError`).
|
|
2056
2056
|
*/
|
|
2057
2057
|
async updateSchema(id, draft, auth2 = SERVICE8) {
|
|
2058
|
-
|
|
2058
|
+
await this.ctx.http.request({
|
|
2059
2059
|
method: "PUT",
|
|
2060
2060
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
2061
2061
|
auth: auth2,
|
|
@@ -2093,7 +2093,7 @@ var SchemaService = class {
|
|
|
2093
2093
|
}
|
|
2094
2094
|
/** Set the entity types a schema applies to (`PUT /schemas/{id}/types`). */
|
|
2095
2095
|
async setSchemaTypes(id, types, auth2 = SERVICE8) {
|
|
2096
|
-
|
|
2096
|
+
await this.ctx.http.request({
|
|
2097
2097
|
method: "PUT",
|
|
2098
2098
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}/types`,
|
|
2099
2099
|
auth: auth2,
|
|
@@ -2118,7 +2118,7 @@ var SchemaService = class {
|
|
|
2118
2118
|
auth: auth2
|
|
2119
2119
|
});
|
|
2120
2120
|
}
|
|
2121
|
-
/** Create a custom-entity definition. */
|
|
2121
|
+
/** Create a custom-entity definition. Resolves to the `201`'s id envelope. */
|
|
2122
2122
|
async createCustomEntity(draft, auth2 = SERVICE8) {
|
|
2123
2123
|
return this.ctx.http.request({
|
|
2124
2124
|
method: "POST",
|
|
@@ -2127,7 +2127,11 @@ var SchemaService = class {
|
|
|
2127
2127
|
body: draft
|
|
2128
2128
|
});
|
|
2129
2129
|
}
|
|
2130
|
-
/**
|
|
2130
|
+
/**
|
|
2131
|
+
* Update a custom-entity definition — an upsert: resolves to the id envelope
|
|
2132
|
+
* when the `PUT` created the type (`201`), to `undefined` when it updated it
|
|
2133
|
+
* (`204`).
|
|
2134
|
+
*/
|
|
2131
2135
|
async updateCustomEntity(id, draft, auth2 = SERVICE8) {
|
|
2132
2136
|
return this.ctx.http.request({
|
|
2133
2137
|
method: "PUT",
|
|
@@ -2138,8 +2142,7 @@ var SchemaService = class {
|
|
|
2138
2142
|
}
|
|
2139
2143
|
/**
|
|
2140
2144
|
* Delete a custom-entity definition. The server rejects with 409 if
|
|
2141
|
-
* instances or schemas still reference it (
|
|
2142
|
-
* conflict error).
|
|
2145
|
+
* instances or schemas still reference it (`EmporixConflictError`).
|
|
2143
2146
|
*/
|
|
2144
2147
|
async deleteCustomEntity(id, auth2 = SERVICE8) {
|
|
2145
2148
|
await this.ctx.http.request({
|
|
@@ -2200,7 +2203,10 @@ var SchemaService = class {
|
|
|
2200
2203
|
auth: auth2
|
|
2201
2204
|
});
|
|
2202
2205
|
}
|
|
2203
|
-
/**
|
|
2206
|
+
/**
|
|
2207
|
+
* Create an instance of a custom entity. Resolves to the `201`'s id envelope;
|
|
2208
|
+
* an id that already exists is answered with a 409 (`EmporixConflictError`).
|
|
2209
|
+
*/
|
|
2204
2210
|
async createInstance(type, draft, auth2 = SERVICE8) {
|
|
2205
2211
|
return this.ctx.http.request({
|
|
2206
2212
|
method: "POST",
|
|
@@ -2209,7 +2215,11 @@ var SchemaService = class {
|
|
|
2209
2215
|
body: draft
|
|
2210
2216
|
});
|
|
2211
2217
|
}
|
|
2212
|
-
/**
|
|
2218
|
+
/**
|
|
2219
|
+
* Replace an instance (full `PUT`, an upsert). Resolves to the id envelope
|
|
2220
|
+
* when it created the instance (`201`), to `undefined` when it replaced one
|
|
2221
|
+
* (`204`). A stale `metadata.version` is answered with a 409.
|
|
2222
|
+
*/
|
|
2213
2223
|
async replaceInstance(type, id, draft, auth2 = SERVICE8) {
|
|
2214
2224
|
return this.ctx.http.request({
|
|
2215
2225
|
method: "PUT",
|
|
@@ -2218,9 +2228,13 @@ var SchemaService = class {
|
|
|
2218
2228
|
body: draft
|
|
2219
2229
|
});
|
|
2220
2230
|
}
|
|
2221
|
-
/**
|
|
2231
|
+
/**
|
|
2232
|
+
* Partially update an instance (`PATCH`) with RFC-6902 operations, e.g.
|
|
2233
|
+
* `[{ op: "replace", path: "/mixins/shoe/size", value: 44 }]`. Resolves on
|
|
2234
|
+
* the `204`.
|
|
2235
|
+
*/
|
|
2222
2236
|
async patchInstance(type, id, patch, auth2 = SERVICE8) {
|
|
2223
|
-
|
|
2237
|
+
await this.ctx.http.request({
|
|
2224
2238
|
method: "PATCH",
|
|
2225
2239
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
2226
2240
|
auth: auth2,
|