sahab-utils 1.9.2 → 1.9.4
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/constants/types.d.ts +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/ts/adminNotifications.d.ts +67 -0
- package/dist/ts/adminNotifications.js +47 -0
- package/dist/ts/staffAccess.d.ts +39 -0
- package/dist/ts/staffAccess.js +58 -0
- package/dist/ts/tap.d.ts +6 -0
- package/dist/ts/tap.js +36 -0
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DocumentReference, GeoPoint, Timestamp } from 'firebase/firestore';
|
|
2
2
|
import type { PushTransport } from '../ts/push';
|
|
3
|
+
import type { TapLicenseType } from '../ts/tap';
|
|
3
4
|
export type GeoPointType = GeoPoint;
|
|
4
5
|
export type TimestampType = Timestamp;
|
|
5
6
|
export type DistenceDueration = {
|
|
@@ -493,7 +494,6 @@ export declare const INTEGRATION_KEYS: {
|
|
|
493
494
|
export type IntegrationKey = (typeof INTEGRATION_KEYS)[keyof typeof INTEGRATION_KEYS];
|
|
494
495
|
export type TapKycStatus = 'draft' | 'documents_uploaded' | 'lead_created' | 'account_created' | 'payout_enabled' | 'rejected';
|
|
495
496
|
export type TapDocumentPurpose = 'commercial_registration' | 'national_id' | 'bank_statement' | 'iban_certificate';
|
|
496
|
-
export type TapLicenseType = 'LLC' | 'SOLE_PROPRIETORSHIP' | 'JOINT_STOCK' | 'PARTNERSHIP' | 'OTHER';
|
|
497
497
|
export type TapApplicationFile = {
|
|
498
498
|
purpose: TapDocumentPurpose;
|
|
499
499
|
fileId: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './constants/types';
|
|
2
|
+
export * from './ts/adminNotifications';
|
|
3
|
+
export * from './ts/staffAccess';
|
|
2
4
|
export * from './ts/broadcast';
|
|
3
5
|
export * from './ts/capacity';
|
|
4
6
|
export * from './ts/calcs';
|
|
@@ -10,6 +12,7 @@ export * from './ts/loyalty';
|
|
|
10
12
|
export * from './ts/offerings';
|
|
11
13
|
export * from './ts/orderActivity';
|
|
12
14
|
export * from './ts/payLink';
|
|
15
|
+
export * from './ts/tap';
|
|
13
16
|
export * from './ts/push';
|
|
14
17
|
export * from './ts/utils';
|
|
15
18
|
export * from './ts/wheel';
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants/types"), exports);
|
|
18
|
+
__exportStar(require("./ts/adminNotifications"), exports);
|
|
19
|
+
__exportStar(require("./ts/staffAccess"), exports);
|
|
18
20
|
__exportStar(require("./ts/broadcast"), exports);
|
|
19
21
|
__exportStar(require("./ts/capacity"), exports);
|
|
20
22
|
__exportStar(require("./ts/calcs"), exports);
|
|
@@ -26,6 +28,7 @@ __exportStar(require("./ts/loyalty"), exports);
|
|
|
26
28
|
__exportStar(require("./ts/offerings"), exports);
|
|
27
29
|
__exportStar(require("./ts/orderActivity"), exports);
|
|
28
30
|
__exportStar(require("./ts/payLink"), exports);
|
|
31
|
+
__exportStar(require("./ts/tap"), exports);
|
|
29
32
|
__exportStar(require("./ts/push"), exports);
|
|
30
33
|
__exportStar(require("./ts/utils"), exports);
|
|
31
34
|
__exportStar(require("./ts/wheel"), exports);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Permissions, StaffRole } from './staffAccess';
|
|
2
|
+
/** Which alerts a back-office admin gets. The shared contract between sahab-website (the Admin notifications page) and cloudFun. */
|
|
3
|
+
/** App (push) alerts, each sent to the admin's customer-app account. */
|
|
4
|
+
export declare const ADMIN_PUSH_KINDS: readonly ["newOrder", "newCarwash", "newGift", "newClient", "needsAttention", "statements"];
|
|
5
|
+
export type AdminPushKind = (typeof ADMIN_PUSH_KINDS)[number];
|
|
6
|
+
/** Every switch on the page: the app alerts plus the lead e-mail. */
|
|
7
|
+
export declare const ADMIN_NOTIFICATION_KEYS: readonly ["newOrder", "newCarwash", "newGift", "newClient", "needsAttention", "statements", "leadEmails"];
|
|
8
|
+
export type AdminNotificationKey = (typeof ADMIN_NOTIFICATION_KEYS)[number];
|
|
9
|
+
export type AdminNotificationPrefs = Record<AdminNotificationKey, boolean>;
|
|
10
|
+
export declare const ADMIN_NOTIFICATION_LABELS: Record<AdminNotificationKey, {
|
|
11
|
+
label: string;
|
|
12
|
+
description: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** Nothing is switched on until an admin is set up. */
|
|
15
|
+
export declare const defaultAdminNotificationPrefs: () => AdminNotificationPrefs;
|
|
16
|
+
/** A stored `notifications` map as a full set of switches; anything missing or not a boolean is off. */
|
|
17
|
+
export declare function normalizeAdminNotificationPrefs(raw: unknown): AdminNotificationPrefs;
|
|
18
|
+
export type AdminListItem = {
|
|
19
|
+
email: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
/** The back-office role, e.g. ADMIN. */
|
|
22
|
+
type?: string;
|
|
23
|
+
role: StaffRole;
|
|
24
|
+
/** The pages a STAFF member may open; empty for an ADMIN, who opens all of them. */
|
|
25
|
+
permissions: Permissions[];
|
|
26
|
+
/** True once their access to the dashboard has been removed. */
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
/** Why this person's role or access cannot be taken away right now (the list shows it instead of the button); absent when it can. */
|
|
29
|
+
accessLocked?: string;
|
|
30
|
+
/** The admin's app user ID (the Firebase user, the same in the customer and provider apps), where app alerts are delivered. */
|
|
31
|
+
appUid?: string;
|
|
32
|
+
notifications: AdminNotificationPrefs;
|
|
33
|
+
};
|
|
34
|
+
export type ListAdminsResponse = {
|
|
35
|
+
/** Whether the caller may change anything on the page. */
|
|
36
|
+
canEdit: boolean;
|
|
37
|
+
admins: AdminListItem[];
|
|
38
|
+
};
|
|
39
|
+
export type UpdateAdminRequest = {
|
|
40
|
+
email: string;
|
|
41
|
+
/** Changes what they may open. Left out, it is unchanged. */
|
|
42
|
+
role?: StaffRole;
|
|
43
|
+
permissions?: Permissions[];
|
|
44
|
+
/** An empty string clears it. Left out, it is unchanged. */
|
|
45
|
+
appUid?: string;
|
|
46
|
+
/** Only the switches listed here change. */
|
|
47
|
+
notifications?: Partial<AdminNotificationPrefs>;
|
|
48
|
+
};
|
|
49
|
+
export type AddAdminRequest = {
|
|
50
|
+
email: string;
|
|
51
|
+
name: string;
|
|
52
|
+
/** Defaults to ADMIN. */
|
|
53
|
+
role?: StaffRole;
|
|
54
|
+
permissions?: Permissions[];
|
|
55
|
+
appUid?: string;
|
|
56
|
+
notifications?: Partial<AdminNotificationPrefs>;
|
|
57
|
+
};
|
|
58
|
+
export type AddAdminResponse = {
|
|
59
|
+
admin: AdminListItem;
|
|
60
|
+
/** Whether the set-password e-mail went out. */
|
|
61
|
+
inviteSent: boolean;
|
|
62
|
+
};
|
|
63
|
+
/** An e-mail as it is stored: trimmed and lower case, since `support_users` documents are keyed by it. */
|
|
64
|
+
export declare const normalizeAdminEmail: (value: unknown) => string;
|
|
65
|
+
export declare const isValidAdminEmail: (value: unknown) => boolean;
|
|
66
|
+
/** A Firebase user ID: letters and digits only, never a path. */
|
|
67
|
+
export declare const isValidAppUid: (value: unknown) => boolean;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidAppUid = exports.isValidAdminEmail = exports.normalizeAdminEmail = exports.defaultAdminNotificationPrefs = exports.ADMIN_NOTIFICATION_LABELS = exports.ADMIN_NOTIFICATION_KEYS = exports.ADMIN_PUSH_KINDS = void 0;
|
|
4
|
+
exports.normalizeAdminNotificationPrefs = normalizeAdminNotificationPrefs;
|
|
5
|
+
/** Which alerts a back-office admin gets. The shared contract between sahab-website (the Admin notifications page) and cloudFun. */
|
|
6
|
+
/** App (push) alerts, each sent to the admin's customer-app account. */
|
|
7
|
+
exports.ADMIN_PUSH_KINDS = ['newOrder', 'newCarwash', 'newGift', 'newClient', 'needsAttention', 'statements'];
|
|
8
|
+
/** Every switch on the page: the app alerts plus the lead e-mail. */
|
|
9
|
+
exports.ADMIN_NOTIFICATION_KEYS = [...exports.ADMIN_PUSH_KINDS, 'leadEmails'];
|
|
10
|
+
exports.ADMIN_NOTIFICATION_LABELS = {
|
|
11
|
+
newOrder: { label: 'New order', description: 'A customer places an order.' },
|
|
12
|
+
newCarwash: { label: 'New carwash', description: 'A carwash registers or finishes its registration.' },
|
|
13
|
+
newGift: { label: 'New gift', description: 'A customer buys a gift.' },
|
|
14
|
+
newClient: { label: 'New customer', description: 'A customer joins the app.' },
|
|
15
|
+
needsAttention: { label: 'Carwash needs attention', description: 'A carwash changed something that needs a look.' },
|
|
16
|
+
statements: { label: 'Statements', description: 'The daily and weekly statements are ready.' },
|
|
17
|
+
leadEmails: { label: 'Lead e-mails', description: 'A visitor sends an enquiry or a carwash request on the website.' },
|
|
18
|
+
};
|
|
19
|
+
/** Nothing is switched on until an admin is set up. */
|
|
20
|
+
const defaultAdminNotificationPrefs = () => {
|
|
21
|
+
const prefs = {};
|
|
22
|
+
exports.ADMIN_NOTIFICATION_KEYS.forEach((key) => {
|
|
23
|
+
prefs[key] = false;
|
|
24
|
+
});
|
|
25
|
+
return prefs;
|
|
26
|
+
};
|
|
27
|
+
exports.defaultAdminNotificationPrefs = defaultAdminNotificationPrefs;
|
|
28
|
+
/** A stored `notifications` map as a full set of switches; anything missing or not a boolean is off. */
|
|
29
|
+
function normalizeAdminNotificationPrefs(raw) {
|
|
30
|
+
const stored = raw && typeof raw === 'object' ? raw : {};
|
|
31
|
+
const prefs = (0, exports.defaultAdminNotificationPrefs)();
|
|
32
|
+
exports.ADMIN_NOTIFICATION_KEYS.forEach((key) => {
|
|
33
|
+
prefs[key] = stored[key] === true;
|
|
34
|
+
});
|
|
35
|
+
return prefs;
|
|
36
|
+
}
|
|
37
|
+
/** An e-mail as it is stored: trimmed and lower case, since `support_users` documents are keyed by it. */
|
|
38
|
+
const normalizeAdminEmail = (value) => (typeof value === 'string' ? value.trim().toLowerCase() : '');
|
|
39
|
+
exports.normalizeAdminEmail = normalizeAdminEmail;
|
|
40
|
+
const isValidAdminEmail = (value) => {
|
|
41
|
+
const email = (0, exports.normalizeAdminEmail)(value);
|
|
42
|
+
return email.length <= 254 && /^[^\s@/]+@[^\s@/]+\.[^\s@/]{2,}$/.test(email);
|
|
43
|
+
};
|
|
44
|
+
exports.isValidAdminEmail = isValidAdminEmail;
|
|
45
|
+
/** A Firebase user ID: letters and digits only, never a path. */
|
|
46
|
+
const isValidAppUid = (value) => typeof value === 'string' && /^[A-Za-z0-9_-]{6,128}$/.test(value);
|
|
47
|
+
exports.isValidAppUid = isValidAppUid;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Who may open which back-office page. The shared contract between sahab-website and cloudFun. */
|
|
2
|
+
/** A dashboard page a non-admin may open. The numbers are stored in `support_users.permissions`, so never renumber. */
|
|
3
|
+
export declare enum Permissions {
|
|
4
|
+
VIEW_KPI = 0,// 0
|
|
5
|
+
VIEW_REQUESTS = 1,// 1
|
|
6
|
+
VIEW_COMPLAINTS = 2,// 2
|
|
7
|
+
VIEW_BUGS = 3,// 3
|
|
8
|
+
VIEW_ORDERS = 4,// 4
|
|
9
|
+
VIEW_PROVIDERS = 5,// 5
|
|
10
|
+
VIEW_MAP = 6,// 6
|
|
11
|
+
VIEW_PROMO = 7,// 7
|
|
12
|
+
VIEW_BANNERS = 8,// 8
|
|
13
|
+
VIEW_INVESTOR_NUMBERS = 9
|
|
14
|
+
}
|
|
15
|
+
export declare const ALL_PERMISSIONS: Permissions[];
|
|
16
|
+
export declare const PERMISSION_LABELS: Record<Permissions, {
|
|
17
|
+
label: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** ADMIN opens every page; STAFF opens only the pages in their list. */
|
|
21
|
+
export declare const STAFF_ROLES: readonly ["ADMIN", "STAFF"];
|
|
22
|
+
export type StaffRole = (typeof STAFF_ROLES)[number];
|
|
23
|
+
export declare const isStaffRole: (value: unknown) => value is StaffRole;
|
|
24
|
+
/** A stored `type` as a role: ADMIN stays ADMIN, anything else is STAFF. */
|
|
25
|
+
export declare const roleOfType: (type: unknown) => StaffRole;
|
|
26
|
+
/** The permissions that exist, once each, in page order; anything else in the input is dropped. */
|
|
27
|
+
export declare function normalizePermissions(raw: unknown): Permissions[];
|
|
28
|
+
/** Whether every entry of a request's list is a real permission, so a typo is refused rather than quietly dropped. */
|
|
29
|
+
export declare const areAllPermissions: (raw: unknown) => raw is Permissions[];
|
|
30
|
+
export type SetAdminAccessRequest = {
|
|
31
|
+
email: string;
|
|
32
|
+
/** True removes their access to the dashboard; false restores it. */
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
};
|
|
35
|
+
export type SetAdminAccessResponse = {
|
|
36
|
+
admin: import('./adminNotifications').AdminListItem;
|
|
37
|
+
/** False when the person has no sign-in account to switch, which does not stop the dashboard from refusing them. */
|
|
38
|
+
authUpdated: boolean;
|
|
39
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** Who may open which back-office page. The shared contract between sahab-website and cloudFun. */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.areAllPermissions = exports.roleOfType = exports.isStaffRole = exports.STAFF_ROLES = exports.PERMISSION_LABELS = exports.ALL_PERMISSIONS = exports.Permissions = void 0;
|
|
5
|
+
exports.normalizePermissions = normalizePermissions;
|
|
6
|
+
/** A dashboard page a non-admin may open. The numbers are stored in `support_users.permissions`, so never renumber. */
|
|
7
|
+
var Permissions;
|
|
8
|
+
(function (Permissions) {
|
|
9
|
+
Permissions[Permissions["VIEW_KPI"] = 0] = "VIEW_KPI";
|
|
10
|
+
Permissions[Permissions["VIEW_REQUESTS"] = 1] = "VIEW_REQUESTS";
|
|
11
|
+
Permissions[Permissions["VIEW_COMPLAINTS"] = 2] = "VIEW_COMPLAINTS";
|
|
12
|
+
Permissions[Permissions["VIEW_BUGS"] = 3] = "VIEW_BUGS";
|
|
13
|
+
Permissions[Permissions["VIEW_ORDERS"] = 4] = "VIEW_ORDERS";
|
|
14
|
+
Permissions[Permissions["VIEW_PROVIDERS"] = 5] = "VIEW_PROVIDERS";
|
|
15
|
+
Permissions[Permissions["VIEW_MAP"] = 6] = "VIEW_MAP";
|
|
16
|
+
Permissions[Permissions["VIEW_PROMO"] = 7] = "VIEW_PROMO";
|
|
17
|
+
Permissions[Permissions["VIEW_BANNERS"] = 8] = "VIEW_BANNERS";
|
|
18
|
+
Permissions[Permissions["VIEW_INVESTOR_NUMBERS"] = 9] = "VIEW_INVESTOR_NUMBERS";
|
|
19
|
+
})(Permissions || (exports.Permissions = Permissions = {}));
|
|
20
|
+
exports.ALL_PERMISSIONS = [
|
|
21
|
+
Permissions.VIEW_KPI,
|
|
22
|
+
Permissions.VIEW_REQUESTS,
|
|
23
|
+
Permissions.VIEW_COMPLAINTS,
|
|
24
|
+
Permissions.VIEW_BUGS,
|
|
25
|
+
Permissions.VIEW_ORDERS,
|
|
26
|
+
Permissions.VIEW_PROVIDERS,
|
|
27
|
+
Permissions.VIEW_MAP,
|
|
28
|
+
Permissions.VIEW_PROMO,
|
|
29
|
+
Permissions.VIEW_BANNERS,
|
|
30
|
+
Permissions.VIEW_INVESTOR_NUMBERS,
|
|
31
|
+
];
|
|
32
|
+
exports.PERMISSION_LABELS = {
|
|
33
|
+
[Permissions.VIEW_KPI]: { label: 'KPIs', description: 'Business KPIs for a chosen period.' },
|
|
34
|
+
[Permissions.VIEW_REQUESTS]: { label: 'Requests', description: 'Carwash applications waiting for review.' },
|
|
35
|
+
[Permissions.VIEW_COMPLAINTS]: { label: 'Complaints', description: 'Customer complaints.' },
|
|
36
|
+
[Permissions.VIEW_BUGS]: { label: 'Bugs', description: 'Bug reports from the apps.' },
|
|
37
|
+
[Permissions.VIEW_ORDERS]: { label: 'Orders', description: 'Live orders, with the option to edit them.' },
|
|
38
|
+
[Permissions.VIEW_PROVIDERS]: { label: 'Providers', description: 'Accepted carwashes and their Tap onboarding.' },
|
|
39
|
+
[Permissions.VIEW_MAP]: { label: 'Map', description: 'Orders and drivers on the map.' },
|
|
40
|
+
[Permissions.VIEW_PROMO]: { label: 'Promo and offers', description: 'Promo codes, offers, gifts and the wheel.' },
|
|
41
|
+
[Permissions.VIEW_BANNERS]: { label: 'Banners', description: 'The app banners.' },
|
|
42
|
+
[Permissions.VIEW_INVESTOR_NUMBERS]: { label: 'Investor numbers', description: 'Financial and unit-economics figures.' },
|
|
43
|
+
};
|
|
44
|
+
/** ADMIN opens every page; STAFF opens only the pages in their list. */
|
|
45
|
+
exports.STAFF_ROLES = ['ADMIN', 'STAFF'];
|
|
46
|
+
const isStaffRole = (value) => exports.STAFF_ROLES.includes(value);
|
|
47
|
+
exports.isStaffRole = isStaffRole;
|
|
48
|
+
/** A stored `type` as a role: ADMIN stays ADMIN, anything else is STAFF. */
|
|
49
|
+
const roleOfType = (type) => (type === 'ADMIN' ? 'ADMIN' : 'STAFF');
|
|
50
|
+
exports.roleOfType = roleOfType;
|
|
51
|
+
/** The permissions that exist, once each, in page order; anything else in the input is dropped. */
|
|
52
|
+
function normalizePermissions(raw) {
|
|
53
|
+
const wanted = Array.isArray(raw) ? raw : [];
|
|
54
|
+
return exports.ALL_PERMISSIONS.filter((permission) => wanted.includes(permission));
|
|
55
|
+
}
|
|
56
|
+
/** Whether every entry of a request's list is a real permission, so a typo is refused rather than quietly dropped. */
|
|
57
|
+
const areAllPermissions = (raw) => Array.isArray(raw) && raw.every((p) => exports.ALL_PERMISSIONS.includes(p));
|
|
58
|
+
exports.areAllPermissions = areAllPermissions;
|
package/dist/ts/tap.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The only `entity.license.type` values Tap's Create Lead API accepts, spelled exactly as Tap lists them. */
|
|
2
|
+
export declare const TAP_LICENSE_TYPES: readonly ["Establishment", "Trust", "Partnership", "LLC", "JSC", "Foreign JSC Branch", "Mix LLC", "Foreign LLC", "GCC Partnership", "GCC LLC", "GCC JSC", "Foreign LLC Branch", "Profession LLC", "Freelancer"];
|
|
3
|
+
export type TapLicenseType = (typeof TAP_LICENSE_TYPES)[number];
|
|
4
|
+
export declare const isTapLicenseType: (value: unknown) => value is TapLicenseType;
|
|
5
|
+
/** A stored or submitted license type as one Tap accepts, or undefined when it maps to none. */
|
|
6
|
+
export declare function normalizeTapLicenseType(value: unknown): TapLicenseType | undefined;
|
package/dist/ts/tap.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTapLicenseType = exports.TAP_LICENSE_TYPES = void 0;
|
|
4
|
+
exports.normalizeTapLicenseType = normalizeTapLicenseType;
|
|
5
|
+
/** The only `entity.license.type` values Tap's Create Lead API accepts, spelled exactly as Tap lists them. */
|
|
6
|
+
exports.TAP_LICENSE_TYPES = [
|
|
7
|
+
'Establishment',
|
|
8
|
+
'Trust',
|
|
9
|
+
'Partnership',
|
|
10
|
+
'LLC',
|
|
11
|
+
'JSC',
|
|
12
|
+
'Foreign JSC Branch',
|
|
13
|
+
'Mix LLC',
|
|
14
|
+
'Foreign LLC',
|
|
15
|
+
'GCC Partnership',
|
|
16
|
+
'GCC LLC',
|
|
17
|
+
'GCC JSC',
|
|
18
|
+
'Foreign LLC Branch',
|
|
19
|
+
'Profession LLC',
|
|
20
|
+
'Freelancer',
|
|
21
|
+
];
|
|
22
|
+
const isTapLicenseType = (value) => exports.TAP_LICENSE_TYPES.includes(value);
|
|
23
|
+
exports.isTapLicenseType = isTapLicenseType;
|
|
24
|
+
// Applications saved before the list was corrected hold the dashboard's old names. There is no Tap value for
|
|
25
|
+
// "other", so that one stays unresolved and the form must ask again.
|
|
26
|
+
const LEGACY_LICENSE_TYPES = {
|
|
27
|
+
SOLE_PROPRIETORSHIP: 'Establishment',
|
|
28
|
+
JOINT_STOCK: 'JSC',
|
|
29
|
+
PARTNERSHIP: 'Partnership',
|
|
30
|
+
};
|
|
31
|
+
/** A stored or submitted license type as one Tap accepts, or undefined when it maps to none. */
|
|
32
|
+
function normalizeTapLicenseType(value) {
|
|
33
|
+
if ((0, exports.isTapLicenseType)(value))
|
|
34
|
+
return value;
|
|
35
|
+
return typeof value === 'string' ? LEGACY_LICENSE_TYPES[value] : undefined;
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sahab-utils",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "This package contains types and utils functions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"prepublishOnly": "npm run build",
|
|
10
10
|
"deploy": "npm run build && npm publish",
|
|
11
|
-
"test": "npm run build && node tests/loyalty.test.js && node tests/gifts.test.js && node tests/cashback.test.js && node tests/utils.test.js && node tests/wheel.test.js && node tests/calcs.test.js && node tests/orderActivity.test.js && node tests/push.test.js && node tests/broadcast.test.js && node tests/iban.test.js && node tests/cash.test.js && node tests/workingHours.test.js && node tests/payLink.test.js && node tests/offerings.test.js && node tests/capacity.test.js"
|
|
11
|
+
"test": "npm run build && node tests/loyalty.test.js && node tests/gifts.test.js && node tests/cashback.test.js && node tests/utils.test.js && node tests/wheel.test.js && node tests/calcs.test.js && node tests/orderActivity.test.js && node tests/push.test.js && node tests/broadcast.test.js && node tests/iban.test.js && node tests/cash.test.js && node tests/workingHours.test.js && node tests/payLink.test.js && node tests/offerings.test.js && node tests/capacity.test.js && node tests/tap.test.js && node tests/adminNotifications.test.js && node tests/staffAccess.test.js"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|