@viu/emporix-sdk 2.10.0 → 2.11.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 +14 -0
- package/dist/availability.d.cts +1 -1
- package/dist/availability.d.ts +1 -1
- package/dist/cart.d.cts +1 -1
- package/dist/cart.d.ts +1 -1
- package/dist/category.d.cts +1 -1
- package/dist/category.d.ts +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/companies.d.cts +1 -1
- package/dist/companies.d.ts +1 -1
- package/dist/contacts.d.cts +1 -1
- package/dist/contacts.d.ts +1 -1
- package/dist/{context-BBKOwNW6.d.cts → context-CmShWI_R.d.cts} +1 -1
- package/dist/{context-BBKOwNW6.d.ts → context-CmShWI_R.d.ts} +1 -1
- package/dist/customer-groups.d.cts +1 -1
- package/dist/customer-groups.d.ts +1 -1
- package/dist/customer.d.cts +1 -1
- package/dist/customer.d.ts +1 -1
- package/dist/index.cjs +26 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/locations.d.cts +1 -1
- package/dist/locations.d.ts +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/orders.d.cts +1 -1
- package/dist/orders.d.ts +1 -1
- package/dist/payment.d.cts +1 -1
- package/dist/payment.d.ts +1 -1
- package/dist/price.d.cts +1 -1
- package/dist/price.d.ts +1 -1
- package/dist/product.d.cts +1 -1
- package/dist/product.d.ts +1 -1
- package/dist/segment.d.cts +1 -1
- package/dist/segment.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @viu/emporix-sdk
|
|
2
2
|
|
|
3
|
+
## 2.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#114](https://github.com/viuteam/emporix-sdk/pull/114) [`ac2b2c8`](https://github.com/viuteam/emporix-sdk/commit/ac2b2c890521da017b3ef44ff15bdf6b16d69bb9) Thanks [@amnael1](https://github.com/amnael1)! - feat: invoke Emporix cloud functions
|
|
8
|
+
|
|
9
|
+
Adds `client.cloudFunctions.invoke<TRes, TReq>(functionId, { method?, path?,
|
|
10
|
+
body?, query?, headers? }, auth)` — a generic call to tenant cloud functions
|
|
11
|
+
(`/cloud-functions/{tenant}/functions/{id}[/sub]`), with GET/POST/PUT/DELETE and
|
|
12
|
+
service / customer / anonymous / raw auth (default anonymous). Adds the React
|
|
13
|
+
hooks `useInvokeCloudFunction` (mutation, any method) and `useCloudFunction`
|
|
14
|
+
(GET-style query with caching), both with auto-auth (customer-if-token-else-
|
|
15
|
+
anonymous) and an optional override.
|
|
16
|
+
|
|
3
17
|
## 2.10.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/availability.d.cts
CHANGED
package/dist/availability.d.ts
CHANGED
package/dist/cart.d.cts
CHANGED
package/dist/cart.d.ts
CHANGED
package/dist/category.d.cts
CHANGED
package/dist/category.d.ts
CHANGED
package/dist/checkout.d.cts
CHANGED
package/dist/checkout.d.ts
CHANGED
package/dist/companies.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-CmShWI_R.cjs';
|
|
2
2
|
import { L as LegalEntity, e as LegalEntityCreate, f as LegalEntityUpdate } from './types.gen-C_wOXYZB.cjs';
|
|
3
3
|
export { A as AccountLimit, d as CustomerGroup, g as LegalInfo } from './types.gen-C_wOXYZB.cjs';
|
|
4
4
|
|
package/dist/companies.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-CmShWI_R.js';
|
|
2
2
|
import { L as LegalEntity, e as LegalEntityCreate, f as LegalEntityUpdate } from './types.gen-C_wOXYZB.js';
|
|
3
3
|
export { A as AccountLimit, d as CustomerGroup, g as LegalInfo } from './types.gen-C_wOXYZB.js';
|
|
4
4
|
|
package/dist/contacts.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-CmShWI_R.cjs';
|
|
2
2
|
import { C as ContactAssignment, a as ContactAssignmentCreate, b as ContactAssignmentUpdate } from './types.gen-C_wOXYZB.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/contacts.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-CmShWI_R.js';
|
|
2
2
|
import { C as ContactAssignment, a as ContactAssignmentCreate, b as ContactAssignmentUpdate } from './types.gen-C_wOXYZB.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -3,7 +3,7 @@ type LogLevel = "trace" | "debug" | "info" | "warn" | "error" | "silent";
|
|
|
3
3
|
/** Numeric ordering used for fast comparison. */
|
|
4
4
|
declare const LEVEL: Record<LogLevel, number>;
|
|
5
5
|
/** Services that bind their own logger and are independently level-controllable. */
|
|
6
|
-
type ServiceName = "customer" | "product" | "category" | "cart" | "checkout" | "payment" | "price" | "media" | "segment" | "site" | "session-context" | "customer-management" | "iam" | "orders" | "sales-orders" | "availability" | "configuration" | "shopping-list" | "ai-rag-indexer" | "sequential-id" | "fee" | "webhook" | "schema" | "ai" | "tax" | "coupon" | "reward-points" | "brand" | "label" | "country" | "currency" | "shipping" | "returns" | "sepa-export" | "indexing" | "unit-handling" | "catalog" | "vendor" | "pick-pack" | "customer-admin" | "approval" | "http" | "auth";
|
|
6
|
+
type ServiceName = "customer" | "product" | "category" | "cart" | "checkout" | "payment" | "price" | "media" | "segment" | "site" | "session-context" | "customer-management" | "iam" | "orders" | "sales-orders" | "availability" | "configuration" | "shopping-list" | "ai-rag-indexer" | "sequential-id" | "fee" | "webhook" | "schema" | "ai" | "tax" | "coupon" | "reward-points" | "brand" | "label" | "country" | "currency" | "shipping" | "returns" | "sepa-export" | "indexing" | "unit-handling" | "catalog" | "vendor" | "pick-pack" | "customer-admin" | "approval" | "cloud-functions" | "http" | "auth";
|
|
7
7
|
/** Arbitrary structured fields attached to a log line. */
|
|
8
8
|
interface LogFields {
|
|
9
9
|
[key: string]: unknown;
|
|
@@ -3,7 +3,7 @@ type LogLevel = "trace" | "debug" | "info" | "warn" | "error" | "silent";
|
|
|
3
3
|
/** Numeric ordering used for fast comparison. */
|
|
4
4
|
declare const LEVEL: Record<LogLevel, number>;
|
|
5
5
|
/** Services that bind their own logger and are independently level-controllable. */
|
|
6
|
-
type ServiceName = "customer" | "product" | "category" | "cart" | "checkout" | "payment" | "price" | "media" | "segment" | "site" | "session-context" | "customer-management" | "iam" | "orders" | "sales-orders" | "availability" | "configuration" | "shopping-list" | "ai-rag-indexer" | "sequential-id" | "fee" | "webhook" | "schema" | "ai" | "tax" | "coupon" | "reward-points" | "brand" | "label" | "country" | "currency" | "shipping" | "returns" | "sepa-export" | "indexing" | "unit-handling" | "catalog" | "vendor" | "pick-pack" | "customer-admin" | "approval" | "http" | "auth";
|
|
6
|
+
type ServiceName = "customer" | "product" | "category" | "cart" | "checkout" | "payment" | "price" | "media" | "segment" | "site" | "session-context" | "customer-management" | "iam" | "orders" | "sales-orders" | "availability" | "configuration" | "shopping-list" | "ai-rag-indexer" | "sequential-id" | "fee" | "webhook" | "schema" | "ai" | "tax" | "coupon" | "reward-points" | "brand" | "label" | "country" | "currency" | "shipping" | "returns" | "sepa-export" | "indexing" | "unit-handling" | "catalog" | "vendor" | "pick-pack" | "customer-admin" | "approval" | "cloud-functions" | "http" | "auth";
|
|
7
7
|
/** Arbitrary structured fields attached to a log line. */
|
|
8
8
|
interface LogFields {
|
|
9
9
|
[key: string]: unknown;
|
package/dist/customer.d.cts
CHANGED
package/dist/customer.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2902,6 +2902,28 @@ var FeeService = class {
|
|
|
2902
2902
|
}
|
|
2903
2903
|
};
|
|
2904
2904
|
|
|
2905
|
+
// src/services/cloud-functions.ts
|
|
2906
|
+
var CloudFunctionsService = class {
|
|
2907
|
+
constructor(ctx) {
|
|
2908
|
+
this.ctx = ctx;
|
|
2909
|
+
}
|
|
2910
|
+
ctx;
|
|
2911
|
+
base() {
|
|
2912
|
+
return `/cloud-functions/${this.ctx.tenant}/functions`;
|
|
2913
|
+
}
|
|
2914
|
+
async invoke(functionId, options = {}, authCtx = auth.anonymous()) {
|
|
2915
|
+
const sub = options.path ? `/${options.path.replace(/^\//, "")}` : "";
|
|
2916
|
+
return this.ctx.http.request({
|
|
2917
|
+
method: options.method ?? "POST",
|
|
2918
|
+
path: `${this.base()}/${functionId}${sub}`,
|
|
2919
|
+
auth: authCtx,
|
|
2920
|
+
...options.body !== void 0 ? { body: options.body } : {},
|
|
2921
|
+
...options.query ? { query: options.query } : {},
|
|
2922
|
+
...options.headers ? { headers: options.headers } : {}
|
|
2923
|
+
});
|
|
2924
|
+
}
|
|
2925
|
+
};
|
|
2926
|
+
|
|
2905
2927
|
// src/services/webhook.ts
|
|
2906
2928
|
var SERVICE8 = { kind: "service" };
|
|
2907
2929
|
var WebhookService = class {
|
|
@@ -5074,7 +5096,7 @@ var ApprovalService = class {
|
|
|
5074
5096
|
};
|
|
5075
5097
|
|
|
5076
5098
|
// package.json
|
|
5077
|
-
var version = "2.
|
|
5099
|
+
var version = "2.11.0";
|
|
5078
5100
|
|
|
5079
5101
|
// src/version.ts
|
|
5080
5102
|
var SDK_VERSION = version;
|
|
@@ -5105,6 +5127,7 @@ var EmporixClient = class {
|
|
|
5105
5127
|
ragIndexer;
|
|
5106
5128
|
sequentialIds;
|
|
5107
5129
|
fees;
|
|
5130
|
+
cloudFunctions;
|
|
5108
5131
|
webhooks;
|
|
5109
5132
|
schemas;
|
|
5110
5133
|
ai;
|
|
@@ -5205,6 +5228,7 @@ var EmporixClient = class {
|
|
|
5205
5228
|
this.ragIndexer = new RagIndexerService(mk("ai-rag-indexer"));
|
|
5206
5229
|
this.sequentialIds = new SequentialIdService(mk("sequential-id"));
|
|
5207
5230
|
this.fees = new FeeService(mk("fee"));
|
|
5231
|
+
this.cloudFunctions = new CloudFunctionsService(mk("cloud-functions"));
|
|
5208
5232
|
this.webhooks = new WebhookService(mk("webhook"));
|
|
5209
5233
|
this.schemas = new SchemaService(mk("schema"));
|
|
5210
5234
|
this.ai = new AiService(mk("ai"));
|
|
@@ -5271,6 +5295,7 @@ exports.CatalogService = CatalogService;
|
|
|
5271
5295
|
exports.CategoryService = CategoryService;
|
|
5272
5296
|
exports.CheckoutService = CheckoutService;
|
|
5273
5297
|
exports.ClientConfigService = ClientConfigService;
|
|
5298
|
+
exports.CloudFunctionsService = CloudFunctionsService;
|
|
5274
5299
|
exports.CompaniesService = CompaniesService;
|
|
5275
5300
|
exports.ContactsService = ContactsService;
|
|
5276
5301
|
exports.CountryService = CountryService;
|