@atlaskit/util-service-support 7.2.1 → 7.4.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.
@@ -1,62 +1 @@
1
- export const defaultRequestServiceOptions = {};
2
- export const buildUrl = (baseUrl, path = '', queryParams, secOptions) => {
3
- const searchParam = new URLSearchParams(
4
- // For relative urls, the URL class requires base to be set. It's ignored if a url is not relative.
5
- // Since we only care about search params it is fine to have any base url here.
6
- new URL(baseUrl, 'https://BASE_FALLBACK').search || undefined);
7
- baseUrl = baseUrl.split('?')[0];
8
- if (queryParams) {
9
- for (const key in queryParams) {
10
- if ({}.hasOwnProperty.call(queryParams, key)) {
11
- searchParam.append(key, queryParams[key]);
12
- }
13
- }
14
- }
15
- if (secOptions && secOptions.params) {
16
- for (const key in secOptions.params) {
17
- if ({}.hasOwnProperty.call(secOptions.params, key)) {
18
- const values = secOptions.params[key];
19
- if (Array.isArray(values)) {
20
- for (let i = 0; i < values.length; i++) {
21
- searchParam.append(key, values[i]);
22
- }
23
- } else {
24
- searchParam.append(key, values);
25
- }
26
- }
27
- }
28
- }
29
- let separator = '';
30
- if (path && baseUrl.substr(-1) !== '/' && !path.startsWith('/')) {
31
- separator = '/';
32
- }
33
- let params = searchParam.toString();
34
- if (params) {
35
- params = '?' + params;
36
- }
37
- return `${baseUrl}${separator}${path}${params}`;
38
- };
39
- const addToHeaders = (headers, keyValues) => {
40
- if (keyValues) {
41
- for (const key in keyValues) {
42
- if ({}.hasOwnProperty.call(keyValues, key)) {
43
- const values = keyValues[key];
44
- if (Array.isArray(values)) {
45
- for (let i = 0; i < values.length; i++) {
46
- headers[key] = values[i];
47
- }
48
- } else {
49
- headers[key] = values;
50
- }
51
- }
52
- }
53
- }
54
- };
55
- export const buildHeaders = (secOptions, extraHeaders) => {
56
- const headers = {};
57
- addToHeaders(headers, extraHeaders);
58
- if (secOptions) {
59
- addToHeaders(headers, secOptions.headers);
60
- }
61
- return headers;
62
- };
1
+ export const defaultRequestServiceOptions = {};
@@ -0,0 +1,24 @@
1
+ var addToHeaders = function addToHeaders(headers, keyValues) {
2
+ if (keyValues) {
3
+ for (var key in keyValues) {
4
+ if ({}.hasOwnProperty.call(keyValues, key)) {
5
+ var values = keyValues[key];
6
+ if (Array.isArray(values)) {
7
+ for (var i = 0; i < values.length; i++) {
8
+ headers[key] = values[i];
9
+ }
10
+ } else {
11
+ headers[key] = values;
12
+ }
13
+ }
14
+ }
15
+ }
16
+ };
17
+ export var buildHeaders = function buildHeaders(secOptions, extraHeaders) {
18
+ var headers = {};
19
+ addToHeaders(headers, extraHeaders);
20
+ if (secOptions) {
21
+ addToHeaders(headers, secOptions.headers);
22
+ }
23
+ return headers;
24
+ };
@@ -0,0 +1,40 @@
1
+ export var buildUrl = function buildUrl(baseUrl) {
2
+ var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
3
+ var queryParams = arguments.length > 2 ? arguments[2] : undefined;
4
+ var secOptions = arguments.length > 3 ? arguments[3] : undefined;
5
+ var searchParam = new URLSearchParams(
6
+ // For relative urls, the URL class requires base to be set. It's ignored if a url is not relative.
7
+ // Since we only care about search params it is fine to have any base url here.
8
+ new URL(baseUrl, 'https://BASE_FALLBACK').search || undefined);
9
+ baseUrl = baseUrl.split('?')[0];
10
+ if (queryParams) {
11
+ for (var key in queryParams) {
12
+ if ({}.hasOwnProperty.call(queryParams, key)) {
13
+ searchParam.append(key, queryParams[key]);
14
+ }
15
+ }
16
+ }
17
+ if (secOptions && secOptions.params) {
18
+ for (var _key in secOptions.params) {
19
+ if ({}.hasOwnProperty.call(secOptions.params, _key)) {
20
+ var values = secOptions.params[_key];
21
+ if (Array.isArray(values)) {
22
+ for (var i = 0; i < values.length; i++) {
23
+ searchParam.append(_key, values[i]);
24
+ }
25
+ } else {
26
+ searchParam.append(_key, values);
27
+ }
28
+ }
29
+ }
30
+ }
31
+ var separator = '';
32
+ if (path && baseUrl.substr(-1) !== '/' && !path.startsWith('/')) {
33
+ separator = '/';
34
+ }
35
+ var params = searchParam.toString();
36
+ if (params) {
37
+ params = '?' + params;
38
+ }
39
+ return "".concat(baseUrl).concat(separator).concat(path).concat(params);
40
+ };
@@ -0,0 +1,17 @@
1
+ var TRACING_RESPONSE_HEADERS = ['x-trace-id', 'atl-request-id'];
2
+
3
+ /**
4
+ * Extracts tracing headers (x-trace-id, atl-request-id) from a Response object.
5
+ * Returns only headers that are present in the response.
6
+ */
7
+ export var extractTracingHeaders = function extractTracingHeaders(response) {
8
+ var headers = {};
9
+ for (var _i = 0, _TRACING_RESPONSE_HEA = TRACING_RESPONSE_HEADERS; _i < _TRACING_RESPONSE_HEA.length; _i++) {
10
+ var name = _TRACING_RESPONSE_HEA[_i];
11
+ var value = response.headers.get(name);
12
+ if (value) {
13
+ headers[name] = value;
14
+ }
15
+ }
16
+ return headers;
17
+ };
@@ -4,9 +4,11 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import { meros } from 'meros/browser';
7
- import { buildCredentials } from './types';
8
- import { buildHeaders, buildUrl, defaultRequestServiceOptions } from './shared';
9
7
  import { getActiveTraceHttpRequestHeaders } from '@atlaskit/react-ufo/experience-trace-id-context';
