@atlaskit/util-service-support 6.1.1 → 6.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/util-service-support
2
2
 
3
+ ## 6.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
8
+
3
9
  ## 6.1.1
4
10
 
5
11
  ### Patch Changes
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-service-support",
3
- "version": "6.1.1"
3
+ "version": "6.1.2"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-service-support",
3
- "version": "6.1.1"
3
+ "version": "6.1.2"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/util-service-support",
3
- "version": "6.1.1"
3
+ "version": "6.1.2"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/util-service-support",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
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/"
@@ -30,7 +30,7 @@
30
30
  "es6-promise": "^4.0.5",
31
31
  "fetch-mock": "^8.0.0",
32
32
  "sinon": "^2.2.0",
33
- "typescript": "4.2.4"
33
+ "typescript": "4.3.5"
34
34
  },
35
35
  "keywords": [
36
36
  "fabric",
package/report.api.md ADDED
@@ -0,0 +1,127 @@
1
+ ## API Report File for "@atlaskit/util-service-support".
2
+
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
+
7
+ ```ts
8
+ export declare abstract class AbstractResource<Q, R, E, I, O>
9
+ implements Provider<Q, R, E, I, O> {
10
+ private lastResult;
11
+ private listeners;
12
+ abstract filter(query?: Q, options?: O): void;
13
+ subscribe(onChange: OnProviderChange<R, E, I>): void;
14
+ unsubscribe(onChange: OnProviderChange<R, E, I>): void;
15
+ protected notifyResult(result: R): void;
16
+ protected notifyError(error: E): void;
17
+ protected notifyInfo(info: I): void;
18
+ protected notifyNotReady(): void;
19
+ }
20
+
21
+ export declare const buildCredentials: (
22
+ secOptions?: SecurityOptions | undefined,
23
+ ) => 'omit' | 'include';
24
+
25
+ export declare interface KeyValues {
26
+ [index: string]: any;
27
+ }
28
+
29
+ export declare interface OnProviderChange<R, E, I> {
30
+ /**
31
+ * Normal callback on a search result, or updated search result.
32
+ */
33
+ result(result: R): void;
34
+ /**
35
+ * When something goes wrong, e.g. underlying service is not available.
36
+ */
37
+ error?(error: E): void;
38
+ /**
39
+ * Information to display, e.g. due to slow searches, initial message, etc.
40
+ */
41
+ info?(info: I): void;
42
+ /**
43
+ * Notifies if the Resource is not ready and won't respond to searches
44
+ * in a timely manner. Note searches that occur while not ready Will
45
+ * eventually be fulfilled.
46
+ */
47
+ notReady?(): void;
48
+ }
49
+
50
+ /**
51
+ * Defines a typical Resource.
52
+ *
53
+ * Q = query type
54
+ * R = result type
55
+ * E = error type
56
+ * I = info type
57
+ * O = options that filter can accept
58
+ */
59
+ export declare interface Provider<Q, R, E, I, O> {
60
+ /**
61
+ * Results are returned to the OnSearchResult
62
+ * in the subscriber.
63
+ *
64
+ * There may not be a 1-on-1 relationship between a search
65
+ * and a callback.
66
+ *
67
+ * For example, multiple queries may result in one callback if the
68
+ * responses are out of order (i.e. old responses are dropped). Or
69
+ * multiple callbacks may be fired, for example if the underlying data
70
+ * set to search has changed, the last search may be executed again
71
+ * with updated results.
72
+ */
73
+ filter(query?: Q, options?: O): void;
74
+ subscribe(onChange: OnProviderChange<R, E, I>): void;
75
+ unsubscribe(onChange: OnProviderChange<R, E, I>): void;
76
+ }
77
+
78
+ /**
79
+ * Returns a promise to a SecurityOptions that has just been forcibly refreshed with a
80
+ * new token. Will be used for single retry per request if a 401 is returned.
81
+ */
82
+ export declare interface RefreshSecurityProvider {
83
+ (): Promise<SecurityOptions>;
84
+ }
85
+
86
+ /**
87
+ * @returns Promise containing the json response
88
+ */
89
+ declare const requestService: <T>(
90
+ serviceConfig: ServiceConfig,
91
+ options?: RequestServiceOptions | undefined,
92
+ ) => Promise<T>;
93
+
94
+ export declare interface RequestServiceOptions {
95
+ path?: string;
96
+ queryParams?: KeyValues;
97
+ requestInit?: RequestInit;
98
+ ignoreResponsePayload?: boolean;
99
+ }
100
+
101
+ export declare interface SecurityOptions {
102
+ params?: KeyValues;
103
+ headers?: KeyValues;
104
+ omitCredentials?: boolean;
105
+ }
106
+
107
+ /**
108
+ * Returns the current SecurityOptions for the mentions service.
109
+ */
110
+ export declare interface SecurityProvider {
111
+ (): SecurityOptions;
112
+ }
113
+
114
+ export declare interface ServiceConfig {
115
+ url: string;
116
+ securityProvider?: SecurityProvider;
117
+ refreshedSecurityProvider?: RefreshSecurityProvider;
118
+ }
119
+
120
+ declare namespace serviceUtils {
121
+ export { requestService };
122
+ }
123
+
124
+ export declare const utils: typeof serviceUtils;
125
+
126
+ export {};
127
+ ```