@munchi_oy/license-sdk 0.5.0 → 0.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/README.md +1 -1
- package/dist/index.cjs +19 -3
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +16 -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`, `card_payments_pos`, `card_payments_kiosk`), with `STORE_ONLY_PRODUCTS` and `isStoreOnlyProduct` for the ones only a store asks for, never the whole group (the delivery apps and card payments at the POS or kiosk).
|
|
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,20 @@ 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",
|
|
109
|
+
"card_payments_pos",
|
|
110
|
+
"card_payments_kiosk"
|
|
105
111
|
];
|
|
112
|
+
var STORE_ONLY_PRODUCTS = [
|
|
113
|
+
"foodora",
|
|
114
|
+
"bolt",
|
|
115
|
+
"card_payments_pos",
|
|
116
|
+
"card_payments_kiosk"
|
|
117
|
+
];
|
|
118
|
+
var storeOnly = new Set(STORE_ONLY_PRODUCTS);
|
|
119
|
+
var isStoreOnlyProduct = /* @__PURE__ */ __name((product) => storeOnly.has(product), "isStoreOnlyProduct");
|
|
106
120
|
|
|
107
121
|
// ../license-core/src/usage-metrics.ts
|
|
108
122
|
var USAGE_METRICS = {
|
|
@@ -255,9 +269,11 @@ var LicenseClient = class {
|
|
|
255
269
|
PLANS,
|
|
256
270
|
PRODUCTS,
|
|
257
271
|
REQUESTABLE_PRODUCTS,
|
|
272
|
+
STORE_ONLY_PRODUCTS,
|
|
258
273
|
USAGE_METRICS,
|
|
259
274
|
USAGE_METRIC_NAMES,
|
|
260
275
|
companyIds,
|
|
261
276
|
finnishBusinessId,
|
|
262
|
-
finnishVatId
|
|
277
|
+
finnishVatId,
|
|
278
|
+
isStoreOnlyProduct
|
|
263
279
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -69,8 +69,14 @@ 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", "card_payments_pos", "card_payments_kiosk"];
|
|
73
73
|
type RequestableProduct = (typeof REQUESTABLE_PRODUCTS)[number];
|
|
74
|
+
/**
|
|
75
|
+
* Delivery apps and card payments at the POS or kiosk are set up one store at a time, so only a
|
|
76
|
+
* store asks for them, never the whole group.
|
|
77
|
+
*/
|
|
78
|
+
declare const STORE_ONLY_PRODUCTS: readonly ["foodora", "bolt", "card_payments_pos", "card_payments_kiosk"];
|
|
79
|
+
declare const isStoreOnlyProduct: (product: RequestableProduct) => boolean;
|
|
74
80
|
|
|
75
81
|
/**
|
|
76
82
|
* What the apps report and the monthly bill can charge for: reminder SMS segments sent (added
|
|
@@ -222,4 +228,4 @@ declare class LicenseClient {
|
|
|
222
228
|
private report;
|
|
223
229
|
}
|
|
224
230
|
|
|
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 };
|
|
231
|
+
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,14 @@ 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", "card_payments_pos", "card_payments_kiosk"];
|
|
73
73
|
type RequestableProduct = (typeof REQUESTABLE_PRODUCTS)[number];
|
|
74
|
+
/**
|
|
75
|
+
* Delivery apps and card payments at the POS or kiosk are set up one store at a time, so only a
|
|
76
|
+
* store asks for them, never the whole group.
|
|
77
|
+
*/
|
|
78
|
+
declare const STORE_ONLY_PRODUCTS: readonly ["foodora", "bolt", "card_payments_pos", "card_payments_kiosk"];
|
|
79
|
+
declare const isStoreOnlyProduct: (product: RequestableProduct) => boolean;
|
|
74
80
|
|
|
75
81
|
/**
|
|
76
82
|
* What the apps report and the monthly bill can charge for: reminder SMS segments sent (added
|
|
@@ -222,4 +228,4 @@ declare class LicenseClient {
|
|
|
222
228
|
private report;
|
|
223
229
|
}
|
|
224
230
|
|
|
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 };
|
|
231
|
+
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,20 @@ 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",
|
|
75
|
+
"card_payments_pos",
|
|
76
|
+
"card_payments_kiosk"
|
|
73
77
|
];
|
|
78
|
+
var STORE_ONLY_PRODUCTS = [
|
|
79
|
+
"foodora",
|
|
80
|
+
"bolt",
|
|
81
|
+
"card_payments_pos",
|
|
82
|
+
"card_payments_kiosk"
|
|
83
|
+
];
|
|
84
|
+
var storeOnly = new Set(STORE_ONLY_PRODUCTS);
|
|
85
|
+
var isStoreOnlyProduct = /* @__PURE__ */ __name((product) => storeOnly.has(product), "isStoreOnlyProduct");
|
|
74
86
|
|
|
75
87
|
// ../license-core/src/usage-metrics.ts
|
|
76
88
|
var USAGE_METRICS = {
|
|
@@ -222,9 +234,11 @@ export {
|
|
|
222
234
|
PLANS,
|
|
223
235
|
PRODUCTS,
|
|
224
236
|
REQUESTABLE_PRODUCTS,
|
|
237
|
+
STORE_ONLY_PRODUCTS,
|
|
225
238
|
USAGE_METRICS,
|
|
226
239
|
USAGE_METRIC_NAMES,
|
|
227
240
|
companyIds,
|
|
228
241
|
finnishBusinessId,
|
|
229
|
-
finnishVatId
|
|
242
|
+
finnishVatId,
|
|
243
|
+
isStoreOnlyProduct
|
|
230
244
|
};
|
package/package.json
CHANGED