@wix/data-resourceusage-service 1.0.0 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/data-resourceusage-service",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,10 +18,9 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/data-resourceusage-service_data": "1.0.0"
21
+ "@wix/data-resourceusage-service_data": "1.0.2"
22
22
  },
23
23
  "devDependencies": {
24
- "@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
25
24
  "glob": "^10.4.1",
26
25
  "rollup": "^4.18.0",
27
26
  "rollup-plugin-dts": "^6.1.1",
@@ -43,5 +42,5 @@
43
42
  "fqdn": ""
44
43
  }
45
44
  },
46
- "falconPackageHash": "652f677494424e1ae62f3d20e85f0c3fa06b75412116b19a9a32d757"
45
+ "falconPackageHash": "b28f18c78d3d48a758df0a235594087511cdd11270b9f2358271ed6e"
47
46
  }
@@ -1,88 +1,8 @@
1
- /** ResourceUsage describes site-wide resource limits and usage */
2
- interface ResourceUsage {
3
- /**
4
- * Used storage sum of Sandbox and Live environments, bytes
5
- * Replaced by live_used_storage_in_bytes
6
- * @deprecated
7
- * @replacedBy live_used_storage_in_bytes + sandbox_used_storage_in_bytes
8
- */
9
- totalUsedStorageInBytes?: string | null;
10
- /** Max storage, bytes */
11
- totalUsedStorageInBytesLimit?: string | null;
12
- /** Total number of native collections created */
13
- collectionCount?: number | null;
14
- /** Max number of native collections allowed */
15
- collectionCountLimit?: number | null;
16
- /**
17
- * Total number of items in native collections sum of Sandbox and Live environments
18
- * Replaced by live_item_count
19
- * @deprecated
20
- * @replacedBy live_item_count + sandbox_item_count
21
- */
22
- totalItemCount?: string | null;
23
- /** Max number of items in native collections */
24
- totalItemCountLimit?: string | null;
25
- /** Resource usages per data collection */
26
- dataCollectionUsages?: DataCollectionResourceUsage[];
27
- /** Used storage in Live environment */
28
- liveUsedStorageInBytes?: string | null;
29
- /** Number of items in native collections in Live environment */
30
- liveItemCount?: string | null;
31
- /** Used storage in Sandbox environment */
32
- sandboxUsedStorageInBytes?: string | null;
33
- /** Number of items in native collections in Sandbox environment */
34
- sandboxItemCount?: string | null;
35
- }
36
- interface DataCollectionResourceUsage {
37
- /** Data Collection ID */
38
- dataCollectionId?: string;
39
- /** Data Collection display name */
40
- displayName?: string | null;
41
- /** Data Collection item count in the live environment */
42
- liveItemCount?: string;
43
- /** Data Collection item count in the sandbox environment, none if disabled */
44
- sandboxItemCount?: string | null;
45
- /** Data Collection used storage in bytes in the live environment */
46
- liveUsedStorageInBytes?: string;
47
- /** Data Collection used storage in bytes in the sandbox environment, none if disabled */
48
- sandboxUsedStorageInBytes?: string | null;
49
- /** Type of data collection, currently only NATIVE or BLOCKS_APP are returned in this API */
50
- dataCollectionType?: CollectionType;
51
- }
52
- declare enum CollectionType {
53
- /** User-created collection. */
54
- NATIVE = "NATIVE",
55
- /** [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app when it is installed. This type of collection can be modified dynamically by that app (for example, Wix Forms). */
56
- WIX_APP = "WIX_APP",
57
- /** Collection created by a Wix Blocks app. */
58
- BLOCKS_APP = "BLOCKS_APP",
59
- /** Collection located in externally connected storage. */
60
- EXTERNAL = "EXTERNAL"
61
- }
62
- interface GetResourceUsageResponse {
63
- /** The retrieved ResourceUsage */
64
- resourceUsage?: ResourceUsage;
65
- }
66
- interface GetResourceUsageResponseNonNullableFields {
67
- resourceUsage?: {
68
- dataCollectionUsages: {
69
- dataCollectionId: string;
70
- liveItemCount: string;
71
- liveUsedStorageInBytes: string;
72
- dataCollectionType: CollectionType;
73
- }[];
74
- };
75
- }
76
- interface GetResourceUsageOptions {
77
- /** ResourceUsage fields to return, if empty all are returned */
78
- fields?: string[];
79
- /** If true, operation queries collections for up-to-date values (rather than using cached values) */
80
- consistentRead?: boolean;
81
- }
82
-
83
1
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
84
2
  interface HttpClient {
85
3
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
86
6
  }
87
7
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
88
8
  type HttpResponse<T = any> = {
@@ -105,9 +25,16 @@ type APIMetadata = {
105
25
  };
106
26
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
107
27
 
108
- declare function getResourceUsage$1(httpClient: HttpClient): (options?: GetResourceUsageOptions) => Promise<GetResourceUsageResponse & GetResourceUsageResponseNonNullableFields>;
28
+ declare global {
29
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
30
+ interface SymbolConstructor {
31
+ readonly observable: symbol;
32
+ }
33
+ }
34
+
35
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
109
36
 
110
- declare const getResourceUsage: BuildRESTFunction<typeof getResourceUsage$1>;
37
+ declare const getResourceUsage: ReturnType<typeof createRESTModule<typeof publicGetResourceUsage>>;
111
38
 
112
39
  declare const context_getResourceUsage: typeof getResourceUsage;
113
40
  declare namespace context {
@@ -381,6 +381,8 @@ interface GetResourceUsageOptions {
381
381
 
382
382
  interface HttpClient {
383
383
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
384
+ fetchWithAuth: typeof fetch;
385
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
384
386
  }
385
387
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
386
388
  type HttpResponse<T = any> = {
@@ -402,6 +404,13 @@ type APIMetadata = {
402
404
  packageName?: string;
403
405
  };
404
406
 
407
+ declare global {
408
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
409
+ interface SymbolConstructor {
410
+ readonly observable: symbol;
411
+ }
412
+ }
413
+
405
414
  declare const __metadata: {
406
415
  PACKAGE_NAME: string;
407
416
  };