8
+ import { buildHeaders } from './buildHeaders';
9
+ import { buildUrl } from './buildUrl';
10
+ import { defaultRequestServiceOptions } from './shared';
11
+ import { buildCredentials } from './types';
10
12
 
11
13
  /** Copied from meros types, as there are difficulties with resolving the type in CI */
12
14
 
@@ -0,0 +1,66 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ import { getActiveTraceHttpRequestHeaders } from '@atlaskit/react-ufo/experience-trace-id-context';
5
+ import { buildHeaders } from './buildHeaders';
6
+ import { buildUrl } from './buildUrl';
7
+ import { extractTracingHeaders } from './extractTracingHeaders';
8
+ import { defaultRequestServiceOptions } from './shared';
9
+ import { buildCredentials } from './types';
10
+
11
+ /**
12
+ * @returns Promise containing the json response
13
+ */
14
+ var _requestService = function requestService(serviceConfig, options) {
15
+ var url = serviceConfig.url,
16
+ securityProvider = serviceConfig.securityProvider,
17
+ refreshedSecurityProvider = serviceConfig.refreshedSecurityProvider;
18
+ var _ref = options || defaultRequestServiceOptions,
19
+ path = _ref.path,
20
+ queryParams = _ref.queryParams,
21
+ requestInit = _ref.requestInit;
22
+ var secOptions = securityProvider && securityProvider();
23
+ var requestUrl = buildUrl(url, path, queryParams, secOptions);
24
+ var headers = buildHeaders(secOptions, requestInit && requestInit.headers);
25
+ var credentials = buildCredentials(secOptions);
26
+ var ignoreResponsePayload = (options === null || options === void 0 ? void 0 : options.ignoreResponsePayload) || false;
27
+
28
+ // Get tracing headers from UFO
29
+ var tracingHeaders = getActiveTraceHttpRequestHeaders(url);
30
+ var requestOptions = _objectSpread(_objectSpread({}, requestInit), {}, {
31
+ // populate headers mainly for the collab provider however
32
+ // other components which uses this util can get the header as well.
33
+ // Those tracing headers shall not incur any issues as long as backends handle them properly
34
+ headers: _objectSpread(_objectSpread({}, headers), tracingHeaders),
35
+ credentials: credentials
36
+ });
37
+ return fetch(requestUrl, requestOptions).then(function (response) {
38
+ if (options !== null && options !== void 0 && options.reportTracingHeaders) {
39
+ var _tracingHeaders = extractTracingHeaders(response);
40
+ if (Object.keys(_tracingHeaders).length > 0) {
41
+ options.reportTracingHeaders(_tracingHeaders);
42
+ }
43
+ }
44
+ if (response.status === 204) {
45
+ return Promise.resolve();
46
+ } else if (response.ok) {
47
+ return ignoreResponsePayload ? Promise.resolve() : response.json();
48
+ } else if (response.status === 401 && refreshedSecurityProvider) {
49
+ // auth issue - try once
50
+ return refreshedSecurityProvider().then(function (newSecOptions) {
51
+ var retryServiceConfig = {
52
+ url: url,
53
+ securityProvider: function securityProvider() {
54
+ return newSecOptions;
55
+ }
56
+ };
57
+ return _requestService(retryServiceConfig, options);
58
+ });
59
+ }
60
+ return Promise.reject({
61
+ code: response.status,
62
+ reason: response.statusText
63
+ });
64
+ });
65
+ };
66
+ export { _requestService as requestService };
@@ -1,80 +1,9 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- import { getActiveTraceHttpRequestHeaders } from '@atlaskit/react-ufo/experience-trace-id-context';
5
- import { buildCredentials } from './types';
6
- import { defaultRequestServiceOptions, buildUrl, buildHeaders } from './shared';
7
- var TRACING_RESPONSE_HEADERS = ['x-trace-id', 'atl-request-id'];
8
-
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
9
2
  /**
10
- * Extracts tracing headers (x-trace-id, atl-request-id) from a Response object.
11
- * Returns only headers that are present in the response.
3
+ * @deprecated Use `import { extractTracingHeaders } from '@atlaskit/util-service-support/extractTracingHeaders'` instead.
12
4
  */
