@wix/notifications 1.0.19 → 1.0.21
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/context.d.ts +1 -0
- package/build/cjs/{index.typings.js → context.js} +7 -3
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js +6 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +1 -1
- package/build/cjs/meta.js +6 -2
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +1 -0
- package/build/es/context.js +2 -0
- package/build/es/context.js.map +1 -0
- package/build/es/index.d.ts +1 -1
- package/build/es/index.js +1 -1
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +1 -1
- package/build/es/meta.js +1 -1
- package/build/es/meta.js.map +1 -1
- package/context/package.json +6 -0
- package/package.json +15 -7
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/ping-notifications-v1-public-notification.http.d.ts +0 -4
- package/build/cjs/src/ping-notifications-v1-public-notification.http.js +0 -69
- package/build/cjs/src/ping-notifications-v1-public-notification.http.js.map +0 -1
- package/build/cjs/src/ping-notifications-v1-public-notification.meta.d.ts +0 -13
- package/build/cjs/src/ping-notifications-v1-public-notification.meta.js +0 -43
- package/build/cjs/src/ping-notifications-v1-public-notification.meta.js.map +0 -1
- package/build/cjs/src/ping-notifications-v1-public-notification.public.d.ts +0 -8
- package/build/cjs/src/ping-notifications-v1-public-notification.public.js +0 -16
- package/build/cjs/src/ping-notifications-v1-public-notification.public.js.map +0 -1
- package/build/cjs/src/ping-notifications-v1-public-notification.types.d.ts +0 -77
- package/build/cjs/src/ping-notifications-v1-public-notification.types.js +0 -28
- package/build/cjs/src/ping-notifications-v1-public-notification.types.js.map +0 -1
- package/build/cjs/src/ping-notifications-v1-public-notification.universal.d.ts +0 -109
- package/build/cjs/src/ping-notifications-v1-public-notification.universal.js +0 -139
- package/build/cjs/src/ping-notifications-v1-public-notification.universal.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/src/ping-notifications-v1-public-notification.http.d.ts +0 -4
- package/build/es/src/ping-notifications-v1-public-notification.http.js +0 -65
- package/build/es/src/ping-notifications-v1-public-notification.http.js.map +0 -1
- package/build/es/src/ping-notifications-v1-public-notification.meta.d.ts +0 -13
- package/build/es/src/ping-notifications-v1-public-notification.meta.js +0 -20
- package/build/es/src/ping-notifications-v1-public-notification.meta.js.map +0 -1
- package/build/es/src/ping-notifications-v1-public-notification.public.d.ts +0 -8
- package/build/es/src/ping-notifications-v1-public-notification.public.js +0 -9
- package/build/es/src/ping-notifications-v1-public-notification.public.js.map +0 -1
- package/build/es/src/ping-notifications-v1-public-notification.types.d.ts +0 -77
- package/build/es/src/ping-notifications-v1-public-notification.types.js +0 -25
- package/build/es/src/ping-notifications-v1-public-notification.types.js.map +0 -1
- package/build/es/src/ping-notifications-v1-public-notification.universal.d.ts +0 -109
- package/build/es/src/ping-notifications-v1-public-notification.universal.js +0 -116
- package/build/es/src/ping-notifications-v1-public-notification.universal.js.map +0 -1
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.notify = exports.DashboardPages = exports.Channel = exports.Role = exports.__debug = void 0;
|
|
32
|
-
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
|
-
const ambassadorWixPingNotificationsV1PublicNotification = __importStar(require("./ping-notifications-v1-public-notification.http"));
|
|
34
|
-
let __verbose = false;
|
|
35
|
-
function __log(...args) {
|
|
36
|
-
__verbose && console.log(...args);
|
|
37
|
-
}
|
|
38
|
-
function __inspect(obj) {
|
|
39
|
-
return obj;
|
|
40
|
-
}
|
|
41
|
-
exports.__debug = {
|
|
42
|
-
verboseLogging: {
|
|
43
|
-
on: () => (__verbose = true),
|
|
44
|
-
off: () => (__verbose = false),
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
const _toVeloEntity = '$';
|
|
48
|
-
const _fromVeloEntity = '$';
|
|
49
|
-
var Role;
|
|
50
|
-
(function (Role) {
|
|
51
|
-
/** All contributors with any role */
|
|
52
|
-
Role["All_Contributors"] = "All_Contributors";
|
|
53
|
-
/** Only the owner */
|
|
54
|
-
Role["Owner"] = "Owner";
|
|
55
|
-
})(Role = exports.Role || (exports.Role = {}));
|
|
56
|
-
var Channel;
|
|
57
|
-
(function (Channel) {
|
|
58
|
-
/** No Default Channel - need to expilicitly decide on channel */
|
|
59
|
-
Channel["Undefined"] = "Undefined";
|
|
60
|
-
/** The widget inside Wix */
|
|
61
|
-
Channel["Dashboard"] = "Dashboard";
|
|
62
|
-
/** Mobile push to WixApp */
|
|
63
|
-
Channel["Mobile"] = "Mobile";
|
|
64
|
-
/** Browser push to the active browser (Chrome/Safari only) */
|
|
65
|
-
Channel["Browser"] = "Browser";
|
|
66
|
-
})(Channel = exports.Channel || (exports.Channel = {}));
|
|
67
|
-
var DashboardPages;
|
|
68
|
-
(function (DashboardPages) {
|
|
69
|
-
DashboardPages["Undefined_Page"] = "Undefined_Page";
|
|
70
|
-
/** goes to business manager home */
|
|
71
|
-
DashboardPages["Home"] = "Home";
|
|
72
|
-
})(DashboardPages = exports.DashboardPages || (exports.DashboardPages = {}));
|
|
73
|
-
const _empty = {};
|
|
74
|
-
const _publicNotifyRequest = {};
|
|
75
|
-
/**
|
|
76
|
-
* This endpoint allows you to send notifications
|
|
77
|
-
* @param body - The body of the notification
|
|
78
|
-
* @param channels - The channel to which send the notification
|
|
79
|
-
* @public
|
|
80
|
-
* @documentationMaturity preview
|
|
81
|
-
* @requiredField body
|
|
82
|
-
* @requiredField channels
|
|
83
|
-
*/
|
|
84
|
-
function notify(body, channels, options) {
|
|
85
|
-
var _a, _b, _c;
|
|
86
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
87
|
-
const requestTransformation = {
|
|
88
|
-
body: '$[0]',
|
|
89
|
-
channels: '$[1]',
|
|
90
|
-
toSiteContributors: '$[2].toSiteContributors',
|
|
91
|
-
toContacts: '$[2].toContacts',
|
|
92
|
-
toTopicsSubscribers: '$[2].toTopicsSubscribers',
|
|
93
|
-
title: '$[2].title',
|
|
94
|
-
action: '$[2].action',
|
|
95
|
-
targetUrl: '$[2].targetUrl',
|
|
96
|
-
targetDashboardPage: '$[2].targetDashboardPage',
|
|
97
|
-
};
|
|
98
|
-
const responseTransformation = '$';
|
|
99
|
-
// @ts-ignore
|
|
100
|
-
const { httpClient, sideEffects } = arguments[3];
|
|
101
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
102
|
-
rootSchema: _publicNotifyRequest,
|
|
103
|
-
depSchemas: {},
|
|
104
|
-
fqdnTransformation: {
|
|
105
|
-
paths: [],
|
|
106
|
-
transformation: _fromVeloEntity,
|
|
107
|
-
},
|
|
108
|
-
customTransformation: requestTransformation,
|
|
109
|
-
});
|
|
110
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
111
|
-
rootSchema: _empty,
|
|
112
|
-
depSchemas: {},
|
|
113
|
-
fqdnTransformation: {
|
|
114
|
-
paths: [],
|
|
115
|
-
transformation: _toVeloEntity,
|
|
116
|
-
},
|
|
117
|
-
customTransformation: responseTransformation,
|
|
118
|
-
});
|
|
119
|
-
const payload = toAmbassadorRequest([body, channels, options]);
|
|
120
|
-
const reqOpts = ambassadorWixPingNotificationsV1PublicNotification.notify(payload);
|
|
121
|
-
__log(`"Notify" sending request with: ${__inspect(reqOpts)}`);
|
|
122
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
123
|
-
try {
|
|
124
|
-
const result = yield httpClient.request(reqOpts);
|
|
125
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
126
|
-
}
|
|
127
|
-
catch (err) {
|
|
128
|
-
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
129
|
-
'body',
|
|
130
|
-
'channels',
|
|
131
|
-
'options',
|
|
132
|
-
]);
|
|
133
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
134
|
-
throw transformedError;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
exports.notify = notify;
|
|
139
|
-
//# sourceMappingURL=ping-notifications-v1-public-notification.universal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ping-notifications-v1-public-notification.universal.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,qIAAuH;AAEvH,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;AAEY,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAqD5B,IAAY,IAKX;AALD,WAAY,IAAI;IACd,qCAAqC;IACrC,6CAAqC,CAAA;IACrC,qBAAqB;IACrB,uBAAe,CAAA;AACjB,CAAC,EALW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAKf;AAcD,IAAY,OASX;AATD,WAAY,OAAO;IACjB,iEAAiE;IACjE,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,4BAAiB,CAAA;I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sBAAsB;SAC7C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAE/D,MAAM,OAAO,GACX,kDAAkD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAErE,KAAK,CAAC,kCAAkC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE9D,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;SAClC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,IAAA,qBAAc,EAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,MAAM;gBACN,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF;AAjED,wBAiEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as notifications from './src/ping-notifications-v1-public-notification.universal';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,2DAA2D,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
-
import { PublicNotifyRequest, Empty } from './ping-notifications-v1-public-notification.types';
|
|
3
|
-
/** This endpoint allows you to send notifications */
|
|
4
|
-
export declare function notify(payload: PublicNotifyRequest): RequestOptionsFactory<Empty>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { serializer } from '@wix/metro-runtime/ambassador';
|
|
2
|
-
import { resolveUrl } from '@wix/metro-runtime';
|
|
3
|
-
const _empty = {};
|
|
4
|
-
const _publicNotifyRequest = {};
|
|
5
|
-
function resolveComWixpressPingHubApiPublicNotificationsServiceUrl(opts) {
|
|
6
|
-
const domainToMappings = {
|
|
7
|
-
'api._api_base_domain_': [
|
|
8
|
-
{
|
|
9
|
-
srcPath: '/notifications-hub-server',
|
|
10
|
-
destPath: '',
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
'www._base_domain_': [
|
|
14
|
-
{
|
|
15
|
-
srcPath: '/_api/ping/hub',
|
|
16
|
-
destPath: '',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
srcPath: '/_api/ping/notifications',
|
|
20
|
-
destPath: '',
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
'manage._base_domain_': [
|
|
24
|
-
{
|
|
25
|
-
srcPath: '/_api/ping/hub',
|
|
26
|
-
destPath: '',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
srcPath: '/_api/ping/notifications',
|
|
30
|
-
destPath: '',
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
'www.wixapis.com': [
|
|
34
|
-
{
|
|
35
|
-
srcPath: '/notifications/v3/notify',
|
|
36
|
-
destPath: '/v3/notify',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
};
|
|
40
|
-
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
41
|
-
}
|
|
42
|
-
/** This endpoint allows you to send notifications */
|
|
43
|
-
export function notify(payload) {
|
|
44
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_publicNotifyRequest, {});
|
|
45
|
-
const { fromJSON: fromRes } = serializer(_empty, {});
|
|
46
|
-
function __notify({ host }) {
|
|
47
|
-
const serializedData = toReq(payload);
|
|
48
|
-
const metadata = {
|
|
49
|
-
entityFqdn: 'wix.ping.notifications.v1.public_notification',
|
|
50
|
-
method: 'POST',
|
|
51
|
-
methodFqn: 'com.wixpress.ping.hub.api.PublicNotificationsService.Notify',
|
|
52
|
-
url: resolveComWixpressPingHubApiPublicNotificationsServiceUrl({
|
|
53
|
-
protoPath: '/api/v1/notify',
|
|
54
|
-
data: serializedData,
|
|
55
|
-
host,
|
|
56
|
-
}),
|
|
57
|
-
data: serializedData,
|
|
58
|
-
transformResponse: fromRes,
|
|
59
|
-
};
|
|
60
|
-
return metadata;
|
|
61
|
-
}
|
|
62
|
-
__notify.fromReq = fromReq;
|
|
63
|
-
return __notify;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=ping-notifications-v1-public-notification.http.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ping-notifications-v1-public-notification.http.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAQhD,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SAAS,yDAAyD,CAChE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,2BAA2B;gBACpC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,YAAY;aACvB;SACF;KACF,CAAC;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,MAAM,CACpB,OAA4B;IAE5B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CACrD,oBAAoB,EACpB,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAErD,SAAS,QAAQ,CAAC,EAAE,IAAI,EAAO;QAC7B,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,+CAA+C;YAC3D,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,6DAA6D;YACxE,GAAG,EAAE,yDAAyD,CAAC;gBAC7D,SAAS,EAAE,gBAAgB;gBAC3B,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as ambassadorWixPingNotificationsV1PublicNotificationTypes from './ping-notifications-v1-public-notification.types';
|
|
2
|
-
import * as ambassadorWixPingNotificationsV1PublicNotificationUniversalTypes from './ping-notifications-v1-public-notification.universal';
|
|
3
|
-
export declare type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
4
|
-
getUrl: (context: any) => string;
|
|
5
|
-
httpMethod: K;
|
|
6
|
-
path: string;
|
|
7
|
-
pathParams: M;
|
|
8
|
-
__requestType: T;
|
|
9
|
-
__originalRequestType: S;
|
|
10
|
-
__responseType: Q;
|
|
11
|
-
__originalResponseType: R;
|
|
12
|
-
};
|
|
13
|
-
export declare function notify(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixPingNotificationsV1PublicNotificationUniversalTypes.PublicNotifyRequest, ambassadorWixPingNotificationsV1PublicNotificationTypes.PublicNotifyRequest, ambassadorWixPingNotificationsV1PublicNotificationUniversalTypes.Empty, ambassadorWixPingNotificationsV1PublicNotificationTypes.Empty>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as ambassadorWixPingNotificationsV1PublicNotification from './ping-notifications-v1-public-notification.http';
|
|
2
|
-
export function notify() {
|
|
3
|
-
const payload = {};
|
|
4
|
-
const getRequestOptions = ambassadorWixPingNotificationsV1PublicNotification.notify(payload);
|
|
5
|
-
const getUrl = (context) => {
|
|
6
|
-
const { url } = getRequestOptions(context);
|
|
7
|
-
return url;
|
|
8
|
-
};
|
|
9
|
-
return {
|
|
10
|
-
getUrl,
|
|
11
|
-
httpMethod: 'POST',
|
|
12
|
-
path: '/api/v1/notify',
|
|
13
|
-
pathParams: {},
|
|
14
|
-
__requestType: null,
|
|
15
|
-
__originalRequestType: null,
|
|
16
|
-
__responseType: null,
|
|
17
|
-
__originalResponseType: null,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=ping-notifications-v1-public-notification.meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ping-notifications-v1-public-notification.meta.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kDAAkD,MAAM,kDAAkD,CAAC;AAsBvH,MAAM,UAAU,MAAM;IAQpB,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,kDAAkD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,gBAAgB;QACtB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@wix/sdk-types';
|
|
2
|
-
import { Channel, NotifyOptions } from './ping-notifications-v1-public-notification.universal';
|
|
3
|
-
export declare const __metadata: {
|
|
4
|
-
PACKAGE_NAME: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function notify(httpClient: HttpClient): (body: string | null, channels: Channel[], options?: NotifyOptions | undefined) => Promise<void>;
|
|
7
|
-
export { Role, Channel, DashboardPages, } from './ping-notifications-v1-public-notification.universal';
|
|
8
|
-
export { Public_notification, PublicNotifyRequest, PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf, ToSiteContributors, ToContacts, ToTopicsSubscribers, Empty, NotifyOptions, } from './ping-notifications-v1-public-notification.universal';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { notify as universalNotify, } from './ping-notifications-v1-public-notification.universal';
|
|
2
|
-
export const __metadata = { PACKAGE_NAME: '@wix/notifications' };
|
|
3
|
-
export function notify(httpClient) {
|
|
4
|
-
return (body, channels, options) => universalNotify(body, channels, options,
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
{ httpClient });
|
|
7
|
-
}
|
|
8
|
-
export { Role, Channel, DashboardPages, } from './ping-notifications-v1-public-notification.universal';
|
|
9
|
-
//# sourceMappingURL=ping-notifications-v1-public-notification.public.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ping-notifications-v1-public-notification.public.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.public.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,IAAI,eAAe,GAC1B,MAAM,uDAAuD,CAAC;AAE/D,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAEjE,MAAM,UAAU,MAAM,CAAC,UAAsB;IAC3C,OAAO,CAAC,IAAmB,EAAE,QAAmB,EAAE,OAAuB,EAAE,EAAE,CAC3E,eAAe,CACb,IAAI,EACJ,QAAQ,EACR,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,OAAO,EACL,IAAI,EACJ,OAAO,EACP,cAAc,GACf,MAAM,uDAAuD,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
export interface Public_notification {
|
|
2
|
-
/** id */
|
|
3
|
-
id?: string | null;
|
|
4
|
-
}
|
|
5
|
-
export interface PublicNotifyRequest extends PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf {
|
|
6
|
-
/** Send to site contributors */
|
|
7
|
-
toSiteContributors?: ToSiteContributors;
|
|
8
|
-
/** Send to contacts */
|
|
9
|
-
toContacts?: ToContacts;
|
|
10
|
-
/** Send to topic subscribers */
|
|
11
|
-
toTopicsSubscribers?: ToTopicsSubscribers;
|
|
12
|
-
/** an open url as an action target */
|
|
13
|
-
targetUrl?: string | null;
|
|
14
|
-
/** target_dashboard_page */
|
|
15
|
-
targetDashboardPage?: DashboardPages;
|
|
16
|
-
/** The title of the notification */
|
|
17
|
-
title?: string | null;
|
|
18
|
-
/** The body of the notification */
|
|
19
|
-
body?: string | null;
|
|
20
|
-
/** The Action of the notification */
|
|
21
|
-
action?: string | null;
|
|
22
|
-
/** The channel to which send the notification */
|
|
23
|
-
channels?: Channel[];
|
|
24
|
-
}
|
|
25
|
-
/** @oneof */
|
|
26
|
-
export interface PublicNotifyRequestRecipientsFilterOneOf {
|
|
27
|
-
/** Send to site contributors */
|
|
28
|
-
toSiteContributors?: ToSiteContributors;
|
|
29
|
-
/** Send to contacts */
|
|
30
|
-
toContacts?: ToContacts;
|
|
31
|
-
/** Send to topic subscribers */
|
|
32
|
-
toTopicsSubscribers?: ToTopicsSubscribers;
|
|
33
|
-
}
|
|
34
|
-
/** @oneof */
|
|
35
|
-
export interface PublicNotifyRequestActionTargetOneOf {
|
|
36
|
-
/** an open url as an action target */
|
|
37
|
-
targetUrl?: string | null;
|
|
38
|
-
/** target_dashboard_page */
|
|
39
|
-
targetDashboardPage?: DashboardPages;
|
|
40
|
-
}
|
|
41
|
-
export interface ToSiteContributors {
|
|
42
|
-
/** with_role */
|
|
43
|
-
withRole?: Role;
|
|
44
|
-
}
|
|
45
|
-
export declare enum Role {
|
|
46
|
-
/** All contributors with any role */
|
|
47
|
-
All_Contributors = "All_Contributors",
|
|
48
|
-
/** Only the owner */
|
|
49
|
-
Owner = "Owner"
|
|
50
|
-
}
|
|
51
|
-
export interface ToContacts {
|
|
52
|
-
/** contact_ids */
|
|
53
|
-
contactIds?: string[];
|
|
54
|
-
}
|
|
55
|
-
export interface ToTopicsSubscribers {
|
|
56
|
-
/** topics */
|
|
57
|
-
topics?: string[];
|
|
58
|
-
/** excluded_contact_ids */
|
|
59
|
-
excludedContactIds?: string[];
|
|
60
|
-
}
|
|
61
|
-
export declare enum Channel {
|
|
62
|
-
/** No Default Channel - need to expilicitly decide on channel */
|
|
63
|
-
Undefined = "Undefined",
|
|
64
|
-
/** The widget inside Wix */
|
|
65
|
-
Dashboard = "Dashboard",
|
|
66
|
-
/** Mobile push to WixApp */
|
|
67
|
-
Mobile = "Mobile",
|
|
68
|
-
/** Browser push to the active browser (Chrome/Safari only) */
|
|
69
|
-
Browser = "Browser"
|
|
70
|
-
}
|
|
71
|
-
export declare enum DashboardPages {
|
|
72
|
-
Undefined_Page = "Undefined_Page",
|
|
73
|
-
/** goes to business manager home */
|
|
74
|
-
Home = "Home"
|
|
75
|
-
}
|
|
76
|
-
export interface Empty {
|
|
77
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export var Role;
|
|
2
|
-
(function (Role) {
|
|
3
|
-
/** All contributors with any role */
|
|
4
|
-
Role["All_Contributors"] = "All_Contributors";
|
|
5
|
-
/** Only the owner */
|
|
6
|
-
Role["Owner"] = "Owner";
|
|
7
|
-
})(Role || (Role = {}));
|
|
8
|
-
export var Channel;
|
|
9
|
-
(function (Channel) {
|
|
10
|
-
/** No Default Channel - need to expilicitly decide on channel */
|
|
11
|
-
Channel["Undefined"] = "Undefined";
|
|
12
|
-
/** The widget inside Wix */
|
|
13
|
-
Channel["Dashboard"] = "Dashboard";
|
|
14
|
-
/** Mobile push to WixApp */
|
|
15
|
-
Channel["Mobile"] = "Mobile";
|
|
16
|
-
/** Browser push to the active browser (Chrome/Safari only) */
|
|
17
|
-
Channel["Browser"] = "Browser";
|
|
18
|
-
})(Channel || (Channel = {}));
|
|
19
|
-
export var DashboardPages;
|
|
20
|
-
(function (DashboardPages) {
|
|
21
|
-
DashboardPages["Undefined_Page"] = "Undefined_Page";
|
|
22
|
-
/** goes to business manager home */
|
|
23
|
-
DashboardPages["Home"] = "Home";
|
|
24
|
-
})(DashboardPages || (DashboardPages = {}));
|
|
25
|
-
//# sourceMappingURL=ping-notifications-v1-public-notification.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ping-notifications-v1-public-notification.types.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.types.ts"],"names":[],"mappings":"AAmDA,MAAM,CAAN,IAAY,IAKX;AALD,WAAY,IAAI;IACd,qCAAqC;IACrC,6CAAqC,CAAA;IACrC,qBAAqB;IACrB,uBAAe,CAAA;AACjB,CAAC,EALW,IAAI,KAAJ,IAAI,QAKf;AAcD,MAAM,CAAN,IAAY,OASX;AATD,WAAY,OAAO;IACjB,iEAAiE;IACjE,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,4BAAiB,CAAA;IACjB,8DAA8D;IAC9D,8BAAmB,CAAA;AACrB,CAAC,EATW,OAAO,KAAP,OAAO,QASlB;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mDAAiC,CAAA;IACjC,oCAAoC;IACpC,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
export declare const __debug: {
|
|
2
|
-
verboseLogging: {
|
|
3
|
-
on: () => boolean;
|
|
4
|
-
off: () => boolean;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export interface Public_notification {
|
|
8
|
-
/** id */
|
|
9
|
-
_id?: string | null;
|
|
10
|
-
}
|
|
11
|
-
export interface PublicNotifyRequest extends PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf {
|
|
12
|
-
/** Send to site contributors */
|
|
13
|
-
toSiteContributors?: ToSiteContributors;
|
|
14
|
-
/** Send to contacts */
|
|
15
|
-
toContacts?: ToContacts;
|
|
16
|
-
/** Send to topic subscribers */
|
|
17
|
-
toTopicsSubscribers?: ToTopicsSubscribers;
|
|
18
|
-
/** an open url as an action target */
|
|
19
|
-
targetUrl?: string | null;
|
|
20
|
-
/** target_dashboard_page */
|
|
21
|
-
targetDashboardPage?: DashboardPages;
|
|
22
|
-
/** The title of the notification */
|
|
23
|
-
title?: string | null;
|
|
24
|
-
/** The body of the notification */
|
|
25
|
-
body?: string | null;
|
|
26
|
-
/** The Action of the notification */
|
|
27
|
-
action?: string | null;
|
|
28
|
-
/** The channel to which send the notification */
|
|
29
|
-
channels?: Channel[];
|
|
30
|
-
}
|
|
31
|
-
/** @oneof */
|
|
32
|
-
export interface PublicNotifyRequestRecipientsFilterOneOf {
|
|
33
|
-
/** Send to site contributors */
|
|
34
|
-
toSiteContributors?: ToSiteContributors;
|
|
35
|
-
/** Send to contacts */
|
|
36
|
-
toContacts?: ToContacts;
|
|
37
|
-
/** Send to topic subscribers */
|
|
38
|
-
toTopicsSubscribers?: ToTopicsSubscribers;
|
|
39
|
-
}
|
|
40
|
-
/** @oneof */
|
|
41
|
-
export interface PublicNotifyRequestActionTargetOneOf {
|
|
42
|
-
/** an open url as an action target */
|
|
43
|
-
targetUrl?: string | null;
|
|
44
|
-
/** target_dashboard_page */
|
|
45
|
-
targetDashboardPage?: DashboardPages;
|
|
46
|
-
}
|
|
47
|
-
export interface ToSiteContributors {
|
|
48
|
-
/** with_role */
|
|
49
|
-
withRole?: Role;
|
|
50
|
-
}
|
|
51
|
-
export declare enum Role {
|
|
52
|
-
/** All contributors with any role */
|
|
53
|
-
All_Contributors = "All_Contributors",
|
|
54
|
-
/** Only the owner */
|
|
55
|
-
Owner = "Owner"
|
|
56
|
-
}
|
|
57
|
-
export interface ToContacts {
|
|
58
|
-
/** contact_ids */
|
|
59
|
-
contactIds?: string[];
|
|
60
|
-
}
|
|
61
|
-
export interface ToTopicsSubscribers {
|
|
62
|
-
/** topics */
|
|
63
|
-
topics?: string[];
|
|
64
|
-
/** excluded_contact_ids */
|
|
65
|
-
excludedContactIds?: string[];
|
|
66
|
-
}
|
|
67
|
-
export declare enum Channel {
|
|
68
|
-
/** No Default Channel - need to expilicitly decide on channel */
|
|
69
|
-
Undefined = "Undefined",
|
|
70
|
-
/** The widget inside Wix */
|
|
71
|
-
Dashboard = "Dashboard",
|
|
72
|
-
/** Mobile push to WixApp */
|
|
73
|
-
Mobile = "Mobile",
|
|
74
|
-
/** Browser push to the active browser (Chrome/Safari only) */
|
|
75
|
-
Browser = "Browser"
|
|
76
|
-
}
|
|
77
|
-
export declare enum DashboardPages {
|
|
78
|
-
Undefined_Page = "Undefined_Page",
|
|
79
|
-
/** goes to business manager home */
|
|
80
|
-
Home = "Home"
|
|
81
|
-
}
|
|
82
|
-
export interface Empty {
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* This endpoint allows you to send notifications
|
|
86
|
-
* @param body - The body of the notification
|
|
87
|
-
* @param channels - The channel to which send the notification
|
|
88
|
-
* @public
|
|
89
|
-
* @documentationMaturity preview
|
|
90
|
-
* @requiredField body
|
|
91
|
-
* @requiredField channels
|
|
92
|
-
*/
|
|
93
|
-
export declare function notify(body: string | null, channels: Channel[], options?: NotifyOptions): Promise<void>;
|
|
94
|
-
export interface NotifyOptions extends PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf {
|
|
95
|
-
/** Send to site contributors */
|
|
96
|
-
toSiteContributors?: ToSiteContributors;
|
|
97
|
-
/** Send to contacts */
|
|
98
|
-
toContacts?: ToContacts;
|
|
99
|
-
/** Send to topic subscribers */
|
|
100
|
-
toTopicsSubscribers?: ToTopicsSubscribers;
|
|
101
|
-
/** The title of the notification */
|
|
102
|
-
title?: string | null;
|
|
103
|
-
/** The Action of the notification */
|
|
104
|
-
action?: string | null;
|
|
105
|
-
/** an open url as an action target */
|
|
106
|
-
targetUrl?: string | null;
|
|
107
|
-
/** target_dashboard_page */
|
|
108
|
-
targetDashboardPage?: DashboardPages;
|
|
109
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { serializer, transformError } from '@wix/metro-runtime/velo';
|
|
11
|
-
import * as ambassadorWixPingNotificationsV1PublicNotification from './ping-notifications-v1-public-notification.http';
|
|
12
|
-
let __verbose = false;
|
|
13
|
-
function __log(...args) {
|
|
14
|
-
__verbose && console.log(...args);
|
|
15
|
-
}
|
|
16
|
-
function __inspect(obj) {
|
|
17
|
-
return obj;
|
|
18
|
-
}
|
|
19
|
-
export const __debug = {
|
|
20
|
-
verboseLogging: {
|
|
21
|
-
on: () => (__verbose = true),
|
|
22
|
-
off: () => (__verbose = false),
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
const _toVeloEntity = '$';
|
|
26
|
-
const _fromVeloEntity = '$';
|
|
27
|
-
export var Role;
|
|
28
|
-
(function (Role) {
|
|
29
|
-
/** All contributors with any role */
|
|
30
|
-
Role["All_Contributors"] = "All_Contributors";
|
|
31
|
-
/** Only the owner */
|
|
32
|
-
Role["Owner"] = "Owner";
|
|
33
|
-
})(Role || (Role = {}));
|
|
34
|
-
export var Channel;
|
|
35
|
-
(function (Channel) {
|
|
36
|
-
/** No Default Channel - need to expilicitly decide on channel */
|
|
37
|
-
Channel["Undefined"] = "Undefined";
|
|
38
|
-
/** The widget inside Wix */
|
|
39
|
-
Channel["Dashboard"] = "Dashboard";
|
|
40
|
-
/** Mobile push to WixApp */
|
|
41
|
-
Channel["Mobile"] = "Mobile";
|
|
42
|
-
/** Browser push to the active browser (Chrome/Safari only) */
|
|
43
|
-
Channel["Browser"] = "Browser";
|
|
44
|
-
})(Channel || (Channel = {}));
|
|
45
|
-
export var DashboardPages;
|
|
46
|
-
(function (DashboardPages) {
|
|
47
|
-
DashboardPages["Undefined_Page"] = "Undefined_Page";
|
|
48
|
-
/** goes to business manager home */
|
|
49
|
-
DashboardPages["Home"] = "Home";
|
|
50
|
-
})(DashboardPages || (DashboardPages = {}));
|
|
51
|
-
const _empty = {};
|
|
52
|
-
const _publicNotifyRequest = {};
|
|
53
|
-
/**
|
|
54
|
-
* This endpoint allows you to send notifications
|
|
55
|
-
* @param body - The body of the notification
|
|
56
|
-
* @param channels - The channel to which send the notification
|
|
57
|
-
* @public
|
|
58
|
-
* @documentationMaturity preview
|
|
59
|
-
* @requiredField body
|
|
60
|
-
* @requiredField channels
|
|
61
|
-
*/
|
|
62
|
-
export function notify(body, channels, options) {
|
|
63
|
-
var _a, _b, _c;
|
|
64
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
65
|
-
const requestTransformation = {
|
|
66
|
-
body: '$[0]',
|
|
67
|
-
channels: '$[1]',
|
|
68
|
-
toSiteContributors: '$[2].toSiteContributors',
|
|
69
|
-
toContacts: '$[2].toContacts',
|
|
70
|
-
toTopicsSubscribers: '$[2].toTopicsSubscribers',
|
|
71
|
-
title: '$[2].title',
|
|
72
|
-
action: '$[2].action',
|
|
73
|
-
targetUrl: '$[2].targetUrl',
|
|
74
|
-
targetDashboardPage: '$[2].targetDashboardPage',
|
|
75
|
-
};
|
|
76
|
-
const responseTransformation = '$';
|
|
77
|
-
// @ts-ignore
|
|
78
|
-
const { httpClient, sideEffects } = arguments[3];
|
|
79
|
-
const { toAmbassadorRequest } = serializer({
|
|
80
|
-
rootSchema: _publicNotifyRequest,
|
|
81
|
-
depSchemas: {},
|
|
82
|
-
fqdnTransformation: {
|
|
83
|
-
paths: [],
|
|
84
|
-
transformation: _fromVeloEntity,
|
|
85
|
-
},
|
|
86
|
-
customTransformation: requestTransformation,
|
|
87
|
-
});
|
|
88
|
-
const { fromJSON } = serializer({
|
|
89
|
-
rootSchema: _empty,
|
|
90
|
-
depSchemas: {},
|
|
91
|
-
fqdnTransformation: {
|
|
92
|
-
paths: [],
|
|
93
|
-
transformation: _toVeloEntity,
|
|
94
|
-
},
|
|
95
|
-
customTransformation: responseTransformation,
|
|
96
|
-
});
|
|
97
|
-
const payload = toAmbassadorRequest([body, channels, options]);
|
|
98
|
-
const reqOpts = ambassadorWixPingNotificationsV1PublicNotification.notify(payload);
|
|
99
|
-
__log(`"Notify" sending request with: ${__inspect(reqOpts)}`);
|
|
100
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
101
|
-
try {
|
|
102
|
-
const result = yield httpClient.request(reqOpts);
|
|
103
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
104
|
-
}
|
|
105
|
-
catch (err) {
|
|
106
|
-
const transformedError = transformError(err, requestTransformation, [
|
|
107
|
-
'body',
|
|
108
|
-
'channels',
|
|
109
|
-
'options',
|
|
110
|
-
]);
|
|
111
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
112
|
-
throw transformedError;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=ping-notifications-v1-public-notification.universal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ping-notifications-v1-public-notification.universal.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,kDAAkD,MAAM,kDAAkD,CAAC;AAEvH,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,GAAG,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