@munchi_oy/license-sdk 0.5.0 → 0.6.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/README.md +1 -1
- package/dist/index.cjs +15 -3
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,6 +31,6 @@ const snapshot = await license.entitlements(venueId); // full snapshot, null = u
|
|
|
31
31
|
|
|
32
32
|
Call `invalidate(venueId)` when you receive a `license.changed` event.
|
|
33
33
|
|
|
34
|
-
It also exports the shared names: `PRODUCTS` and `PLANS` (catalog codes), `USAGE_METRICS` (what usage can cost money) and `REQUESTABLE_PRODUCTS` (what a store asks Munchi for in the dashboard: `ari`, `business_account`, `capital`).
|
|
34
|
+
It also exports the shared names: `PRODUCTS` and `PLANS` (catalog codes), `USAGE_METRICS` (what usage can cost money) and `REQUESTABLE_PRODUCTS` (what a store asks Munchi for in the dashboard: `ari`, `business_account`, `capital`, `foodora`, `bolt`), with `STORE_ONLY_PRODUCTS` and `isStoreOnlyProduct` for the ones only a store asks for, never the whole group (the delivery apps).
|
|
35
35
|
|
|
36
36
|
For a group's company (ADR 0025) it exports `companyIds(country, { businessId, vatId })` (the IDs to store by the company's country, or `{ invalid: "businessId" | "vatId" }`; any country is accepted, Finland's are checked), `finnishBusinessId(input)` (the Y-tunnus as `NNNNNNN-C`, or `null` when its format or check digit is wrong), `finnishVatId(businessId)` (`FI` and its digits), and the types `LegalEntityChange` (the body of `PATCH /v1/accounts/:accountId/legal-entities/:legalEntityId`) and `LegalEntity` (its response).
|
package/dist/index.cjs
CHANGED
|
@@ -25,11 +25,13 @@ __export(index_exports, {
|
|
|
25
25
|
PLANS: () => PLANS,
|
|
26
26
|
PRODUCTS: () => PRODUCTS,
|
|
27
27
|
REQUESTABLE_PRODUCTS: () => REQUESTABLE_PRODUCTS,
|
|
28
|
+
STORE_ONLY_PRODUCTS: () => STORE_ONLY_PRODUCTS,
|
|
28
29
|
USAGE_METRICS: () => USAGE_METRICS,
|
|
29
30
|
USAGE_METRIC_NAMES: () => USAGE_METRIC_NAMES,
|
|
30
31
|
companyIds: () => companyIds,
|
|
31
32
|
finnishBusinessId: () => finnishBusinessId,
|
|
32
|
-
finnishVatId: () => finnishVatId
|
|
33
|
+
finnishVatId: () => finnishVatId,
|
|
34
|
+
isStoreOnlyProduct: () => isStoreOnlyProduct
|
|
33
35
|
});
|
|
34
36
|
module.exports = __toCommonJS(index_exports);
|
|
35
37
|
|
|
@@ -101,8 +103,16 @@ var companyIds = /* @__PURE__ */ __name((country, input) => {
|
|
|
101
103
|
var REQUESTABLE_PRODUCTS = [
|
|
102
104
|
"ari",
|
|
103
105
|
"business_account",
|
|
104
|
-
"capital"
|
|
106
|
+
"capital",
|
|
107
|
+
"foodora",
|
|
108
|
+
"bolt"
|
|
105
109
|
];
|
|
110
|
+
var STORE_ONLY_PRODUCTS = [
|
|
111
|
+
"foodora",
|
|
112
|
+
"bolt"
|
|
113
|
+
];
|
|
114
|
+
var storeOnly = new Set(STORE_ONLY_PRODUCTS);
|
|
115
|
+
var isStoreOnlyProduct = /* @__PURE__ */ __name((product) => storeOnly.has(product), "isStoreOnlyProduct");
|
|
106
116
|
|
|
107
117
|
// ../license-core/src/usage-metrics.ts
|
|
108
118
|
var USAGE_METRICS = {
|
|
@@ -255,9 +265,11 @@ var LicenseClient = class {
|
|
|
255
265
|
PLANS,
|
|
256
266
|
PRODUCTS,
|
|
257
267
|
REQUESTABLE_PRODUCTS,
|
|
268
|
+
STORE_ONLY_PRODUCTS,
|
|
258
269
|
USAGE_METRICS,
|
|
259
270
|
USAGE_METRIC_NAMES,
|
|
260
271
|
companyIds,
|
|
261
272
|
finnishBusinessId,
|
|
262
|
-
finnishVatId
|
|
273
|
+
finnishVatId,
|
|
274
|
+
isStoreOnlyProduct
|
|
263
275
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -69,8 +69,11 @@ declare const companyIds: (country: string, input: {
|
|
|
69
69
|
* (ADR 0022). These are the dashboard's product ids, not catalog codes (`MUN-*`); the mobile app
|
|
70
70
|
* has its own request flow (ADR 0021). A new one is added here first.
|
|
71
71
|
*/
|
|
72
|
-
declare const REQUESTABLE_PRODUCTS: readonly ["ari", "business_account", "capital"];
|
|
72
|
+
declare const REQUESTABLE_PRODUCTS: readonly ["ari", "business_account", "capital", "foodora", "bolt"];
|
|
73
73
|
type RequestableProduct = (typeof REQUESTABLE_PRODUCTS)[number];
|
|
74
|
+
/** Delivery apps connect one store at a time, so only a store asks for them, never the whole group. */
|
|
75
|
+
declare const STORE_ONLY_PRODUCTS: readonly ["foodora", "bolt"];
|
|
76
|
+
declare const isStoreOnlyProduct: (product: RequestableProduct) => boolean;
|
|
74
77
|
|
|
75
78
|
/**
|
|
76
79
|
* What the apps report and the monthly bill can charge for: reminder SMS segments sent (added
|
|
@@ -222,4 +225,4 @@ declare class LicenseClient {
|
|
|
222
225
|
private report;
|
|
223
226
|
}
|
|
224
227
|
|
|
225
|
-
export { type CompanyIds, type DeniedEvent, type KnownProductCode, type LegalEntity, type LegalEntityChange, LicenseClient, type LicenseClientOptions, PLANS, PRODUCTS, type PlanCode, REQUESTABLE_PRODUCTS, type RequestableProduct, type Snapshot, USAGE_METRICS, USAGE_METRIC_NAMES, type UsageMetric, companyIds, finnishBusinessId, finnishVatId };
|
|
228
|
+
export { type CompanyIds, type DeniedEvent, type KnownProductCode, type LegalEntity, type LegalEntityChange, LicenseClient, type LicenseClientOptions, PLANS, PRODUCTS, type PlanCode, REQUESTABLE_PRODUCTS, type RequestableProduct, STORE_ONLY_PRODUCTS, type Snapshot, USAGE_METRICS, USAGE_METRIC_NAMES, type UsageMetric, companyIds, finnishBusinessId, finnishVatId, isStoreOnlyProduct };
|
package/dist/index.d.ts
CHANGED
|
@@ -69,8 +69,11 @@ declare const companyIds: (country: string, input: {
|
|
|
69
69
|
* (ADR 0022). These are the dashboard's product ids, not catalog codes (`MUN-*`); the mobile app
|
|
70
70
|
* has its own request flow (ADR 0021). A new one is added here first.
|
|
71
71
|
*/
|
|
72
|
-
declare const REQUESTABLE_PRODUCTS: readonly ["ari", "business_account", "capital"];
|
|
72
|
+
declare const REQUESTABLE_PRODUCTS: readonly ["ari", "business_account", "capital", "foodora", "bolt"];
|
|
73
73
|
type RequestableProduct = (typeof REQUESTABLE_PRODUCTS)[number];
|
|
74
|
+
/** Delivery apps connect one store at a time, so only a store asks for them, never the whole group. */
|
|
75
|
+
declare const STORE_ONLY_PRODUCTS: readonly ["foodora", "bolt"];
|
|
76
|
+
declare const isStoreOnlyProduct: (product: RequestableProduct) => boolean;
|
|
74
77
|
|
|
75
78
|
/**
|
|
76
79
|
* What the apps report and the monthly bill can charge for: reminder SMS segments sent (added
|
|
@@ -222,4 +225,4 @@ declare class LicenseClient {
|
|
|
222
225
|
private report;
|
|
223
226
|
}
|
|
224
227
|
|
|
225
|
-
export { type CompanyIds, type DeniedEvent, type KnownProductCode, type LegalEntity, type LegalEntityChange, LicenseClient, type LicenseClientOptions, PLANS, PRODUCTS, type PlanCode, REQUESTABLE_PRODUCTS, type RequestableProduct, type Snapshot, USAGE_METRICS, USAGE_METRIC_NAMES, type UsageMetric, companyIds, finnishBusinessId, finnishVatId };
|
|
228
|
+
export { type CompanyIds, type DeniedEvent, type KnownProductCode, type LegalEntity, type LegalEntityChange, LicenseClient, type LicenseClientOptions, PLANS, PRODUCTS, type PlanCode, REQUESTABLE_PRODUCTS, type RequestableProduct, STORE_ONLY_PRODUCTS, type Snapshot, USAGE_METRICS, USAGE_METRIC_NAMES, type UsageMetric, companyIds, finnishBusinessId, finnishVatId, isStoreOnlyProduct };
|
package/dist/index.js
CHANGED
|
@@ -69,8 +69,16 @@ var companyIds = /* @__PURE__ */ __name((country, input) => {
|
|
|
69
69
|
var REQUESTABLE_PRODUCTS = [
|
|
70
70
|
"ari",
|
|
71
71
|
"business_account",
|
|
72
|
-
"capital"
|
|
72
|
+
"capital",
|
|
73
|
+
"foodora",
|
|
74
|
+
"bolt"
|
|
73
75
|
];
|
|
76
|
+
var STORE_ONLY_PRODUCTS = [
|
|
77
|
+
"foodora",
|
|
78
|
+
"bolt"
|
|
79
|
+
];
|
|
80
|
+
var storeOnly = new Set(STORE_ONLY_PRODUCTS);
|
|
81
|
+
var isStoreOnlyProduct = /* @__PURE__ */ __name((product) => storeOnly.has(product), "isStoreOnlyProduct");
|
|
74
82
|
|
|
75
83
|
// ../license-core/src/usage-metrics.ts
|
|
76
84
|
var USAGE_METRICS = {
|
|
@@ -222,9 +230,11 @@ export {
|
|
|
222
230
|
PLANS,
|
|
223
231
|
PRODUCTS,
|
|
224
232
|
REQUESTABLE_PRODUCTS,
|
|
233
|
+
STORE_ONLY_PRODUCTS,
|
|
225
234
|
USAGE_METRICS,
|
|
226
235
|
USAGE_METRIC_NAMES,
|
|
227
236
|
companyIds,
|
|
228
237
|
finnishBusinessId,
|
|
229
|
-
finnishVatId
|
|
238
|
+
finnishVatId,
|
|
239
|
+
isStoreOnlyProduct
|
|
230
240
|
};
|
package/package.json
CHANGED