13
- export var extractTracingHeaders = function extractTracingHeaders(response) {
14
- var headers = {};
15
- for (var _i = 0, _TRACING_RESPONSE_HEA = TRACING_RESPONSE_HEADERS; _i < _TRACING_RESPONSE_HEA.length; _i++) {
16
- var name = _TRACING_RESPONSE_HEA[_i];
17
- var value = response.headers.get(name);
18
- if (value) {
19
- headers[name] = value;
20
- }
21
- }
22
- return headers;
23
- };
24
-
5
+ export { extractTracingHeaders } from './extractTracingHeaders';
25
6
  /**
26
- * @returns Promise containing the json response
7
+ * @deprecated Use `import { requestService } from '@atlaskit/util-service-support/requestService'` instead.
27
8
  */
28
- var _requestService = function requestService(serviceConfig, options) {
29
- var url = serviceConfig.url,
30
- securityProvider = serviceConfig.securityProvider,
31
- refreshedSecurityProvider = serviceConfig.refreshedSecurityProvider;
32
- var _ref = options || defaultRequestServiceOptions,
33
- path = _ref.path,
34
- queryParams = _ref.queryParams,
35
- requestInit = _ref.requestInit;
36
- var secOptions = securityProvider && securityProvider();
37
- var requestUrl = buildUrl(url, path, queryParams, secOptions);
38
- var headers = buildHeaders(secOptions, requestInit && requestInit.headers);
39
- var credentials = buildCredentials(secOptions);
40
- var ignoreResponsePayload = (options === null || options === void 0 ? void 0 : options.ignoreResponsePayload) || false;
41
-
42
- // Get tracing headers from UFO
43
- var tracingHeaders = getActiveTraceHttpRequestHeaders(url);
44
- var requestOptions = _objectSpread(_objectSpread({}, requestInit), {}, {
45
- // populate headers mainly for the collab provider however
46
- // other components which uses this util can get the header as well.
47
- // Those tracing headers shall not incur any issues as long as backends handle them properly
48
- headers: _objectSpread(_objectSpread({}, headers), tracingHeaders),
49
- credentials: credentials
50
- });
51
- return fetch(requestUrl, requestOptions).then(function (response) {
52
- if (options !== null && options !== void 0 && options.reportTracingHeaders) {
53
- var _tracingHeaders = extractTracingHeaders(response);
54
- if (Object.keys(_tracingHeaders).length > 0) {
55
- options.reportTracingHeaders(_tracingHeaders);
56
- }
57
- }
58
- if (response.status === 204) {
59
- return Promise.resolve();
60
- } else if (response.ok) {
61
- return ignoreResponsePayload ? Promise.resolve() : response.json();
62
- } else if (response.status === 401 && refreshedSecurityProvider) {
63
- // auth issue - try once
64
- return refreshedSecurityProvider().then(function (newSecOptions) {
65
- var retryServiceConfig = {
66
- url: url,
67
- securityProvider: function securityProvider() {
68
- return newSecOptions;
69
- }
70
- };
71
- return _requestService(retryServiceConfig, options);
72
- });
73
- }
74
- return Promise.reject({
75
- code: response.status,
76
- reason: response.statusText
77
- });
78
- });
79
- };
80
- export { _requestService as requestService };
9
+ export { requestService } from './requestService';
@@ -1,65 +1 @@
1
- export var defaultRequestServiceOptions = {};
2
- export var buildUrl = function buildUrl(baseUrl) {
3
- var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4
- var queryParams = arguments.length > 2 ? arguments[2] : undefined;
5
- var secOptions = arguments.length > 3 ? arguments[3] : undefined;
6
- var searchParam = new URLSearchParams(
7
- // For relative urls, the URL class requires base to be set. It's ignored if a url is not relative.
8
- // Since we only care about search params it is fine to have any base url here.
9
- new URL(baseUrl, 'https://BASE_FALLBACK').search || undefined);
10
- baseUrl = baseUrl.split('?')[0];
11
- if (queryParams) {
12
- for (var key in queryParams) {
13
- if ({}.hasOwnProperty.call(queryParams, key)) {
14
- searchParam.append(key, queryParams[key]);
15
- }
16
- }
17
- }
18
- if (secOptions && secOptions.params) {
19
- for (var _key in secOptions.params) {
20
- if ({}.hasOwnProperty.call(secOptions.params, _key)) {
21
- var values = secOptions.params[_key];
22
- if (Array.isArray(values)) {
23
- for (var i = 0; i < values.length; i++) {
24
- searchParam.append(_key, values[i]);
25
- }
26
- } else {
27
- searchParam.append(_key, values);
28
- }
29
- }
30
- }
31
- }
32
- var separator = '';
33
- if (path && baseUrl.substr(-1) !== '/' && !path.startsWith('/')) {
34
- separator = '/';
35
- }
36
- var params = searchParam.toString();
37
- if (params) {
38
- params = '?' + params;
39
- }
40
- return "".concat(baseUrl).concat(separator).concat(path).concat(params);
41
- };
42
- var addToHeaders = function addToHeaders(headers, keyValues) {
43
- if (keyValues) {
44
- for (var key in keyValues) {
45
- if ({}.hasOwnProperty.call(keyValues, key)) {
46
- var values = keyValues[key];
47
- if (Array.isArray(values)) {
48
- for (var i = 0; i < values.length; i++) {
49
- headers[key] = values[i];
50
- }
51
- } else {
52
- headers[key] = values;
53
- }
54
- }
55
- }
56
- }
57
- };
58
- export var buildHeaders = function buildHeaders(secOptions, extraHeaders) {
59
- var headers = {};
60
- addToHeaders(headers, extraHeaders);
61
- if (secOptions) {
62
- addToHeaders(headers, secOptions.headers);
63
- }
64
- return headers;
65
- };
1
+ export var defaultRequestServiceOptions = {};
@@ -0,0 +1,2 @@
1
+ import type { KeyValues, SecurityOptions } from './types';
2
+ export declare const buildHeaders: (secOptions?: SecurityOptions, extraHeaders?: KeyValues) => KeyValues;
@@ -0,0 +1,2 @@
1
+ import type { KeyValues, SecurityOptions } from './types';
2
+ export declare const buildUrl: (baseUrl: string, path?: string, queryParams?: KeyValues, secOptions?: SecurityOptions) => string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Extracts tracing headers (x-trace-id, atl-request-id) from a Response object.
3
+ * Returns only headers that are present in the response.
4
+ */
5
+ export declare const extractTracingHeaders: (response: Response) => Record<string, string>;
@@ -0,0 +1,5 @@
1
+ import { type RequestServiceOptions, type ServiceConfig } from './types';
2
+ /**
3
+ * @returns Promise containing the json response
4
+ */
5
+ export declare const requestService: <T>(serviceConfig: ServiceConfig, options?: RequestServiceOptions) => Promise<T>;
@@ -1,10 +1,8 @@
1
- import { type RequestServiceOptions, type ServiceConfig } from './types';
2
1
  /**
3
- * Extracts tracing headers (x-trace-id, atl-request-id) from a Response object.
4
- * Returns only headers that are present in the response.
2
+ * @deprecated Use `import { extractTracingHeaders } from '@atlaskit/util-service-support/extractTracingHeaders'` instead.
5
3
  */
