@antcde/connect-ts 0.4.38 → 0.4.39-rc.1
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/build/AntConnect.d.ts +4 -1
- package/build/AntConnect.d.ts.map +1 -1
- package/build/AntConnect.js +4 -15
- package/build/comms/models.d.ts +7 -0
- package/build/comms/models.d.ts.map +1 -1
- package/build/comms/signalTypes.d.ts +5 -0
- package/build/comms/signalTypes.d.ts.map +1 -1
- package/build/index.d.ts +7 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/service-types-app.d.ts +1 -1
- package/build/service-types-app.d.ts.map +1 -1
- package/build/service-types.d.ts +6 -4
- package/build/service-types.d.ts.map +1 -1
- package/build/services/AppService/factory/resourceAccess.d.ts +1 -1
- package/build/services/AppService/factory/resourceAccess.d.ts.map +1 -1
- package/build/services/AppService/factory/resourceAccess.js +2 -0
- package/build/services/AppService/index.d.ts.map +1 -1
- package/build/services/AppService/types/accessRequests.d.ts +3 -1
- package/build/services/AppService/types/accessRequests.d.ts.map +1 -1
- package/build/services/AppService/types/app.d.ts +3 -0
- package/build/services/AppService/types/app.d.ts.map +1 -1
- package/build/services/AppService/types/appDevices.d.ts +3 -0
- package/build/services/AppService/types/appDevices.d.ts.map +1 -0
- package/build/services/AppService/types/appDevices.js +1 -0
- package/build/services/AppService/types/appList.d.ts +3 -0
- package/build/services/AppService/types/appList.d.ts.map +1 -1
- package/build/services/AppService/types/appRequests.d.ts +3 -0
- package/build/services/AppService/types/appRequests.d.ts.map +1 -1
- package/build/services/AppService/types/appScopes.d.ts +2 -2
- package/build/services/AppService/types/appScopes.d.ts.map +1 -1
- package/build/services/AppService/types/resourceEntitlements.d.ts +6 -0
- package/build/services/AppService/types/resourceEntitlements.d.ts.map +1 -1
- package/build/services/AppService/types.d.ts +1 -0
- package/build/services/AppService/types.d.ts.map +1 -1
- package/build/services/AppService/types.js +1 -0
- package/build/services/BroadcastingService.d.ts +11 -0
- package/build/services/BroadcastingService.d.ts.map +1 -0
- package/build/services/BroadcastingService.js +7 -0
- package/build/services/DeviceService.d.ts +96 -0
- package/build/services/DeviceService.d.ts.map +1 -0
- package/build/services/DeviceService.js +35 -0
- package/build/services/LicenseCompanyPeople.types.d.ts +34 -0
- package/build/services/LicenseCompanyPeople.types.d.ts.map +1 -0
- package/build/services/LicenseCompanyPeople.types.js +3 -0
- package/build/services/LicenseMemberErrors.types.d.ts +42 -0
- package/build/services/LicenseMemberErrors.types.d.ts.map +1 -0
- package/build/services/LicenseMemberErrors.types.js +27 -0
- package/build/services/LicenseService.d.ts +61 -9
- package/build/services/LicenseService.d.ts.map +1 -1
- package/build/services/LicenseService.js +12 -2
- package/build/services/LicenseService.types.d.ts +139 -0
- package/build/services/LicenseService.types.d.ts.map +1 -0
- package/build/services/LicenseService.types.js +15 -0
- package/build/services/Notifications/NotificationService.d.ts +7 -2
- package/build/services/Notifications/NotificationService.d.ts.map +1 -1
- package/build/services/Project/ProjectUserService.d.ts +0 -5
- package/build/services/Project/ProjectUserService.d.ts.map +1 -1
- package/build/services/Project/ProjectUserService.js +0 -1
- package/build/services/ProjectService.d.ts +18 -0
- package/build/services/ProjectService.d.ts.map +1 -1
- package/build/services/ProjectService.js +1 -0
- package/build/services/PropagationService.d.ts +5 -1
- package/build/services/PropagationService.d.ts.map +1 -1
- package/build/services/RBAC/PermissionService.d.ts +2 -2
- package/build/services/RBAC/PermissionService.d.ts.map +1 -1
- package/build/services/RBAC/PermissionService.js +1 -1
- package/build/services/RBAC/RoleService.d.ts +2 -1
- package/build/services/RBAC/RoleService.d.ts.map +1 -1
- package/build/services/RBAC/RoleService.js +0 -1
- package/build/services/ResellerService.d.ts +17 -3
- package/build/services/ResellerService.d.ts.map +1 -1
- package/build/services/ResellerService.js +8 -0
- package/build/services/ResellerService.types.d.ts +112 -0
- package/build/services/ResellerService.types.d.ts.map +1 -0
- package/build/services/ResellerService.types.js +22 -0
- package/build/services/ScriptsService.d.ts +3 -9
- package/build/services/ScriptsService.d.ts.map +1 -1
- package/build/services/TableService.types.d.ts +18 -1
- package/build/services/TableService.types.d.ts.map +1 -1
- package/build/services/TokenService.d.ts +8 -2
- package/build/services/TokenService.d.ts.map +1 -1
- package/build/services/TokenService.js +1 -1
- package/build/services/Trigger/TriggerDatasetResponses.types.d.ts +12 -6
- package/build/services/Trigger/TriggerDatasetResponses.types.d.ts.map +1 -1
- package/build/services/Trigger/TriggerDatasetResponses.types.js +3 -0
- package/build/services/Trigger/TriggerHistoryService.d.ts +19 -19
- package/build/services/Trigger/TriggerHistoryService.d.ts.map +1 -1
- package/build/services/Trigger/TriggerLastRun.types.d.ts +10 -14
- package/build/services/Trigger/TriggerLastRun.types.d.ts.map +1 -1
- package/build/services/Trigger/TriggerRefusalDetail.types.d.ts +12 -6
- package/build/services/Trigger/TriggerRefusalDetail.types.d.ts.map +1 -1
- package/build/services/UserService.d.ts +17 -9
- package/build/services/UserService.d.ts.map +1 -1
- package/build/types.d.ts +1 -126
- package/build/types.d.ts.map +1 -1
- package/build/types.js +2 -19
- package/package.json +3 -3
|
@@ -66,6 +66,8 @@ export type ResourceAccessReason = 'not_entitled' | 'entitlement_revoked' | 'sub
|
|
|
66
66
|
| 'script_version_mismatch'
|
|
67
67
|
/** AAD-1102, 502: the publisher's trigger failed. Show the server's `message`. */
|
|
68
68
|
| 'trigger_version_failed'
|
|
69
|
+
/** OPSS-hardening I, 502: the publisher's script failed. Only `details.exit_code` comes along. */
|
|
70
|
+
| 'script_failed'
|
|
69
71
|
/** AAD-1111, 503: another reader's refresh of a cached version is still running. Retry shortly. */
|
|
70
72
|
| 'payload_refreshing'
|
|
71
73
|
/**
|
|
@@ -78,6 +80,10 @@ export type ResourceAccessReason = 'not_entitled' | 'entitlement_revoked' | 'sub
|
|
|
78
80
|
export interface ResourceAccessError {
|
|
79
81
|
message: string;
|
|
80
82
|
reason: ResourceAccessReason;
|
|
83
|
+
/** Only on `script_failed`, and only when known. Never the script's message: that is the seller's code. */
|
|
84
|
+
details?: {
|
|
85
|
+
exit_code?: number;
|
|
86
|
+
};
|
|
81
87
|
}
|
|
82
88
|
/**
|
|
83
89
|
* Release state, independent of commercial state. Present when the publisher
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceEntitlements.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/resourceEntitlements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAEhE;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,oBAAoB,GAC1B,cAAc,GACd,qBAAqB,GACrB,sBAAsB,GACtB,+BAA+B;AACjC;;;;;GAKG;GACD,wBAAwB;AAC1B;;;;;;GAMG;GACD,aAAa,GACb,mBAAmB,GACnB,mBAAmB;AACrB;;;;;;;;;;;;;GAaG;GACD,6BAA6B;AAC/B,iFAAiF;GAC/E,yBAAyB;AAC3B,2FAA2F;GACzF,yBAAyB;AAC3B,kFAAkF;GAChF,wBAAwB;AAC1B,mGAAmG;GACjG,oBAAoB;AACtB;;;;GAIG;GACD,iCAAiC,CAAA;AAEvC,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"resourceEntitlements.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/resourceEntitlements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAEhE;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,oBAAoB,GAC1B,cAAc,GACd,qBAAqB,GACrB,sBAAsB,GACtB,+BAA+B;AACjC;;;;;GAKG;GACD,wBAAwB;AAC1B;;;;;;GAMG;GACD,aAAa,GACb,mBAAmB,GACnB,mBAAmB;AAC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CAAA;IAChB,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACzC;AAED,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACrE,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -4,6 +4,7 @@ export * from './types/app';
|
|
|
4
4
|
export * from './types/appCategories';
|
|
5
5
|
export * from './types/appChangelog';
|
|
6
6
|
export * from './types/appConfigStatus';
|
|
7
|
+
export * from './types/appDevices';
|
|
7
8
|
export * from './types/appList';
|
|
8
9
|
export * from './types/appManifest';
|
|
9
10
|
export * from './types/appMedia';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/AppService/types.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,eAAe,CAAA;AAC7B,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/AppService/types.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,eAAe,CAAA;AAC7B,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA"}
|
|
@@ -7,6 +7,7 @@ export * from './types/app';
|
|
|
7
7
|
export * from './types/appCategories';
|
|
8
8
|
export * from './types/appChangelog';
|
|
9
9
|
export * from './types/appConfigStatus';
|
|
10
|
+
export * from './types/appDevices';
|
|
10
11
|
export * from './types/appList';
|
|
11
12
|
export * from './types/appManifest';
|
|
12
13
|
export * from './types/appMedia';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AntHttpClient } from "../AntHttpClient";
|
|
2
|
+
export interface BroadcastingAuth {
|
|
3
|
+
/** `"<app key>:<signature>"` — sent verbatim as `auth` in the `pusher:subscribe` frame. */
|
|
4
|
+
auth: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BroadcastingService {
|
|
7
|
+
/** For raw Pusher/Reverb sockets (Script IDE debug console); the host's Echo authorises its own channels. */
|
|
8
|
+
auth: (socketId: string, channelName: string) => Promise<BroadcastingAuth>;
|
|
9
|
+
}
|
|
10
|
+
export declare function newBroadcastingService(client: AntHttpClient): BroadcastingService;
|
|
11
|
+
//# sourceMappingURL=BroadcastingService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BroadcastingService.d.ts","sourceRoot":"","sources":["../../src/services/BroadcastingService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAuB;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,6GAA6G;IAC7G,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAC3E;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,mBAAmB,CAUjF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function newBroadcastingService(client) {
|
|
2
|
+
return {
|
|
3
|
+
// `/api/broadcasting/auth`, not `/api/2.0/...`: the route lives outside the versioned API
|
|
4
|
+
// (see `authEndpointFor()` in ant-os echoService.ts), so the API root replaces the baseURL.
|
|
5
|
+
auth: (socketId, channelName) => client.post('/api/broadcasting/auth', { socket_id: socketId, channel_name: channelName }, { baseURL: client.getBaseUrl() }),
|
|
6
|
+
};
|
|
7
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { AntHttpClient } from "../AntHttpClient";
|
|
2
|
+
/**
|
|
3
|
+
* Paired devices (shop-floor tablets) and their station accounts, bearer-authenticated. Pairing and the device-cookie sign-in are /session/device calls the shell makes itself.
|
|
4
|
+
*/
|
|
5
|
+
/** What a device is told about itself. */
|
|
6
|
+
export interface DeviceSession {
|
|
7
|
+
name: string;
|
|
8
|
+
type: DeviceType;
|
|
9
|
+
license_id: string;
|
|
10
|
+
/** The ANT OS path the device opens after signing in, or null for the home page. */
|
|
11
|
+
launch_path: string | null;
|
|
12
|
+
expires_at: string;
|
|
13
|
+
/** The latest date the expiry can be extended to without pairing again. */
|
|
14
|
+
max_expires_at: string;
|
|
15
|
+
/** Within the warn window (or already expired). */
|
|
16
|
+
expires_soon: boolean;
|
|
17
|
+
warn_days: number;
|
|
18
|
+
}
|
|
19
|
+
/** What kind of device was paired; drives the icon in lists. */
|
|
20
|
+
export type DeviceType = 'tablet' | 'kiosk' | 'display' | 'handheld' | 'other';
|
|
21
|
+
export declare const DEVICE_TYPES: readonly DeviceType[];
|
|
22
|
+
/** expiring = inside the warn window; expired = inside the renewal grace (extending revives it); lapsed = past it, pair again. */
|
|
23
|
+
export type DeviceStatus = 'active' | 'expiring' | 'expired' | 'lapsed' | 'revoked' | 'pending';
|
|
24
|
+
export interface PairedDevice {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
type: DeviceType;
|
|
28
|
+
status: DeviceStatus;
|
|
29
|
+
account: {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string | null;
|
|
32
|
+
};
|
|
33
|
+
launch_path: string | null;
|
|
34
|
+
expires_at: string;
|
|
35
|
+
max_expires_at: string;
|
|
36
|
+
/** Last moment an expired device can still be extended without re-pairing. */
|
|
37
|
+
renewable_until: string;
|
|
38
|
+
paired_at: string | null;
|
|
39
|
+
last_seen_at: string | null;
|
|
40
|
+
last_seen_ip: string | null;
|
|
41
|
+
user_agent: string | null;
|
|
42
|
+
revoked_at: string | null;
|
|
43
|
+
created_at: string | null;
|
|
44
|
+
}
|
|
45
|
+
export interface DeviceAccount {
|
|
46
|
+
/** The station account's user id. */
|
|
47
|
+
id: string;
|
|
48
|
+
name: string | null;
|
|
49
|
+
/** The device it is currently paired to. */
|
|
50
|
+
device: PairedDevice | null;
|
|
51
|
+
created_at: string | null;
|
|
52
|
+
}
|
|
53
|
+
export interface DevicePairingRequest {
|
|
54
|
+
user_code: string;
|
|
55
|
+
user_agent: string | null;
|
|
56
|
+
requested_at: string;
|
|
57
|
+
expires_at: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ApproveDevicePairingBody {
|
|
60
|
+
account_id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
/** Defaults to tablet. */
|
|
63
|
+
type?: DeviceType;
|
|
64
|
+
/** An ANT OS address; a full URL is reduced to its path by the API. */
|
|
65
|
+
launch_path?: string | null;
|
|
66
|
+
expires_at?: string | null;
|
|
67
|
+
}
|
|
68
|
+
export interface UpdateDeviceBody {
|
|
69
|
+
name?: string;
|
|
70
|
+
type?: DeviceType;
|
|
71
|
+
launch_path?: string | null;
|
|
72
|
+
}
|
|
73
|
+
export interface DeviceService {
|
|
74
|
+
/** The device the current user signs in through; null for anyone who is not a station account. */
|
|
75
|
+
getCurrentDevice: (requestConfig?: Record<string, any>) => Promise<{
|
|
76
|
+
device: DeviceSession | null;
|
|
77
|
+
}>;
|
|
78
|
+
getDevices: (licenseId: string) => Promise<PairedDevice[]>;
|
|
79
|
+
updateDevice: (licenseId: string, deviceId: string, body: UpdateDeviceBody) => Promise<PairedDevice>;
|
|
80
|
+
extendDevice: (licenseId: string, deviceId: string, expiresAt: string) => Promise<PairedDevice>;
|
|
81
|
+
/** Revoke: the device stops working on its next request. */
|
|
82
|
+
revokeDevice: (licenseId: string, deviceId: string) => Promise<void>;
|
|
83
|
+
getPairingRequest: (licenseId: string, code: string, requestConfig?: Record<string, any>) => Promise<DevicePairingRequest>;
|
|
84
|
+
approvePairing: (licenseId: string, code: string, body: ApproveDevicePairingBody) => Promise<PairedDevice>;
|
|
85
|
+
getDeviceAccounts: (licenseId: string, requestConfig?: Record<string, any>) => Promise<DeviceAccount[]>;
|
|
86
|
+
createDeviceAccount: (licenseId: string, name: string) => Promise<DeviceAccount>;
|
|
87
|
+
renameDeviceAccount: (licenseId: string, accountId: string, name: string) => Promise<DeviceAccount>;
|
|
88
|
+
deleteDeviceAccount: (licenseId: string, accountId: string) => Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
/** A pairing code as the device shows it: upper case, `XXXX-XXXX`. */
|
|
91
|
+
export declare function normalizeDeviceCode(input: string): string;
|
|
92
|
+
/** Add `immersive=1` (no OS bar) to an ANT OS address unless it already decides it either way. */
|
|
93
|
+
export declare function withImmersive(path: string): string;
|
|
94
|
+
export declare function newDeviceService(client: AntHttpClient): DeviceService;
|
|
95
|
+
export default newDeviceService;
|
|
96
|
+
//# sourceMappingURL=DeviceService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceService.d.ts","sourceRoot":"","sources":["../../src/services/DeviceService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAuB;AAEpD;;GAEG;AAEH,0CAA0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,oFAAoF;IACpF,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAA;IACtB,mDAAmD;IACnD,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG,QAA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,GAAG,CAAC,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAC1H,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IAE1G,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;IACvG,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IAChF,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IACnG,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7E;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUlD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAwBrE;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const DEVICE_TYPES = ['tablet', 'kiosk', 'display', 'handheld', 'other'];
|
|
2
|
+
/** A pairing code as the device shows it: upper case, `XXXX-XXXX`. */
|
|
3
|
+
export function normalizeDeviceCode(input) {
|
|
4
|
+
const raw = input.toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 8);
|
|
5
|
+
return raw.length > 4 ? `${raw.slice(0, 4)}-${raw.slice(4)}` : raw;
|
|
6
|
+
}
|
|
7
|
+
/** Add `immersive=1` (no OS bar) to an ANT OS address unless it already decides it either way. */
|
|
8
|
+
export function withImmersive(path) {
|
|
9
|
+
if (!path || /[?&]immersive=/.test(path))
|
|
10
|
+
return path;
|
|
11
|
+
const hashAt = path.indexOf('#');
|
|
12
|
+
const beforeHash = hashAt === -1 ? path : path.slice(0, hashAt);
|
|
13
|
+
const hash = hashAt === -1 ? '' : path.slice(hashAt);
|
|
14
|
+
const separator = beforeHash.includes('?') ? '&' : '?';
|
|
15
|
+
return `${beforeHash}${separator}immersive=1${hash}`;
|
|
16
|
+
}
|
|
17
|
+
export function newDeviceService(client) {
|
|
18
|
+
const base = (licenseId) => `/licenses/${licenseId}/devices`;
|
|
19
|
+
// Codes are shown as `K7QF-M2XP`; the dash is cosmetic and the API accepts either.
|
|
20
|
+
const code = (value) => encodeURIComponent(value.trim());
|
|
21
|
+
return {
|
|
22
|
+
getCurrentDevice: async (requestConfig) => await client.get('/devices/current', requestConfig),
|
|
23
|
+
getDevices: async (licenseId) => await client.get(base(licenseId)),
|
|
24
|
+
updateDevice: async (licenseId, deviceId, body) => await client.put(`${base(licenseId)}/${deviceId}`, body),
|
|
25
|
+
extendDevice: async (licenseId, deviceId, expiresAt) => await client.post(`${base(licenseId)}/${deviceId}/extend`, { expires_at: expiresAt }),
|
|
26
|
+
revokeDevice: async (licenseId, deviceId) => await client.delete(`${base(licenseId)}/${deviceId}`),
|
|
27
|
+
getPairingRequest: async (licenseId, value, requestConfig) => await client.get(`${base(licenseId)}/pairings/${code(value)}`, requestConfig),
|
|
28
|
+
approvePairing: async (licenseId, value, body) => await client.post(`${base(licenseId)}/pairings/${code(value)}/approve`, body),
|
|
29
|
+
getDeviceAccounts: async (licenseId, requestConfig) => await client.get(`${base(licenseId)}/accounts`, requestConfig),
|
|
30
|
+
createDeviceAccount: async (licenseId, name) => await client.post(`${base(licenseId)}/accounts`, { name }),
|
|
31
|
+
renameDeviceAccount: async (licenseId, accountId, name) => await client.put(`${base(licenseId)}/accounts/${accountId}`, { name }),
|
|
32
|
+
deleteDeviceAccount: async (licenseId, accountId) => await client.delete(`${base(licenseId)}/accounts/${accountId}`),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export default newDeviceService;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LicenseUsersResponse } from './LicenseService';
|
|
2
|
+
/** Membership counts behind the Users tab's quick filters. */
|
|
3
|
+
export interface LicenseUsersSummary {
|
|
4
|
+
total: number;
|
|
5
|
+
active: number;
|
|
6
|
+
invited: number;
|
|
7
|
+
inactive: number;
|
|
8
|
+
devices: number;
|
|
9
|
+
/** Accounts of the license's domain that are not members; present only while license plans are enabled. */
|
|
10
|
+
company_people?: number;
|
|
11
|
+
}
|
|
12
|
+
/** A same-domain account that is not a member; add it with `addUser`. */
|
|
13
|
+
export interface LicenseCompanyPerson {
|
|
14
|
+
id: string;
|
|
15
|
+
firstname: string | null;
|
|
16
|
+
lastname: string | null;
|
|
17
|
+
name: string;
|
|
18
|
+
email: string;
|
|
19
|
+
/** False for an account invited elsewhere that never activated: follow `addUser` with `grantAccess` to send the invite. */
|
|
20
|
+
initialised: boolean;
|
|
21
|
+
created_at: string | null;
|
|
22
|
+
/** When they were last removed from this license; null when never a member. */
|
|
23
|
+
removed_at: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface LicenseCompanyPeopleQuery {
|
|
26
|
+
/** Matches email, first or last name. */
|
|
27
|
+
q?: string;
|
|
28
|
+
page?: number;
|
|
29
|
+
per_page?: number;
|
|
30
|
+
}
|
|
31
|
+
export type LicenseCompanyPeopleResponse = Omit<LicenseUsersResponse, 'data'> & {
|
|
32
|
+
data: LicenseCompanyPerson[];
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=LicenseCompanyPeople.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LicenseCompanyPeople.types.d.ts","sourceRoot":"","sources":["../../src/services/LicenseCompanyPeople.types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,2GAA2G;IAC3G,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,yEAAyE;AACzE,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,2HAA2H;IAC3H,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,+EAA+E;IAC/E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,yCAAyC;IACzC,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,oBAAoB,EAAE,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** The 403 body when a license guest sends a write (`LICENSE_GUEST_READ_ONLY`). */
|
|
2
|
+
export interface LicenseGuestReadOnlyError {
|
|
3
|
+
error: 'LICENSE_GUEST_READ_ONLY';
|
|
4
|
+
message: string;
|
|
5
|
+
details: {
|
|
6
|
+
/** Null when the write named no license at all */
|
|
7
|
+
license_id: string | null;
|
|
8
|
+
license_name: string | null;
|
|
9
|
+
member_type: 'guest';
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** True when an error response body is a `LicenseGuestReadOnlyError`. */
|
|
13
|
+
export declare function isLicenseGuestReadOnlyError(error: unknown): error is LicenseGuestReadOnlyError;
|
|
14
|
+
/** The 409 body when guest → user would add a billed sponsored seat and `confirm_paid_seat` was not sent. */
|
|
15
|
+
export interface PaidSeatConfirmationRequiredError {
|
|
16
|
+
error: 'PAID_SEAT_CONFIRMATION_REQUIRED';
|
|
17
|
+
message: string;
|
|
18
|
+
details: {
|
|
19
|
+
license_id: string;
|
|
20
|
+
user_id: string;
|
|
21
|
+
user_domain: string | null;
|
|
22
|
+
sponsored_seats: {
|
|
23
|
+
current: number;
|
|
24
|
+
after: number;
|
|
25
|
+
};
|
|
26
|
+
/** Filled once licenses are linked to resellers (AAD-1154) */
|
|
27
|
+
reseller: {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
} | null;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** True when an error response body is a `PaidSeatConfirmationRequiredError`. */
|
|
34
|
+
export declare function isPaidSeatConfirmationRequired(error: unknown): error is PaidSeatConfirmationRequiredError;
|
|
35
|
+
/** The 422 body when a membership rule refuses a change. */
|
|
36
|
+
export interface LicenseMemberRuleError {
|
|
37
|
+
error: 'GUEST_SAME_DOMAIN' | 'LICENSE_ADMIN_CANNOT_BE_GUEST' | 'GUEST_CANNOT_BE_ADMIN';
|
|
38
|
+
message: string;
|
|
39
|
+
}
|
|
40
|
+
/** True when an error response body is a `LicenseMemberRuleError`. */
|
|
41
|
+
export declare function isLicenseMemberRuleError(error: unknown): error is LicenseMemberRuleError;
|
|
42
|
+
//# sourceMappingURL=LicenseMemberErrors.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LicenseMemberErrors.types.d.ts","sourceRoot":"","sources":["../../src/services/LicenseMemberErrors.types.ts"],"names":[],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ecord = (value) => typeof value === 'object' && value !== null;
|
|
3
|
+
const isStringOrNull = (value) => value === null || typeof value === 'string';
|
|
4
|
+
// The guards below promise the fields callers read, not just the code
|
|
5
|
+
function isErrorBody(error, codes) {
|
|
6
|
+
return isRecord(error) && typeof error.error === 'string' && codes.has(error.error) && typeof error.message === 'string';
|
|
7
|
+
}
|
|
8
|
+
/** True when an error response body is a `LicenseGuestReadOnlyError`. */
|
|
9
|
+
export function isLicenseGuestReadOnlyError(error) {
|
|
10
|
+
if (!isErrorBody(error, new Set(['LICENSE_GUEST_READ_ONLY'])) || !isRecord(error.details))
|
|
11
|
+
return false;
|
|
12
|
+
const { license_id, license_name, member_type } = error.details;
|
|
13
|
+
return isStringOrNull(license_id) && isStringOrNull(license_name) && member_type === 'guest';
|
|
14
|
+
}
|
|
15
|
+
/** True when an error response body is a `PaidSeatConfirmationRequiredError`. */
|
|
16
|
+
export function isPaidSeatConfirmationRequired(error) {
|
|
17
|
+
if (!isErrorBody(error, new Set(['PAID_SEAT_CONFIRMATION_REQUIRED'])) || !isRecord(error.details))
|
|
18
|
+
return false;
|
|
19
|
+
const { license_id, user_id, sponsored_seats: seats } = error.details;
|
|
20
|
+
return typeof license_id === 'string' && typeof user_id === 'string'
|
|
21
|
+
&& isRecord(seats) && typeof seats.current === 'number' && typeof seats.after === 'number';
|
|
22
|
+
}
|
|
23
|
+
const LICENSE_MEMBER_RULE_ERRORS = new Set(['GUEST_SAME_DOMAIN', 'LICENSE_ADMIN_CANNOT_BE_GUEST', 'GUEST_CANNOT_BE_ADMIN']);
|
|
24
|
+
/** True when an error response body is a `LicenseMemberRuleError`. */
|
|
25
|
+
export function isLicenseMemberRuleError(error) {
|
|
26
|
+
return isErrorBody(error, LICENSE_MEMBER_RULE_ERRORS);
|
|
27
|
+
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import type { LabelFilterParams, ResourceLabel } from './LabelService';
|
|
2
|
+
import type { LicenseCompanyPeopleQuery, LicenseCompanyPeopleResponse, LicenseUsersSummary } from './LicenseCompanyPeople.types';
|
|
3
|
+
import type { LicenseEntitlements, LicenseMemberType, LicensePlan, LicensePlanLimits, SetMemberTypeData } from './LicenseService.types';
|
|
2
4
|
import type { Role } from './RBAC/RoleService';
|
|
5
|
+
import type { LicensePlanRequest, LicensePlanRequestStatus, LicenseResellerRef, RequestProData, UpgradeNudgeData } from './ResellerService.types';
|
|
3
6
|
import type { UserShort } from './UserService';
|
|
4
7
|
import type { MessageResponse } from "../AntConnect";
|
|
5
8
|
import type { AntHttpClient } from "../AntHttpClient";
|
|
6
9
|
import type { DataWrapper, ResourceLimitInfo } from "../types";
|
|
10
|
+
export type { LicenseUsersSummary } from './LicenseCompanyPeople.types';
|
|
7
11
|
export declare enum LicensePermission {
|
|
8
12
|
TRIGGERS_READ = "triggers.read",
|
|
9
13
|
TRIGGERS_CONFIGURE = "triggers.configure",
|
|
10
14
|
APPS_CONFIGURE = "apps.configure",
|
|
11
15
|
RBAC_CONFIGURE = "rbac.configure",
|
|
12
16
|
USERS_CONFIGURE = "users.configure",
|
|
17
|
+
DEVICES_CONFIGURE = "devices.configure",
|
|
13
18
|
TABLES_CONFIGURE = "tables.configure",
|
|
14
19
|
PROJECTS_CREATE = "projects.create",
|
|
15
20
|
PROJECTS_UPDATE = "projects.update",
|
|
@@ -27,6 +32,16 @@ export interface License {
|
|
|
27
32
|
is_admin: boolean;
|
|
28
33
|
name: string;
|
|
29
34
|
type: string;
|
|
35
|
+
/** Free or Pro (AAD-1146); present only while license plans are enabled. */
|
|
36
|
+
plan?: LicensePlan;
|
|
37
|
+
/** The company email domain the license claims (AAD-1150), null when none; present only while license plans are enabled. */
|
|
38
|
+
primary_domain?: string | null;
|
|
39
|
+
/** The reseller this license is linked to (AAD-1154); present only while license plans are enabled. */
|
|
40
|
+
reseller?: LicenseResellerRef | null;
|
|
41
|
+
/** Whether this license is an active reseller (AAD-1154); present only while license plans are enabled. */
|
|
42
|
+
is_reseller?: boolean;
|
|
43
|
+
/** When the reseller suspended access (AAD-1154), null while access is on; present only while license plans are enabled. */
|
|
44
|
+
access_revoked_at?: string | null;
|
|
30
45
|
company: string;
|
|
31
46
|
theme: string;
|
|
32
47
|
/** One or two letters for the license circle (AAD-1109). */
|
|
@@ -35,8 +50,6 @@ export interface License {
|
|
|
35
50
|
logo_dark_url?: string | null;
|
|
36
51
|
url: string;
|
|
37
52
|
readonly mfa_required: boolean;
|
|
38
|
-
node_base_url?: string;
|
|
39
|
-
node_api_url?: string;
|
|
40
53
|
user_roles?: Role[];
|
|
41
54
|
user_permissions?: LicensePermissionMap;
|
|
42
55
|
user_is_admin: boolean;
|
|
@@ -45,10 +58,13 @@ export interface License {
|
|
|
45
58
|
limits: LicenseLimits;
|
|
46
59
|
}
|
|
47
60
|
export interface InviteUserData {
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
/** Optional: the person sets their name on activation; ignored for an existing user. */
|
|
62
|
+
first_name?: string;
|
|
63
|
+
last_name?: string;
|
|
50
64
|
email: string;
|
|
51
65
|
mfa_required?: boolean;
|
|
66
|
+
/** user (default) or guest: read-only, free, other email domain only (AAD-1149) */
|
|
67
|
+
member_type?: LicenseMemberType;
|
|
52
68
|
}
|
|
53
69
|
export interface LicenseUsersResponse {
|
|
54
70
|
data: UserShort[];
|
|
@@ -109,20 +125,56 @@ export interface LicenseUserAccess {
|
|
|
109
125
|
license_roles: LicenseUserRoleDetail[];
|
|
110
126
|
projects: LicenseUserProjectAccess[];
|
|
111
127
|
}
|
|
128
|
+
/** Filters shared by the paginated user list and the users export. */
|
|
129
|
+
export interface LicenseUsersQuery {
|
|
130
|
+
q?: string;
|
|
131
|
+
type?: 'all' | 'name' | 'email' | 'role';
|
|
132
|
+
status?: 'active' | 'invited' | 'inactive';
|
|
133
|
+
role_id?: string;
|
|
134
|
+
date?: string | null;
|
|
135
|
+
/** Only members with no login in this many days, including those who never logged in. */
|
|
136
|
+
inactive_days?: number;
|
|
137
|
+
account_type?: 'user' | 'device';
|
|
138
|
+
/** Only guests or only users; ignored while license plans are off (AAD-1149). */
|
|
139
|
+
member_type?: LicenseMemberType;
|
|
140
|
+
sort?: string;
|
|
141
|
+
direction?: 'asc' | 'desc';
|
|
142
|
+
}
|
|
112
143
|
export interface LicenseService {
|
|
113
144
|
getLicenses: (params?: LicenseQueryParams) => Promise<License[]>;
|
|
114
145
|
getLicense: (licenseId: string, requestConfig?: Record<string, any>) => Promise<License>;
|
|
115
146
|
getLicensedUsers: (licenseId: string, params: any, requestConfig?: Record<string, any>) => Promise<LicenseUsersResponse>;
|
|
116
|
-
|
|
147
|
+
/** The invited member as the users list shows them, so a caller can append the row. */
|
|
148
|
+
addUser: (licenseId: string, user: InviteUserData) => Promise<{
|
|
149
|
+
user: UserShort;
|
|
150
|
+
}>;
|
|
117
151
|
removeUser: (licenseId: string, userId: string) => Promise<MessageResponse>;
|
|
118
152
|
grantAccess: (licenseId: string, userId: string, access?: boolean) => Promise<MessageResponse>;
|
|
119
153
|
set2faRequired: (licenseId: string, userId: string, mfa_required?: boolean) => Promise<MessageResponse>;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
access_token: string;
|
|
154
|
+
/** Make a member a user or a guest; a 409 `PaidSeatConfirmationRequiredError` asks for `confirm_paid_seat` (AAD-1149). */
|
|
155
|
+
setMemberType: (licenseId: string, userId: string, data: SetMemberTypeData) => Promise<{
|
|
156
|
+
user: UserShort;
|
|
124
157
|
}>;
|
|
158
|
+
getLicenseUserAccess: (licenseId: string, userId: string) => Promise<DataWrapper<LicenseUserAccess>>;
|
|
159
|
+
/** CSV of every member matching the filters, with license and project roles. */
|
|
160
|
+
exportUsers: (licenseId: string, params?: LicenseUsersQuery) => Promise<string>;
|
|
161
|
+
getUsersSummary: (licenseId: string) => Promise<LicenseUsersSummary>;
|
|
162
|
+
/** Accounts of the license's domain that are not members, newest first (AAD-1150). */
|
|
163
|
+
listCompanyPeople: (licenseId: string, query?: LicenseCompanyPeopleQuery) => Promise<LicenseCompanyPeopleResponse>;
|
|
125
164
|
update: (license: Partial<License>) => Promise<void>;
|
|
165
|
+
/** The configured limits of the Free and Pro plans; null = unlimited (AAD-1146). */
|
|
166
|
+
getPlans: () => Promise<LicensePlanLimits>;
|
|
167
|
+
/** The license's plan, every limit with its usage, and the seats held (AAD-1146). */
|
|
168
|
+
getEntitlements: (licenseId: string) => Promise<LicenseEntitlements>;
|
|
169
|
+
/** ANT staff only; a Free license requests Pro through its reseller instead. */
|
|
170
|
+
changePlan: (licenseId: string, plan: LicensePlan, reason?: string) => Promise<License>;
|
|
171
|
+
/** Ask a reseller to make a Free license Pro (AAD-1154); 409 while one is pending, 422 `LICENSE_NOT_FREE`. */
|
|
172
|
+
requestPro: (licenseId: string, data: RequestProData) => Promise<LicensePlanRequest>;
|
|
173
|
+
/** The license's Pro requests, newest first, the pending one included. */
|
|
174
|
+
listPlanRequests: (licenseId: string, status?: LicensePlanRequestStatus) => Promise<LicensePlanRequest[]>;
|
|
175
|
+
cancelPlanRequest: (requestId: string) => Promise<LicensePlanRequest>;
|
|
176
|
+
/** "Ask your admin": the admins are mailed once per member per license per day (429 after). */
|
|
177
|
+
nudgeAdmins: (licenseId: string, data?: UpgradeNudgeData) => Promise<void>;
|
|
126
178
|
}
|
|
127
179
|
export declare function newLicenseService(client: AntHttpClient): LicenseService;
|
|
128
180
|
export default LicenseService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LicenseService.d.ts","sourceRoot":"","sources":["../../src/services/LicenseService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAoB;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAuB;AACpD,OA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SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAEpE,gFAAgF;IAChF,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAEvF,8GAA8G;IAC9G,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACpF,0EAA0E;IAC1E,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAA;IACzG,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACrE,+FAA+F;IAC/F,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3E;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,cAAc,CAkCvE;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -6,6 +6,7 @@ export var LicensePermission;
|
|
|
6
6
|
LicensePermission["APPS_CONFIGURE"] = "apps.configure";
|
|
7
7
|
LicensePermission["RBAC_CONFIGURE"] = "rbac.configure";
|
|
8
8
|
LicensePermission["USERS_CONFIGURE"] = "users.configure";
|
|
9
|
+
LicensePermission["DEVICES_CONFIGURE"] = "devices.configure";
|
|
9
10
|
LicensePermission["TABLES_CONFIGURE"] = "tables.configure";
|
|
10
11
|
LicensePermission["PROJECTS_CREATE"] = "projects.create";
|
|
11
12
|
LicensePermission["PROJECTS_UPDATE"] = "projects.update";
|
|
@@ -22,9 +23,18 @@ export function newLicenseService(client) {
|
|
|
22
23
|
removeUser: (licenseId, userId) => client.delete(`/licenses/${licenseId}/users/${userId}`),
|
|
23
24
|
grantAccess: (licenseId, userId, access) => client.put(`/licenses/${licenseId}/users/${userId}`, { access }),
|
|
24
25
|
set2faRequired: (licenseId, userId, mfa_required) => client.put(`/licenses/${licenseId}/users/${userId}`, { mfa_required }),
|
|
26
|
+
setMemberType: (licenseId, userId, data) => client.put(`/licenses/${licenseId}/users/${userId}/member-type`, data),
|
|
25
27
|
getLicenseUserAccess: (licenseId, userId) => client.get(`/licenses/${licenseId}/users/${userId}`),
|
|
26
|
-
exportUsers: licenseId => client.get(`/licenses/${licenseId}/users/export
|
|
27
|
-
|
|
28
|
+
exportUsers: (licenseId, params) => client.get(`/licenses/${licenseId}/users/export`, { params, responseType: 'text' }),
|
|
29
|
+
getUsersSummary: licenseId => client.get(`/licenses/${licenseId}/users/summary`),
|
|
30
|
+
listCompanyPeople: (licenseId, query) => client.get(`/licenses/${licenseId}/company-people`, { params: query }),
|
|
28
31
|
update: license => client.put(`/licenses/${license.id}`, objectDelete(license, 'id')),
|
|
32
|
+
getPlans: () => client.get('/license-plans').then(r => r.data),
|
|
33
|
+
getEntitlements: licenseId => client.get(`/licenses/${licenseId}/entitlements`).then(r => r.data),
|
|
34
|
+
changePlan: (licenseId, plan, reason) => client.put(`/licenses/${licenseId}/plan`, { plan, reason }),
|
|
35
|
+
requestPro: (licenseId, data) => client.post(`/licenses/${licenseId}/plan-requests`, data).then(r => r.data),
|
|
36
|
+
listPlanRequests: (licenseId, status) => client.get(`/licenses/${licenseId}/plan-requests`, { params: { status } }).then(r => r.data),
|
|
37
|
+
cancelPlanRequest: requestId => client.post(`/plan-requests/${requestId}/cancel`).then(r => r.data),
|
|
38
|
+
nudgeAdmins: (licenseId, data = {}) => client.post(`/licenses/${licenseId}/upgrade-nudge`, data),
|
|
29
39
|
};
|
|
30
40
|
}
|