@esri/hub-common 9.12.0 → 9.14.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/dist/es2017/ArcGISContext.js +205 -0
- package/dist/es2017/ArcGISContext.js.map +1 -0
- package/dist/es2017/ArcGISContextManager.js +160 -0
- package/dist/es2017/ArcGISContextManager.js.map +1 -0
- package/dist/es2017/index.js +2 -0
- package/dist/es2017/index.js.map +1 -1
- package/dist/es2017/search/_searchContent.js +18 -7
- package/dist/es2017/search/_searchContent.js.map +1 -1
- package/dist/es2017/search/_searchGroups.js +1 -11
- package/dist/es2017/search/_searchGroups.js.map +1 -1
- package/dist/es2017/search/utils.js +1 -1
- package/dist/es2017/urls/getHubApiFromPortalUrl.js +21 -0
- package/dist/es2017/urls/getHubApiFromPortalUrl.js.map +1 -0
- package/dist/es2017/urls/getPortalBaseFromOrgUrl.js +25 -0
- package/dist/es2017/urls/getPortalBaseFromOrgUrl.js.map +1 -0
- package/dist/es2017/urls/index.js +2 -0
- package/dist/es2017/urls/index.js.map +1 -1
- package/dist/es2017/utils/index.js +1 -0
- package/dist/es2017/utils/index.js.map +1 -1
- package/dist/es2017/utils/sessionLocalStorage.js +47 -0
- package/dist/es2017/utils/sessionLocalStorage.js.map +1 -0
- package/dist/esm/ArcGISContext.js +287 -0
- package/dist/esm/ArcGISContext.js.map +1 -0
- package/dist/esm/ArcGISContextManager.js +204 -0
- package/dist/esm/ArcGISContextManager.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/search/_searchContent.js +18 -7
- package/dist/esm/search/_searchContent.js.map +1 -1
- package/dist/esm/search/_searchGroups.js +3 -13
- package/dist/esm/search/_searchGroups.js.map +1 -1
- package/dist/esm/search/utils.js +1 -1
- package/dist/esm/urls/getHubApiFromPortalUrl.js +21 -0
- package/dist/esm/urls/getHubApiFromPortalUrl.js.map +1 -0
- package/dist/esm/urls/getPortalBaseFromOrgUrl.js +25 -0
- package/dist/esm/urls/getPortalBaseFromOrgUrl.js.map +1 -0
- package/dist/esm/urls/index.js +2 -0
- package/dist/esm/urls/index.js.map +1 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/sessionLocalStorage.js +50 -0
- package/dist/esm/utils/sessionLocalStorage.js.map +1 -0
- package/dist/node/ArcGISContext.js +209 -0
- package/dist/node/ArcGISContext.js.map +1 -0
- package/dist/node/ArcGISContextManager.js +164 -0
- package/dist/node/ArcGISContextManager.js.map +1 -0
- package/dist/node/index.js +2 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/search/_searchContent.js +17 -6
- package/dist/node/search/_searchContent.js.map +1 -1
- package/dist/node/search/_searchGroups.js +1 -11
- package/dist/node/search/_searchGroups.js.map +1 -1
- package/dist/node/search/utils.js +1 -1
- package/dist/node/urls/getHubApiFromPortalUrl.js +25 -0
- package/dist/node/urls/getHubApiFromPortalUrl.js.map +1 -0
- package/dist/node/urls/getPortalBaseFromOrgUrl.js +29 -0
- package/dist/node/urls/getPortalBaseFromOrgUrl.js.map +1 -0
- package/dist/node/urls/index.js +2 -0
- package/dist/node/urls/index.js.map +1 -1
- package/dist/node/utils/index.js +1 -0
- package/dist/node/utils/index.js.map +1 -1
- package/dist/node/utils/sessionLocalStorage.js +53 -0
- package/dist/node/utils/sessionLocalStorage.js.map +1 -0
- package/dist/types/ArcGISContext.d.ts +136 -0
- package/dist/types/ArcGISContextManager.d.ts +113 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/search/utils.d.ts +1 -1
- package/dist/types/types.d.ts +5 -2
- package/dist/types/urls/getHubApiFromPortalUrl.d.ts +8 -0
- package/dist/types/urls/getPortalBaseFromOrgUrl.d.ts +9 -0
- package/dist/types/urls/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/sessionLocalStorage.d.ts +23 -0
- package/dist/umd/common.umd.js +3330 -2709
- package/dist/umd/common.umd.js.map +1 -1
- package/dist/umd/common.umd.min.js +1 -1
- package/dist/umd/common.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { getProp, getWithDefault } from ".";
|
|
2
|
+
/**
|
|
3
|
+
* Hash of Hub API end points so updates
|
|
4
|
+
* are centralized
|
|
5
|
+
*/
|
|
6
|
+
const hubApiEndpoints = {
|
|
7
|
+
domains: "/api/v3/domains",
|
|
8
|
+
search: "/api/v3/datasets",
|
|
9
|
+
discussions: "/api/discussions/v1",
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* ArcGISContext
|
|
13
|
+
*
|
|
14
|
+
* Abstraction that holds a UserSession, along with
|
|
15
|
+
* getters to streamline access to various platform
|
|
16
|
+
* urls, and common constructs like IRequestOptions
|
|
17
|
+
*
|
|
18
|
+
* Thin class just used to enable getters
|
|
19
|
+
*
|
|
20
|
+
* This class should not be used by anything other than
|
|
21
|
+
* the ArcGISContextManager class
|
|
22
|
+
*/
|
|
23
|
+
export class ArcGISContext {
|
|
24
|
+
constructor(opts) {
|
|
25
|
+
this._portalUrl = "https://www.arcgis.com";
|
|
26
|
+
this.id = opts.id;
|
|
27
|
+
this._portalUrl = opts.portalUrl;
|
|
28
|
+
this._hubUrl = opts.hubUrl;
|
|
29
|
+
if (opts.authentication) {
|
|
30
|
+
this._authentication = opts.authentication;
|
|
31
|
+
}
|
|
32
|
+
if (opts.portalSelf) {
|
|
33
|
+
this._portalSelf = opts.portalSelf;
|
|
34
|
+
}
|
|
35
|
+
if (opts.currentUser) {
|
|
36
|
+
this._currentUser = opts.currentUser;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Return the UserSession if authenticated
|
|
41
|
+
*/
|
|
42
|
+
get session() {
|
|
43
|
+
return this._authentication;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Return boolean indicating if authenticatio is present
|
|
47
|
+
*/
|
|
48
|
+
get isAuthenticated() {
|
|
49
|
+
return !!this._authentication;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Return `IUserRequestOptions`, which is used for REST-JS
|
|
53
|
+
* functions which require authentication information.
|
|
54
|
+
*
|
|
55
|
+
* If context is not authenticated, this function will throw
|
|
56
|
+
*/
|
|
57
|
+
get userRequestOptions() {
|
|
58
|
+
if (this.isAuthenticated) {
|
|
59
|
+
return {
|
|
60
|
+
authentication: this._authentication,
|
|
61
|
+
portal: this.sharingApiUrl,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Return `IRequestOptions`, which is used by REST-JS functions
|
|
67
|
+
* which *may* use authentication information if provided.
|
|
68
|
+
*
|
|
69
|
+
* If context is not authenticated, this function just returns
|
|
70
|
+
* the `portal` property, which informs REST-JS what Sharing API
|
|
71
|
+
* instance to use (i.e. AGO, Enterprise etc)
|
|
72
|
+
*/
|
|
73
|
+
get requestOptions() {
|
|
74
|
+
let ro = {
|
|
75
|
+
portal: this.sharingApiUrl,
|
|
76
|
+
};
|
|
77
|
+
if (this.isAuthenticated) {
|
|
78
|
+
ro = {
|
|
79
|
+
authentication: this._authentication,
|
|
80
|
+
portal: this.sharingApiUrl,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return ro;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Return a `IHubRequestOptions` object
|
|
87
|
+
*/
|
|
88
|
+
get hubRequestOptions() {
|
|
89
|
+
// We may add more logic around what is returned in some corner cases
|
|
90
|
+
return {
|
|
91
|
+
authentication: this.session,
|
|
92
|
+
isPortal: this.isPortal,
|
|
93
|
+
portalSelf: this.portal,
|
|
94
|
+
hubApiUrl: this.hubUrl,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Return the portal url.
|
|
99
|
+
*
|
|
100
|
+
* If authenticated @ ArcGIS Online, it will return
|
|
101
|
+
* the https://org.env.arcgis.com
|
|
102
|
+
*
|
|
103
|
+
* If authenticated @ ArcGIS Enterprise, it will return
|
|
104
|
+
* https://portalHostname, which includes the web adaptor
|
|
105
|
+
*/
|
|
106
|
+
get portalUrl() {
|
|
107
|
+
if (this.isAuthenticated) {
|
|
108
|
+
if (this.isPortal) {
|
|
109
|
+
return `https://${this._portalSelf.portalHostname}`;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return `https://${this._portalSelf.urlKey}.${this._portalSelf.customBaseUrl}`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
return this._portalUrl;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Returns the url to the sharing api
|
|
121
|
+
* i.e. https://myorg.maps.arcgis.com/sharing/rest
|
|
122
|
+
*/
|
|
123
|
+
get sharingApiUrl() {
|
|
124
|
+
return `${this.portalUrl}/sharing/rest`;
|
|
125
|
+
}
|
|
126
|
+
get hubUrl() {
|
|
127
|
+
return this._hubUrl;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Returns boolean indicating if the backing system
|
|
131
|
+
* is ArcGIS Enterprise (formerly ArcGIS Portal) or not
|
|
132
|
+
*/
|
|
133
|
+
get isPortal() {
|
|
134
|
+
return this._portalSelf
|
|
135
|
+
? this._portalSelf.isPortal
|
|
136
|
+
: this._portalUrl.indexOf("arcgis.com") === -1;
|
|
137
|
+
}
|
|
138
|
+
// Hub APIs
|
|
139
|
+
// ----------
|
|
140
|
+
// Discussions
|
|
141
|
+
get discussionsServiceUrl() {
|
|
142
|
+
if (this._hubUrl) {
|
|
143
|
+
return `${this._hubUrl}${hubApiEndpoints.discussions}`;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Hub Search
|
|
147
|
+
get hubSearchServiceUrl() {
|
|
148
|
+
if (this._hubUrl) {
|
|
149
|
+
return `${this._hubUrl}${hubApiEndpoints.search}`;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// Domain
|
|
153
|
+
get domainServiceUrl() {
|
|
154
|
+
if (this._hubUrl) {
|
|
155
|
+
return `${this._hubUrl}${hubApiEndpoints.domains}`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Events
|
|
159
|
+
// returns `{serviceId: '3ef..', publicViewId: 'bc3...'}
|
|
160
|
+
get eventsConfig() {
|
|
161
|
+
if (this._portalSelf) {
|
|
162
|
+
return getProp(this._portalSelf, "portalProperties.hub.settings.events");
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Returns boolean indicating if the current user
|
|
167
|
+
* belongs to an organization that has licensed
|
|
168
|
+
* ArcGIS Hub
|
|
169
|
+
*/
|
|
170
|
+
get hubEnabled() {
|
|
171
|
+
return getWithDefault(this._portalSelf, "portalProperties.hub.enabled", false);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Return Hub Community Org Id, if defined
|
|
175
|
+
*/
|
|
176
|
+
get communityOrgId() {
|
|
177
|
+
if (this._portalSelf) {
|
|
178
|
+
return getProp(this._portalSelf, "portalProperties.hub.settings.communityOrg.orgId");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
get communityOrgHostname() {
|
|
182
|
+
if (this._portalSelf) {
|
|
183
|
+
return getProp(this._portalSelf, "portalProperties.hub.settings.communityOrg.portalHostname");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
get communityOrgUrl() {
|
|
187
|
+
if (this.communityOrgHostname) {
|
|
188
|
+
return `https://${this.communityOrgHostname}`;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// Platform API service urls are all in helperServices
|
|
192
|
+
// and not consistent to expose as urls
|
|
193
|
+
get helperServices() {
|
|
194
|
+
if (this._portalSelf) {
|
|
195
|
+
return this._portalSelf.helperServices;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
get currentUser() {
|
|
199
|
+
return this._currentUser;
|
|
200
|
+
}
|
|
201
|
+
get portal() {
|
|
202
|
+
return this._portalSelf;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=ArcGISContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGISContext.js","sourceRoot":"","sources":["../../src/ArcGISContext.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAsB,MAAM,GAAG,CAAC;AAEhE;;;GAGG;AACH,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,kBAAkB;IAC1B,WAAW,EAAE,qBAAqB;CACnC,CAAC;AA+CF;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,aAAa;IAYxB,YAAY,IAA2B;QAR/B,eAAU,GAAW,wBAAwB,CAAC;QASpD,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC;SAC5C;QAED,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC;SACpC;QAED,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;SACtC;IACH,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QACxB,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,IAAW,kBAAkB;QAC3B,IAAI,IAAI,CAAC,eAAe,EAAE;Y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AAoB,EAAE;YAC7B,OAAO,WAAW,IAAI,CAAC,oBAAoB,EAAE,CAAC;SAC/C;IACH,CAAC;IAED,sDAAsD;IACtD,uCAAuC;IACvC,IAAW,cAAc;QACvB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;SACxC;IACH,CAAC;IAED,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { getSelf, getUser } from "@esri/arcgis-rest-portal";
|
|
2
|
+
import { ArcGISContext, } from "./ArcGISContext";
|
|
3
|
+
import { cloneObject, Logger, Level } from ".";
|
|
4
|
+
import { getHubApiFromPortalUrl } from "./urls/getHubApiFromPortalUrl";
|
|
5
|
+
import { getPortalBaseFromOrgUrl } from "./urls/getPortalBaseFromOrgUrl";
|
|
6
|
+
/**
|
|
7
|
+
* ArcGIS Context Manager
|
|
8
|
+
*
|
|
9
|
+
* The manager exposes context (`IArcGISContext`), which combines a `UserSession` with
|
|
10
|
+
* the `portal/self` and `user/self` responses to provide a central lookup for platform
|
|
11
|
+
* information, api urls, and other useful properties for developers such as IRequestOptions
|
|
12
|
+
* IUserRequestOptions, IHubRequestOptions etc.
|
|
13
|
+
*
|
|
14
|
+
* The context is exposed on gthe `.context` property, and as the authentication changes
|
|
15
|
+
* the `.context` is re-created. This is done to allow web frameworks to watch for
|
|
16
|
+
* changes on that single property, instead of having to leverage observers or events
|
|
17
|
+
* for change detection.
|
|
18
|
+
*
|
|
19
|
+
* This is a work-in-progress, and will likely expand over time.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export class ArcGISContextManager {
|
|
23
|
+
/**
|
|
24
|
+
* Private constructor. Use `ArcGISContextManager.create(...)` to
|
|
25
|
+
* instantiate an instance
|
|
26
|
+
* @param opts
|
|
27
|
+
*/
|
|
28
|
+
constructor(opts) {
|
|
29
|
+
this._portalUrl = "https://www.arcgis.com";
|
|
30
|
+
this._logLevel = Level.error;
|
|
31
|
+
// Having a unique id makes debugging easier
|
|
32
|
+
this.id = new Date().getTime();
|
|
33
|
+
if (opts.logLevel) {
|
|
34
|
+
this._logLevel = opts.logLevel;
|
|
35
|
+
}
|
|
36
|
+
Logger.setLogLevel(this._logLevel);
|
|
37
|
+
Logger.debug(`ArcGISContextManager:ctor: Creating ${this.id}`);
|
|
38
|
+
if (opts.authentication) {
|
|
39
|
+
this._authentication = opts.authentication;
|
|
40
|
+
this._portalUrl = this._authentication.portal.replace("/sharing/rest", "");
|
|
41
|
+
this._hubUrl = getHubApiFromPortalUrl(this._portalUrl);
|
|
42
|
+
}
|
|
43
|
+
else if (opts.portalUrl) {
|
|
44
|
+
this._portalUrl = opts.portalUrl;
|
|
45
|
+
this._hubUrl = getHubApiFromPortalUrl(this._portalUrl);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this._hubUrl = getHubApiFromPortalUrl(this._portalUrl);
|
|
49
|
+
}
|
|
50
|
+
if (opts.portal) {
|
|
51
|
+
this._portalSelf = cloneObject(opts.portal);
|
|
52
|
+
}
|
|
53
|
+
if (opts.currentUser) {
|
|
54
|
+
this._currentUser = cloneObject(opts.currentUser);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Static async Factory
|
|
59
|
+
* @param opts
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
static async create(opts = {}) {
|
|
63
|
+
const ctx = new ArcGISContextManager(opts);
|
|
64
|
+
await ctx.initialize();
|
|
65
|
+
return ctx;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Set the Authentication (UserSession) for the context.
|
|
69
|
+
* This should be called when a user signs into a running
|
|
70
|
+
* application.
|
|
71
|
+
* @param auth
|
|
72
|
+
*/
|
|
73
|
+
async setAuthentication(auth) {
|
|
74
|
+
this._authentication = auth;
|
|
75
|
+
this._portalUrl = auth.portal.replace("/sharing/rest", "");
|
|
76
|
+
await this.initialize();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Clear the Authentication (UserSession). This should be
|
|
80
|
+
* called when a user signs out of an application, but
|
|
81
|
+
* the application continues running
|
|
82
|
+
*/
|
|
83
|
+
clearAuthentication() {
|
|
84
|
+
// Reset the portalUrl from the org url to the base url
|
|
85
|
+
// for ArcGIS Enterprise, we just leave the _portalUrl as-is
|
|
86
|
+
if (!this._context.isPortal) {
|
|
87
|
+
this._portalUrl = getPortalBaseFromOrgUrl(this._portalUrl);
|
|
88
|
+
}
|
|
89
|
+
// Clear the auth, portalSelf and currentUser props
|
|
90
|
+
this._authentication = null;
|
|
91
|
+
this._portalSelf = null;
|
|
92
|
+
this._currentUser = null;
|
|
93
|
+
this._context = new ArcGISContext({
|
|
94
|
+
id: this.id,
|
|
95
|
+
portalUrl: this._portalUrl,
|
|
96
|
+
hubUrl: this._hubUrl,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Return a reference to the current state.
|
|
101
|
+
* When `.setAuthentication()` or `.clearAuthenentication()` are
|
|
102
|
+
* called, the state will be re-created. This is done so frameworks
|
|
103
|
+
* like React or Ember can detect changes.
|
|
104
|
+
*/
|
|
105
|
+
get context() {
|
|
106
|
+
return this._context;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* If we have a UserSession, fetch portal/self and
|
|
110
|
+
* store that along with current user
|
|
111
|
+
*/
|
|
112
|
+
async initialize() {
|
|
113
|
+
// if we have auth, and don't have portalSelf or currentUser, fetch them
|
|
114
|
+
if (this._authentication && (!this._portalSelf || !this._currentUser)) {
|
|
115
|
+
Logger.debug(`ArcGISContextManager-${this.id}: Initializing`);
|
|
116
|
+
const username = this._authentication.username;
|
|
117
|
+
const requests = [
|
|
118
|
+
getSelf({ authentication: this._authentication }),
|
|
119
|
+
getUser({ username, authentication: this._authentication }),
|
|
120
|
+
];
|
|
121
|
+
try {
|
|
122
|
+
const [portal, user] = await Promise.all(requests);
|
|
123
|
+
this._portalSelf = portal;
|
|
124
|
+
this._currentUser = user;
|
|
125
|
+
Logger.debug(`ArcGISContextManager-${this.id}: received portalSelf and currentUser`);
|
|
126
|
+
}
|
|
127
|
+
catch (ex) {
|
|
128
|
+
const msg = `ArcGISContextManager could not fetch portal & user for "${this._authentication.username}" using ${this._authentication.portal}.`;
|
|
129
|
+
Logger.error(msg);
|
|
130
|
+
// tslint:disable-next-line:no-console
|
|
131
|
+
console.error(msg);
|
|
132
|
+
throw ex;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
Logger.debug(`ArcGISContextManager-${this.id}: updating context`);
|
|
136
|
+
// update the context
|
|
137
|
+
this._context = new ArcGISContext(this.contextOpts);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Getter to streamline the creation of updated Context instances
|
|
141
|
+
*/
|
|
142
|
+
get contextOpts() {
|
|
143
|
+
const contextOpts = {
|
|
144
|
+
id: this.id,
|
|
145
|
+
portalUrl: this._portalUrl,
|
|
146
|
+
hubUrl: this._hubUrl,
|
|
147
|
+
};
|
|
148
|
+
if (this._authentication) {
|
|
149
|
+
contextOpts.authentication = this._authentication;
|
|
150
|
+
}
|
|
151
|
+
if (this._portalSelf) {
|
|
152
|
+
contextOpts.portalSelf = this._portalSelf;
|
|
153
|
+
}
|
|
154
|
+
if (this._currentUser) {
|
|
155
|
+
contextOpts.currentUser = this._currentUser;
|
|
156
|
+
}
|
|
157
|
+
return contextOpts;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=ArcGISContextManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGISContextManager.js","sourceRoot":"","sources":["../../src/ArcGISContextManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,E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AAoB,CAAC,CAAC;QAClE,qBAAqB;QACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,IAAY,WAAW;QACrB,MAAM,WAAW,GAA0B;YACzC,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,MAAM,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;QACF,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,WAAW,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC;SACnD;QACD,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,WAAW,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;SAC3C;QACD,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;SAC7C;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
|
package/dist/es2017/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export * from "./utils";
|
|
|
20
20
|
export * from "./i18n";
|
|
21
21
|
export * from "./request";
|
|
22
22
|
export * from "./surveys";
|
|
23
|
+
export * from "./ArcGISContextManager";
|
|
24
|
+
export * from "./ArcGISContext";
|
|
23
25
|
import OperationStack from "./OperationStack";
|
|
24
26
|
import OperationError from "./OperationError";
|
|
25
27
|
// Re-exports
|
package/dist/es2017/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAEhC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,aAAa;AACb,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expandContentFilter, serializeContentFilterForPortal, convertPortalResponseToFacets, } from "./content-utils";
|
|
2
2
|
import { searchItems } from "@esri/arcgis-rest-portal";
|
|
3
3
|
import { expandApi, getNextFunction } from ".";
|
|
4
|
-
import { cloneObject, itemToContent, setContentSiteUrls, } from "..";
|
|
4
|
+
import { cloneObject, getItemThumbnailUrl, itemToContent, setContentSiteUrls, } from "..";
|
|
5
5
|
/**
|
|
6
6
|
* Search for content via the Portal or Hub API
|
|
7
7
|
* @param filter
|
|
@@ -14,13 +14,12 @@ export async function _searchContent(filter, options) {
|
|
|
14
14
|
// API
|
|
15
15
|
const api = expandApi(options.api || "arcgis");
|
|
16
16
|
let searchPromise;
|
|
17
|
-
// map over the apis, depending on the type we issue the queries
|
|
18
|
-
// const searchPromises = apis.map((api) => {
|
|
19
17
|
// Portal Search
|
|
20
18
|
if (api.type === "arcgis") {
|
|
21
19
|
// serialize for portal
|
|
22
20
|
const so = serializeContentFilterForPortal(expanded);
|
|
23
|
-
//
|
|
21
|
+
// if we have auth, pass it forward
|
|
22
|
+
// otherwise set the portal property
|
|
24
23
|
if (options.authentication) {
|
|
25
24
|
so.authentication = options.authentication;
|
|
26
25
|
}
|
|
@@ -33,7 +32,6 @@ export async function _searchContent(filter, options) {
|
|
|
33
32
|
so.countSize = 200;
|
|
34
33
|
}
|
|
35
34
|
// copy over various options
|
|
36
|
-
// TODO: Dry this up - typscript makes this... inconvenient
|
|
37
35
|
if (options.num) {
|
|
38
36
|
so.num = options.num;
|
|
39
37
|
}
|
|
@@ -61,8 +59,6 @@ export async function _searchContent(filter, options) {
|
|
|
61
59
|
},
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
|
-
// });
|
|
65
|
-
// return for results
|
|
66
62
|
return searchPromise;
|
|
67
63
|
}
|
|
68
64
|
/**
|
|
@@ -74,12 +70,27 @@ export async function _searchContent(filter, options) {
|
|
|
74
70
|
* @returns
|
|
75
71
|
*/
|
|
76
72
|
function searchPortal(searchOptions) {
|
|
73
|
+
var _a;
|
|
74
|
+
const portalUrl = ((_a = searchOptions.authentication) === null || _a === void 0 ? void 0 : _a.portal) || searchOptions.portal;
|
|
75
|
+
let token;
|
|
76
|
+
if (searchOptions.authentication) {
|
|
77
|
+
const us = searchOptions.authentication;
|
|
78
|
+
token = us.token;
|
|
79
|
+
}
|
|
80
|
+
const thumbnailify = (content) => {
|
|
81
|
+
content.thumbnailUrl = getItemThumbnailUrl(content, portalUrl, token);
|
|
82
|
+
return content;
|
|
83
|
+
};
|
|
77
84
|
return searchItems(searchOptions).then((resp) => {
|
|
78
85
|
const hasNext = resp.nextStart > -1;
|
|
86
|
+
// convert items to IHubContent's
|
|
79
87
|
let content = resp.results.map(itemToContent);
|
|
88
|
+
// if we have a site, add those urls
|
|
80
89
|
if (searchOptions.site) {
|
|
81
90
|
content = content.map((entry) => setContentSiteUrls(entry, searchOptions.site));
|
|
82
91
|
}
|
|
92
|
+
// add thumbnailUrl
|
|
93
|
+
content = content.map(thumbnailify);
|
|
83
94
|
// convert aggregations into facets
|
|
84
95
|
const facets = convertPortalResponseToFacets(resp);
|
|
85
96
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_searchContent.js","sourceRoot":"","sources":["../../../src/search/_searchContent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAkB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAC/C,OAAO,EACL,WAAW,
|
|
1
|
+
{"version":3,"file":"_searchContent.js","sourceRoot":"","sources":["../../../src/search/_searchContent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAkB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;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G,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC9B,kBAAkB,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAC9C,CAAC;SACH;QACD,mBAAmB;QACnB,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACpC,mCAAmC;QACnC,MAAM,MAAM,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC;QACnD,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,OAAO;YAChB,MAAM;YACN,OAAO;YACP,IAAI,EAAE,eAAe,CACnB,aAAa,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,KAAK,EACV,YAAY,CACb;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -11,25 +11,20 @@ import { cloneObject, getGroupThumbnailUrl } from "..";
|
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
13
|
export async function _searchGroups(filter, options) {
|
|
14
|
-
var _a;
|
|
15
14
|
// expand filter so we can serialize to either api
|
|
16
15
|
const expanded = expandGroupFilter(filter);
|
|
17
16
|
// API
|
|
18
17
|
const api = expandApi(options.api || "arcgis");
|
|
19
18
|
if (api.type === "arcgis") {
|
|
20
19
|
const so = serializeGroupFilterForPortal(expanded);
|
|
21
|
-
let token = "";
|
|
22
20
|
// if we have auth, pass it forward
|
|
23
21
|
// otherwise set the portal property
|
|
24
22
|
if (options.authentication) {
|
|
25
23
|
so.authentication = options.authentication;
|
|
26
|
-
const us = options.authentication;
|
|
27
|
-
token = us.token;
|
|
28
24
|
}
|
|
29
25
|
else {
|
|
30
26
|
so.portal = `${api.url}/sharing/rest`;
|
|
31
27
|
}
|
|
32
|
-
// TODO: Dry this up - typscript makes this... inconvenient
|
|
33
28
|
if (options.num) {
|
|
34
29
|
so.num = options.num;
|
|
35
30
|
}
|
|
@@ -39,10 +34,6 @@ export async function _searchGroups(filter, options) {
|
|
|
39
34
|
if (options.sortOrder) {
|
|
40
35
|
so.sortOrder = options.sortOrder;
|
|
41
36
|
}
|
|
42
|
-
let portalUrl = `${api.url}/sharing/rest`;
|
|
43
|
-
if ((_a = so.authentication) === null || _a === void 0 ? void 0 : _a.portal) {
|
|
44
|
-
portalUrl = so.authentication.portal;
|
|
45
|
-
}
|
|
46
37
|
if (options.site) {
|
|
47
38
|
so.site = cloneObject(options.site);
|
|
48
39
|
}
|
|
@@ -63,8 +54,7 @@ function searchPortalGroups(searchOptions) {
|
|
|
63
54
|
group.siteTeamUrl = `${searchOptions.site.item.url}/teams/${group.id}/about`;
|
|
64
55
|
return group;
|
|
65
56
|
};
|
|
66
|
-
const portalUrl = ((_a = searchOptions.authentication) === null || _a === void 0 ? void 0 : _a.portal) ||
|
|
67
|
-
"https://www.arcgis.com/sharing/rest";
|
|
57
|
+
const portalUrl = ((_a = searchOptions.authentication) === null || _a === void 0 ? void 0 : _a.portal) || searchOptions.portal;
|
|
68
58
|
let token;
|
|
69
59
|
if (searchOptions.authentication) {
|
|
70
60
|
const us = searchOptions.authentication;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_searchGroups.js","sourceRoot":"","sources":["../../../src/search/_searchGroups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAmB,MAAM,IAAI,CAAC;AAMxE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAuB,EACvB,OAA0B
|
|
1
|
+
{"version":3,"file":"_searchGroups.js","sourceRoot":"","sources":["../../../src/search/_searchGroups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY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KAAK;YACrB,OAAO;YACP,IAAI,EAAE,eAAe,CACnB,aAAa,EACb,QAAQ,CAAC,SAAS,EAClB,QAAQ,CAAC,KAAK,EACd,kBAAkB,CACnB;SACyB,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -352,7 +352,7 @@ export function getNextFunction(request, nextStart, total, fn) {
|
|
|
352
352
|
* Construct a the full url to a group thumbnail
|
|
353
353
|
*
|
|
354
354
|
* - If the group has a thumbnail, construct the full url
|
|
355
|
-
* - If the group is not public, append on the token
|
|
355
|
+
* - If the group is not public, append on the token (if passed in)
|
|
356
356
|
* @param portalUrl
|
|
357
357
|
* @param group
|
|
358
358
|
* @param token
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-walk from a portalUrl to the corresponding Hub API Url
|
|
3
|
+
*
|
|
4
|
+
* If the passed url is not recognized, then this will return `undefined`
|
|
5
|
+
* @param portalUrl
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export function getHubApiFromPortalUrl(portalUrl) {
|
|
9
|
+
let result;
|
|
10
|
+
if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
|
|
11
|
+
result = "https://hubqa.arcgis.com";
|
|
12
|
+
}
|
|
13
|
+
else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
|
|
14
|
+
result = "https://hubdev.arcgis.com";
|
|
15
|
+
}
|
|
16
|
+
else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
|
|
17
|
+
result = "https://hub.arcgis.com";
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=getHubApiFromPortalUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getHubApiFromPortalUrl.js","sourceRoot":"","sources":["../../../src/urls/getHubApiFromPortalUrl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,sBAAsB,CAAC,SAAiB;IACtD,IAAI,MAAM,CAAC;IAEX,IAAI,SAAS,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE;QACnD,MAAM,GAAG,0BAA0B,CAAC;KACrC;SAAM,IAAI,SAAS,CAAC,KAAK,CAAC,mCAAmC,CAAC,EAAE;QAC/D,MAAM,GAAG,2BAA2B,CAAC;KACtC;SAAM,IAAI,SAAS,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE;QACtD,MAAM,GAAG,wBAAwB,CAAC;KACnC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given an org url, get the portal base url
|
|
3
|
+
*
|
|
4
|
+
* i.e. https://myorg.maps.arcgis.com will return https://www.arcgis.com
|
|
5
|
+
*
|
|
6
|
+
* @param orgUrl
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export function getPortalBaseFromOrgUrl(orgUrl) {
|
|
10
|
+
let result = orgUrl;
|
|
11
|
+
if (orgUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
|
|
12
|
+
result = "https://qaext.arcgis.com";
|
|
13
|
+
}
|
|
14
|
+
else if (orgUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
|
|
15
|
+
result = "https://devext.arcgis.com";
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
/* istanbul ignore else */
|
|
19
|
+
if (orgUrl.match(/(www|\.maps)\.arcgis.com/)) {
|
|
20
|
+
result = "https://www.arcgis.com";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=getPortalBaseFromOrgUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPortalBaseFromOrgUrl.js","sourceRoot":"","sources":["../../../src/urls/getPortalBaseFromOrgUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,IAAI,MAAM,GAAG,MAAM,CAAC;IAEpB,IAAI,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE;QAChD,MAAM,GAAG,0BAA0B,CAAC;KACrC;SAAM,IAAI,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,EAAE;QAC5D,MAAM,GAAG,2BAA2B,CAAC;KACtC;SAAM;QACL,0BAA0B;QAC1B,IAAI,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE;YAC5C,MAAM,GAAG,wBAAwB,CAAC;SACnC;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -14,6 +14,8 @@ export * from "./get-item-home-url";
|
|
|
14
14
|
export * from "./get-item-api-url";
|
|
15
15
|
export * from "./get-item-data-url";
|
|
16
16
|
export * from "./convert-urls-to-anchor-tags";
|
|
17
|
+
export * from "./getHubApiFromPortalUrl";
|
|
18
|
+
export * from "./getPortalBaseFromOrgUrl";
|
|
17
19
|
const MAP_OR_FEATURE_SERVER_URL_REGEX = /\/(map|feature)server/i;
|
|
18
20
|
/**
|
|
19
21
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/urls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/urls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAE1C,MAAM,+BAA+B,GAAG,wBAAwB,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAE,EAAE;IACrD,OAAO,+BAA+B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAE,EAAE;IACnD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,YAAY,IAAI,GAAG,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC;AAC/D,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|