6
- export declare const extractTracingHeaders: (response: Response) => Record<string, string>;
4
+ export { extractTracingHeaders } from './extractTracingHeaders';
7
5
  /**
8
- * @returns Promise containing the json response
6
+ * @deprecated Use `import { requestService } from '@atlaskit/util-service-support/requestService'` instead.
9
7
  */
10
- export declare const requestService: <T>(serviceConfig: ServiceConfig, options?: RequestServiceOptions) => Promise<T>;
8
+ export { requestService } from './requestService';
@@ -1,4 +1,2 @@
1
- import type { RequestServiceOptions, KeyValues, SecurityOptions } from './types';
1
+ import type { RequestServiceOptions } from './types';
2
2
  export declare const defaultRequestServiceOptions: RequestServiceOptions;
3
- export declare const buildUrl: (baseUrl: string, path?: string, queryParams?: KeyValues, secOptions?: SecurityOptions) => string;
4
- export declare const buildHeaders: (secOptions?: SecurityOptions, extraHeaders?: KeyValues) => KeyValues;
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@atlaskit/util-service-support/extractTracingHeaders",
3
+ "main": "../dist/cjs/extractTracingHeaders.js",
4
+ "module": "../dist/esm/extractTracingHeaders.js",
5
+ "module:es2019": "../dist/es2019/extractTracingHeaders.js",
6
+ "types": "../dist/types/extractTracingHeaders.d.ts"
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/util-service-support",
3
- "version": "7.2.1",
3
+ "version": "7.4.0",
4
4
  "description": "A library of support classes for integrating React components with REST HTTP services",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,9 +27,9 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@atlaskit/platform-feature-flags": "^2.1.0",
