@qlik/api 0.0.9 → 0.0.10
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/api-keys.d.mts +9 -0
- package/api-keys.d.ts +9 -0
- package/api-keys.js +10 -10
- package/api-keys.mjs +2 -2
- package/apps.d.mts +125 -1
- package/apps.d.ts +125 -1
- package/apps.js +46 -46
- package/apps.mjs +2 -2
- package/audits.d.mts +13 -0
- package/audits.d.ts +13 -0
- package/audits.js +9 -9
- package/audits.mjs +2 -2
- package/auth.js +3 -3
- package/auth.mjs +2 -2
- package/automations.d.mts +8 -0
- package/automations.d.ts +8 -0
- package/automations.js +21 -21
- package/automations.mjs +2 -2
- package/brands.d.mts +15 -0
- package/brands.d.ts +15 -0
- package/brands.js +15 -15
- package/brands.mjs +2 -2
- package/chunks/{YDB23Q56.mjs → 34FMVD4C.mjs} +164 -20
- package/chunks/{PQ4OWSWX.js → 37PLWNAN.js} +44 -56
- package/chunks/{AULTUQC4.js → 3MHXEHLQ.js} +2 -2
- package/chunks/{AU62SBT4.mjs → 42LZKDDD.mjs} +1 -1
- package/chunks/{AGASWXYW.js → AVQ3WHH7.js} +167 -23
- package/chunks/{W2I5OQA5.js → FG5GDUSZ.js} +3 -3
- package/chunks/{EHZ6H6TD.mjs → FUU5VIC4.mjs} +1 -1
- package/chunks/{L7DRRU3T.mjs → HFNJ3ERI.mjs} +2 -2
- package/chunks/{POR3DZIU.mjs → HWZC3PIL.mjs} +1 -1
- package/chunks/{XY3AC335.js → ILOY5QEA.js} +4 -4
- package/chunks/{K4YCNLTC.mjs → KEPPVUY3.mjs} +1 -1
- package/chunks/{WQHUX4R2.mjs → MMUU2CQM.mjs} +1 -1
- package/chunks/{VLLTA4EY.mjs → O5POHH2Q.mjs} +3 -3
- package/chunks/{EL2GSPZZ.js → QMWU5E4D.js} +3 -3
- package/chunks/RMNAO4DP.js +17 -0
- package/chunks/SUYUL6MB.js +41 -0
- package/chunks/{KDW6ZD2R.mjs → VMS4MOCI.mjs} +42 -54
- package/chunks/{F7GJTDIU.js → WCJ4JQHA.js} +8 -8
- package/collections.d.mts +29 -1
- package/collections.d.ts +29 -1
- package/collections.js +14 -14
- package/collections.mjs +2 -2
- package/csp-origins.js +9 -9
- package/csp-origins.mjs +2 -2
- package/data-assets.js +8 -8
- package/data-assets.mjs +2 -2
- package/data-connections.d.mts +12 -1
- package/data-connections.d.ts +12 -1
- package/data-connections.js +12 -12
- package/data-connections.mjs +2 -2
- package/data-credentials.d.mts +5 -0
- package/data-credentials.d.ts +5 -0
- package/data-credentials.js +7 -7
- package/data-credentials.mjs +2 -2
- package/data-files.d.mts +6 -0
- package/data-files.d.ts +6 -0
- package/data-files.js +15 -15
- package/data-files.mjs +2 -2
- package/extensions.d.mts +12 -0
- package/extensions.d.ts +12 -0
- package/extensions.js +10 -10
- package/extensions.mjs +2 -2
- package/glossaries.d.mts +50 -0
- package/glossaries.d.ts +50 -0
- package/glossaries.js +27 -27
- package/glossaries.mjs +2 -2
- package/groups.d.mts +39 -0
- package/groups.d.ts +39 -0
- package/groups.js +11 -11
- package/groups.mjs +2 -2
- package/identity-providers.d.mts +42 -0
- package/identity-providers.d.ts +42 -0
- package/identity-providers.js +11 -11
- package/identity-providers.mjs +2 -2
- package/index.js +8 -8
- package/index.mjs +4 -4
- package/items.d.mts +32 -1
- package/items.d.ts +32 -1
- package/items.js +11 -11
- package/items.mjs +2 -2
- package/licenses.d.mts +7 -4
- package/licenses.d.ts +7 -4
- package/licenses.js +12 -12
- package/licenses.mjs +2 -2
- package/package.json +1 -1
- package/qix.d.mts +1 -1
- package/qix.d.ts +1 -1
- package/qix.js +3 -3
- package/qix.mjs +2 -2
- package/quotas.d.mts +3 -0
- package/quotas.d.ts +3 -0
- package/quotas.js +5 -5
- package/quotas.mjs +2 -2
- package/reload-tasks.d.mts +6 -3
- package/reload-tasks.d.ts +6 -3
- package/reload-tasks.js +8 -8
- package/reload-tasks.mjs +2 -2
- package/reloads.d.mts +9 -0
- package/reloads.d.ts +9 -0
- package/reloads.js +7 -7
- package/reloads.mjs +2 -2
- package/roles.d.mts +10 -1
- package/roles.d.ts +10 -1
- package/roles.js +5 -5
- package/roles.mjs +2 -2
- package/spaces.d.mts +37 -5
- package/spaces.d.ts +37 -5
- package/spaces.js +15 -15
- package/spaces.mjs +2 -2
- package/temp-contents.d.mts +6 -0
- package/temp-contents.d.ts +6 -0
- package/temp-contents.js +6 -6
- package/temp-contents.mjs +2 -2
- package/tenants.d.mts +12 -0
- package/tenants.d.ts +12 -0
- package/tenants.js +9 -9
- package/tenants.mjs +2 -2
- package/themes.d.mts +9 -0
- package/themes.d.ts +9 -0
- package/themes.js +10 -10
- package/themes.mjs +2 -2
- package/transports.d.mts +9 -0
- package/transports.d.ts +9 -0
- package/transports.js +9 -9
- package/transports.mjs +2 -2
- package/users.d.mts +85 -14
- package/users.d.ts +85 -14
- package/users.js +13 -13
- package/users.mjs +2 -2
- package/web-integrations.d.mts +18 -0
- package/web-integrations.d.ts +18 -0
- package/web-integrations.js +8 -8
- package/web-integrations.mjs +2 -2
- package/web-notifications.d.mts +18 -0
- package/web-notifications.d.ts +18 -0
- package/web-notifications.js +9 -9
- package/web-notifications.mjs +2 -2
- package/webhooks.d.mts +3 -0
- package/webhooks.d.ts +3 -0
- package/webhooks.js +13 -13
- package/webhooks.mjs +2 -2
- package/chunks/37STYSYC.js +0 -41
- package/chunks/VC2LAFLZ.js +0 -17
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
generateRandomString,
|
|
2
3
|
getRestCallAuthParams,
|
|
3
4
|
getWebSocketAuthParams,
|
|
4
5
|
toValidWebsocketLocationUrl
|
|
5
|
-
} from "./
|
|
6
|
+
} from "./VMS4MOCI.mjs";
|
|
6
7
|
import "./VSY5YIQY.mjs";
|
|
7
8
|
|
|
8
9
|
// src/qix/session/enigma-session.ts
|
|
@@ -9675,6 +9676,148 @@ var mixin5 = {
|
|
|
9675
9676
|
}
|
|
9676
9677
|
};
|
|
9677
9678
|
|
|
9679
|
+
// src/qix/session/mixins/doc/create-client-objects.js
|
|
9680
|
+
import merge2 from "lodash/merge.js";
|
|
9681
|
+
var mixin6 = {
|
|
9682
|
+
types: "Doc",
|
|
9683
|
+
override: {
|
|
9684
|
+
createBookmark(_createBookmark, props) {
|
|
9685
|
+
return _createBookmark(
|
|
9686
|
+
merge2(
|
|
9687
|
+
{},
|
|
9688
|
+
{
|
|
9689
|
+
qInfo: {
|
|
9690
|
+
qType: "bookmark"
|
|
9691
|
+
},
|
|
9692
|
+
qMetaDef: {
|
|
9693
|
+
title: "",
|
|
9694
|
+
description: ""
|
|
9695
|
+
},
|
|
9696
|
+
creationDate: (/* @__PURE__ */ new Date()).toISOString()
|
|
9697
|
+
},
|
|
9698
|
+
props
|
|
9699
|
+
)
|
|
9700
|
+
);
|
|
9701
|
+
},
|
|
9702
|
+
createBookmarkEx(_createBookmarkEx, props, patchObjs) {
|
|
9703
|
+
return _createBookmarkEx(
|
|
9704
|
+
merge2(
|
|
9705
|
+
true,
|
|
9706
|
+
{
|
|
9707
|
+
qInfo: {
|
|
9708
|
+
qType: "bookmark"
|
|
9709
|
+
},
|
|
9710
|
+
qMetaDef: {
|
|
9711
|
+
title: "",
|
|
9712
|
+
description: ""
|
|
9713
|
+
},
|
|
9714
|
+
creationDate: (/* @__PURE__ */ new Date()).toISOString()
|
|
9715
|
+
},
|
|
9716
|
+
props
|
|
9717
|
+
),
|
|
9718
|
+
patchObjs
|
|
9719
|
+
);
|
|
9720
|
+
}
|
|
9721
|
+
},
|
|
9722
|
+
extend: {
|
|
9723
|
+
/**
|
|
9724
|
+
* Creates a Qlik Sense Sheet
|
|
9725
|
+
* @param {Object} [props] The sheet properties to override
|
|
9726
|
+
* @param {String} [props.title] - The new sheet's title
|
|
9727
|
+
* @param {String} [props.description] - The new sheet's description
|
|
9728
|
+
* @param {String} [props.thumbnail] - URL to a thumbnail image
|
|
9729
|
+
* @param {String} [props.rank] - Sorting rank
|
|
9730
|
+
* @param {Number} [props.rows] - number of grid rows
|
|
9731
|
+
* @param {Number} [props.columns] - number of grid columns
|
|
9732
|
+
* @param {Number} [props.customRowBase] - number of rows for grid resolution
|
|
9733
|
+
* @param {String} [props.gridResolution] - number of grid cells: small|medium|large
|
|
9734
|
+
* @param {Object} [props.layoutOptions] - layout options for the sheet
|
|
9735
|
+
*
|
|
9736
|
+
* @returns {Promise<Object,Error>} A Promise that returns an api to the new sheet if resolved or an Error if rejected
|
|
9737
|
+
*/
|
|
9738
|
+
createSheet(props) {
|
|
9739
|
+
return this.createObject({
|
|
9740
|
+
qInfo: {
|
|
9741
|
+
// generating id on client side to support multiple undo create operations
|
|
9742
|
+
// raised an engine bug to solve this, when resolved can be changed
|
|
9743
|
+
// TODO: update the jira id for engine bug once created
|
|
9744
|
+
qId: generateRandomString(43),
|
|
9745
|
+
qType: "sheet"
|
|
9746
|
+
},
|
|
9747
|
+
qMetaDef: {
|
|
9748
|
+
title: props.title || "",
|
|
9749
|
+
description: props.description || ""
|
|
9750
|
+
},
|
|
9751
|
+
rank: typeof props.rank !== "undefined" ? props.rank : -1,
|
|
9752
|
+
thumbnail: { qStaticContentUrlDef: props.thumbnail || null },
|
|
9753
|
+
columns: props.columns || 24,
|
|
9754
|
+
rows: props.rows || 12,
|
|
9755
|
+
cells: [],
|
|
9756
|
+
customRowBase: props.rows || void 0,
|
|
9757
|
+
gridResolution: props.gridResolution || void 0,
|
|
9758
|
+
layoutOptions: props.layoutOptions || void 0,
|
|
9759
|
+
qChildListDef: {
|
|
9760
|
+
qData: {
|
|
9761
|
+
title: "/title"
|
|
9762
|
+
}
|
|
9763
|
+
}
|
|
9764
|
+
});
|
|
9765
|
+
},
|
|
9766
|
+
/**
|
|
9767
|
+
* Creates a Qlik Sense Story
|
|
9768
|
+
* @param {Object} [props] The story properties to override
|
|
9769
|
+
* @param {String} [props.title] - The new story's title
|
|
9770
|
+
* @param {String} [props.description] - The new story's description
|
|
9771
|
+
* @param {String} [props.thumbnail] - URL to a thumbnail image
|
|
9772
|
+
* @param {String} [props.rank] - Sorting rank
|
|
9773
|
+
* @returns {Promise<Object,Error>} A Promise that returns an api to the new story if resolved or an Error if rejected
|
|
9774
|
+
*/
|
|
9775
|
+
createStory(props) {
|
|
9776
|
+
return this.createObject({
|
|
9777
|
+
qInfo: {
|
|
9778
|
+
// generating id on client side to support multiple undo create operations
|
|
9779
|
+
// raised an engine bug to solve this, when resolved can be changed
|
|
9780
|
+
qId: util.generateId(),
|
|
9781
|
+
qType: "story"
|
|
9782
|
+
},
|
|
9783
|
+
qMetaDef: {
|
|
9784
|
+
title: props.title || "",
|
|
9785
|
+
description: ""
|
|
9786
|
+
},
|
|
9787
|
+
rank: typeof props.rank !== "undefined" ? props.rank : -1,
|
|
9788
|
+
thumbnail: { qStaticContentUrlDef: props.thumbnail || null },
|
|
9789
|
+
qChildListDef: {
|
|
9790
|
+
qData: {
|
|
9791
|
+
title: "/title",
|
|
9792
|
+
rank: "/rank"
|
|
9793
|
+
}
|
|
9794
|
+
}
|
|
9795
|
+
});
|
|
9796
|
+
},
|
|
9797
|
+
/**
|
|
9798
|
+
* Creates a Qlik Sense Master Object
|
|
9799
|
+
* @param {Object} [props] The properties to override
|
|
9800
|
+
* @param {String} [props.title] - The master object title
|
|
9801
|
+
* @param {String} [props.description] - The master object description
|
|
9802
|
+
* @param {String} [props.tags] - The list of tags
|
|
9803
|
+
* @returns {Promise<Object,Error>} A Promise that returns an api to the new master object if resolved or an Error if rejected
|
|
9804
|
+
*/
|
|
9805
|
+
createMasterObject(props) {
|
|
9806
|
+
props = props || {};
|
|
9807
|
+
return this.createObject({
|
|
9808
|
+
qInfo: {
|
|
9809
|
+
qType: "masterobject"
|
|
9810
|
+
},
|
|
9811
|
+
qMetaDef: {
|
|
9812
|
+
title: props.title || "",
|
|
9813
|
+
description: props.description || "",
|
|
9814
|
+
tags: props.tags || ""
|
|
9815
|
+
}
|
|
9816
|
+
});
|
|
9817
|
+
}
|
|
9818
|
+
}
|
|
9819
|
+
};
|
|
9820
|
+
|
|
9678
9821
|
// src/qix/session/mixins/doc/current-selections.ts
|
|
9679
9822
|
var currentSelectionProps = {
|
|
9680
9823
|
qInfo: {
|
|
@@ -9683,7 +9826,7 @@ var currentSelectionProps = {
|
|
|
9683
9826
|
},
|
|
9684
9827
|
qSelectionObjectDef: {}
|
|
9685
9828
|
};
|
|
9686
|
-
var
|
|
9829
|
+
var mixin7 = {
|
|
9687
9830
|
types: ["Doc"],
|
|
9688
9831
|
extend: {
|
|
9689
9832
|
getCurrentSelectionObject() {
|
|
@@ -9710,7 +9853,7 @@ var dimensionListProps = {
|
|
|
9710
9853
|
}
|
|
9711
9854
|
}
|
|
9712
9855
|
};
|
|
9713
|
-
var
|
|
9856
|
+
var mixin8 = {
|
|
9714
9857
|
types: "Doc",
|
|
9715
9858
|
extend: {
|
|
9716
9859
|
getDimensionList() {
|
|
@@ -9736,7 +9879,7 @@ var listProps = {
|
|
|
9736
9879
|
}
|
|
9737
9880
|
}
|
|
9738
9881
|
};
|
|
9739
|
-
var
|
|
9882
|
+
var mixin9 = {
|
|
9740
9883
|
types: "Doc",
|
|
9741
9884
|
extend: {
|
|
9742
9885
|
getDynamicAppViewList() {
|
|
@@ -9790,7 +9933,7 @@ var onTheFlyWithHiddenListProps = {
|
|
|
9790
9933
|
qShowDefinitionOnly: true
|
|
9791
9934
|
}
|
|
9792
9935
|
};
|
|
9793
|
-
var
|
|
9936
|
+
var mixin10 = {
|
|
9794
9937
|
types: "Doc",
|
|
9795
9938
|
extend: {
|
|
9796
9939
|
getFieldList() {
|
|
@@ -9824,7 +9967,7 @@ var masterObjectListProps = {
|
|
|
9824
9967
|
}
|
|
9825
9968
|
}
|
|
9826
9969
|
};
|
|
9827
|
-
var
|
|
9970
|
+
var mixin11 = {
|
|
9828
9971
|
types: "Doc",
|
|
9829
9972
|
extend: {
|
|
9830
9973
|
getMasterObjectList() {
|
|
@@ -9851,7 +9994,7 @@ var measureListProps = {
|
|
|
9851
9994
|
}
|
|
9852
9995
|
}
|
|
9853
9996
|
};
|
|
9854
|
-
var
|
|
9997
|
+
var mixin12 = {
|
|
9855
9998
|
types: "Doc",
|
|
9856
9999
|
extend: {
|
|
9857
10000
|
getMeasureList() {
|
|
@@ -9877,7 +10020,7 @@ var sheetListProps = {
|
|
|
9877
10020
|
}
|
|
9878
10021
|
}
|
|
9879
10022
|
};
|
|
9880
|
-
var
|
|
10023
|
+
var mixin13 = {
|
|
9881
10024
|
types: "Doc",
|
|
9882
10025
|
extend: {
|
|
9883
10026
|
getODAGAppLinkList() {
|
|
@@ -9915,7 +10058,7 @@ var sheetListProps2 = {
|
|
|
9915
10058
|
}
|
|
9916
10059
|
}
|
|
9917
10060
|
};
|
|
9918
|
-
var
|
|
10061
|
+
var mixin14 = {
|
|
9919
10062
|
types: "Doc",
|
|
9920
10063
|
extend: {
|
|
9921
10064
|
/**
|
|
@@ -9950,7 +10093,7 @@ var snapshotListProps = {
|
|
|
9950
10093
|
}
|
|
9951
10094
|
}
|
|
9952
10095
|
};
|
|
9953
|
-
var
|
|
10096
|
+
var mixin15 = {
|
|
9954
10097
|
types: "Doc",
|
|
9955
10098
|
extend: {
|
|
9956
10099
|
getSnapshotListObject() {
|
|
@@ -9978,7 +10121,7 @@ var storyListProps = {
|
|
|
9978
10121
|
}
|
|
9979
10122
|
}
|
|
9980
10123
|
};
|
|
9981
|
-
var
|
|
10124
|
+
var mixin16 = {
|
|
9982
10125
|
types: "Doc",
|
|
9983
10126
|
extend: {
|
|
9984
10127
|
getStoryList() {
|
|
@@ -9999,7 +10142,7 @@ var undoInfoProps = {
|
|
|
9999
10142
|
qUndoInfoDef: {},
|
|
10000
10143
|
markers: []
|
|
10001
10144
|
};
|
|
10002
|
-
var
|
|
10145
|
+
var mixin17 = {
|
|
10003
10146
|
types: ["Doc"],
|
|
10004
10147
|
extend: {
|
|
10005
10148
|
getUndoInfoObject() {
|
|
@@ -10024,7 +10167,7 @@ var variableListProps = {
|
|
|
10024
10167
|
}
|
|
10025
10168
|
}
|
|
10026
10169
|
};
|
|
10027
|
-
var
|
|
10170
|
+
var mixin18 = {
|
|
10028
10171
|
types: "Doc",
|
|
10029
10172
|
extend: {
|
|
10030
10173
|
getVariableList() {
|
|
@@ -10044,16 +10187,17 @@ var mixins3 = [
|
|
|
10044
10187
|
mixin5,
|
|
10045
10188
|
mixin6,
|
|
10046
10189
|
mixin7,
|
|
10047
|
-
|
|
10190
|
+
mixin8,
|
|
10048
10191
|
mixin10,
|
|
10049
10192
|
mixin11,
|
|
10050
10193
|
mixin12,
|
|
10051
|
-
mixin8,
|
|
10052
10194
|
mixin13,
|
|
10195
|
+
mixin9,
|
|
10053
10196
|
mixin14,
|
|
10054
10197
|
mixin15,
|
|
10055
10198
|
mixin16,
|
|
10056
|
-
mixin17
|
|
10199
|
+
mixin17,
|
|
10200
|
+
mixin18
|
|
10057
10201
|
];
|
|
10058
10202
|
|
|
10059
10203
|
// src/qix/session/mixins/genericobject/effective-properties.js
|
|
@@ -10070,7 +10214,7 @@ function updateQAttribute(properties) {
|
|
|
10070
10214
|
});
|
|
10071
10215
|
}
|
|
10072
10216
|
}
|
|
10073
|
-
var
|
|
10217
|
+
var mixin19 = {
|
|
10074
10218
|
types: ["GenericObject"],
|
|
10075
10219
|
override: {
|
|
10076
10220
|
setProperties(_setProperties, properties) {
|
|
@@ -10089,7 +10233,7 @@ var mixin18 = {
|
|
|
10089
10233
|
};
|
|
10090
10234
|
|
|
10091
10235
|
// src/qix/session/mixins/genericobject/export-data.js
|
|
10092
|
-
var
|
|
10236
|
+
var mixin20 = {
|
|
10093
10237
|
types: "GenericObject",
|
|
10094
10238
|
override: {
|
|
10095
10239
|
/**
|
|
@@ -10116,7 +10260,7 @@ var mixin19 = {
|
|
|
10116
10260
|
};
|
|
10117
10261
|
|
|
10118
10262
|
// src/qix/session/mixins/genericobject/publishing.js
|
|
10119
|
-
var
|
|
10263
|
+
var mixin21 = {
|
|
10120
10264
|
types: ["GenericObject"],
|
|
10121
10265
|
override: {
|
|
10122
10266
|
/**
|
|
@@ -10149,7 +10293,7 @@ var mixin20 = {
|
|
|
10149
10293
|
};
|
|
10150
10294
|
|
|
10151
10295
|
// src/qix/session/mixins/genericobject/index.ts
|
|
10152
|
-
var mixins4 = [
|
|
10296
|
+
var mixins4 = [mixin20, mixin19, mixin21];
|
|
10153
10297
|
|
|
10154
10298
|
// src/qix/session/mixins/index.ts
|
|
10155
10299
|
var mixins5 = [...mixins3, ...mixins, ...mixins4, ...mixins2];
|
|
@@ -495,6 +495,46 @@ function isBrowser() {
|
|
|
495
495
|
function isNode() {
|
|
496
496
|
return typeof process === "object" && typeof _4HB3TAEOjs.__require === "function";
|
|
497
497
|
}
|
|
498
|
+
function generateRandomString(targetLength) {
|
|
499
|
+
const byteArrayLength = Math.ceil(targetLength * 3 / 4);
|
|
500
|
+
const array = new Uint8Array(byteArrayLength);
|
|
501
|
+
globalThis.crypto.getRandomValues(array);
|
|
502
|
+
const base64UrlString = toBase64Url(array);
|
|
503
|
+
return base64UrlString.substring(0, targetLength);
|
|
504
|
+
}
|
|
505
|
+
function toBase64Url(uint8Array) {
|
|
506
|
+
const hashArray = Array.from(uint8Array);
|
|
507
|
+
const regularBase64 = byteArrayToBase64(hashArray);
|
|
508
|
+
return regularBase64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
509
|
+
}
|
|
510
|
+
function byteArrayToBase64(hashArray) {
|
|
511
|
+
let result2 = "";
|
|
512
|
+
if (isBrowser()) {
|
|
513
|
+
const byteArrayToString = String.fromCharCode.apply(null, hashArray);
|
|
514
|
+
result2 = btoa(byteArrayToString);
|
|
515
|
+
} else if (isNode()) {
|
|
516
|
+
result2 = Buffer.from(hashArray).toString("base64");
|
|
517
|
+
} else {
|
|
518
|
+
throw new Error("Environment not supported for oauth2 authentication");
|
|
519
|
+
}
|
|
520
|
+
return result2;
|
|
521
|
+
}
|
|
522
|
+
async function sha256(message) {
|
|
523
|
+
const msgBuffer = new TextEncoder().encode(message);
|
|
524
|
+
const hashBuffer = await globalThis.crypto.subtle.digest("SHA-256", msgBuffer);
|
|
525
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
526
|
+
const hashBase64 = byteArrayToBase64(hashArray);
|
|
527
|
+
return hashBase64.replaceAll(/\+/g, "-").replaceAll(/\//g, "_").replace(/=+$/, "");
|
|
528
|
+
}
|
|
529
|
+
async function polyfillMissingGlobals() {
|
|
530
|
+
if (isNode() && !globalThis.crypto) {
|
|
531
|
+
globalThis.crypto = await Promise.resolve().then(() => _interopRequireWildcard(require(
|
|
532
|
+
/* webpackIgnore: true */
|
|
533
|
+
"crypto"
|
|
534
|
+
)));
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
await polyfillMissingGlobals();
|
|
498
538
|
|
|
499
539
|
// src/auth/internal/default-auth-modules/oauth/storage-helpers.ts
|
|
500
540
|
var storagePrefix = "qlik-qmfe-api";
|
|
@@ -619,42 +659,11 @@ function handleOAuthCallback() {
|
|
|
619
659
|
}
|
|
620
660
|
|
|
621
661
|
// src/auth/internal/default-auth-modules/oauth/oauth-utils.ts
|
|
622
|
-
function generateRandomString(targetLength) {
|
|
623
|
-
const byteArrayLength = Math.ceil(targetLength * 3 / 4);
|
|
624
|
-
const array = new Uint8Array(byteArrayLength);
|
|
625
|
-
globalThis.crypto.getRandomValues(array);
|
|
626
|
-
const base64UrlString = toBase64Url(array);
|
|
627
|
-
return base64UrlString.substring(0, targetLength);
|
|
628
|
-
}
|
|
629
|
-
function toBase64Url(uint8Array) {
|
|
630
|
-
const hashArray = Array.from(uint8Array);
|
|
631
|
-
const regularBase64 = byteArrayToBase64(hashArray);
|
|
632
|
-
return regularBase64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
633
|
-
}
|
|
634
|
-
function byteArrayToBase64(hashArray) {
|
|
635
|
-
let result2 = "";
|
|
636
|
-
if (isBrowser()) {
|
|
637
|
-
const byteArrayToString = String.fromCharCode.apply(null, hashArray);
|
|
638
|
-
result2 = btoa(byteArrayToString);
|
|
639
|
-
} else if (isNode()) {
|
|
640
|
-
result2 = Buffer.from(hashArray).toString("base64");
|
|
641
|
-
} else {
|
|
642
|
-
throw new Error("Environment not supported for oauth2 authentication");
|
|
643
|
-
}
|
|
644
|
-
return result2;
|
|
645
|
-
}
|
|
646
662
|
function handlePossibleErrors(data) {
|
|
647
663
|
if (data.errors) {
|
|
648
664
|
throw new AuthorizationError(data.errors);
|
|
649
665
|
}
|
|
650
666
|
}
|
|
651
|
-
async function sha256(message) {
|
|
652
|
-
const msgBuffer = new TextEncoder().encode(message);
|
|
653
|
-
const hashBuffer = await globalThis.crypto.subtle.digest("SHA-256", msgBuffer);
|
|
654
|
-
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
655
|
-
const hashBase64 = byteArrayToBase64(hashArray);
|
|
656
|
-
return hashBase64.replaceAll(/\+/g, "-").replaceAll(/\//g, "_").replace(/=+$/, "");
|
|
657
|
-
}
|
|
658
667
|
function toQueryString(queryParams) {
|
|
659
668
|
const queryParamsKeys = Object.keys(queryParams);
|
|
660
669
|
queryParamsKeys.sort();
|
|
@@ -1216,29 +1225,7 @@ async function performActualHttpFetch(method, completeUrl, unencodedBody, conten
|
|
|
1216
1225
|
if (_optionalChain([interceptors, 'optionalAccess', _26 => _26.request, 'access', _27 => _27.hasInterceptors, 'call', _28 => _28()])) {
|
|
1217
1226
|
request = await interceptors.request.apply(completeUrl, request);
|
|
1218
1227
|
}
|
|
1219
|
-
|
|
1220
|
-
const location = fetchResponse.headers.get("location");
|
|
1221
|
-
if (location && request.redirect === "follow" && fetchResponse.status === 201) {
|
|
1222
|
-
const followRequest = {
|
|
1223
|
-
method: "get",
|
|
1224
|
-
credentials,
|
|
1225
|
-
mode: request.mode,
|
|
1226
|
-
headers,
|
|
1227
|
-
redirect: request.redirect
|
|
1228
|
-
};
|
|
1229
|
-
let followUrl;
|
|
1230
|
-
try {
|
|
1231
|
-
followUrl = new URL(location).toString();
|
|
1232
|
-
} catch (e3) {
|
|
1233
|
-
try {
|
|
1234
|
-
const { origin } = new URL(completeUrl);
|
|
1235
|
-
followUrl = `${origin}/${location}`;
|
|
1236
|
-
} catch (e4) {
|
|
1237
|
-
followUrl = location;
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
fetchResponse = await fetchAndTransformExceptions(followUrl, followRequest);
|
|
1241
|
-
}
|
|
1228
|
+
const fetchResponse = await fetchAndTransformExceptions(completeUrl, request);
|
|
1242
1229
|
if (fetchTimeoutId) {
|
|
1243
1230
|
clearTimeout(fetchTimeoutId);
|
|
1244
1231
|
}
|
|
@@ -1593,7 +1580,7 @@ async function parseFetchResponse(fetchResponse, url) {
|
|
|
1593
1580
|
try {
|
|
1594
1581
|
resultData = await fetchResponse.text();
|
|
1595
1582
|
resultData = JSON.parse(resultData);
|
|
1596
|
-
} catch (
|
|
1583
|
+
} catch (e3) {
|
|
1597
1584
|
}
|
|
1598
1585
|
break;
|
|
1599
1586
|
}
|
|
@@ -1647,4 +1634,5 @@ var invoke_fetch_default = invokeFetchExp;
|
|
|
1647
1634
|
|
|
1648
1635
|
|
|
1649
1636
|
|
|
1650
|
-
|
|
1637
|
+
|
|
1638
|
+
exports.getPlatform = getPlatform; exports.InvalidHostConfigError = InvalidHostConfigError; exports.UnexpectedAuthTypeError = UnexpectedAuthTypeError; exports.InvalidAuthTypeError = InvalidAuthTypeError; exports.AuthorizationError = AuthorizationError; exports.isHostCrossOrigin = isHostCrossOrigin; exports.isWindows = isWindows; exports.toValidLocationUrl = toValidLocationUrl; exports.toValidEnigmaLocationUrl = toValidEnigmaLocationUrl; exports.toValidWebsocketLocationUrl = toValidWebsocketLocationUrl; exports.getWebSocketAuthParams = getWebSocketAuthParams; exports.getWebResourceAuthParams = getWebResourceAuthParams; exports.handleAuthenticationError = handleAuthenticationError; exports.getRestCallAuthParams = getRestCallAuthParams; exports.registerAuthModule = registerAuthModule2; exports.setDefaultHostConfig = setDefaultHostConfig2; exports.checkForCrossDomainRequest = checkForCrossDomainRequest; exports.logout = logout; exports.generateRandomString = generateRandomString; exports.InvokeFetchError = InvokeFetchError; exports.EncodingError = EncodingError; exports.invokeFetch = invokeFetch; exports.clearApiCache = clearApiCache; exports.parseFetchResponse = parseFetchResponse; exports.invoke_fetch_default = invoke_fetch_default; exports.auth_default = auth_default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _FG5GDUSZjs = require('./FG5GDUSZ.js');
|
|
4
4
|
|
|
5
5
|
// src/public/qix.ts
|
|
6
6
|
function openAppSession(appSessionProps) {
|
|
7
|
-
const appSessionPromise =
|
|
7
|
+
const appSessionPromise = _FG5GDUSZjs.getQixRuntimeModule.call(void 0, appSessionProps.hostConfig).then(
|
|
8
8
|
(impl) => impl.openAppSession(appSessionProps)
|
|
9
9
|
);
|
|
10
10
|
const appSessionProxy = {
|