mp-request-handler-sdk 0.4.0 → 0.4.2
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/core/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { IAMRequest } from './requestHandler';
|
|
1
|
+
export { IAMRequest, type IAMActionMap, type TActionType, type TLoginChannels, type TRolePayloadObj, type IIAMResponse, type ICreateProjectUserPayload, type IUpdateProjectUserPayload, type TProjectUserListPayload, type TGetProjectUserDetailsPayload, type ICreateChannelPayload, type IRemoveChannelPayload, type IRegenerateCredPayload, type IManageProjectChannelsPayload, type ICreateAccessUserPayload, type IGetRelationPayload, type IUpdateRelationPayload, type TUserAccessListPayload, type TServiceAccountCreatePayload, type TGetApiUserPayload, type TUpdateApiUserPayload, type TGetQuotaPayload, type TGetGroupPayload, type TGroupCreatePayload, type TGroupUpdatePayload, type TGroupDetailsPayload, type TAddGroupMemberPayload, type TRemoveGroupMemberPayload, type TGetRolesPayload, type TGetRolePermissionsPayload, type IGetLabelValuesPayload, type IGetLabelValuesResponse, type IPermissionCheckPayload, type TEvaluateUnifiedResult, type IEvaluateFlagPayload, type IEvaluateFlagResponse, } from './requestHandler';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC7B,MAAM,kBAAkB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Core SDK functionality
|
|
2
|
-
export { IAMRequest } from './requestHandler';
|
|
2
|
+
export { IAMRequest, } from './requestHandler';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type TLoginChannels = 'userqr' | 'password' | 'phoneotp' | 'numchallenge';
|
|
2
|
-
type TRolePayloadObj = {
|
|
1
|
+
export type TLoginChannels = 'userqr' | 'password' | 'phoneotp' | 'numchallenge';
|
|
2
|
+
export type TRolePayloadObj = {
|
|
3
3
|
role: string;
|
|
4
4
|
role_namespace: string;
|
|
5
5
|
role_uuid: string;
|
|
@@ -16,7 +16,7 @@ export interface IIAMResponse {
|
|
|
16
16
|
error: null | string;
|
|
17
17
|
requestID: string;
|
|
18
18
|
}
|
|
19
|
-
interface ICreateProjectUserPayload {
|
|
19
|
+
export interface ICreateProjectUserPayload {
|
|
20
20
|
username: string;
|
|
21
21
|
display_name?: string;
|
|
22
22
|
channels: TLoginChannels[];
|
|
@@ -26,22 +26,22 @@ interface ICreateProjectUserPayload {
|
|
|
26
26
|
};
|
|
27
27
|
role?: string;
|
|
28
28
|
}
|
|
29
|
-
interface IUpdateProjectUserPayload {
|
|
29
|
+
export interface IUpdateProjectUserPayload {
|
|
30
30
|
user_code: string;
|
|
31
31
|
username?: string;
|
|
32
32
|
display_name?: string;
|
|
33
33
|
is_active?: boolean;
|
|
34
34
|
}
|
|
35
|
-
type TProjectUserListPayload = {
|
|
35
|
+
export type TProjectUserListPayload = {
|
|
36
36
|
page: number;
|
|
37
37
|
per_page: number;
|
|
38
38
|
search: string;
|
|
39
39
|
is_active: boolean | undefined;
|
|
40
40
|
};
|
|
41
|
-
type TGetProjectUserDetailsPayload = {
|
|
41
|
+
export type TGetProjectUserDetailsPayload = {
|
|
42
42
|
user_code: string;
|
|
43
43
|
};
|
|
44
|
-
interface ICreateChannelPayload {
|
|
44
|
+
export interface ICreateChannelPayload {
|
|
45
45
|
user_code: string;
|
|
46
46
|
channels: TLoginChannels[];
|
|
47
47
|
details: {
|
|
@@ -49,7 +49,7 @@ interface ICreateChannelPayload {
|
|
|
49
49
|
password?: string;
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
interface IRemoveChannelPayload {
|
|
52
|
+
export interface IRemoveChannelPayload {
|
|
53
53
|
user_code: string;
|
|
54
54
|
channels: string[];
|
|
55
55
|
details: {
|
|
@@ -57,13 +57,13 @@ interface IRemoveChannelPayload {
|
|
|
57
57
|
phone_number?: string;
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
interface IRegenerateCredPayload {
|
|
60
|
+
export interface IRegenerateCredPayload {
|
|
61
61
|
user_code: string;
|
|
62
62
|
channel_code: string;
|
|
63
63
|
whitelisted_ips?: string[];
|
|
64
64
|
expires_at?: string;
|
|
65
65
|
}
|
|
66
|
-
interface IManageProjectChannelsPayload {
|
|
66
|
+
export interface IManageProjectChannelsPayload {
|
|
67
67
|
userCode: string;
|
|
68
68
|
selectedChannels: TLoginChannels[];
|
|
69
69
|
originalChannels: TLoginChannels[];
|
|
@@ -73,7 +73,7 @@ interface IManageProjectChannelsPayload {
|
|
|
73
73
|
originalPhone?: string;
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
interface ICreateAccessUserPayload {
|
|
76
|
+
export interface ICreateAccessUserPayload {
|
|
77
77
|
resourceNamespace: string;
|
|
78
78
|
resource: string;
|
|
79
79
|
resourceType: string;
|
|
@@ -81,18 +81,13 @@ interface ICreateAccessUserPayload {
|
|
|
81
81
|
rolesUpdate?: TRolePayloadObj[];
|
|
82
82
|
rolesRemove?: TRolePayloadObj[];
|
|
83
83
|
principalName: string;
|
|
84
|
-
|
|
85
|
-
condition_uuid: any;
|
|
86
|
-
operator: string;
|
|
87
|
-
field: string;
|
|
88
|
-
value: string | string[];
|
|
89
|
-
}[];
|
|
84
|
+
principal: string;
|
|
90
85
|
}
|
|
91
|
-
interface IGetRelationPayload {
|
|
86
|
+
export interface IGetRelationPayload {
|
|
92
87
|
principal: string;
|
|
93
88
|
resource: string;
|
|
94
89
|
}
|
|
95
|
-
interface IUpdateRelationPayload {
|
|
90
|
+
export interface IUpdateRelationPayload {
|
|
96
91
|
resourceNamespace: string;
|
|
97
92
|
resource: string;
|
|
98
93
|
resourceType: string;
|
|
@@ -102,12 +97,12 @@ interface IUpdateRelationPayload {
|
|
|
102
97
|
principalName: string;
|
|
103
98
|
principal: string;
|
|
104
99
|
}
|
|
105
|
-
type TUserAccessListPayload = {
|
|
100
|
+
export type TUserAccessListPayload = {
|
|
106
101
|
search: string;
|
|
107
102
|
per_page: number;
|
|
108
103
|
page: number;
|
|
109
104
|
};
|
|
110
|
-
type TServiceAccountCreatePayload = {
|
|
105
|
+
export type TServiceAccountCreatePayload = {
|
|
111
106
|
username: string;
|
|
112
107
|
display_name?: string;
|
|
113
108
|
channels: ['apijwt'];
|
|
@@ -117,52 +112,52 @@ type TServiceAccountCreatePayload = {
|
|
|
117
112
|
expires_at?: string;
|
|
118
113
|
};
|
|
119
114
|
};
|
|
120
|
-
type TGetApiUserPayload = {
|
|
115
|
+
export type TGetApiUserPayload = {
|
|
121
116
|
user_code: string;
|
|
122
117
|
};
|
|
123
|
-
type TUpdateApiUserPayload = {
|
|
118
|
+
export type TUpdateApiUserPayload = {
|
|
124
119
|
user_code: string;
|
|
125
120
|
display_name: string;
|
|
126
121
|
is_active: boolean;
|
|
127
122
|
};
|
|
128
|
-
type TGetQuotaPayload = Record<string, unknown>;
|
|
129
|
-
type TGetGroupPayload = {
|
|
123
|
+
export type TGetQuotaPayload = Record<string, unknown>;
|
|
124
|
+
export type TGetGroupPayload = {
|
|
130
125
|
search: string;
|
|
131
126
|
page: number;
|
|
132
127
|
limit: number;
|
|
133
128
|
};
|
|
134
|
-
type TGroupCreatePayload = {
|
|
129
|
+
export type TGroupCreatePayload = {
|
|
135
130
|
groupName: string;
|
|
136
131
|
};
|
|
137
|
-
type TGroupUpdatePayload = {
|
|
132
|
+
export type TGroupUpdatePayload = {
|
|
138
133
|
groupCode: string;
|
|
139
134
|
groupName?: string;
|
|
140
135
|
isActive: boolean;
|
|
141
136
|
};
|
|
142
|
-
type TGroupDetailsPayload = {
|
|
137
|
+
export type TGroupDetailsPayload = {
|
|
143
138
|
groupCode: string;
|
|
144
139
|
};
|
|
145
|
-
type TAddGroupMemberPayload = {
|
|
140
|
+
export type TAddGroupMemberPayload = {
|
|
146
141
|
groupCode: string;
|
|
147
142
|
member_name: string;
|
|
148
143
|
};
|
|
149
|
-
type TRemoveGroupMemberPayload = {
|
|
144
|
+
export type TRemoveGroupMemberPayload = {
|
|
150
145
|
groupCode: string;
|
|
151
146
|
members: string[];
|
|
152
147
|
};
|
|
153
|
-
type TGetRolesPayload = {
|
|
148
|
+
export type TGetRolesPayload = {
|
|
154
149
|
namespace_code?: string;
|
|
155
150
|
search?: string;
|
|
156
151
|
page?: number;
|
|
157
152
|
per_page?: number;
|
|
158
153
|
};
|
|
159
|
-
type TGetRolePermissionsPayload = {
|
|
154
|
+
export type TGetRolePermissionsPayload = {
|
|
160
155
|
role_uuid: string;
|
|
161
156
|
page: number;
|
|
162
157
|
per_page: number;
|
|
163
158
|
search: string;
|
|
164
159
|
};
|
|
165
|
-
interface IGetLabelValuesPayload {
|
|
160
|
+
export interface IGetLabelValuesPayload {
|
|
166
161
|
keys: string[];
|
|
167
162
|
}
|
|
168
163
|
export interface IGetLabelValuesResponse {
|
|
@@ -173,7 +168,23 @@ export interface IGetLabelValuesResponse {
|
|
|
173
168
|
value: boolean | null;
|
|
174
169
|
}[];
|
|
175
170
|
}
|
|
176
|
-
interface
|
|
171
|
+
export interface IPermissionCheckPayload {
|
|
172
|
+
permissions: string[];
|
|
173
|
+
}
|
|
174
|
+
export type TEvaluateUnifiedResult = {
|
|
175
|
+
value: boolean | string | null;
|
|
176
|
+
payload: Record<string, unknown> | null;
|
|
177
|
+
reason: string;
|
|
178
|
+
};
|
|
179
|
+
export interface IEvaluateFlagPayload {
|
|
180
|
+
flagKey: string;
|
|
181
|
+
properties?: Record<string, unknown>;
|
|
182
|
+
}
|
|
183
|
+
export interface IEvaluateFlagResponse {
|
|
184
|
+
result: TEvaluateUnifiedResult;
|
|
185
|
+
error: string | null;
|
|
186
|
+
}
|
|
187
|
+
export interface IAMActionMap {
|
|
177
188
|
createProjectUser: ICreateProjectUserPayload;
|
|
178
189
|
updateProjectUser: IUpdateProjectUserPayload;
|
|
179
190
|
getProjectUserList: TProjectUserListPayload;
|
|
@@ -201,7 +212,10 @@ interface IAMActionMap {
|
|
|
201
212
|
getRelation: IGetRelationPayload;
|
|
202
213
|
updateRelation: IUpdateRelationPayload;
|
|
203
214
|
getLabelValues: IGetLabelValuesPayload;
|
|
215
|
+
permissionCheck: IPermissionCheckPayload;
|
|
216
|
+
getFlag: IEvaluateFlagPayload;
|
|
204
217
|
}
|
|
218
|
+
export type TActionType = keyof IAMActionMap;
|
|
205
219
|
declare global {
|
|
206
220
|
interface Window {
|
|
207
221
|
IAMRequest?: (actiontype: string, payload: any, requestID: string, project?: string) => void;
|
|
@@ -256,6 +270,12 @@ declare global {
|
|
|
256
270
|
* - **Label Values Actions:**
|
|
257
271
|
* - `getLabelValues` - Get label values for specified keys
|
|
258
272
|
*
|
|
273
|
+
* - **Permission Check Actions:**
|
|
274
|
+
* - `permissionCheck` - Test whether the current user has the given permissions
|
|
275
|
+
*
|
|
276
|
+
* - **Feature Flag Actions:**
|
|
277
|
+
* - `getFlag` - Evaluate a feature flag for the current project context
|
|
278
|
+
*
|
|
259
279
|
* @param payload - The payload specific to the action type. TypeScript will autocomplete the correct structure based on your selected action.
|
|
260
280
|
*
|
|
261
281
|
* @param project - Optional project code (e.g., 'PRJ1455'). When provided, will be added to request headers.
|
|
@@ -318,6 +338,21 @@ declare global {
|
|
|
318
338
|
* }, 'PRJ1455');
|
|
319
339
|
* ```
|
|
320
340
|
*
|
|
341
|
+
* @example Checking permissions
|
|
342
|
+
* ```typescript
|
|
343
|
+
* const result = await IAMRequest('permissionCheck', {
|
|
344
|
+
* permissions: ['platform.project.viewer']
|
|
345
|
+
* }, 'PRJ1455');
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* @example Evaluating a feature flag
|
|
349
|
+
* ```typescript
|
|
350
|
+
* const result = await IAMRequest('getFlag', {
|
|
351
|
+
* flagKey: 'my_feature_flag',
|
|
352
|
+
* properties: { country: 'ae' }
|
|
353
|
+
* }, 'PRJ1455');
|
|
354
|
+
* ```
|
|
355
|
+
*
|
|
321
356
|
* @see Partner Platform documentation: https://docs.noon.partners
|
|
322
357
|
* @see For detailed payload structures, TypeScript autocomplete will guide you based on your selected action
|
|
323
358
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandler.d.ts","sourceRoot":"","sources":["../../src/core/requestHandler.ts"],"names":[],"mappings":"AAOA,
|
|
1
|
+
{"version":3,"file":"requestHandler.d.ts","sourceRoot":"","sources":["../../src/core/requestHandler.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,UAAU,GA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B,EAAE,wBAAwB,CAAC;IAC3C,WAAW,EAAE,mBAAmB,CAAC;IACjC,cAAc,EAAE,sBAAsB,CAAC;IAGvC,cAAc,EAAE,sBAAsB,CAAC;IAGvC,eAAe,EAAE,uBAAuB,CAAC;IAGzC,OAAO,EAAE,oBAAoB,CAAC;CACjC;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC;AAI7C,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;KAChG;CACJ;AAwFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsIG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,YAAY,EACnD,YAAY,CAAC,EACb,SAAS,YAAY,CAAC,CAAC,CAAC,EACxB,UAAU,MAAM,KACjB,OAAO,CAAC,OAAO,CAA4D,CAAC;AAE/E,eAAe,UAAU,CAAC"}
|
|
@@ -123,6 +123,12 @@ const iamRequestHandler = new IAMRequestHandler();
|
|
|
123
123
|
* - **Label Values Actions:**
|
|
124
124
|
* - `getLabelValues` - Get label values for specified keys
|
|
125
125
|
*
|
|
126
|
+
* - **Permission Check Actions:**
|
|
127
|
+
* - `permissionCheck` - Test whether the current user has the given permissions
|
|
128
|
+
*
|
|
129
|
+
* - **Feature Flag Actions:**
|
|
130
|
+
* - `getFlag` - Evaluate a feature flag for the current project context
|
|
131
|
+
*
|
|
126
132
|
* @param payload - The payload specific to the action type. TypeScript will autocomplete the correct structure based on your selected action.
|
|
127
133
|
*
|
|
128
134
|
* @param project - Optional project code (e.g., 'PRJ1455'). When provided, will be added to request headers.
|
|
@@ -185,6 +191,21 @@ const iamRequestHandler = new IAMRequestHandler();
|
|
|
185
191
|
* }, 'PRJ1455');
|
|
186
192
|
* ```
|
|
187
193
|
*
|
|
194
|
+
* @example Checking permissions
|
|
195
|
+
* ```typescript
|
|
196
|
+
* const result = await IAMRequest('permissionCheck', {
|
|
197
|
+
* permissions: ['platform.project.viewer']
|
|
198
|
+
* }, 'PRJ1455');
|
|
199
|
+
* ```
|
|
200
|
+
*
|
|
201
|
+
* @example Evaluating a feature flag
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const result = await IAMRequest('getFlag', {
|
|
204
|
+
* flagKey: 'my_feature_flag',
|
|
205
|
+
* properties: { country: 'ae' }
|
|
206
|
+
* }, 'PRJ1455');
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
188
209
|
* @see Partner Platform documentation: https://docs.noon.partners
|
|
189
210
|
* @see For detailed payload structures, TypeScript autocomplete will guide you based on your selected action
|
|
190
211
|
*/
|