@compassdigital/sdk.typescript 3.3.0 → 3.5.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/lib/index.d.ts +182 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +214 -0
- package/lib/index.js.map +1 -1
- package/lib/interface/compassconnect.d.ts +36 -0
- package/lib/interface/compassconnect.d.ts.map +1 -0
- package/lib/interface/compassconnect.js +4 -0
- package/lib/interface/compassconnect.js.map +1 -0
- package/lib/interface/kds.d.ts +8 -0
- package/lib/interface/kds.d.ts.map +1 -1
- package/lib/interface/permission.d.ts +137 -0
- package/lib/interface/permission.d.ts.map +1 -0
- package/lib/interface/permission.js +4 -0
- package/lib/interface/permission.js.map +1 -0
- package/lib/interface/sms.d.ts +1 -0
- package/lib/interface/sms.d.ts.map +1 -0
- package/lib/interface/sms.js +3 -0
- package/lib/interface/sms.js.map +1 -0
- package/lib/interface/vendor.d.ts +150 -0
- package/lib/interface/vendor.d.ts.map +1 -0
- package/lib/interface/vendor.js +4 -0
- package/lib/interface/vendor.js.map +1 -0
- package/manifest.json +20 -4
- package/package.json +1 -1
- package/src/index.ts +456 -0
- package/src/interface/compassconnect.ts +50 -0
- package/src/interface/kds.ts +15 -0
- package/src/interface/permission.ts +233 -0
- package/src/interface/sms.ts +1 -0
- package/src/interface/vendor.ts +244 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
|
|
2
|
+
|
|
3
|
+
export interface Success {
|
|
4
|
+
success?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Error {
|
|
8
|
+
message?: string;
|
|
9
|
+
code?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface PermissionBody {
|
|
13
|
+
recipient_id?: string;
|
|
14
|
+
// The organization or domain to which this role belongs
|
|
15
|
+
domain: string;
|
|
16
|
+
// The object type we give permission to
|
|
17
|
+
object: string;
|
|
18
|
+
// The action we allow to happen.
|
|
19
|
+
action: string;
|
|
20
|
+
// The relationship link to the resource. If not passed *:RECIPIENT_USER_ID is used
|
|
21
|
+
link?: string;
|
|
22
|
+
// Properties that are allowed in permission. If not allowed should be prefixed with !.
|
|
23
|
+
properties?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Permission {
|
|
27
|
+
// permission
|
|
28
|
+
id?: string;
|
|
29
|
+
recipient_id?: string;
|
|
30
|
+
// The organization or domain to which this role belongs
|
|
31
|
+
domain: string;
|
|
32
|
+
// The object type we give permission to
|
|
33
|
+
object: string;
|
|
34
|
+
// The action we allow to happen.
|
|
35
|
+
action: string;
|
|
36
|
+
// The relationship link to the resource
|
|
37
|
+
link?: string;
|
|
38
|
+
// Properties that are allowed in permission. If not allowed should be prefixed with !.
|
|
39
|
+
properties?: string;
|
|
40
|
+
last_updated_by?: string;
|
|
41
|
+
date_created?: string;
|
|
42
|
+
date_modified?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface Permissions {
|
|
46
|
+
permissions: Permission[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface Role {
|
|
50
|
+
// role
|
|
51
|
+
id: string;
|
|
52
|
+
// Role Name
|
|
53
|
+
name: string;
|
|
54
|
+
// The status of whether the role is in use or not
|
|
55
|
+
status: string;
|
|
56
|
+
// The organization or domain to which this role belongs
|
|
57
|
+
domain: string;
|
|
58
|
+
// The description of the role
|
|
59
|
+
description?: string;
|
|
60
|
+
last_updated_by?: string;
|
|
61
|
+
date_created?: string;
|
|
62
|
+
date_modified?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface RoleBody {
|
|
66
|
+
// Role Name
|
|
67
|
+
name: string;
|
|
68
|
+
// The status of whether the role is in use or not
|
|
69
|
+
status?: string;
|
|
70
|
+
// The organization or domain to which this role belongs
|
|
71
|
+
domain: string;
|
|
72
|
+
// The description of the role
|
|
73
|
+
description?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface RolePatchBody {
|
|
77
|
+
// Role Name
|
|
78
|
+
name?: string;
|
|
79
|
+
// The status of whether the role is in use or not
|
|
80
|
+
status?: string;
|
|
81
|
+
// The description of the role
|
|
82
|
+
description?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface RoleAssignmentBody {
|
|
86
|
+
// role
|
|
87
|
+
role_id: string;
|
|
88
|
+
recipient_id: string;
|
|
89
|
+
meta?: any;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface RoleAssignment {
|
|
93
|
+
// role_assignment
|
|
94
|
+
id: string;
|
|
95
|
+
// role
|
|
96
|
+
role_id: string;
|
|
97
|
+
recipient_id: string;
|
|
98
|
+
meta?: any;
|
|
99
|
+
last_updated_by?: string;
|
|
100
|
+
date_created?: string;
|
|
101
|
+
date_modified?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface RoleAssignments {
|
|
105
|
+
role_assignments: RoleAssignment[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface Roles {
|
|
109
|
+
roles: Role[];
|
|
110
|
+
last_key?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// POST /permission - Creates a new permission for a role or a user
|
|
114
|
+
|
|
115
|
+
export type PostPermissionBody = PermissionBody;
|
|
116
|
+
|
|
117
|
+
export type PostPermissionResponse = Permission;
|
|
118
|
+
|
|
119
|
+
export interface PostPermissionRequest {
|
|
120
|
+
body: PostPermissionBody;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// DELETE /permission/{id} - Delete a permission from a role or a user
|
|
124
|
+
|
|
125
|
+
export interface DeletePermissionPath {
|
|
126
|
+
// permission
|
|
127
|
+
id: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export type DeletePermissionResponse = Success;
|
|
131
|
+
|
|
132
|
+
export interface DeletePermissionRequest extends DeletePermissionPath {}
|
|
133
|
+
|
|
134
|
+
// GET /permission/role - Get Roles, with pagination and filters
|
|
135
|
+
|
|
136
|
+
export interface GetPermissionRoleQuery {
|
|
137
|
+
// Filter roles by their domain
|
|
138
|
+
domain: string;
|
|
139
|
+
// Filter roles by their status.
|
|
140
|
+
status?: string;
|
|
141
|
+
// Key for pagination, retrieves the next page of items
|
|
142
|
+
start_at?: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type GetPermissionRoleResponse = Roles;
|
|
146
|
+
|
|
147
|
+
export interface GetPermissionRoleRequest extends GetPermissionRoleQuery {}
|
|
148
|
+
|
|
149
|
+
// POST /permission/role - Create a new role
|
|
150
|
+
|
|
151
|
+
export type PostPermissionRoleBody = RoleBody;
|
|
152
|
+
|
|
153
|
+
export type PostPermissionRoleResponse = Role;
|
|
154
|
+
|
|
155
|
+
export interface PostPermissionRoleRequest {
|
|
156
|
+
body: PostPermissionRoleBody;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// PATCH /permission/role/{id} - Update a role
|
|
160
|
+
|
|
161
|
+
export interface PatchPermissionRolePath {
|
|
162
|
+
// role
|
|
163
|
+
id: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export type PatchPermissionRoleBody = RolePatchBody;
|
|
167
|
+
|
|
168
|
+
export type PatchPermissionRoleResponse = Role;
|
|
169
|
+
|
|
170
|
+
export interface PatchPermissionRoleRequest extends PatchPermissionRolePath {
|
|
171
|
+
body: PatchPermissionRoleBody;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// GET /permission/recipient/{recipient_id} - Get permissions for a recipient(role or user id)
|
|
175
|
+
|
|
176
|
+
export interface GetPermissionRecipientPath {
|
|
177
|
+
// CDL Id of a recipient
|
|
178
|
+
recipient: string;
|
|
179
|
+
// TODO: add parameter to swagger.json
|
|
180
|
+
recipient_id: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface GetPermissionRecipientQuery {
|
|
184
|
+
// Show additional meta fields
|
|
185
|
+
extended?: boolean;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export type GetPermissionRecipientResponse = Permissions;
|
|
189
|
+
|
|
190
|
+
export interface GetPermissionRecipientRequest
|
|
191
|
+
extends GetPermissionRecipientQuery,
|
|
192
|
+
GetPermissionRecipientPath {}
|
|
193
|
+
|
|
194
|
+
// GET /permission/role/user/{user_id} - Get a list of role assignments for a user
|
|
195
|
+
|
|
196
|
+
export interface GetPermissionRoleUserPath {
|
|
197
|
+
// Id of a user
|
|
198
|
+
user_id: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export type GetPermissionRoleUserResponse = RoleAssignments;
|
|
202
|
+
|
|
203
|
+
export interface GetPermissionRoleUserRequest extends GetPermissionRoleUserPath {}
|
|
204
|
+
|
|
205
|
+
// POST /permission/role/user/{user_id} - Assign a role to a user
|
|
206
|
+
|
|
207
|
+
export interface PostPermissionRoleUserPath {
|
|
208
|
+
// Id of a user
|
|
209
|
+
user_id: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export type PostPermissionRoleUserBody = RoleAssignmentBody;
|
|
213
|
+
|
|
214
|
+
export type PostPermissionRoleUserResponse = RoleAssignment;
|
|
215
|
+
|
|
216
|
+
export interface PostPermissionRoleUserRequest extends PostPermissionRoleUserPath {
|
|
217
|
+
body: PostPermissionRoleUserBody;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// DELETE /permission/role/user/{user_id} - Remove a role from a user
|
|
221
|
+
|
|
222
|
+
export interface DeletePermissionRoleUserPath {
|
|
223
|
+
// Id of a user
|
|
224
|
+
user_id: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export type DeletePermissionRoleUserBody = RoleAssignment;
|
|
228
|
+
|
|
229
|
+
export type DeletePermissionRoleUserResponse = Success;
|
|
230
|
+
|
|
231
|
+
export interface DeletePermissionRoleUserRequest extends DeletePermissionRoleUserPath {
|
|
232
|
+
body: DeletePermissionRoleUserBody;
|
|
233
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
|
|
2
|
+
|
|
3
|
+
export interface Error {
|
|
4
|
+
message?: string;
|
|
5
|
+
code?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Vendor {
|
|
9
|
+
// vendor
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
email?: string;
|
|
14
|
+
phone?: string;
|
|
15
|
+
// Property to store any additional data
|
|
16
|
+
meta?: {
|
|
17
|
+
legacy_token?: {
|
|
18
|
+
dev?: string;
|
|
19
|
+
staging?: string;
|
|
20
|
+
v1?: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
domain?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface VendorPostBody {
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
email: string;
|
|
30
|
+
domain?: string;
|
|
31
|
+
phone?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Vendors {
|
|
35
|
+
vendors: Vendor[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Key {
|
|
39
|
+
// key
|
|
40
|
+
id: string;
|
|
41
|
+
date_created?: string;
|
|
42
|
+
date_modified?: string;
|
|
43
|
+
// Unique client id for this key. Will remain same on rotation
|
|
44
|
+
client_id?: string;
|
|
45
|
+
// Unique password for this key.
|
|
46
|
+
client_password?: string;
|
|
47
|
+
// Date the key becomes expired
|
|
48
|
+
date_expires?: string;
|
|
49
|
+
environment?: string;
|
|
50
|
+
permissions?: string[];
|
|
51
|
+
// Flag identifying if the key is latest
|
|
52
|
+
active?: boolean;
|
|
53
|
+
domain?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface KeyPostBody {
|
|
57
|
+
// vendor
|
|
58
|
+
vendor_id: string;
|
|
59
|
+
// Date the key becomes expired
|
|
60
|
+
date_expires: string;
|
|
61
|
+
environment: string;
|
|
62
|
+
permissions: string[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface KeyPatchBody {
|
|
66
|
+
// Date the key becomes expired
|
|
67
|
+
date_expires?: string;
|
|
68
|
+
permissions?: string[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface Keys {
|
|
72
|
+
keys: Key[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface Success {
|
|
76
|
+
success?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface Auth {
|
|
80
|
+
access: {
|
|
81
|
+
token?: string;
|
|
82
|
+
expires?: string;
|
|
83
|
+
};
|
|
84
|
+
refresh: {
|
|
85
|
+
token?: string;
|
|
86
|
+
expires?: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface RefreshPayload {
|
|
91
|
+
access_token: string;
|
|
92
|
+
refresh_token: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// POST /vendor - Create new vendor
|
|
96
|
+
|
|
97
|
+
export type PostVendorBody = VendorPostBody;
|
|
98
|
+
|
|
99
|
+
export type PostVendorResponse = Vendor;
|
|
100
|
+
|
|
101
|
+
export interface PostVendorRequest {
|
|
102
|
+
body: PostVendorBody;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// GET /vendor - Get all Vendors
|
|
106
|
+
|
|
107
|
+
export type GetVendorsResponse = Vendors;
|
|
108
|
+
|
|
109
|
+
export type GetVendorsRequest = {};
|
|
110
|
+
|
|
111
|
+
// GET /vendor/{id} - Get info about the Vendor
|
|
112
|
+
|
|
113
|
+
export interface GetVendorPath {
|
|
114
|
+
// vendor
|
|
115
|
+
id: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type GetVendorResponse = Vendor;
|
|
119
|
+
|
|
120
|
+
export interface GetVendorRequest extends GetVendorPath {}
|
|
121
|
+
|
|
122
|
+
// PATCH /vendor/{id} - Update info about the Vendor
|
|
123
|
+
|
|
124
|
+
export interface PatchVendorPath {
|
|
125
|
+
// vendor
|
|
126
|
+
id: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export type PatchVendorBody = Vendor;
|
|
130
|
+
|
|
131
|
+
export type PatchVendorResponse = Vendor;
|
|
132
|
+
|
|
133
|
+
export interface PatchVendorRequest extends PatchVendorPath {
|
|
134
|
+
body: PatchVendorBody;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// GET /vendor/auth - Get access/refresh tokens for accessing our APIs
|
|
138
|
+
|
|
139
|
+
export type GetVendorAuthResponse = Auth;
|
|
140
|
+
|
|
141
|
+
export type GetVendorAuthRequest = {};
|
|
142
|
+
|
|
143
|
+
// POST /vendor/auth - Get new access token using refresh token and previous token
|
|
144
|
+
|
|
145
|
+
export type PostVendorAuthBody = RefreshPayload;
|
|
146
|
+
|
|
147
|
+
export type PostVendorAuthResponse = Auth;
|
|
148
|
+
|
|
149
|
+
export interface PostVendorAuthRequest {
|
|
150
|
+
body: PostVendorAuthBody;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// GET /vendor/{id}/key - Get list of Vendor keys
|
|
154
|
+
|
|
155
|
+
export interface GetVendorKeysPath {
|
|
156
|
+
// vendor
|
|
157
|
+
id: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export type GetVendorKeysResponse = Keys;
|
|
161
|
+
|
|
162
|
+
export interface GetVendorKeysRequest extends GetVendorKeysPath {}
|
|
163
|
+
|
|
164
|
+
// POST /vendor/{id}/key - Create new key for the vendor
|
|
165
|
+
|
|
166
|
+
export interface PostVendorKeyPath {
|
|
167
|
+
// vendor
|
|
168
|
+
id: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type PostVendorKeyBody = KeyPostBody;
|
|
172
|
+
|
|
173
|
+
export type PostVendorKeyResponse = Key;
|
|
174
|
+
|
|
175
|
+
export interface PostVendorKeyRequest extends PostVendorKeyPath {
|
|
176
|
+
body: PostVendorKeyBody;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// GET /vendor/{id}/key/{key} - Get info about vendor key
|
|
180
|
+
|
|
181
|
+
export interface GetVendorKeyPath {
|
|
182
|
+
// vendor
|
|
183
|
+
id: string;
|
|
184
|
+
// key
|
|
185
|
+
key: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface GetVendorKeyQuery {
|
|
189
|
+
// Pagination token to start query from
|
|
190
|
+
last_evaluated_key?: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export type GetVendorKeyResponse = Key;
|
|
194
|
+
|
|
195
|
+
export interface GetVendorKeyRequest extends GetVendorKeyQuery, GetVendorKeyPath {}
|
|
196
|
+
|
|
197
|
+
// PATCH /vendor/{id}/key/{key} - Update info for vendor key
|
|
198
|
+
|
|
199
|
+
export interface PatchVendorKeyPath {
|
|
200
|
+
// vendor
|
|
201
|
+
id: string;
|
|
202
|
+
// key
|
|
203
|
+
key: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type PatchVendorKeyBody = KeyPatchBody;
|
|
207
|
+
|
|
208
|
+
export type PatchVendorKeyResponse = Key;
|
|
209
|
+
|
|
210
|
+
export interface PatchVendorKeyRequest extends PatchVendorKeyPath {
|
|
211
|
+
body: PatchVendorKeyBody;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// DELETE /vendor/{id}/key/{key} - Mark key as expired
|
|
215
|
+
|
|
216
|
+
export interface DeleteVendorKeyPath {
|
|
217
|
+
// vendor
|
|
218
|
+
id: string;
|
|
219
|
+
// key
|
|
220
|
+
key: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export type DeleteVendorKeyResponse = Key;
|
|
224
|
+
|
|
225
|
+
export interface DeleteVendorKeyRequest extends DeleteVendorKeyPath {}
|
|
226
|
+
|
|
227
|
+
// POST /vendor/{id}/key/{key}/rotate - Rotate vendor key
|
|
228
|
+
|
|
229
|
+
export interface PostVendorKeyRotatePath {
|
|
230
|
+
// vendor
|
|
231
|
+
id: string;
|
|
232
|
+
// key
|
|
233
|
+
key: string;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface PostVendorKeyRotateQuery {
|
|
237
|
+
date_expires?: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export type PostVendorKeyRotateResponse = Success;
|
|
241
|
+
|
|
242
|
+
export interface PostVendorKeyRotateRequest
|
|
243
|
+
extends PostVendorKeyRotateQuery,
|
|
244
|
+
PostVendorKeyRotatePath {}
|