@wix/data-resourceusage-service 1.0.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.
@@ -0,0 +1 @@
1
+ export * as data from '@wix/data-resourceusage-service_data/context';
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.data = void 0;
27
+ exports.data = __importStar(require("@wix/data-resourceusage-service_data/context"));
28
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qFAAqE"}
@@ -0,0 +1 @@
1
+ export * as data from '@wix/data-resourceusage-service_data';
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.data = void 0;
27
+ exports.data = __importStar(require("@wix/data-resourceusage-service_data"));
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAA6D"}
@@ -0,0 +1 @@
1
+ export * as data from '@wix/data-resourceusage-service_data/meta';
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.data = void 0;
27
+ exports.data = __importStar(require("@wix/data-resourceusage-service_data/meta"));
28
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAAkE"}
@@ -0,0 +1 @@
1
+ export * as data from '@wix/data-resourceusage-service_data/context';
@@ -0,0 +1,2 @@
1
+ export * as data from '@wix/data-resourceusage-service_data/context';
2
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,8CAA8C,CAAC"}
@@ -0,0 +1 @@
1
+ export * as data from '@wix/data-resourceusage-service_data';
@@ -0,0 +1,2 @@
1
+ export * as data from '@wix/data-resourceusage-service_data';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,sCAAsC,CAAC"}
@@ -0,0 +1 @@
1
+ export * as data from '@wix/data-resourceusage-service_data/meta';
@@ -0,0 +1,2 @@
1
+ export * as data from '@wix/data-resourceusage-service_data/meta';
2
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,2CAA2C,CAAC"}
@@ -0,0 +1,7 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../build/es/context.js",
4
+ "main": "../build/cjs/context.js",
5
+ "typings": "../build/cjs/context.d.ts",
6
+ "typesBundle": "../type-bundles/context.bundle.d.ts"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../build/es/meta.js",
4
+ "main": "../build/cjs/meta.js",
5
+ "typings": "../build/cjs/meta.d.ts",
6
+ "typesBundle": "../type-bundles/meta.bundle.d.ts"
7
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@wix/data-resourceusage-service",
3
+ "version": "1.0.0",
4
+ "publishConfig": {
5
+ "registry": "https://registry.npmjs.org/",
6
+ "access": "public"
7
+ },
8
+ "sideEffects": false,
9
+ "module": "build/es/index.js",
10
+ "main": "build/cjs/index.js",
11
+ "typings": "./build/cjs/index.d.ts",
12
+ "typesBundle": "./type-bundles/index.bundle.d.ts",
13
+ "files": [
14
+ "build",
15
+ "frontend/package.json",
16
+ "meta",
17
+ "context",
18
+ "type-bundles"
19
+ ],
20
+ "dependencies": {
21
+ "@wix/data-resourceusage-service_data": "1.0.0"
22
+ },
23
+ "devDependencies": {
24
+ "@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
25
+ "glob": "^10.4.1",
26
+ "rollup": "^4.18.0",
27
+ "rollup-plugin-dts": "^6.1.1",
28
+ "typescript": "^5.3.2"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc -b tsconfig.json tsconfig.esm.json && npm run build:dts-bundles",
32
+ "build:dts-bundles": "test -f config/rollup-config.js && rollup --config config/rollup-config.js || echo 'Warning: config/rollup-config.js not found!'",
33
+ "test": ":"
34
+ },
35
+ "wix": {
36
+ "artifact": {
37
+ "groupId": "com.wixpress.public-sdk-autogen",
38
+ "artifactId": "data-resourceusage-service-public-sdk-autogen",
39
+ "isRootPublicSdk": true
40
+ },
41
+ "sdkDependency": {
42
+ "fqdnNamespace": "",
43
+ "fqdn": ""
44
+ }
45
+ },
46
+ "falconPackageHash": "652f677494424e1ae62f3d20e85f0c3fa06b75412116b19a9a32d757"
47
+ }
@@ -0,0 +1,117 @@
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
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
84
+ interface HttpClient {
85
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
86
+ }
87
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
88
+ type HttpResponse<T = any> = {
89
+ data: T;
90
+ status: number;
91
+ statusText: string;
92
+ headers: any;
93
+ request?: any;
94
+ };
95
+ type RequestOptions<_TResponse = any, Data = any> = {
96
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
97
+ url: string;
98
+ data?: Data;
99
+ params?: URLSearchParams;
100
+ } & APIMetadata;
101
+ type APIMetadata = {
102
+ methodFqn?: string;
103
+ entityFqdn?: string;
104
+ packageName?: string;
105
+ };
106
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
107
+
108
+ declare function getResourceUsage$1(httpClient: HttpClient): (options?: GetResourceUsageOptions) => Promise<GetResourceUsageResponse & GetResourceUsageResponseNonNullableFields>;
109
+
110
+ declare const getResourceUsage: BuildRESTFunction<typeof getResourceUsage$1>;
111
+
112
+ declare const context_getResourceUsage: typeof getResourceUsage;
113
+ declare namespace context {
114
+ export { context_getResourceUsage as getResourceUsage };
115
+ }
116
+
117
+ export { context as data };
@@ -0,0 +1,457 @@
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 GetResourceUsageRequest {
63
+ /** ResourceUsage fields to return, if empty all are returned */
64
+ fields?: string[];
65
+ /** If true, operation queries collections for up-to-date values (rather than using cached values) */
66
+ consistentRead?: boolean;
67
+ }
68
+ interface GetResourceUsageResponse {
69
+ /** The retrieved ResourceUsage */
70
+ resourceUsage?: ResourceUsage;
71
+ }
72
+ interface BulkUpdateUsagesRequest {
73
+ updates?: InstanceUsageUpdate[];
74
+ }
75
+ interface DataCollectionResourceUsageUpdate {
76
+ /** Data Collection ID */
77
+ dataCollectionId?: string;
78
+ /** if true present values are added to existing, otherwise values are replaced */
79
+ relative?: boolean;
80
+ /** Data Collection item count in the live environment */
81
+ liveItemCount?: string | null;
82
+ /** Data Collection item count in the sandbox environment */
83
+ sandboxItemCount?: string | null;
84
+ /** Data Collection used storage in bytes in the live environment */
85
+ liveUsedStorageInBytes?: string | null;
86
+ /** Data Collection used storage in bytes in the sandbox environment */
87
+ sandboxUsedStorageInBytes?: string | null;
88
+ }
89
+ declare enum Segment {
90
+ BOTH = "BOTH",
91
+ LIVE = "LIVE",
92
+ SANDBOX = "SANDBOX"
93
+ }
94
+ interface InstanceUsageUpdate {
95
+ /** Data Instance ID */
96
+ instanceId?: string;
97
+ /** Usage updates per collection */
98
+ collections?: DataCollectionResourceUsageUpdate[];
99
+ /** if true all collections not in the list assumed to have 0 usage */
100
+ allCollectionsPresent?: boolean;
101
+ /** Indicates which segment is being updated */
102
+ segment?: Segment;
103
+ }
104
+ interface BulkUpdateUsagesResponse {
105
+ }
106
+ interface GetStoredUsageRequest {
107
+ instanceId?: string;
108
+ }
109
+ interface GetStoredUsageResponse {
110
+ usages?: DataCollectionResourceUsage[];
111
+ }
112
+ interface DomainEvent extends DomainEventBodyOneOf {
113
+ createdEvent?: EntityCreatedEvent;
114
+ updatedEvent?: EntityUpdatedEvent;
115
+ deletedEvent?: EntityDeletedEvent;
116
+ actionEvent?: ActionEvent;
117
+ /**
118
+ * Unique event ID.
119
+ * Allows clients to ignore duplicate webhooks.
120
+ */
121
+ _id?: string;
122
+ /**
123
+ * Assumes actions are also always typed to an entity_type
124
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
125
+ */
126
+ entityFqdn?: string;
127
+ /**
128
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
129
+ * This is although the created/updated/deleted notion is duplication of the oneof types
130
+ * Example: created/updated/deleted/started/completed/email_opened
131
+ */
132
+ slug?: string;
133
+ /** ID of the entity associated with the event. */
134
+ entityId?: string;
135
+ /** Event timestamp. */
136
+ eventTime?: Date;
137
+ /**
138
+ * Whether the event was triggered as a result of a privacy regulation application
139
+ * (for example, GDPR).
140
+ */
141
+ triggeredByAnonymizeRequest?: boolean | null;
142
+ /** If present, indicates the action that triggered the event. */
143
+ originatedFrom?: string | null;
144
+ /**
145
+ * A sequence number defining the order of updates to the underlying entity.
146
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
147
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
148
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
149
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
150
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
151
+ */
152
+ entityEventSequence?: string | null;
153
+ }
154
+ /** @oneof */
155
+ interface DomainEventBodyOneOf {
156
+ createdEvent?: EntityCreatedEvent;
157
+ updatedEvent?: EntityUpdatedEvent;
158
+ deletedEvent?: EntityDeletedEvent;
159
+ actionEvent?: ActionEvent;
160
+ }
161
+ interface EntityCreatedEvent {
162
+ entity?: string;
163
+ }
164
+ interface EntityUpdatedEvent {
165
+ /**
166
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
167
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
168
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
169
+ */
170
+ currentEntity?: string;
171
+ }
172
+ interface EntityDeletedEvent {
173
+ /** Entity that was deleted */
174
+ deletedEntity?: string | null;
175
+ }
176
+ interface ActionEvent {
177
+ body?: string;
178
+ }
179
+ interface Empty {
180
+ }
181
+ interface DataChangeEvent extends DataChangeEventEventOneOf {
182
+ dataChanged?: DataChanged;
183
+ /** resume point is lost so some changes may be lost */
184
+ changesLost?: ChangesLost;
185
+ referenceChanged?: ReferenceChanged;
186
+ /** segment access or mapping changed */
187
+ segmentChanged?: SegmentChanged;
188
+ /** segment migration started to new physical location */
189
+ segmentMigrationStarted?: SegmentMigrationStarted;
190
+ }
191
+ /** @oneof */
192
+ interface DataChangeEventEventOneOf {
193
+ dataChanged?: DataChanged;
194
+ /** resume point is lost so some changes may be lost */
195
+ changesLost?: ChangesLost;
196
+ referenceChanged?: ReferenceChanged;
197
+ /** segment access or mapping changed */
198
+ segmentChanged?: SegmentChanged;
199
+ /** segment migration started to new physical location */
200
+ segmentMigrationStarted?: SegmentMigrationStarted;
201
+ }
202
+ interface DataChanged extends DataChangedChangeOneOf {
203
+ /** inserted document */
204
+ inserted?: Record<string, any> | null;
205
+ /** full replaced document */
206
+ replaced?: Record<string, any> | null;
207
+ /** partial update, removed fields are set to Empty */
208
+ partial?: Record<string, any> | null;
209
+ /** deleted document ID */
210
+ removedId?: string;
211
+ /** physical cluster ID */
212
+ clusterId?: string;
213
+ /**
214
+ * physical source
215
+ * db.collection for MongoDB
216
+ */
217
+ source?: string;
218
+ /** instance ID */
219
+ tenantId?: string;
220
+ /** logical collection name */
221
+ collectionName?: string;
222
+ dataStore?: DataStore;
223
+ documentId?: string;
224
+ clusterTime?: Date;
225
+ /** raw resume token BSON */
226
+ resumeToken?: string;
227
+ /** Initiator of the request */
228
+ initiator?: Initiator;
229
+ }
230
+ /** @oneof */
231
+ interface DataChangedChangeOneOf {
232
+ /** inserted document */
233
+ inserted?: Record<string, any> | null;
234
+ /** full replaced document */
235
+ replaced?: Record<string, any> | null;
236
+ /** partial update, removed fields are set to Empty */
237
+ partial?: Record<string, any> | null;
238
+ /** deleted document ID */
239
+ removedId?: string;
240
+ }
241
+ declare enum Type {
242
+ /** Initiator is unknown */
243
+ Unknown = "Unknown",
244
+ /** Indicated that write has been initiated by SSR indexer */
245
+ SsrIndexer = "SsrIndexer"
246
+ }
247
+ declare enum DataStore {
248
+ Dev = "Dev",
249
+ Public = "Public"
250
+ }
251
+ interface Initiator {
252
+ type?: Type;
253
+ }
254
+ interface ChangesLost {
255
+ clusterId?: string;
256
+ }
257
+ interface ReferenceChanged {
258
+ /** physical cluster ID */
259
+ clusterId?: string;
260
+ /**
261
+ * physical source
262
+ * db.collection for MongoDB
263
+ */
264
+ source?: string;
265
+ /** instance ID */
266
+ tenantId?: string;
267
+ dataStore?: DataStore;
268
+ relationshipName?: string;
269
+ leftId?: string;
270
+ rightId?: string;
271
+ /** if reference is set or unset */
272
+ isRemoved?: boolean;
273
+ clusterTime?: Date;
274
+ /** raw resume token BSON */
275
+ resumeToken?: string;
276
+ /** ref created date */
277
+ createdAt?: Date;
278
+ }
279
+ interface SegmentChanged {
280
+ /** physical cluster ID */
281
+ clusterId?: string;
282
+ /**
283
+ * physical source
284
+ * db.collection for MongoDB
285
+ */
286
+ source?: string;
287
+ /** instance ID */
288
+ tenantId?: string;
289
+ /** segment */
290
+ dataStore?: DataStore;
291
+ /** new db name if changed */
292
+ newDatabase?: string | null;
293
+ /** new cluster if changed */
294
+ newClusterId?: string | null;
295
+ /** read permissions if changed */
296
+ readsEnabled?: boolean | null;
297
+ /** write permissions if changed */
298
+ writesEnabled?: boolean | null;
299
+ /** event time */
300
+ clusterTime?: Date;
301
+ /** raw resume token BSON */
302
+ resumeToken?: string;
303
+ }
304
+ interface SegmentMigrationStarted {
305
+ /** physical cluster ID */
306
+ clusterId?: string;
307
+ /**
308
+ * physical source
309
+ * db.collection for MongoDB
310
+ */
311
+ source?: string;
312
+ /** instance ID */
313
+ tenantId?: string;
314
+ /** segment */
315
+ dataStore?: DataStore;
316
+ /** new db name if changed */
317
+ newDatabase?: string;
318
+ /** new cluster if changed */
319
+ newClusterId?: string;
320
+ /** event time */
321
+ clusterTime?: Date;
322
+ /** raw resume token BSON */
323
+ resumeToken?: string;
324
+ }
325
+ interface MessageEnvelope {
326
+ /** App instance ID. */
327
+ instanceId?: string | null;
328
+ /** Event type. */
329
+ eventType?: string;
330
+ /** The identification type and identity data. */
331
+ identity?: IdentificationData;
332
+ /** Stringify payload. */
333
+ data?: string;
334
+ }
335
+ interface IdentificationData extends IdentificationDataIdOneOf {
336
+ /** ID of a site visitor that has not logged in to the site. */
337
+ anonymousVisitorId?: string;
338
+ /** ID of a site visitor that has logged in to the site. */
339
+ memberId?: string;
340
+ /** ID of a Wix user (site owner, contributor, etc.). */
341
+ wixUserId?: string;
342
+ /** ID of an app. */
343
+ appId?: string;
344
+ /** @readonly */
345
+ identityType?: WebhookIdentityType;
346
+ }
347
+ /** @oneof */
348
+ interface IdentificationDataIdOneOf {
349
+ /** ID of a site visitor that has not logged in to the site. */
350
+ anonymousVisitorId?: string;
351
+ /** ID of a site visitor that has logged in to the site. */
352
+ memberId?: string;
353
+ /** ID of a Wix user (site owner, contributor, etc.). */
354
+ wixUserId?: string;
355
+ /** ID of an app. */
356
+ appId?: string;
357
+ }
358
+ declare enum WebhookIdentityType {
359
+ UNKNOWN = "UNKNOWN",
360
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
361
+ MEMBER = "MEMBER",
362
+ WIX_USER = "WIX_USER",
363
+ APP = "APP"
364
+ }
365
+ interface GetResourceUsageResponseNonNullableFields {
366
+ resourceUsage?: {
367
+ dataCollectionUsages: {
368
+ dataCollectionId: string;
369
+ liveItemCount: string;
370
+ liveUsedStorageInBytes: string;
371
+ dataCollectionType: CollectionType;
372
+ }[];
373
+ };
374
+ }
375
+ interface GetResourceUsageOptions {
376
+ /** ResourceUsage fields to return, if empty all are returned */
377
+ fields?: string[];
378
+ /** If true, operation queries collections for up-to-date values (rather than using cached values) */
379
+ consistentRead?: boolean;
380
+ }
381
+
382
+ interface HttpClient {
383
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
384
+ }
385
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
386
+ type HttpResponse<T = any> = {
387
+ data: T;
388
+ status: number;
389
+ statusText: string;
390
+ headers: any;
391
+ request?: any;
392
+ };
393
+ type RequestOptions<_TResponse = any, Data = any> = {
394
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
395
+ url: string;
396
+ data?: Data;
397
+ params?: URLSearchParams;
398
+ } & APIMetadata;
399
+ type APIMetadata = {
400
+ methodFqn?: string;
401
+ entityFqdn?: string;
402
+ packageName?: string;
403
+ };
404
+
405
+ declare const __metadata: {
406
+ PACKAGE_NAME: string;
407
+ };
408
+ declare function getResourceUsage(httpClient: HttpClient): (options?: GetResourceUsageOptions) => Promise<GetResourceUsageResponse & GetResourceUsageResponseNonNullableFields>;
409
+
410
+ type index_d_ActionEvent = ActionEvent;
411
+ type index_d_BulkUpdateUsagesRequest = BulkUpdateUsagesRequest;
412
+ type index_d_BulkUpdateUsagesResponse = BulkUpdateUsagesResponse;
413
+ type index_d_ChangesLost = ChangesLost;
414
+ type index_d_CollectionType = CollectionType;
415
+ declare const index_d_CollectionType: typeof CollectionType;
416
+ type index_d_DataChangeEvent = DataChangeEvent;
417
+ type index_d_DataChangeEventEventOneOf = DataChangeEventEventOneOf;
418
+ type index_d_DataChanged = DataChanged;
419
+ type index_d_DataChangedChangeOneOf = DataChangedChangeOneOf;
420
+ type index_d_DataCollectionResourceUsage = DataCollectionResourceUsage;
421
+ type index_d_DataCollectionResourceUsageUpdate = DataCollectionResourceUsageUpdate;
422
+ type index_d_DataStore = DataStore;
423
+ declare const index_d_DataStore: typeof DataStore;
424
+ type index_d_DomainEvent = DomainEvent;
425
+ type index_d_DomainEventBodyOneOf = DomainEventBodyOneOf;
426
+ type index_d_Empty = Empty;
427
+ type index_d_EntityCreatedEvent = EntityCreatedEvent;
428
+ type index_d_EntityDeletedEvent = EntityDeletedEvent;
429
+ type index_d_EntityUpdatedEvent = EntityUpdatedEvent;
430
+ type index_d_GetResourceUsageOptions = GetResourceUsageOptions;
431
+ type index_d_GetResourceUsageRequest = GetResourceUsageRequest;
432
+ type index_d_GetResourceUsageResponse = GetResourceUsageResponse;
433
+ type index_d_GetResourceUsageResponseNonNullableFields = GetResourceUsageResponseNonNullableFields;
434
+ type index_d_GetStoredUsageRequest = GetStoredUsageRequest;
435
+ type index_d_GetStoredUsageResponse = GetStoredUsageResponse;
436
+ type index_d_IdentificationData = IdentificationData;
437
+ type index_d_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
438
+ type index_d_Initiator = Initiator;
439
+ type index_d_InstanceUsageUpdate = InstanceUsageUpdate;
440
+ type index_d_MessageEnvelope = MessageEnvelope;
441
+ type index_d_ReferenceChanged = ReferenceChanged;
442
+ type index_d_ResourceUsage = ResourceUsage;
443
+ type index_d_Segment = Segment;
444
+ declare const index_d_Segment: typeof Segment;
445
+ type index_d_SegmentChanged = SegmentChanged;
446
+ type index_d_SegmentMigrationStarted = SegmentMigrationStarted;
447
+ type index_d_Type = Type;
448
+ declare const index_d_Type: typeof Type;
449
+ type index_d_WebhookIdentityType = WebhookIdentityType;
450
+ declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
451
+ declare const index_d___metadata: typeof __metadata;
452
+ declare const index_d_getResourceUsage: typeof getResourceUsage;
453
+ declare namespace index_d {
454
+ export { type index_d_ActionEvent as ActionEvent, type index_d_BulkUpdateUsagesRequest as BulkUpdateUsagesRequest, type index_d_BulkUpdateUsagesResponse as BulkUpdateUsagesResponse, type index_d_ChangesLost as ChangesLost, index_d_CollectionType as CollectionType, type index_d_DataChangeEvent as DataChangeEvent, type index_d_DataChangeEventEventOneOf as DataChangeEventEventOneOf, type index_d_DataChanged as DataChanged, type index_d_DataChangedChangeOneOf as DataChangedChangeOneOf, type index_d_DataCollectionResourceUsage as DataCollectionResourceUsage, type index_d_DataCollectionResourceUsageUpdate as DataCollectionResourceUsageUpdate, index_d_DataStore as DataStore, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_Empty as Empty, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_GetResourceUsageOptions as GetResourceUsageOptions, type index_d_GetResourceUsageRequest as GetResourceUsageRequest, type index_d_GetResourceUsageResponse as GetResourceUsageResponse, type index_d_GetResourceUsageResponseNonNullableFields as GetResourceUsageResponseNonNullableFields, type index_d_GetStoredUsageRequest as GetStoredUsageRequest, type index_d_GetStoredUsageResponse as GetStoredUsageResponse, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_Initiator as Initiator, type index_d_InstanceUsageUpdate as InstanceUsageUpdate, type index_d_MessageEnvelope as MessageEnvelope, type index_d_ReferenceChanged as ReferenceChanged, type index_d_ResourceUsage as ResourceUsage, index_d_Segment as Segment, type index_d_SegmentChanged as SegmentChanged, type index_d_SegmentMigrationStarted as SegmentMigrationStarted, index_d_Type as Type, index_d_WebhookIdentityType as WebhookIdentityType, index_d___metadata as __metadata, index_d_getResourceUsage as getResourceUsage };
455
+ }
456
+
457
+ export { index_d as data };
@@ -0,0 +1,183 @@
1
+ /** ResourceUsage describes site-wide resource limits and usage */
2
+ interface ResourceUsage$1 {
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$1[];
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$1 {
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$1;
51
+ }
52
+ declare enum CollectionType$1 {
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 GetResourceUsageRequest$1 {
63
+ /** ResourceUsage fields to return, if empty all are returned */
64
+ fields?: string[];
65
+ /** If true, operation queries collections for up-to-date values (rather than using cached values) */
66
+ consistentRead?: boolean;
67
+ }
68
+ interface GetResourceUsageResponse$1 {
69
+ /** The retrieved ResourceUsage */
70
+ resourceUsage?: ResourceUsage$1;
71
+ }
72
+ interface GetResourceUsageResponseNonNullableFields$1 {
73
+ resourceUsage?: {
74
+ dataCollectionUsages: {
75
+ dataCollectionId: string;
76
+ liveItemCount: string;
77
+ liveUsedStorageInBytes: string;
78
+ dataCollectionType: CollectionType$1;
79
+ }[];
80
+ };
81
+ }
82
+
83
+ /** ResourceUsage describes site-wide resource limits and usage */
84
+ interface ResourceUsage {
85
+ /**
86
+ * Used storage sum of Sandbox and Live environments, bytes
87
+ * Replaced by live_used_storage_in_bytes
88
+ * @deprecated
89
+ * @replacedBy live_used_storage_in_bytes + sandbox_used_storage_in_bytes
90
+ */
91
+ totalUsedStorageInBytes?: string | null;
92
+ /** Max storage, bytes */
93
+ totalUsedStorageInBytesLimit?: string | null;
94
+ /** Total number of native collections created */
95
+ collectionCount?: number | null;
96
+ /** Max number of native collections allowed */
97
+ collectionCountLimit?: number | null;
98
+ /**
99
+ * Total number of items in native collections sum of Sandbox and Live environments
100
+ * Replaced by live_item_count
101
+ * @deprecated
102
+ * @replacedBy live_item_count + sandbox_item_count
103
+ */
104
+ totalItemCount?: string | null;
105
+ /** Max number of items in native collections */
106
+ totalItemCountLimit?: string | null;
107
+ /** Resource usages per data collection */
108
+ dataCollectionUsages?: DataCollectionResourceUsage[];
109
+ /** Used storage in Live environment */
110
+ liveUsedStorageInBytes?: string | null;
111
+ /** Number of items in native collections in Live environment */
112
+ liveItemCount?: string | null;
113
+ /** Used storage in Sandbox environment */
114
+ sandboxUsedStorageInBytes?: string | null;
115
+ /** Number of items in native collections in Sandbox environment */
116
+ sandboxItemCount?: string | null;
117
+ }
118
+ interface DataCollectionResourceUsage {
119
+ /** Data Collection ID */
120
+ dataCollectionId?: string;
121
+ /** Data Collection display name */
122
+ displayName?: string | null;
123
+ /** Data Collection item count in the live environment */
124
+ liveItemCount?: string;
125
+ /** Data Collection item count in the sandbox environment, none if disabled */
126
+ sandboxItemCount?: string | null;
127
+ /** Data Collection used storage in bytes in the live environment */
128
+ liveUsedStorageInBytes?: string;
129
+ /** Data Collection used storage in bytes in the sandbox environment, none if disabled */
130
+ sandboxUsedStorageInBytes?: string | null;
131
+ /** Type of data collection, currently only NATIVE or BLOCKS_APP are returned in this API */
132
+ dataCollectionType?: CollectionType;
133
+ }
134
+ declare enum CollectionType {
135
+ /** User-created collection. */
136
+ NATIVE = "NATIVE",
137
+ /** [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). */
138
+ WIX_APP = "WIX_APP",
139
+ /** Collection created by a Wix Blocks app. */
140
+ BLOCKS_APP = "BLOCKS_APP",
141
+ /** Collection located in externally connected storage. */
142
+ EXTERNAL = "EXTERNAL"
143
+ }
144
+ interface GetResourceUsageRequest {
145
+ /** ResourceUsage fields to return, if empty all are returned */
146
+ fields?: string[];
147
+ /** If true, operation queries collections for up-to-date values (rather than using cached values) */
148
+ consistentRead?: boolean;
149
+ }
150
+ interface GetResourceUsageResponse {
151
+ /** The retrieved ResourceUsage */
152
+ resourceUsage?: ResourceUsage;
153
+ }
154
+ interface GetResourceUsageResponseNonNullableFields {
155
+ resourceUsage?: {
156
+ dataCollectionUsages: {
157
+ dataCollectionId: string;
158
+ liveItemCount: string;
159
+ liveUsedStorageInBytes: string;
160
+ dataCollectionType: CollectionType;
161
+ }[];
162
+ };
163
+ }
164
+
165
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
166
+ getUrl: (context: any) => string;
167
+ httpMethod: K;
168
+ path: string;
169
+ pathParams: M;
170
+ __requestType: T;
171
+ __originalRequestType: S;
172
+ __responseType: Q;
173
+ __originalResponseType: R;
174
+ };
175
+ declare function getResourceUsage(): __PublicMethodMetaInfo<'GET', {}, GetResourceUsageRequest, GetResourceUsageRequest$1, GetResourceUsageResponse & GetResourceUsageResponseNonNullableFields, GetResourceUsageResponse$1 & GetResourceUsageResponseNonNullableFields$1>;
176
+
177
+ type meta___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
178
+ declare const meta_getResourceUsage: typeof getResourceUsage;
179
+ declare namespace meta {
180
+ export { type meta___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_getResourceUsage as getResourceUsage };
181
+ }
182
+
183
+ export { meta as data };