30
+ "@atlaskit/platform-feature-flags": "^2.2.0",
31
31
  "@atlaskit/react-compiler-gating": "^0.2.0",
32
- "@atlaskit/react-ufo": "^7.7.0",
32
+ "@atlaskit/react-ufo": "^7.8.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "meros": "^1.3.0"
35
35
  },
@@ -43,10 +43,5 @@
43
43
  "ui",
44
44
  "private"
45
45
  ],
46
- "techstack": {
47
- "@atlassian/frontend": {
48
- "tree-shaking": []
49
- }
50
- },
51
46
  "platform-feature-flags": {}
52
47
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@atlaskit/util-service-support/requestService",
3
+ "main": "../dist/cjs/requestService.js",
4
+ "module": "../dist/esm/requestService.js",
5
+ "module:es2019": "../dist/es2019/requestService.js",
6
+ "types": "../dist/types/requestService.d.ts"
7
+ }
@@ -1,35 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.local-consumption.json",
3
- "compilerOptions": {
4
- "outDir": "../../../../../confluence/tsDist/@atlaskit__util-service-support",
5
- "rootDir": "../",
6
- "composite": true,
7
- "noCheck": true
8
- },
9
- "include": [
10
- "../src/**/*.ts",
11
- "../src/**/*.tsx"
12
- ],
13
- "exclude": [
14
- "../src/**/__tests__/*",
15
- "../src/**/*.test.*",
16
- "../src/**/test.*",
17
- "../src/**/examples.*",
18
- "../src/**/examples/*",
19
- "../src/**/examples/**/*",
20
- "../src/**/*.stories.*",
21
- "../src/**/stories/*",
22
- "../src/**/stories/**/*"
23
- ],
24
- "references": [
25
- {
26
- "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
27
- },
28
- {
29
- "path": "../../../react-compiler/react-compiler-gating/afm-cc/tsconfig.json"
30
- },
31
- {
32
- "path": "../../../react-ufo/atlaskit/afm-cc/tsconfig.json"
33
- }
34
- ]
35
- }
package/report.api.md DELETED
@@ -1,133 +0,0 @@
1
- <!-- API Report Version: 2.3 -->
2
-
3
- ## API Report File for "@atlaskit/util-service-support"
4
-
5
- > Do not edit this file. This report is auto-generated using
6
- > [API Extractor](https://api-extractor.com/).
7
- > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
8
-
9
- ### Table of contents
10
-
11
- - [Main Entry Types](#main-entry-types)
12
- - [Peer Dependencies](#peer-dependencies)
13
-
14
- ### Main Entry Types
15
-
16
- <!--SECTION START: Main Entry Types-->
17
-
18
- ```ts
19
- // @public (undocumented)
20
- export abstract class AbstractResource<Q, R, E, I, O> implements Provider<Q, R, E, I, O> {
21
- // (undocumented)
22
- abstract filter(query?: Q, options?: O): void;
23
- // (undocumented)
24
- protected notifyError(error: E): void;
25
- // (undocumented)
26
- protected notifyInfo(info: I): void;
27
- // (undocumented)
28
- protected notifyNotReady(): void;
29
- // (undocumented)
30
- protected notifyResult(result: R): void;
31
- // (undocumented)
32
- subscribe(onChange: OnProviderChange<R, E, I>): void;
33
- // (undocumented)
34
- unsubscribe(onChange: OnProviderChange<R, E, I>): void;
35
- }
36
-
37
- // @public (undocumented)
38
- export const buildCredentials: (secOptions?: SecurityOptions) => 'include' | 'omit';
39
-
40
- // @public (undocumented)
41
- export interface KeyValues {
42
- // (undocumented)
43
- [index: string]: any;
44
- }
45
-
46
- // @public (undocumented)
47
- export interface OnProviderChange<R, E, I> {
48
- error?(error: E): void;
49
- info?(info: I): void;
50
- notReady?(): void;
51
- result(result: R): void;
52
- }
53
-
54
- // @public
55
- export interface Provider<Q, R, E, I, O> {
56
- filter(query?: Q, options?: O): void;
57
- // (undocumented)
58
- subscribe(onChange: OnProviderChange<R, E, I>): void;
59
- // (undocumented)
60
- unsubscribe(onChange: OnProviderChange<R, E, I>): void;
61
- }
62
-
63
- // @public
64
- export interface RefreshSecurityProvider {
65
- // (undocumented)
66
- (): Promise<SecurityOptions>;
67
- }
68
-
69
- // @public (undocumented)
70
- const requestService: <T>(
71
- serviceConfig: ServiceConfig,
72
- options?: RequestServiceOptions,
73
- ) => Promise<T>;
74
-
75
- // @public (undocumented)
76
- export interface RequestServiceOptions {
77
- // (undocumented)
78
- ignoreResponsePayload?: boolean;
79
- // (undocumented)
80
- path?: string;
81
- // (undocumented)
82
- queryParams?: KeyValues;
83
- // (undocumented)
84
- requestInit?: RequestInit;
85
- }
86
-
87
- // @public (undocumented)
88
- export interface SecurityOptions {
89
- // (undocumented)
90
- headers?: KeyValues;
91
- // (undocumented)
92
- omitCredentials?: boolean;
93
- // (undocumented)
94
- params?: KeyValues;
95
- }
96
-
97
- // @public
98
- export interface SecurityProvider {
99
- // (undocumented)
100
- (): SecurityOptions;
101
- }
102
-
103
- // @public (undocumented)
104
- export interface ServiceConfig {
105
- // (undocumented)
106
- refreshedSecurityProvider?: RefreshSecurityProvider;
107
- // (undocumented)
108
- securityProvider?: SecurityProvider;
109
- // (undocumented)
110
- url: string;
111
- }
112
-
113
- declare namespace serviceUtils {
114
- export { requestService };
115
- }
116
-
117
- // @public (undocumented)
118
- export const utils: typeof serviceUtils;
119
-
120
- // (No @packageDocumentation comment for this package)
121
- ```
122
-
123
- <!--SECTION END: Main Entry Types-->
124
-
125
- ### Peer Dependencies
126
-
127
- <!--SECTION START: Peer Dependencies-->
128
-
129
- ```json
130
- {}
131
- ```
132
-
133
- <!--SECTION END: Peer Dependencies-->