@wix/auto_sdk_events_notifications 1.0.41 → 1.0.42
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.js +9 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +9 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.js +9 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs +9 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +9 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.mjs +9 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.js +9 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.js +9 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.js +9 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.mjs +9 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.mjs +9 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.mjs +9 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/meta.js
CHANGED
|
@@ -107,6 +107,9 @@ function triggerNotification(payload) {
|
|
|
107
107
|
method: "POST",
|
|
108
108
|
methodFqn: "wix.events.notifications.v2.NotificationService.TriggerNotification",
|
|
109
109
|
packageName: PACKAGE_NAME,
|
|
110
|
+
migrationOptions: {
|
|
111
|
+
optInTransformResponse: true
|
|
112
|
+
},
|
|
110
113
|
url: resolveWixEventsNotificationsV2NotificationServiceUrl({
|
|
111
114
|
protoPath: "/v2/notifications/trigger",
|
|
112
115
|
data: payload,
|
|
@@ -125,6 +128,9 @@ function resolveNotificationConfig(payload) {
|
|
|
125
128
|
method: "GET",
|
|
126
129
|
methodFqn: "wix.events.notifications.v2.NotificationConfigManagement.ResolveNotificationConfig",
|
|
127
130
|
packageName: PACKAGE_NAME,
|
|
131
|
+
migrationOptions: {
|
|
132
|
+
optInTransformResponse: true
|
|
133
|
+
},
|
|
128
134
|
url: resolveWixEventsNotificationsV2NotificationConfigManagementUrl({
|
|
129
135
|
protoPath: "/v2/notification-configs/resolve/{notificationConfigId}",
|
|
130
136
|
data: payload,
|
|
@@ -165,6 +171,9 @@ function upsertNotificationConfig(payload) {
|
|
|
165
171
|
method: "POST",
|
|
166
172
|
methodFqn: "wix.events.notifications.v2.NotificationConfigManagement.UpsertNotificationConfig",
|
|
167
173
|
packageName: PACKAGE_NAME,
|
|
174
|
+
migrationOptions: {
|
|
175
|
+
optInTransformResponse: true
|
|
176
|
+
},
|
|
168
177
|
url: resolveWixEventsNotificationsV2NotificationConfigManagementUrl({
|
|
169
178
|
protoPath: "/v2/notification-configs/{notificationConfig.id}",
|
|
170
179
|
data: serializedData,
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../meta.ts","../../src/events-notifications-v2-notification-config-notifications.http.ts","../../src/events-notifications-v2-notification-config-notifications.meta.ts"],"sourcesContent":["export * from './src/events-notifications-v2-notification-config-notifications.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { 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 resolveWixEventsNotificationsV2NotificationConfigManagementUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/events-notifications',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/events-notifications',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/events-notifications',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/events-notifications',\n destPath: '',\n },\n {\n srcPath: '/events/v2/notifications',\n destPath: '/v2/notifications',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nfunction resolveWixEventsNotificationsV2NotificationServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/events-notifications',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/events-notifications',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/events-notifications',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/events-notifications',\n destPath: '',\n },\n {\n srcPath: '/events/v2/notifications',\n destPath: '/v2/notifications',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_events_notifications';\n\n/** Triggers notification */\nexport function triggerNotification(\n payload: object\n): RequestOptionsFactory<any> {\n function __triggerNotification({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.events.notifications.v2.notification_config',\n method: 'POST' as any,\n methodFqn:\n 'wix.events.notifications.v2.NotificationService.TriggerNotification',\n packageName: PACKAGE_NAME,\n url: resolveWixEventsNotificationsV2NotificationServiceUrl({\n protoPath: '/v2/notifications/trigger',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __triggerNotification;\n}\n\n/** Resolves a NotificationConfig by id. Returns saved value or default value if not saved yet. */\nexport function resolveNotificationConfig(\n payload: object\n): RequestOptionsFactory<any> {\n function __resolveNotificationConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.events.notifications.v2.notification_config',\n method: 'GET' as any,\n methodFqn:\n 'wix.events.notifications.v2.NotificationConfigManagement.ResolveNotificationConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixEventsNotificationsV2NotificationConfigManagementUrl({\n protoPath: '/v2/notification-configs/resolve/{notificationConfigId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'notificationConfig.createdDate' },\n { path: 'notificationConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __resolveNotificationConfig;\n}\n\n/** Upsert a NotificationConfig */\nexport function upsertNotificationConfig(\n payload: object\n): RequestOptionsFactory<any> {\n function __upsertNotificationConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'notificationConfig.createdDate' },\n { path: 'notificationConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.events.notifications.v2.notification_config',\n method: 'POST' as any,\n methodFqn:\n 'wix.events.notifications.v2.NotificationConfigManagement.UpsertNotificationConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixEventsNotificationsV2NotificationConfigManagementUrl({\n protoPath: '/v2/notification-configs/{notificationConfig.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'notificationConfig.createdDate' },\n { path: 'notificationConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __upsertNotificationConfig;\n}\n","import * as ambassadorWixEventsNotificationsV2NotificationConfig from './events-notifications-v2-notification-config-notifications.http.js';\nimport * as ambassadorWixEventsNotificationsV2NotificationConfigTypes from './events-notifications-v2-notification-config-notifications.types.js';\nimport * as ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes from './events-notifications-v2-notification-config-notifications.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function triggerNotification(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.TriggerNotificationRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.TriggerNotificationRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.TriggerNotificationResponse,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.TriggerNotificationResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEventsNotificationsV2NotificationConfig.triggerNotification(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/notifications/trigger',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function resolveNotificationConfig(): __PublicMethodMetaInfo<\n 'GET',\n { notificationConfigId: string },\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.ResolveNotificationConfigRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.ResolveNotificationConfigRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.ResolveNotificationConfigResponse,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.ResolveNotificationConfigResponse\n> {\n const payload = { notificationConfigId: ':notificationConfigId' } as any;\n\n const getRequestOptions =\n ambassadorWixEventsNotificationsV2NotificationConfig.resolveNotificationConfig(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/notification-configs/resolve/{notificationConfigId}',\n pathParams: { notificationConfigId: 'notificationConfigId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function upsertNotificationConfig(): __PublicMethodMetaInfo<\n 'POST',\n { notificationConfigId: string },\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.UpsertNotificationConfigRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.UpsertNotificationConfigRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.UpsertNotificationConfigResponse,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.UpsertNotificationConfigResponse\n> {\n const payload = {\n notificationConfig: { id: ':notificationConfigId' },\n } as any;\n\n const getRequestOptions =\n ambassadorWixEventsNotificationsV2NotificationConfig.upsertNotificationConfig(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/notification-configs/{notificationConfig.id}',\n pathParams: { notificationConfigId: 'notificationConfigId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,gCAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,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SAAO;AACT;;;ACzKO,SAASC,uBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACiD;AAAA,IACnD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,6BAOd;AACA,QAAM,UAAU,EAAE,sBAAsB,wBAAwB;AAEhE,QAAM,oBACiD;AAAA,IACnD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,EAAE,sBAAsB,uBAAuB;AAAA,IAC3D,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,4BAOd;AACA,QAAM,UAAU;AAAA,IACd,oBAAoB,EAAE,IAAI,wBAAwB;AAAA,EACpD;AAEA,QAAM,oBACiD;AAAA,IACnD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,EAAE,sBAAsB,uBAAuB;AAAA,IAC3D,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["resolveNotificationConfig","triggerNotification","upsertNotificationConfig","import_timestamp","import_rest_modules","payload","triggerNotification","resolveNotificationConfig","upsertNotificationConfig"]}
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/events-notifications-v2-notification-config-notifications.http.ts","../../src/events-notifications-v2-notification-config-notifications.meta.ts"],"sourcesContent":["export * from './src/events-notifications-v2-notification-config-notifications.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { 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 resolveWixEventsNotificationsV2NotificationConfigManagementUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/events-notifications',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/events-notifications',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/events-notifications',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/events-notifications',\n destPath: '',\n },\n {\n srcPath: '/events/v2/notifications',\n destPath: '/v2/notifications',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nfunction resolveWixEventsNotificationsV2NotificationServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/events-notifications',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/events-notifications',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/events-notifications',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/events-notifications',\n destPath: '',\n },\n {\n srcPath: '/events/v2/notifications',\n destPath: '/v2/notifications',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_events_notifications';\n\n/** Triggers notification */\nexport function triggerNotification(\n payload: object\n): RequestOptionsFactory<any> {\n function __triggerNotification({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.events.notifications.v2.notification_config',\n method: 'POST' as any,\n methodFqn:\n 'wix.events.notifications.v2.NotificationService.TriggerNotification',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEventsNotificationsV2NotificationServiceUrl({\n protoPath: '/v2/notifications/trigger',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __triggerNotification;\n}\n\n/** Resolves a NotificationConfig by id. Returns saved value or default value if not saved yet. */\nexport function resolveNotificationConfig(\n payload: object\n): RequestOptionsFactory<any> {\n function __resolveNotificationConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.events.notifications.v2.notification_config',\n method: 'GET' as any,\n methodFqn:\n 'wix.events.notifications.v2.NotificationConfigManagement.ResolveNotificationConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEventsNotificationsV2NotificationConfigManagementUrl({\n protoPath: '/v2/notification-configs/resolve/{notificationConfigId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'notificationConfig.createdDate' },\n { path: 'notificationConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __resolveNotificationConfig;\n}\n\n/** Upsert a NotificationConfig */\nexport function upsertNotificationConfig(\n payload: object\n): RequestOptionsFactory<any> {\n function __upsertNotificationConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'notificationConfig.createdDate' },\n { path: 'notificationConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.events.notifications.v2.notification_config',\n method: 'POST' as any,\n methodFqn:\n 'wix.events.notifications.v2.NotificationConfigManagement.UpsertNotificationConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixEventsNotificationsV2NotificationConfigManagementUrl({\n protoPath: '/v2/notification-configs/{notificationConfig.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'notificationConfig.createdDate' },\n { path: 'notificationConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __upsertNotificationConfig;\n}\n","import * as ambassadorWixEventsNotificationsV2NotificationConfig from './events-notifications-v2-notification-config-notifications.http.js';\nimport * as ambassadorWixEventsNotificationsV2NotificationConfigTypes from './events-notifications-v2-notification-config-notifications.types.js';\nimport * as ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes from './events-notifications-v2-notification-config-notifications.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function triggerNotification(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.TriggerNotificationRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.TriggerNotificationRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.TriggerNotificationResponse,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.TriggerNotificationResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixEventsNotificationsV2NotificationConfig.triggerNotification(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/notifications/trigger',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function resolveNotificationConfig(): __PublicMethodMetaInfo<\n 'GET',\n { notificationConfigId: string },\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.ResolveNotificationConfigRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.ResolveNotificationConfigRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.ResolveNotificationConfigResponse,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.ResolveNotificationConfigResponse\n> {\n const payload = { notificationConfigId: ':notificationConfigId' } as any;\n\n const getRequestOptions =\n ambassadorWixEventsNotificationsV2NotificationConfig.resolveNotificationConfig(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/notification-configs/resolve/{notificationConfigId}',\n pathParams: { notificationConfigId: 'notificationConfigId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function upsertNotificationConfig(): __PublicMethodMetaInfo<\n 'POST',\n { notificationConfigId: string },\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.UpsertNotificationConfigRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.UpsertNotificationConfigRequest,\n ambassadorWixEventsNotificationsV2NotificationConfigUniversalTypes.UpsertNotificationConfigResponse,\n ambassadorWixEventsNotificationsV2NotificationConfigTypes.UpsertNotificationConfigResponse\n> {\n const payload = {\n notificationConfig: { id: ':notificationConfigId' },\n } as any;\n\n const getRequestOptions =\n ambassadorWixEventsNotificationsV2NotificationConfig.upsertNotificationConfig(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/notification-configs/{notificationConfig.id}',\n pathParams: { notificationConfigId: 'notificationConfigId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,gCAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;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,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,SAAS,sDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAA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IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,6BAOd;AACA,QAAM,UAAU,EAAE,sBAAsB,wBAAwB;AAEhE,QAAM,oBACiD;AAAA,IACnD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,EAAE,sBAAsB,uBAAuB;AAAA,IAC3D,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,4BAOd;AACA,QAAM,UAAU;AAAA,IACd,oBAAoB,EAAE,IAAI,wBAAwB;AAAA,EACpD;AAEA,QAAM,oBACiD;AAAA,IACnD;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,EAAE,sBAAsB,uBAAuB;AAAA,IAC3D,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["resolveNotificationConfig","triggerNotification","upsertNotificationConfig","import_timestamp","import_rest_modules","payload","triggerNotification","resolveNotificationConfig","upsertNotificationConfig"]}
|
package/build/es/index.mjs
CHANGED
|
@@ -92,6 +92,9 @@ function triggerNotification(payload) {
|
|
|
92
92
|
method: "POST",
|
|
93
93
|
methodFqn: "wix.events.notifications.v2.NotificationService.TriggerNotification",
|
|
94
94
|
packageName: PACKAGE_NAME,
|
|
95
|
+
migrationOptions: {
|
|
96
|
+
optInTransformResponse: true
|
|
97
|
+
},
|
|
95
98
|
url: resolveWixEventsNotificationsV2NotificationServiceUrl({
|
|
96
99
|
protoPath: "/v2/notifications/trigger",
|
|
97
100
|
data: payload,
|
|
@@ -110,6 +113,9 @@ function resolveNotificationConfig(payload) {
|
|
|
110
113
|
method: "GET",
|
|
111
114
|
methodFqn: "wix.events.notifications.v2.NotificationConfigManagement.ResolveNotificationConfig",
|
|
112
115
|
packageName: PACKAGE_NAME,
|
|
116
|
+
migrationOptions: {
|
|
117
|
+
optInTransformResponse: true
|
|
118
|
+
},
|
|
113
119
|
url: resolveWixEventsNotificationsV2NotificationConfigManagementUrl({
|
|
114
120
|
protoPath: "/v2/notification-configs/resolve/{notificationConfigId}",
|
|
115
121
|
data: payload,
|
|
@@ -150,6 +156,9 @@ function upsertNotificationConfig(payload) {
|
|
|
150
156
|
method: "POST",
|
|
151
157
|
methodFqn: "wix.events.notifications.v2.NotificationConfigManagement.UpsertNotificationConfig",
|
|
152
158
|
packageName: PACKAGE_NAME,
|
|
159
|
+
migrationOptions: {
|
|
160
|
+
optInTransformResponse: true
|
|
161
|
+
},
|
|
153
162
|
url: resolveWixEventsNotificationsV2NotificationConfigManagementUrl({
|
|
154
163
|
protoPath: "/v2/notification-configs/{notificationConfig.id}",
|
|
155
164
|
data: serializedData,
|