@wix/auto_sdk_motion_alarms 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/build/cjs/index.d.ts +46 -1
- package/build/cjs/index.js +368 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +308 -1
- package/build/cjs/index.typings.js +285 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +50 -1
- package/build/cjs/meta.js +241 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +46 -0
- package/build/es/index.mjs +341 -0
- package/build/es/index.mjs.map +1 -0
- package/build/{internal/cjs/src/alarm-v1-alarm-alarms.universal.d.ts → es/index.typings.d.mts} +73 -87
- package/build/es/index.typings.mjs +261 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +50 -0
- package/build/es/meta.mjs +215 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +46 -1
- package/build/internal/cjs/index.js +368 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +323 -1
- package/build/internal/cjs/index.typings.js +285 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +50 -1
- package/build/internal/cjs/meta.js +241 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +46 -0
- package/build/internal/es/index.mjs +341 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/{cjs/src/alarm-v1-alarm-alarms.universal.d.ts → internal/es/index.typings.d.mts} +88 -87
- package/build/internal/es/index.typings.mjs +261 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +50 -0
- package/build/internal/es/meta.mjs +215 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +12 -10
- package/build/cjs/src/alarm-v1-alarm-alarms.context.d.ts +0 -23
- package/build/cjs/src/alarm-v1-alarm-alarms.context.js +0 -27
- package/build/cjs/src/alarm-v1-alarm-alarms.context.js.map +0 -1
- package/build/cjs/src/alarm-v1-alarm-alarms.http.d.ts +0 -7
- package/build/cjs/src/alarm-v1-alarm-alarms.http.js +0 -162
- package/build/cjs/src/alarm-v1-alarm-alarms.http.js.map +0 -1
- package/build/cjs/src/alarm-v1-alarm-alarms.meta.d.ts +0 -19
- package/build/cjs/src/alarm-v1-alarm-alarms.meta.js +0 -85
- package/build/cjs/src/alarm-v1-alarm-alarms.meta.js.map +0 -1
- package/build/cjs/src/alarm-v1-alarm-alarms.public.d.ts +0 -30
- package/build/cjs/src/alarm-v1-alarm-alarms.public.js +0 -48
- package/build/cjs/src/alarm-v1-alarm-alarms.public.js.map +0 -1
- package/build/cjs/src/alarm-v1-alarm-alarms.types.d.ts +0 -202
- package/build/cjs/src/alarm-v1-alarm-alarms.types.js +0 -12
- package/build/cjs/src/alarm-v1-alarm-alarms.types.js.map +0 -1
- package/build/cjs/src/alarm-v1-alarm-alarms.universal.js +0 -134
- package/build/cjs/src/alarm-v1-alarm-alarms.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/src/alarm-v1-alarm-alarms.context.d.ts +0 -23
- package/build/es/src/alarm-v1-alarm-alarms.context.js +0 -23
- package/build/es/src/alarm-v1-alarm-alarms.context.js.map +0 -1
- package/build/es/src/alarm-v1-alarm-alarms.http.d.ts +0 -7
- package/build/es/src/alarm-v1-alarm-alarms.http.js +0 -156
- package/build/es/src/alarm-v1-alarm-alarms.http.js.map +0 -1
- package/build/es/src/alarm-v1-alarm-alarms.meta.d.ts +0 -19
- package/build/es/src/alarm-v1-alarm-alarms.meta.js +0 -56
- package/build/es/src/alarm-v1-alarm-alarms.meta.js.map +0 -1
- package/build/es/src/alarm-v1-alarm-alarms.public.d.ts +0 -30
- package/build/es/src/alarm-v1-alarm-alarms.public.js +0 -41
- package/build/es/src/alarm-v1-alarm-alarms.public.js.map +0 -1
- package/build/es/src/alarm-v1-alarm-alarms.types.d.ts +0 -202
- package/build/es/src/alarm-v1-alarm-alarms.types.js +0 -9
- package/build/es/src/alarm-v1-alarm-alarms.types.js.map +0 -1
- package/build/es/src/alarm-v1-alarm-alarms.universal.d.ts +0 -322
- package/build/es/src/alarm-v1-alarm-alarms.universal.js +0 -105
- package/build/es/src/alarm-v1-alarm-alarms.universal.js.map +0 -1
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.context.d.ts +0 -23
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.context.js +0 -27
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.context.js.map +0 -1
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.http.d.ts +0 -7
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.http.js +0 -162
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.http.js.map +0 -1
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.meta.d.ts +0 -19
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.meta.js +0 -85
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.meta.js.map +0 -1
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.public.d.ts +0 -30
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.public.js +0 -48
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.public.js.map +0 -1
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.types.d.ts +0 -202
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.types.js +0 -12
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.types.js.map +0 -1
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.universal.js +0 -134
- package/build/internal/cjs/src/alarm-v1-alarm-alarms.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/alarm-v1-alarm-alarms.context.d.ts +0 -23
- package/build/internal/es/src/alarm-v1-alarm-alarms.context.js +0 -23
- package/build/internal/es/src/alarm-v1-alarm-alarms.context.js.map +0 -1
- package/build/internal/es/src/alarm-v1-alarm-alarms.http.d.ts +0 -7
- package/build/internal/es/src/alarm-v1-alarm-alarms.http.js +0 -156
- package/build/internal/es/src/alarm-v1-alarm-alarms.http.js.map +0 -1
- package/build/internal/es/src/alarm-v1-alarm-alarms.meta.d.ts +0 -19
- package/build/internal/es/src/alarm-v1-alarm-alarms.meta.js +0 -56
- package/build/internal/es/src/alarm-v1-alarm-alarms.meta.js.map +0 -1
- package/build/internal/es/src/alarm-v1-alarm-alarms.public.d.ts +0 -30
- package/build/internal/es/src/alarm-v1-alarm-alarms.public.js +0 -41
- package/build/internal/es/src/alarm-v1-alarm-alarms.public.js.map +0 -1
- package/build/internal/es/src/alarm-v1-alarm-alarms.types.d.ts +0 -202
- package/build/internal/es/src/alarm-v1-alarm-alarms.types.js +0 -9
- package/build/internal/es/src/alarm-v1-alarm-alarms.types.js.map +0 -1
- package/build/internal/es/src/alarm-v1-alarm-alarms.universal.d.ts +0 -322
- package/build/internal/es/src/alarm-v1-alarm-alarms.universal.js +0 -105
- package/build/internal/es/src/alarm-v1-alarm-alarms.universal.js.map +0 -1
package/build/{internal/cjs/src/alarm-v1-alarm-alarms.universal.d.ts → es/index.typings.d.mts}
RENAMED
|
@@ -1,71 +1,73 @@
|
|
|
1
|
-
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
interface AlarmMessage {
|
|
2
4
|
_id?: string;
|
|
3
5
|
seconds?: number;
|
|
6
|
+
/** @maxLength 1024 */
|
|
7
|
+
someOtherField?: string;
|
|
4
8
|
}
|
|
5
|
-
|
|
9
|
+
interface Dispatched {
|
|
6
10
|
/** the message someone says */
|
|
7
11
|
echo?: EchoMessage;
|
|
8
12
|
}
|
|
9
|
-
|
|
13
|
+
interface EchoMessage {
|
|
10
14
|
/** message comment from EchoMessage proto def, with special comment */
|
|
11
15
|
message?: string;
|
|
12
16
|
/** messages_list comment from EchoMessage proto def */
|
|
13
17
|
messagesList?: MessageItem[];
|
|
14
18
|
_id?: string;
|
|
15
19
|
}
|
|
16
|
-
|
|
20
|
+
interface MessageItem {
|
|
17
21
|
/** inner_message comment from EchoMessage proto def */
|
|
18
22
|
innerMessage?: string;
|
|
19
23
|
}
|
|
20
|
-
|
|
24
|
+
interface AlarmTestRequest {
|
|
21
25
|
}
|
|
22
|
-
|
|
26
|
+
interface AlarmTestResponse {
|
|
23
27
|
}
|
|
24
|
-
|
|
28
|
+
interface AlarmRequest {
|
|
25
29
|
seconds: number;
|
|
26
30
|
someString?: string;
|
|
27
31
|
someOtherString?: string;
|
|
28
32
|
someOtherField?: string;
|
|
29
33
|
}
|
|
30
|
-
|
|
34
|
+
interface AlarmResponse {
|
|
31
35
|
time?: Date | null;
|
|
32
36
|
}
|
|
33
|
-
|
|
37
|
+
interface AlarmTriggered {
|
|
34
38
|
}
|
|
35
|
-
|
|
39
|
+
interface AlarmSnoozed {
|
|
36
40
|
}
|
|
37
|
-
|
|
41
|
+
interface AlarmDeleted {
|
|
38
42
|
}
|
|
39
|
-
|
|
43
|
+
interface UpdateAlarmRequest {
|
|
40
44
|
alarm: AlarmMessage;
|
|
45
|
+
/** @maxLength 1024 */
|
|
46
|
+
someRequiredRequestField: string;
|
|
41
47
|
}
|
|
42
|
-
|
|
48
|
+
interface UpdateAlarmResponse {
|
|
43
49
|
alarm?: AlarmMessage;
|
|
44
50
|
}
|
|
45
|
-
|
|
51
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
46
52
|
createdEvent?: EntityCreatedEvent;
|
|
47
53
|
updatedEvent?: EntityUpdatedEvent;
|
|
48
54
|
deletedEvent?: EntityDeletedEvent;
|
|
49
55
|
actionEvent?: ActionEvent;
|
|
50
|
-
/**
|
|
51
|
-
* Unique event ID.
|
|
52
|
-
* Allows clients to ignore duplicate webhooks.
|
|
53
|
-
*/
|
|
56
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
54
57
|
_id?: string;
|
|
55
58
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
59
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
60
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
58
61
|
*/
|
|
59
62
|
entityFqdn?: string;
|
|
60
63
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* Example: created/updated/deleted/started/completed/email_opened
|
|
64
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
65
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
64
66
|
*/
|
|
65
67
|
slug?: string;
|
|
66
68
|
/** ID of the entity associated with the event. */
|
|
67
69
|
entityId?: string;
|
|
68
|
-
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example
|
|
70
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
69
71
|
eventTime?: Date | null;
|
|
70
72
|
/**
|
|
71
73
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
@@ -75,29 +77,25 @@ export interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
75
77
|
/** If present, indicates the action that triggered the event. */
|
|
76
78
|
originatedFrom?: string | null;
|
|
77
79
|
/**
|
|
78
|
-
* A sequence number
|
|
79
|
-
*
|
|
80
|
-
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
81
|
-
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
82
|
-
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
83
|
-
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
80
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
|
|
81
|
+
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
84
82
|
*/
|
|
85
83
|
entityEventSequence?: string | null;
|
|
86
84
|
}
|
|
87
85
|
/** @oneof */
|
|
88
|
-
|
|
86
|
+
interface DomainEventBodyOneOf {
|
|
89
87
|
createdEvent?: EntityCreatedEvent;
|
|
90
88
|
updatedEvent?: EntityUpdatedEvent;
|
|
91
89
|
deletedEvent?: EntityDeletedEvent;
|
|
92
90
|
actionEvent?: ActionEvent;
|
|
93
91
|
}
|
|
94
|
-
|
|
92
|
+
interface EntityCreatedEvent {
|
|
95
93
|
entity?: string;
|
|
96
94
|
}
|
|
97
|
-
|
|
95
|
+
interface RestoreInfo {
|
|
98
96
|
deletedDate?: Date | null;
|
|
99
97
|
}
|
|
100
|
-
|
|
98
|
+
interface EntityUpdatedEvent {
|
|
101
99
|
/**
|
|
102
100
|
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
103
101
|
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
@@ -105,14 +103,14 @@ export interface EntityUpdatedEvent {
|
|
|
105
103
|
*/
|
|
106
104
|
currentEntity?: string;
|
|
107
105
|
}
|
|
108
|
-
|
|
109
|
-
/** Entity that was deleted */
|
|
106
|
+
interface EntityDeletedEvent {
|
|
107
|
+
/** Entity that was deleted. */
|
|
110
108
|
deletedEntity?: string | null;
|
|
111
109
|
}
|
|
112
|
-
|
|
110
|
+
interface ActionEvent {
|
|
113
111
|
body?: string;
|
|
114
112
|
}
|
|
115
|
-
|
|
113
|
+
interface MessageEnvelope {
|
|
116
114
|
/**
|
|
117
115
|
* App instance ID.
|
|
118
116
|
* @format GUID
|
|
@@ -128,7 +126,7 @@ export interface MessageEnvelope {
|
|
|
128
126
|
/** Stringify payload. */
|
|
129
127
|
data?: string;
|
|
130
128
|
}
|
|
131
|
-
|
|
129
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
132
130
|
/**
|
|
133
131
|
* ID of a site visitor that has not logged in to the site.
|
|
134
132
|
* @format GUID
|
|
@@ -150,10 +148,10 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
|
150
148
|
*/
|
|
151
149
|
appId?: string;
|
|
152
150
|
/** @readonly */
|
|
153
|
-
identityType?:
|
|
151
|
+
identityType?: WebhookIdentityTypeWithLiterals;
|
|
154
152
|
}
|
|
155
153
|
/** @oneof */
|
|
156
|
-
|
|
154
|
+
interface IdentificationDataIdOneOf {
|
|
157
155
|
/**
|
|
158
156
|
* ID of a site visitor that has not logged in to the site.
|
|
159
157
|
* @format GUID
|
|
@@ -175,29 +173,16 @@ export interface IdentificationDataIdOneOf {
|
|
|
175
173
|
*/
|
|
176
174
|
appId?: string;
|
|
177
175
|
}
|
|
178
|
-
|
|
176
|
+
declare enum WebhookIdentityType {
|
|
179
177
|
UNKNOWN = "UNKNOWN",
|
|
180
178
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
181
179
|
MEMBER = "MEMBER",
|
|
182
180
|
WIX_USER = "WIX_USER",
|
|
183
181
|
APP = "APP"
|
|
184
182
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
export interface UpdateAlarmRequestRequiredFields {
|
|
189
|
-
alarm: {
|
|
190
|
-
_id: string;
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
interface AlarmMessageNonNullableFields {
|
|
194
|
-
_id: string;
|
|
195
|
-
seconds: number;
|
|
196
|
-
}
|
|
197
|
-
export interface UpdateAlarmResponseNonNullableFields {
|
|
198
|
-
alarm?: AlarmMessageNonNullableFields;
|
|
199
|
-
}
|
|
200
|
-
export interface BaseEventMetadata {
|
|
183
|
+
/** @enumType */
|
|
184
|
+
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
185
|
+
interface BaseEventMetadata {
|
|
201
186
|
/**
|
|
202
187
|
* App instance ID.
|
|
203
188
|
* @format GUID
|
|
@@ -211,26 +196,22 @@ export interface BaseEventMetadata {
|
|
|
211
196
|
/** The identification type and identity data. */
|
|
212
197
|
identity?: IdentificationData;
|
|
213
198
|
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Unique event ID.
|
|
217
|
-
* Allows clients to ignore duplicate webhooks.
|
|
218
|
-
*/
|
|
199
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
200
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
219
201
|
_id?: string;
|
|
220
202
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
203
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
204
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
223
205
|
*/
|
|
224
206
|
entityFqdn?: string;
|
|
225
207
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* Example: created/updated/deleted/started/completed/email_opened
|
|
208
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
209
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
229
210
|
*/
|
|
230
211
|
slug?: string;
|
|
231
212
|
/** ID of the entity associated with the event. */
|
|
232
213
|
entityId?: string;
|
|
233
|
-
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example
|
|
214
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
234
215
|
eventTime?: Date | null;
|
|
235
216
|
/**
|
|
236
217
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
@@ -240,16 +221,12 @@ export interface EventMetadata extends BaseEventMetadata {
|
|
|
240
221
|
/** If present, indicates the action that triggered the event. */
|
|
241
222
|
originatedFrom?: string | null;
|
|
242
223
|
/**
|
|
243
|
-
* A sequence number
|
|
244
|
-
*
|
|
245
|
-
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
246
|
-
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
247
|
-
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
248
|
-
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
224
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
|
|
225
|
+
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
249
226
|
*/
|
|
250
227
|
entityEventSequence?: string | null;
|
|
251
228
|
}
|
|
252
|
-
|
|
229
|
+
interface AlarmDeletedEnvelope {
|
|
253
230
|
data: AlarmDeleted;
|
|
254
231
|
metadata: EventMetadata;
|
|
255
232
|
}
|
|
@@ -261,8 +238,8 @@ export interface AlarmDeletedEnvelope {
|
|
|
261
238
|
* @serviceIdentifier wix.coreservices.alarm.v1.AlarmService
|
|
262
239
|
* @slug alarm_deleted
|
|
263
240
|
*/
|
|
264
|
-
|
|
265
|
-
|
|
241
|
+
declare function onAlarmDeleted(handler: (event: AlarmDeletedEnvelope) => void | Promise<void>): void;
|
|
242
|
+
interface AlarmSnoozedEnvelope {
|
|
266
243
|
data: AlarmSnoozed;
|
|
267
244
|
metadata: EventMetadata;
|
|
268
245
|
}
|
|
@@ -274,8 +251,8 @@ export interface AlarmSnoozedEnvelope {
|
|
|
274
251
|
* @serviceIdentifier wix.coreservices.alarm.v1.AlarmService
|
|
275
252
|
* @slug alarm_snoozed
|
|
276
253
|
*/
|
|
277
|
-
|
|
278
|
-
|
|
254
|
+
declare function onAlarmSnoozed(handler: (event: AlarmSnoozedEnvelope) => void | Promise<void>): void;
|
|
255
|
+
interface AlarmTriggeredEnvelope {
|
|
279
256
|
data: AlarmTriggered;
|
|
280
257
|
metadata: EventMetadata;
|
|
281
258
|
}
|
|
@@ -287,22 +264,22 @@ export interface AlarmTriggeredEnvelope {
|
|
|
287
264
|
* @serviceIdentifier wix.coreservices.alarm.v1.AlarmService
|
|
288
265
|
* @slug alarm_triggered
|
|
289
266
|
*/
|
|
290
|
-
|
|
267
|
+
declare function onAlarmTriggered(handler: (event: AlarmTriggeredEnvelope) => void | Promise<void>): void;
|
|
291
268
|
/**
|
|
292
269
|
* Some description
|
|
293
270
|
* @public
|
|
294
271
|
* @permissionId METRO.ALARM_TEST_FAKE
|
|
295
272
|
* @fqn wix.coreservices.alarm.v1.AlarmService.AlarmTest
|
|
296
273
|
*/
|
|
297
|
-
|
|
274
|
+
declare function alarmTest(): Promise<void>;
|
|
298
275
|
/**
|
|
299
276
|
* sets up an alarm after {seconds}
|
|
300
277
|
* @public
|
|
301
278
|
* @requiredField seconds
|
|
302
279
|
* @fqn wix.coreservices.alarm.v1.AlarmService.Alarm
|
|
303
280
|
*/
|
|
304
|
-
|
|
305
|
-
|
|
281
|
+
declare function alarm(seconds: number, options?: AlarmOptions): Promise<AlarmResponse>;
|
|
282
|
+
interface AlarmOptions {
|
|
306
283
|
someString?: string;
|
|
307
284
|
someOtherString?: string;
|
|
308
285
|
someOtherField?: string;
|
|
@@ -312,11 +289,20 @@ export interface AlarmOptions {
|
|
|
312
289
|
* @public
|
|
313
290
|
* @requiredField _id
|
|
314
291
|
* @requiredField alarm
|
|
292
|
+
* @requiredField options
|
|
293
|
+
* @requiredField options.someRequiredRequestField
|
|
315
294
|
* @fqn wix.coreservices.alarm.v1.AlarmService.UpdateAlarm
|
|
316
295
|
*/
|
|
317
|
-
|
|
318
|
-
|
|
296
|
+
declare function updateAlarm(_id: string, alarm: UpdateAlarm, options: NonNullablePaths<UpdateAlarmOptions, `someRequiredRequestField`, 2>): Promise<NonNullablePaths<UpdateAlarmResponse, `alarm._id` | `alarm.seconds` | `alarm.someOtherField`, 3>>;
|
|
297
|
+
interface UpdateAlarm {
|
|
319
298
|
_id?: string;
|
|
320
299
|
seconds?: number;
|
|
300
|
+
/** @maxLength 1024 */
|
|
301
|
+
someOtherField?: string;
|
|
302
|
+
}
|
|
303
|
+
interface UpdateAlarmOptions {
|
|
304
|
+
/** @maxLength 1024 */
|
|
305
|
+
someRequiredRequestField: string;
|
|
321
306
|
}
|
|
322
|
-
|
|
307
|
+
|
|
308
|
+
export { type ActionEvent, type AlarmDeleted, type AlarmDeletedEnvelope, type AlarmMessage, type AlarmOptions, type AlarmRequest, type AlarmResponse, type AlarmSnoozed, type AlarmSnoozedEnvelope, type AlarmTestRequest, type AlarmTestResponse, type AlarmTriggered, type AlarmTriggeredEnvelope, type BaseEventMetadata, type Dispatched, type DomainEvent, type DomainEventBodyOneOf, type EchoMessage, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type MessageItem, type RestoreInfo, type UpdateAlarm, type UpdateAlarmOptions, type UpdateAlarmRequest, type UpdateAlarmResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, alarm, alarmTest, onAlarmDeleted, onAlarmSnoozed, onAlarmTriggered, updateAlarm };
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// src/alarm-v1-alarm-alarms.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/alarm-v1-alarm-alarms.http.ts
|
|
9
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
10
|
+
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
11
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
12
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
13
|
+
function resolveWixCoreservicesAlarmV1AlarmServiceUrl(opts) {
|
|
14
|
+
const domainToMappings = {
|
|
15
|
+
"apps._base_domain_": [
|
|
16
|
+
{
|
|
17
|
+
srcPath: "/_api/metro-inspector",
|
|
18
|
+
destPath: "/api"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"api._api_base_domain_": [
|
|
22
|
+
{
|
|
23
|
+
srcPath: "/metro-inspector",
|
|
24
|
+
destPath: ""
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"www._base_domain_": [
|
|
28
|
+
{
|
|
29
|
+
srcPath: "/metro-inspector",
|
|
30
|
+
destPath: "/api"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"manage._base_domain_": [
|
|
34
|
+
{
|
|
35
|
+
srcPath: "/metro-inspector",
|
|
36
|
+
destPath: ""
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"www.wixgateway.com": [
|
|
40
|
+
{
|
|
41
|
+
srcPath: "/_api/metro-inspector",
|
|
42
|
+
destPath: "/api"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
_: [
|
|
46
|
+
{
|
|
47
|
+
srcPath: "/_api/metro-inspector",
|
|
48
|
+
destPath: "/api"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"www.wixapis.com": [
|
|
52
|
+
{
|
|
53
|
+
srcPath: "/_api/metro-inspector",
|
|
54
|
+
destPath: "/api"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
srcPath: "/metro-inspector",
|
|
58
|
+
destPath: ""
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"editor._base_domain_": [
|
|
62
|
+
{
|
|
63
|
+
srcPath: "/metro-insepctor",
|
|
64
|
+
destPath: ""
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/_api/metro-inspector",
|
|
68
|
+
destPath: "/api"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"blocks._base_domain_": [
|
|
72
|
+
{
|
|
73
|
+
srcPath: "/metro-insepctor",
|
|
74
|
+
destPath: ""
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/_api/metro-inspector",
|
|
78
|
+
destPath: "/api"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"create.editorx": [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/metro-insepctor",
|
|
84
|
+
destPath: ""
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
srcPath: "/_api/metro-inspector",
|
|
88
|
+
destPath: "/api"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
};
|
|
92
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
93
|
+
}
|
|
94
|
+
var PACKAGE_NAME = "@wix/auto_sdk_motion_alarms";
|
|
95
|
+
function alarmTest(payload) {
|
|
96
|
+
function __alarmTest({ host }) {
|
|
97
|
+
const metadata = {
|
|
98
|
+
entityFqdn: "wix.alarm.v1.alarm",
|
|
99
|
+
method: "POST",
|
|
100
|
+
methodFqn: "wix.coreservices.alarm.v1.AlarmService.AlarmTest",
|
|
101
|
+
packageName: PACKAGE_NAME,
|
|
102
|
+
url: resolveWixCoreservicesAlarmV1AlarmServiceUrl({
|
|
103
|
+
protoPath: "/api/v1/alarm/test",
|
|
104
|
+
data: payload,
|
|
105
|
+
host
|
|
106
|
+
}),
|
|
107
|
+
data: payload
|
|
108
|
+
};
|
|
109
|
+
return metadata;
|
|
110
|
+
}
|
|
111
|
+
return __alarmTest;
|
|
112
|
+
}
|
|
113
|
+
function alarm(payload) {
|
|
114
|
+
function __alarm({ host }) {
|
|
115
|
+
const metadata = {
|
|
116
|
+
entityFqdn: "wix.alarm.v1.alarm",
|
|
117
|
+
method: "POST",
|
|
118
|
+
methodFqn: "wix.coreservices.alarm.v1.AlarmService.Alarm",
|
|
119
|
+
packageName: PACKAGE_NAME,
|
|
120
|
+
url: resolveWixCoreservicesAlarmV1AlarmServiceUrl({
|
|
121
|
+
protoPath: "/api/v1/alarm/{seconds}",
|
|
122
|
+
data: payload,
|
|
123
|
+
host
|
|
124
|
+
}),
|
|
125
|
+
data: payload,
|
|
126
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
127
|
+
{
|
|
128
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
129
|
+
paths: [{ path: "time" }]
|
|
130
|
+
}
|
|
131
|
+
])
|
|
132
|
+
};
|
|
133
|
+
return metadata;
|
|
134
|
+
}
|
|
135
|
+
return __alarm;
|
|
136
|
+
}
|
|
137
|
+
function updateAlarm(payload) {
|
|
138
|
+
function __updateAlarm({ host }) {
|
|
139
|
+
const serializedData = transformPaths(payload, [
|
|
140
|
+
{
|
|
141
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
142
|
+
paths: [{ path: "fieldMask" }]
|
|
143
|
+
}
|
|
144
|
+
]);
|
|
145
|
+
const metadata = {
|
|
146
|
+
entityFqdn: "wix.alarm.v1.alarm",
|
|
147
|
+
method: "PATCH",
|
|
148
|
+
methodFqn: "wix.coreservices.alarm.v1.AlarmService.UpdateAlarm",
|
|
149
|
+
packageName: PACKAGE_NAME,
|
|
150
|
+
url: resolveWixCoreservicesAlarmV1AlarmServiceUrl({
|
|
151
|
+
protoPath: "/api/v1/alarms/{alarm.id}",
|
|
152
|
+
data: serializedData,
|
|
153
|
+
host
|
|
154
|
+
}),
|
|
155
|
+
data: serializedData
|
|
156
|
+
};
|
|
157
|
+
return metadata;
|
|
158
|
+
}
|
|
159
|
+
return __updateAlarm;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/alarm-v1-alarm-alarms.universal.ts
|
|
163
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
164
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
165
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
166
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
167
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
168
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
169
|
+
return WebhookIdentityType2;
|
|
170
|
+
})(WebhookIdentityType || {});
|
|
171
|
+
async function alarmTest2() {
|
|
172
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
173
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({});
|
|
174
|
+
const reqOpts = alarmTest(payload);
|
|
175
|
+
sideEffects?.onSiteCall?.();
|
|
176
|
+
try {
|
|
177
|
+
const result = await httpClient.request(reqOpts);
|
|
178
|
+
sideEffects?.onSuccess?.(result);
|
|
179
|
+
} catch (err) {
|
|
180
|
+
const transformedError = sdkTransformError(
|
|
181
|
+
err,
|
|
182
|
+
{
|
|
183
|
+
spreadPathsToArguments: {},
|
|
184
|
+
explicitPathsToArguments: {},
|
|
185
|
+
singleArgumentUnchanged: false
|
|
186
|
+
},
|
|
187
|
+
[]
|
|
188
|
+
);
|
|
189
|
+
sideEffects?.onError?.(err);
|
|
190
|
+
throw transformedError;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
async function alarm2(seconds, options) {
|
|
194
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
195
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
196
|
+
seconds,
|
|
197
|
+
someString: options?.someString,
|
|
198
|
+
someOtherString: options?.someOtherString,
|
|
199
|
+
someOtherField: options?.someOtherField
|
|
200
|
+
});
|
|
201
|
+
const reqOpts = alarm(payload);
|
|
202
|
+
sideEffects?.onSiteCall?.();
|
|
203
|
+
try {
|
|
204
|
+
const result = await httpClient.request(reqOpts);
|
|
205
|
+
sideEffects?.onSuccess?.(result);
|
|
206
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
207
|
+
} catch (err) {
|
|
208
|
+
const transformedError = sdkTransformError(
|
|
209
|
+
err,
|
|
210
|
+
{
|
|
211
|
+
spreadPathsToArguments: {},
|
|
212
|
+
explicitPathsToArguments: {
|
|
213
|
+
seconds: "$[0]",
|
|
214
|
+
someString: "$[1].someString",
|
|
215
|
+
someOtherString: "$[1].someOtherString",
|
|
216
|
+
someOtherField: "$[1].someOtherField"
|
|
217
|
+
},
|
|
218
|
+
singleArgumentUnchanged: false
|
|
219
|
+
},
|
|
220
|
+
["seconds", "options"]
|
|
221
|
+
);
|
|
222
|
+
sideEffects?.onError?.(err);
|
|
223
|
+
throw transformedError;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
async function updateAlarm2(_id, alarm3, options) {
|
|
227
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
228
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
229
|
+
alarm: { ...alarm3, id: _id },
|
|
230
|
+
someRequiredRequestField: options?.someRequiredRequestField
|
|
231
|
+
});
|
|
232
|
+
const reqOpts = updateAlarm(payload);
|
|
233
|
+
sideEffects?.onSiteCall?.();
|
|
234
|
+
try {
|
|
235
|
+
const result = await httpClient.request(reqOpts);
|
|
236
|
+
sideEffects?.onSuccess?.(result);
|
|
237
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
238
|
+
} catch (err) {
|
|
239
|
+
const transformedError = sdkTransformError(
|
|
240
|
+
err,
|
|
241
|
+
{
|
|
242
|
+
spreadPathsToArguments: { alarm: "$[1]" },
|
|
243
|
+
explicitPathsToArguments: {
|
|
244
|
+
"alarm.id": "$[0]",
|
|
245
|
+
someRequiredRequestField: "$[2].someRequiredRequestField"
|
|
246
|
+
},
|
|
247
|
+
singleArgumentUnchanged: false
|
|
248
|
+
},
|
|
249
|
+
["_id", "alarm", "options"]
|
|
250
|
+
);
|
|
251
|
+
sideEffects?.onError?.(err);
|
|
252
|
+
throw transformedError;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
export {
|
|
256
|
+
WebhookIdentityType,
|
|
257
|
+
alarm2 as alarm,
|
|
258
|
+
alarmTest2 as alarmTest,
|
|
259
|
+
updateAlarm2 as updateAlarm
|
|
260
|
+
};
|
|
261
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/alarm-v1-alarm-alarms.universal.ts","../../src/alarm-v1-alarm-alarms.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAlarmV1Alarm from './alarm-v1-alarm-alarms.http.js';\n\nexport interface AlarmMessage {\n _id?: string;\n seconds?: number;\n /**\n * @internal\n * @maxLength 1024\n */\n someAlphaEntityField?: string;\n /** @maxLength 1024 */\n someOtherField?: string;\n}\n\nexport interface Dispatched {\n /** the message someone says */\n echo?: EchoMessage;\n}\n\nexport interface EchoMessage {\n /** message comment from EchoMessage proto def, with special comment */\n message?: string;\n /** messages_list comment from EchoMessage proto def */\n messagesList?: MessageItem[];\n _id?: string;\n}\n\nexport interface MessageItem {\n /** inner_message comment from EchoMessage proto def */\n innerMessage?: string;\n}\n\nexport interface AlarmTestRequest {}\n\nexport interface AlarmTestResponse {}\n\nexport interface AlarmRequest {\n seconds: number;\n someString?: string;\n someOtherString?: string;\n someOtherField?: string;\n}\n\nexport interface AlarmResponse {\n time?: Date | null;\n}\n\nexport interface AlarmTriggered {}\n\nexport interface AlarmSnoozed {}\n\nexport interface AlarmDeleted {}\n\nexport interface UpdateAlarmRequest {\n alarm: AlarmMessage;\n /**\n * @internal\n * @maxLength 1024\n */\n someAlphaRequestField?: string;\n /** @maxLength 1024 */\n someRequiredRequestField: string;\n}\n\nexport interface UpdateAlarmResponse {\n alarm?: AlarmMessage;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface AlarmDeletedEnvelope {\n data: AlarmDeleted;\n metadata: EventMetadata;\n}\n\n/**\n * alarm event that might be consumed when alarm is deleted\n * @permissionId METRO.ALARM.MANAGE\n * @webhook\n * @eventType wix.alarm.v1.alarm_alarm_deleted\n * @serviceIdentifier wix.coreservices.alarm.v1.AlarmService\n * @slug alarm_deleted\n */\nexport declare function onAlarmDeleted(\n handler: (event: AlarmDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AlarmSnoozedEnvelope {\n data: AlarmSnoozed;\n metadata: EventMetadata;\n}\n\n/**\n * alarm event that might be consumed when alarm is snoozed\n * @permissionId METRO.ALARM.MANAGE\n * @webhook\n * @eventType wix.alarm.v1.alarm_alarm_snoozed\n * @serviceIdentifier wix.coreservices.alarm.v1.AlarmService\n * @slug alarm_snoozed\n */\nexport declare function onAlarmSnoozed(\n handler: (event: AlarmSnoozedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AlarmTriggeredEnvelope {\n data: AlarmTriggered;\n metadata: EventMetadata;\n}\n\n/**\n * alarm event that might be consumed when alarm is triggered\n * @permissionId METRO.ALARM.MANAGE\n * @webhook\n * @eventType wix.alarm.v1.alarm_alarm_triggered\n * @serviceIdentifier wix.coreservices.alarm.v1.AlarmService\n * @slug alarm_triggered\n */\nexport declare function onAlarmTriggered(\n handler: (event: AlarmTriggeredEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Some description\n * @public\n * @permissionId METRO.ALARM_TEST_FAKE\n * @fqn wix.coreservices.alarm.v1.AlarmService.AlarmTest\n */\nexport async function alarmTest(): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixAlarmV1Alarm.alarmTest(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * sets up an alarm after {seconds}\n * @public\n * @requiredField seconds\n * @fqn wix.coreservices.alarm.v1.AlarmService.Alarm\n */\nexport async function alarm(\n seconds: number,\n options?: AlarmOptions\n): Promise<AlarmResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n seconds: seconds,\n someString: options?.someString,\n someOtherString: options?.someOtherString,\n someOtherField: options?.someOtherField,\n });\n\n const reqOpts = ambassadorWixAlarmV1Alarm.alarm(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n seconds: '$[0]',\n someString: '$[1].someString',\n someOtherString: '$[1].someOtherString',\n someOtherField: '$[1].someOtherField',\n },\n singleArgumentUnchanged: false,\n },\n ['seconds', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface AlarmOptions {\n someString?: string;\n someOtherString?: string;\n someOtherField?: string;\n}\n\n/**\n * sets up an existing alarm with id {id}\n * @public\n * @requiredField _id\n * @requiredField alarm\n * @requiredField options\n * @requiredField options.someRequiredRequestField\n * @fqn wix.coreservices.alarm.v1.AlarmService.UpdateAlarm\n */\nexport async function updateAlarm(\n _id: string,\n alarm: UpdateAlarm,\n options: NonNullablePaths<UpdateAlarmOptions, `someRequiredRequestField`, 2>\n): Promise<\n NonNullablePaths<\n UpdateAlarmResponse,\n `alarm._id` | `alarm.seconds` | `alarm.someOtherField`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n alarm: { ...alarm, id: _id },\n someRequiredRequestField: options?.someRequiredRequestField,\n });\n\n const reqOpts = ambassadorWixAlarmV1Alarm.updateAlarm(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { alarm: '$[1]' },\n explicitPathsToArguments: {\n 'alarm.id': '$[0]',\n someRequiredRequestField: '$[2].someRequiredRequestField',\n },\n singleArgumentUnchanged: false,\n },\n ['_id', 'alarm', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateAlarm {\n _id?: string;\n seconds?: number;\n /**\n * @internal\n * @maxLength 1024\n */\n someAlphaEntityField?: string;\n /** @maxLength 1024 */\n someOtherField?: string;\n}\n\nexport interface UpdateAlarmOptions {\n /** @maxLength 1024 */\n someRequiredRequestField: string;\n}\n","import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixCoreservicesAlarmV1AlarmServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'apps._base_domain_': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/metro-inspector',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/metro-inspector',\n destPath: '/api',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/metro-inspector',\n destPath: '',\n },\n ],\n 'www.wixgateway.com': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n _: [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n {\n srcPath: '/metro-inspector',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/metro-insepctor',\n destPath: '',\n },\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/metro-insepctor',\n destPath: '',\n },\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/metro-insepctor',\n destPath: '',\n },\n {\n srcPath: '/_api/metro-inspector',\n destPath: '/api',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_motion_alarms';\n\n/** Some description */\nexport function alarmTest(payload: object): RequestOptionsFactory<any> {\n function __alarmTest({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.alarm.v1.alarm',\n method: 'POST' as any,\n methodFqn: 'wix.coreservices.alarm.v1.AlarmService.AlarmTest',\n packageName: PACKAGE_NAME,\n url: resolveWixCoreservicesAlarmV1AlarmServiceUrl({\n protoPath: '/api/v1/alarm/test',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __alarmTest;\n}\n\n/** sets up an alarm after {seconds} */\nexport function alarm(payload: object): RequestOptionsFactory<any> {\n function __alarm({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.alarm.v1.alarm',\n method: 'POST' as any,\n methodFqn: 'wix.coreservices.alarm.v1.AlarmService.Alarm',\n packageName: PACKAGE_NAME,\n url: resolveWixCoreservicesAlarmV1AlarmServiceUrl({\n protoPath: '/api/v1/alarm/{seconds}',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'time' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __alarm;\n}\n\n/** sets up an existing alarm with id {id} */\nexport function updateAlarm(payload: object): RequestOptionsFactory<any> {\n function __updateAlarm({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.alarm.v1.alarm',\n method: 'PATCH' as any,\n methodFqn: 'wix.coreservices.alarm.v1.AlarmService.UpdateAlarm',\n packageName: PACKAGE_NAME,\n url: resolveWixCoreservicesAlarmV1AlarmServiceUrl({\n protoPath: '/api/v1/alarms/{alarm.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __updateAlarm;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,6CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA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