@wix/data-resourceusage-service 1.0.1 → 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.1",
3
+ "version": "1.0.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,7 +18,7 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/data-resourceusage-service_data": "1.0.1"
21
+ "@wix/data-resourceusage-service_data": "1.0.2"
22
22
  },
23
23
  "devDependencies": {
24
24
  "glob": "^10.4.1",
@@ -42,5 +42,5 @@
42
42
  "fqdn": ""
43
43
  }
44
44
  },
45
- "falconPackageHash": "c462aa04e47589d7238874705692fc4a0a0e29ece62a447bef9141ef"
45
+ "falconPackageHash": "b28f18c78d3d48a758df0a235594087511cdd11270b9f2358271ed6e"
46
46
  }
@@ -1,89 +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>>;
86
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
87
6
  }
88
7
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
89
8
  type HttpResponse<T = any> = {
@@ -113,9 +32,9 @@ declare global {
113
32
  }
114
33
  }
115
34
 
116
- declare function getResourceUsage$1(httpClient: HttpClient): (options?: GetResourceUsageOptions) => Promise<GetResourceUsageResponse & GetResourceUsageResponseNonNullableFields>;
35
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
117
36
 
118
- declare const getResourceUsage: BuildRESTFunction<typeof getResourceUsage$1>;
37
+ declare const getResourceUsage: ReturnType<typeof createRESTModule<typeof publicGetResourceUsage>>;
119
38
 
120
39
  declare const context_getResourceUsage: typeof getResourceUsage;
121
40
  declare namespace context {
@@ -381,7 +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: (url: string | URL, init?: RequestInit) => Promise<Response>;
384
+ fetchWithAuth: typeof fetch;
385
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
385
386
  }
386
387
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
387
388
  type HttpResponse<T = any> = {