@wix/groups 1.0.57 → 1.0.59
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/src/social-groups-v2-group-member.public.d.ts +1 -1
- package/build/cjs/src/social-groups-v2-group-member.types.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group-member.universal.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group-member.universal.js +46 -22
- package/build/cjs/src/social-groups-v2-group-member.universal.js.map +1 -1
- package/build/cjs/src/social-groups-v2-group-request.public.d.ts +1 -1
- package/build/cjs/src/social-groups-v2-group-request.types.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group-request.universal.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group-request.universal.js +19 -9
- package/build/cjs/src/social-groups-v2-group-request.universal.js.map +1 -1
- package/build/cjs/src/social-groups-v2-group-role.public.d.ts +1 -1
- package/build/cjs/src/social-groups-v2-group-role.types.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group-role.universal.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group-role.universal.js +21 -12
- package/build/cjs/src/social-groups-v2-group-role.universal.js.map +1 -1
- package/build/cjs/src/social-groups-v2-group-rules.public.d.ts +1 -1
- package/build/cjs/src/social-groups-v2-group-rules.types.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group-rules.universal.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group-rules.universal.js +11 -7
- package/build/cjs/src/social-groups-v2-group-rules.universal.js.map +1 -1
- package/build/cjs/src/social-groups-v2-group.public.d.ts +1 -1
- package/build/cjs/src/social-groups-v2-group.types.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group.universal.d.ts +67 -0
- package/build/cjs/src/social-groups-v2-group.universal.js +37 -20
- package/build/cjs/src/social-groups-v2-group.universal.js.map +1 -1
- package/build/cjs/src/social-groups-v2-join-group-request.public.d.ts +1 -1
- package/build/cjs/src/social-groups-v2-join-group-request.types.d.ts +73 -0
- package/build/cjs/src/social-groups-v2-join-group-request.types.js.map +1 -1
- package/build/cjs/src/social-groups-v2-join-group-request.universal.d.ts +73 -0
- package/build/cjs/src/social-groups-v2-join-group-request.universal.js +24 -13
- package/build/cjs/src/social-groups-v2-join-group-request.universal.js.map +1 -1
- package/build/cjs/src/social-groups-v2-membership-question.universal.js +23 -11
- package/build/cjs/src/social-groups-v2-membership-question.universal.js.map +1 -1
- package/build/es/src/social-groups-v2-group-member.public.d.ts +1 -1
- package/build/es/src/social-groups-v2-group-member.types.d.ts +67 -0
- package/build/es/src/social-groups-v2-group-member.universal.d.ts +67 -0
- package/build/es/src/social-groups-v2-group-member.universal.js +46 -22
- package/build/es/src/social-groups-v2-group-member.universal.js.map +1 -1
- package/build/es/src/social-groups-v2-group-request.public.d.ts +1 -1
- package/build/es/src/social-groups-v2-group-request.types.d.ts +67 -0
- package/build/es/src/social-groups-v2-group-request.universal.d.ts +67 -0
- package/build/es/src/social-groups-v2-group-request.universal.js +19 -9
- package/build/es/src/social-groups-v2-group-request.universal.js.map +1 -1
- package/build/es/src/social-groups-v2-group-role.public.d.ts +1 -1
- package/build/es/src/social-groups-v2-group-role.types.d.ts +67 -0
- package/build/es/src/social-groups-v2-group-role.universal.d.ts +67 -0
- package/build/es/src/social-groups-v2-group-role.universal.js +22 -13
- package/build/es/src/social-groups-v2-group-role.universal.js.map +1 -1
- package/build/es/src/social-groups-v2-group-rules.public.d.ts +1 -1
- package/build/es/src/social-groups-v2-group-rules.types.d.ts +67 -0
- package/build/es/src/social-groups-v2-group-rules.universal.d.ts +67 -0
- package/build/es/src/social-groups-v2-group-rules.universal.js +12 -8
- package/build/es/src/social-groups-v2-group-rules.universal.js.map +1 -1
- package/build/es/src/social-groups-v2-group.public.d.ts +1 -1
- package/build/es/src/social-groups-v2-group.types.d.ts +67 -0
- package/build/es/src/social-groups-v2-group.universal.d.ts +67 -0
- package/build/es/src/social-groups-v2-group.universal.js +37 -20
- package/build/es/src/social-groups-v2-group.universal.js.map +1 -1
- package/build/es/src/social-groups-v2-join-group-request.public.d.ts +1 -1
- package/build/es/src/social-groups-v2-join-group-request.types.d.ts +73 -0
- package/build/es/src/social-groups-v2-join-group-request.types.js.map +1 -1
- package/build/es/src/social-groups-v2-join-group-request.universal.d.ts +73 -0
- package/build/es/src/social-groups-v2-join-group-request.universal.js +24 -13
- package/build/es/src/social-groups-v2-join-group-request.universal.js.map +1 -1
- package/build/es/src/social-groups-v2-membership-question.universal.js +24 -12
- package/build/es/src/social-groups-v2-membership-question.universal.js.map +1 -1
- package/package.json +3 -3
|
@@ -119,6 +119,73 @@ export interface RoleUnassignedFromGroupMember {
|
|
|
119
119
|
/** ID of site member who unassigned the role. It can be empty if the role was assigned by a third-party application. */
|
|
120
120
|
unassignedById?: string | null;
|
|
121
121
|
}
|
|
122
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
123
|
+
createdEvent?: EntityCreatedEvent;
|
|
124
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
125
|
+
deletedEvent?: EntityDeletedEvent;
|
|
126
|
+
actionEvent?: ActionEvent;
|
|
127
|
+
/**
|
|
128
|
+
* Unique event ID.
|
|
129
|
+
* Allows clients to ignore duplicate webhooks.
|
|
130
|
+
*/
|
|
131
|
+
_id?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Assumes actions are also always typed to an entity_type
|
|
134
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
135
|
+
*/
|
|
136
|
+
entityFqdn?: string;
|
|
137
|
+
/**
|
|
138
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
139
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
140
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
141
|
+
*/
|
|
142
|
+
slug?: string;
|
|
143
|
+
/** ID of the entity associated with the event. */
|
|
144
|
+
entityId?: string;
|
|
145
|
+
/** Event timestamp. */
|
|
146
|
+
eventTime?: Date;
|
|
147
|
+
/**
|
|
148
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
149
|
+
* (for example, GDPR).
|
|
150
|
+
*/
|
|
151
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
152
|
+
/** If present, indicates the action that triggered the event. */
|
|
153
|
+
originatedFrom?: string | null;
|
|
154
|
+
/**
|
|
155
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
156
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
157
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
158
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
159
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
160
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
161
|
+
*/
|
|
162
|
+
entityEventSequence?: string | null;
|
|
163
|
+
}
|
|
164
|
+
/** @oneof */
|
|
165
|
+
export interface DomainEventBodyOneOf {
|
|
166
|
+
createdEvent?: EntityCreatedEvent;
|
|
167
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
168
|
+
deletedEvent?: EntityDeletedEvent;
|
|
169
|
+
actionEvent?: ActionEvent;
|
|
170
|
+
}
|
|
171
|
+
export interface EntityCreatedEvent {
|
|
172
|
+
entityAsJson?: string;
|
|
173
|
+
}
|
|
174
|
+
export interface EntityUpdatedEvent {
|
|
175
|
+
/**
|
|
176
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
177
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
178
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
179
|
+
*/
|
|
180
|
+
currentEntityAsJson?: string;
|
|
181
|
+
}
|
|
182
|
+
export interface EntityDeletedEvent {
|
|
183
|
+
/** Entity that was deleted */
|
|
184
|
+
deletedEntityAsJson?: string | null;
|
|
185
|
+
}
|
|
186
|
+
export interface ActionEvent {
|
|
187
|
+
bodyAsJson?: string;
|
|
188
|
+
}
|
|
122
189
|
export interface AssignRoleResponseNonNullableFields {
|
|
123
190
|
groupId: string;
|
|
124
191
|
siteMemberIds: string[];
|
|
@@ -7,7 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { serializer
|
|
10
|
+
import { serializer } from '@wix/metro-runtime/velo';
|
|
11
|
+
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
11
12
|
import * as ambassadorWixSocialGroupsV2GroupRole from './social-groups-v2-group-role.http';
|
|
12
13
|
let __verbose = false;
|
|
13
14
|
function __log(...args) {
|
|
@@ -93,12 +94,16 @@ export function assignRole(groupId, memberIds, role, options) {
|
|
|
93
94
|
return fromJSON(result.data);
|
|
94
95
|
}
|
|
95
96
|
catch (err) {
|
|
96
|
-
const transformedError =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
const transformedError = sdkTransformError(err, {
|
|
98
|
+
spreadPathsToArguments: {},
|
|
99
|
+
explicitPathsToArguments: {
|
|
100
|
+
groupId: '$[0]',
|
|
101
|
+
memberIds: '$[1]',
|
|
102
|
+
role: '$[2]',
|
|
103
|
+
siteMemberIds: '$[3].siteMemberIds',
|
|
104
|
+
},
|
|
105
|
+
singleArgumentUnchanged: false,
|
|
106
|
+
}, ['groupId', 'memberIds', 'role', 'options']);
|
|
102
107
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
103
108
|
throw transformedError;
|
|
104
109
|
}
|
|
@@ -160,12 +165,16 @@ export function unassignRole(groupId, memberIds, role, options) {
|
|
|
160
165
|
return fromJSON(result.data);
|
|
161
166
|
}
|
|
162
167
|
catch (err) {
|
|
163
|
-
const transformedError =
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
const transformedError = sdkTransformError(err, {
|
|
169
|
+
spreadPathsToArguments: {},
|
|
170
|
+
explicitPathsToArguments: {
|
|
171
|
+
groupId: '$[0]',
|
|
172
|
+
memberIds: '$[1]',
|
|
173
|
+
role: '$[2]',
|
|
174
|
+
siteMemberIds: '$[3].siteMemberIds',
|
|
175
|
+
},
|
|
176
|
+
singleArgumentUnchanged: false,
|
|
177
|
+
}, ['groupId', 'memberIds', 'role', 'options']);
|
|
169
178
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
170
179
|
throw transformedError;
|
|
171
180
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-groups-v2-group-role.universal.js","sourceRoot":"","sources":["../../../src/social-groups-v2-group-role.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"social-groups-v2-group-role.universal.js","sourceRoot":"","sources":["../../../src/social-groups-v2-group-role.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEvF,OAAO,KAAK,oCAAoC,MAAM,oCAAoC,CAAC;AAE3F,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GA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,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,4DAAG,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;QACtC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;gBACE,sBAAsB,EAAE,EAAE;gBAC1B,wBAAwB,EAAE;oBACxB,OAAO,EAAE,MAAM;oBACf,SAAS,EAAE,MAAM;oBACjB,IAAI,EAAE,MAAM;oBACZ,aAAa,EAAE,oBAAoB;iBACpC;gBACD,uBAAuB,EAAE,KAAK;aAC/B,EACD,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAC5C,CAAC;YACF,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,4DAAG,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;QACzB,CAAC;;CACF"}
|
|
@@ -5,4 +5,4 @@ export declare const __metadata: {
|
|
|
5
5
|
};
|
|
6
6
|
export declare function listRules(httpClient: HttpClient): (groupId: string) => Promise<import("./social-groups-v2-group-rules.universal").ListRulesResponse & import("./social-groups-v2-group-rules.universal").ListRulesResponseNonNullableFields>;
|
|
7
7
|
export declare function createOrReplaceAllRules(httpClient: HttpClient): (groupId: string, options?: CreateOrReplaceAllRulesOptions) => Promise<import("./social-groups-v2-group-rules.universal").CreateOrReplaceAllRulesResponse & import("./social-groups-v2-group-rules.universal").CreateOrReplaceAllRulesResponseNonNullableFields>;
|
|
8
|
-
export { GroupRules, GroupRule, ListRulesRequest, ListRulesResponse, CreateOrReplaceAllRulesRequest, CreateOrReplaceAllRulesResponse, Empty, ListTemplatesResponse, ListRulesResponseNonNullableFields, CreateOrReplaceAllRulesResponseNonNullableFields, CreateOrReplaceAllRulesOptions, } from './social-groups-v2-group-rules.universal';
|
|
8
|
+
export { GroupRules, GroupRule, ListRulesRequest, ListRulesResponse, CreateOrReplaceAllRulesRequest, CreateOrReplaceAllRulesResponse, Empty, ListTemplatesResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, ListRulesResponseNonNullableFields, CreateOrReplaceAllRulesResponseNonNullableFields, CreateOrReplaceAllRulesOptions, } from './social-groups-v2-group-rules.universal';
|
|
@@ -38,6 +38,73 @@ export interface ListTemplatesResponse {
|
|
|
38
38
|
/** Retrieved rule templates. */
|
|
39
39
|
rules?: GroupRule[];
|
|
40
40
|
}
|
|
41
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
42
|
+
createdEvent?: EntityCreatedEvent;
|
|
43
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
44
|
+
deletedEvent?: EntityDeletedEvent;
|
|
45
|
+
actionEvent?: ActionEvent;
|
|
46
|
+
/**
|
|
47
|
+
* Unique event ID.
|
|
48
|
+
* Allows clients to ignore duplicate webhooks.
|
|
49
|
+
*/
|
|
50
|
+
id?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Assumes actions are also always typed to an entity_type
|
|
53
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
54
|
+
*/
|
|
55
|
+
entityFqdn?: string;
|
|
56
|
+
/**
|
|
57
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
58
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
59
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
60
|
+
*/
|
|
61
|
+
slug?: string;
|
|
62
|
+
/** ID of the entity associated with the event. */
|
|
63
|
+
entityId?: string;
|
|
64
|
+
/** Event timestamp. */
|
|
65
|
+
eventTime?: Date;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
68
|
+
* (for example, GDPR).
|
|
69
|
+
*/
|
|
70
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
71
|
+
/** If present, indicates the action that triggered the event. */
|
|
72
|
+
originatedFrom?: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
75
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
76
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
77
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
78
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
79
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
80
|
+
*/
|
|
81
|
+
entityEventSequence?: string | null;
|
|
82
|
+
}
|
|
83
|
+
/** @oneof */
|
|
84
|
+
export interface DomainEventBodyOneOf {
|
|
85
|
+
createdEvent?: EntityCreatedEvent;
|
|
86
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
87
|
+
deletedEvent?: EntityDeletedEvent;
|
|
88
|
+
actionEvent?: ActionEvent;
|
|
89
|
+
}
|
|
90
|
+
export interface EntityCreatedEvent {
|
|
91
|
+
entityAsJson?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface EntityUpdatedEvent {
|
|
94
|
+
/**
|
|
95
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
96
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
97
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
98
|
+
*/
|
|
99
|
+
currentEntityAsJson?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface EntityDeletedEvent {
|
|
102
|
+
/** Entity that was deleted */
|
|
103
|
+
deletedEntityAsJson?: string | null;
|
|
104
|
+
}
|
|
105
|
+
export interface ActionEvent {
|
|
106
|
+
bodyAsJson?: string;
|
|
107
|
+
}
|
|
41
108
|
export interface ListRulesResponseNonNullableFields {
|
|
42
109
|
rules: {
|
|
43
110
|
title: string;
|
|
@@ -44,6 +44,73 @@ export interface ListTemplatesResponse {
|
|
|
44
44
|
/** Retrieved rule templates. */
|
|
45
45
|
rules?: GroupRule[];
|
|
46
46
|
}
|
|
47
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
48
|
+
createdEvent?: EntityCreatedEvent;
|
|
49
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
50
|
+
deletedEvent?: EntityDeletedEvent;
|
|
51
|
+
actionEvent?: ActionEvent;
|
|
52
|
+
/**
|
|
53
|
+
* Unique event ID.
|
|
54
|
+
* Allows clients to ignore duplicate webhooks.
|
|
55
|
+
*/
|
|
56
|
+
_id?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Assumes actions are also always typed to an entity_type
|
|
59
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
60
|
+
*/
|
|
61
|
+
entityFqdn?: string;
|
|
62
|
+
/**
|
|
63
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
64
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
65
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
66
|
+
*/
|
|
67
|
+
slug?: string;
|
|
68
|
+
/** ID of the entity associated with the event. */
|
|
69
|
+
entityId?: string;
|
|
70
|
+
/** Event timestamp. */
|
|
71
|
+
eventTime?: Date;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
74
|
+
* (for example, GDPR).
|
|
75
|
+
*/
|
|
76
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
77
|
+
/** If present, indicates the action that triggered the event. */
|
|
78
|
+
originatedFrom?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
81
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
82
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
83
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
84
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
85
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
86
|
+
*/
|
|
87
|
+
entityEventSequence?: string | null;
|
|
88
|
+
}
|
|
89
|
+
/** @oneof */
|
|
90
|
+
export interface DomainEventBodyOneOf {
|
|
91
|
+
createdEvent?: EntityCreatedEvent;
|
|
92
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
93
|
+
deletedEvent?: EntityDeletedEvent;
|
|
94
|
+
actionEvent?: ActionEvent;
|
|
95
|
+
}
|
|
96
|
+
export interface EntityCreatedEvent {
|
|
97
|
+
entityAsJson?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface EntityUpdatedEvent {
|
|
100
|
+
/**
|
|
101
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
102
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
103
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
104
|
+
*/
|
|
105
|
+
currentEntityAsJson?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface EntityDeletedEvent {
|
|
108
|
+
/** Entity that was deleted */
|
|
109
|
+
deletedEntityAsJson?: string | null;
|
|
110
|
+
}
|
|
111
|
+
export interface ActionEvent {
|
|
112
|
+
bodyAsJson?: string;
|
|
113
|
+
}
|
|
47
114
|
export interface ListRulesResponseNonNullableFields {
|
|
48
115
|
rules: {
|
|
49
116
|
title: string;
|
|
@@ -7,7 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { serializer
|
|
10
|
+
import { serializer } from '@wix/metro-runtime/velo';
|
|
11
|
+
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
11
12
|
import * as ambassadorWixSocialGroupsV2GroupRules from './social-groups-v2-group-rules.http';
|
|
12
13
|
let __verbose = false;
|
|
13
14
|
function __log(...args) {
|
|
@@ -73,9 +74,11 @@ export function listRules(groupId) {
|
|
|
73
74
|
return fromJSON(result.data);
|
|
74
75
|
}
|
|
75
76
|
catch (err) {
|
|
76
|
-
const transformedError =
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const transformedError = sdkTransformError(err, {
|
|
78
|
+
spreadPathsToArguments: {},
|
|
79
|
+
explicitPathsToArguments: { groupId: '$[0]' },
|
|
80
|
+
singleArgumentUnchanged: false,
|
|
81
|
+
}, ['groupId']);
|
|
79
82
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
80
83
|
throw transformedError;
|
|
81
84
|
}
|
|
@@ -127,10 +130,11 @@ export function createOrReplaceAllRules(groupId, options) {
|
|
|
127
130
|
return fromJSON(result.data);
|
|
128
131
|
}
|
|
129
132
|
catch (err) {
|
|
130
|
-
const transformedError =
|
|
131
|
-
|
|
132
|
-
'
|
|
133
|
-
|
|
133
|
+
const transformedError = sdkTransformError(err, {
|
|
134
|
+
spreadPathsToArguments: {},
|
|
135
|
+
explicitPathsToArguments: { groupId: '$[0]', rules: '$[1].rules' },
|
|
136
|
+
singleArgumentUnchanged: false,
|
|
137
|
+
}, ['groupId', 'options']);
|
|
134
138
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
135
139
|
throw transformedError;
|
|
136
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-groups-v2-group-rules.universal.js","sourceRoot":"","sources":["../../../src/social-groups-v2-group-rules.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"social-groups-v2-group-rules.universal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,MAAM,CAAC,IAAI,CAAQ,CAAC;QACtC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;gBACE,sBAAsB,EAAE,EAAE;gBAC1B,wBAAwB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE;gBAClE,uBAAuB,EAAE,KAAK;aAC/B,EACD,CAAC,SAAS,EAAE,SAAS,CAAC,CACvB,CAAC;YACF,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,4DAAG,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;QACzB,CAAC;;CACF"}
|
|
@@ -77,4 +77,4 @@ export declare function getGroupBySlug(httpClient: HttpClient): (slug: string) =
|
|
|
77
77
|
export declare function listGroups(httpClient: HttpClient): (options?: ListGroupsOptions) => Promise<import("./social-groups-v2-group.universal").ListGroupsResponse & import("./social-groups-v2-group.universal").ListGroupsResponseNonNullableFields>;
|
|
78
78
|
export declare function queryGroups(httpClient: HttpClient): () => import("./social-groups-v2-group.universal").GroupsQueryBuilder;
|
|
79
79
|
export { Type, AllowPolicy, StepKey, PrivacyStatus, IdentityType, SortOrder, MembershipStatus, } from './social-groups-v2-group.universal';
|
|
80
|
-
export { Group, Events, Logo, GroupDetailsPosition, Image, Position, OnboardingStepSettings, AccessRestriction, AccessRestrictionDataOneOf, GroupDetails, CoverImage, GroupSettings, Identity, CreateGroupRequest, CreateGroupResponse, UpdateGroupRequest, UpdateGroupResponse, GroupCoverChanged, GroupDescriptionChanged, DeleteGroupRequest, DeleteGroupResponse, GetGroupRequest, GetGroupResponse, GetGroupBySlugRequest, GetGroupBySlugResponse, ListGroupsRequest, ListGroupsResponse, PagingMetadata, ListGroupsByUserIdRequest, ListGroupsByUserIdResponse, GroupWithMsId, QueryGroupsRequest, Query, Sorting, Paging, QueryGroupsResponse, QueryJoinedGroupsRequest, QueryJoinedGroupsResponse, QueryGroupsByMembershipRequest, GroupPermissions, QueryGroupsByMembershipResponse, CreateGroupResponseNonNullableFields, UpdateGroupResponseNonNullableFields, DeleteGroupResponseNonNullableFields, GetGroupResponseNonNullableFields, GetGroupBySlugResponseNonNullableFields, ListGroupsResponseNonNullableFields, QueryGroupsResponseNonNullableFields, CreateGroupOptions, UpdateGroup, ListGroupsOptions, GroupsQueryResult, GroupsQueryBuilder, } from './social-groups-v2-group.universal';
|
|
80
|
+
export { Group, Events, Logo, GroupDetailsPosition, Image, Position, OnboardingStepSettings, AccessRestriction, AccessRestrictionDataOneOf, GroupDetails, CoverImage, GroupSettings, Identity, CreateGroupRequest, CreateGroupResponse, UpdateGroupRequest, UpdateGroupResponse, GroupCoverChanged, GroupDescriptionChanged, DeleteGroupRequest, DeleteGroupResponse, GetGroupRequest, GetGroupResponse, GetGroupBySlugRequest, GetGroupBySlugResponse, ListGroupsRequest, ListGroupsResponse, PagingMetadata, ListGroupsByUserIdRequest, ListGroupsByUserIdResponse, GroupWithMsId, QueryGroupsRequest, Query, Sorting, Paging, QueryGroupsResponse, QueryJoinedGroupsRequest, QueryJoinedGroupsResponse, QueryGroupsByMembershipRequest, GroupPermissions, QueryGroupsByMembershipResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateGroupResponseNonNullableFields, UpdateGroupResponseNonNullableFields, DeleteGroupResponseNonNullableFields, GetGroupResponseNonNullableFields, GetGroupBySlugResponseNonNullableFields, ListGroupsResponseNonNullableFields, QueryGroupsResponseNonNullableFields, CreateGroupOptions, UpdateGroup, ListGroupsOptions, GroupsQueryResult, GroupsQueryBuilder, } from './social-groups-v2-group.universal';
|
|
@@ -353,6 +353,73 @@ export interface QueryGroupsByMembershipResponse {
|
|
|
353
353
|
groups?: Group[];
|
|
354
354
|
metadata?: PagingMetadata;
|
|
355
355
|
}
|
|
356
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
357
|
+
createdEvent?: EntityCreatedEvent;
|
|
358
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
359
|
+
deletedEvent?: EntityDeletedEvent;
|
|
360
|
+
actionEvent?: ActionEvent;
|
|
361
|
+
/**
|
|
362
|
+
* Unique event ID.
|
|
363
|
+
* Allows clients to ignore duplicate webhooks.
|
|
364
|
+
*/
|
|
365
|
+
id?: string;
|
|
366
|
+
/**
|
|
367
|
+
* Assumes actions are also always typed to an entity_type
|
|
368
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
369
|
+
*/
|
|
370
|
+
entityFqdn?: string;
|
|
371
|
+
/**
|
|
372
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
373
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
374
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
375
|
+
*/
|
|
376
|
+
slug?: string;
|
|
377
|
+
/** ID of the entity associated with the event. */
|
|
378
|
+
entityId?: string;
|
|
379
|
+
/** Event timestamp. */
|
|
380
|
+
eventTime?: Date;
|
|
381
|
+
/**
|
|
382
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
383
|
+
* (for example, GDPR).
|
|
384
|
+
*/
|
|
385
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
386
|
+
/** If present, indicates the action that triggered the event. */
|
|
387
|
+
originatedFrom?: string | null;
|
|
388
|
+
/**
|
|
389
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
390
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
391
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
392
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
393
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
394
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
395
|
+
*/
|
|
396
|
+
entityEventSequence?: string | null;
|
|
397
|
+
}
|
|
398
|
+
/** @oneof */
|
|
399
|
+
export interface DomainEventBodyOneOf {
|
|
400
|
+
createdEvent?: EntityCreatedEvent;
|
|
401
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
402
|
+
deletedEvent?: EntityDeletedEvent;
|
|
403
|
+
actionEvent?: ActionEvent;
|
|
404
|
+
}
|
|
405
|
+
export interface EntityCreatedEvent {
|
|
406
|
+
entityAsJson?: string;
|
|
407
|
+
}
|
|
408
|
+
export interface EntityUpdatedEvent {
|
|
409
|
+
/**
|
|
410
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
411
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
412
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
413
|
+
*/
|
|
414
|
+
currentEntityAsJson?: string;
|
|
415
|
+
}
|
|
416
|
+
export interface EntityDeletedEvent {
|
|
417
|
+
/** Entity that was deleted */
|
|
418
|
+
deletedEntityAsJson?: string | null;
|
|
419
|
+
}
|
|
420
|
+
export interface ActionEvent {
|
|
421
|
+
bodyAsJson?: string;
|
|
422
|
+
}
|
|
356
423
|
export interface CreateGroupResponseNonNullableFields {
|
|
357
424
|
group?: {
|
|
358
425
|
privacyLevel: PrivacyStatus;
|
|
@@ -353,6 +353,73 @@ export interface QueryGroupsByMembershipResponse {
|
|
|
353
353
|
groups?: Group[];
|
|
354
354
|
metadata?: PagingMetadata;
|
|
355
355
|
}
|
|
356
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
357
|
+
createdEvent?: EntityCreatedEvent;
|
|
358
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
359
|
+
deletedEvent?: EntityDeletedEvent;
|
|
360
|
+
actionEvent?: ActionEvent;
|
|
361
|
+
/**
|
|
362
|
+
* Unique event ID.
|
|
363
|
+
* Allows clients to ignore duplicate webhooks.
|
|
364
|
+
*/
|
|
365
|
+
_id?: string;
|
|
366
|
+
/**
|
|
367
|
+
* Assumes actions are also always typed to an entity_type
|
|
368
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
369
|
+
*/
|
|
370
|
+
entityFqdn?: string;
|
|
371
|
+
/**
|
|
372
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
373
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
374
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
375
|
+
*/
|
|
376
|
+
slug?: string;
|
|
377
|
+
/** ID of the entity associated with the event. */
|
|
378
|
+
entityId?: string;
|
|
379
|
+
/** Event timestamp. */
|
|
380
|
+
eventTime?: Date;
|
|
381
|
+
/**
|
|
382
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
383
|
+
* (for example, GDPR).
|
|
384
|
+
*/
|
|
385
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
386
|
+
/** If present, indicates the action that triggered the event. */
|
|
387
|
+
originatedFrom?: string | null;
|
|
388
|
+
/**
|
|
389
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
390
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
391
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
392
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
393
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
394
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
395
|
+
*/
|
|
396
|
+
entityEventSequence?: string | null;
|
|
397
|
+
}
|
|
398
|
+
/** @oneof */
|
|
399
|
+
export interface DomainEventBodyOneOf {
|
|
400
|
+
createdEvent?: EntityCreatedEvent;
|
|
401
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
402
|
+
deletedEvent?: EntityDeletedEvent;
|
|
403
|
+
actionEvent?: ActionEvent;
|
|
404
|
+
}
|
|
405
|
+
export interface EntityCreatedEvent {
|
|
406
|
+
entityAsJson?: string;
|
|
407
|
+
}
|
|
408
|
+
export interface EntityUpdatedEvent {
|
|
409
|
+
/**
|
|
410
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
411
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
412
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
413
|
+
*/
|
|
414
|
+
currentEntityAsJson?: string;
|
|
415
|
+
}
|
|
416
|
+
export interface EntityDeletedEvent {
|
|
417
|
+
/** Entity that was deleted */
|
|
418
|
+
deletedEntityAsJson?: string | null;
|
|
419
|
+
}
|
|
420
|
+
export interface ActionEvent {
|
|
421
|
+
bodyAsJson?: string;
|
|
422
|
+
}
|
|
356
423
|
export interface CreateGroupResponseNonNullableFields {
|
|
357
424
|
group?: {
|
|
358
425
|
privacyLevel: PrivacyStatus;
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { serializer, transformError, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
|
|
11
|
+
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
11
12
|
import * as ambassadorWixSocialGroupsV2Group from './social-groups-v2-group.http';
|
|
12
13
|
// @ts-ignore
|
|
13
14
|
import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
|
|
@@ -135,10 +136,14 @@ export function createGroup(group, options) {
|
|
|
135
136
|
return fromJSON(result.data);
|
|
136
137
|
}
|
|
137
138
|
catch (err) {
|
|
138
|
-
const transformedError =
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
const transformedError = sdkTransformError(err, {
|
|
140
|
+
spreadPathsToArguments: {},
|
|
141
|
+
explicitPathsToArguments: {
|
|
142
|
+
group: '$[0]',
|
|
143
|
+
creatorId: '$[1].creatorId',
|
|
144
|
+
},
|
|
145
|
+
singleArgumentUnchanged: false,
|
|
146
|
+
}, ['group', 'options']);
|
|
142
147
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
143
148
|
throw transformedError;
|
|
144
149
|
}
|
|
@@ -196,10 +201,11 @@ export function updateGroup(_id, group) {
|
|
|
196
201
|
return fromJSON(result.data);
|
|
197
202
|
}
|
|
198
203
|
catch (err) {
|
|
199
|
-
const transformedError =
|
|
200
|
-
'
|
|
201
|
-
'group',
|
|
202
|
-
|
|
204
|
+
const transformedError = sdkTransformError(err, {
|
|
205
|
+
spreadPathsToArguments: { group: '$[1]' },
|
|
206
|
+
explicitPathsToArguments: { 'group.id': '$[0]' },
|
|
207
|
+
singleArgumentUnchanged: false,
|
|
208
|
+
}, ['_id', 'group']);
|
|
203
209
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
204
210
|
throw transformedError;
|
|
205
211
|
}
|
|
@@ -250,9 +256,11 @@ export function deleteGroup(groupId) {
|
|
|
250
256
|
return fromJSON(result.data);
|
|
251
257
|
}
|
|
252
258
|
catch (err) {
|
|
253
|
-
const transformedError =
|
|
254
|
-
|
|
255
|
-
|
|
259
|
+
const transformedError = sdkTransformError(err, {
|
|
260
|
+
spreadPathsToArguments: {},
|
|
261
|
+
explicitPathsToArguments: { groupId: '$[0]' },
|
|
262
|
+
singleArgumentUnchanged: false,
|
|
263
|
+
}, ['groupId']);
|
|
256
264
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
257
265
|
throw transformedError;
|
|
258
266
|
}
|
|
@@ -305,9 +313,11 @@ export function getGroup(groupId) {
|
|
|
305
313
|
return fromJSON(result.data);
|
|
306
314
|
}
|
|
307
315
|
catch (err) {
|
|
308
|
-
const transformedError =
|
|
309
|
-
|
|
310
|
-
|
|
316
|
+
const transformedError = sdkTransformError(err, {
|
|
317
|
+
spreadPathsToArguments: {},
|
|
318
|
+
explicitPathsToArguments: { groupId: '$[0]' },
|
|
319
|
+
singleArgumentUnchanged: false,
|
|
320
|
+
}, ['groupId']);
|
|
311
321
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
312
322
|
throw transformedError;
|
|
313
323
|
}
|
|
@@ -359,9 +369,11 @@ export function getGroupBySlug(slug) {
|
|
|
359
369
|
return fromJSON(result.data);
|
|
360
370
|
}
|
|
361
371
|
catch (err) {
|
|
362
|
-
const transformedError =
|
|
363
|
-
|
|
364
|
-
|
|
372
|
+
const transformedError = sdkTransformError(err, {
|
|
373
|
+
spreadPathsToArguments: {},
|
|
374
|
+
explicitPathsToArguments: { slug: '$[0]' },
|
|
375
|
+
singleArgumentUnchanged: false,
|
|
376
|
+
}, ['slug']);
|
|
365
377
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
366
378
|
throw transformedError;
|
|
367
379
|
}
|
|
@@ -415,9 +427,14 @@ export function listGroups(options) {
|
|
|
415
427
|
return fromJSON(result.data);
|
|
416
428
|
}
|
|
417
429
|
catch (err) {
|
|
418
|
-
const transformedError =
|
|
419
|
-
|
|
420
|
-
|
|
430
|
+
const transformedError = sdkTransformError(err, {
|
|
431
|
+
spreadPathsToArguments: {},
|
|
432
|
+
explicitPathsToArguments: {
|
|
433
|
+
limit: '$[0].limit',
|
|
434
|
+
offset: '$[0].offset',
|
|
435
|
+
},
|
|
436
|
+
singleArgumentUnchanged: false,
|
|
437
|
+
}, ['options']);
|
|
421
438
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
422
439
|
throw transformedError;
|
|
423
440
|
}
|