@wix/auto_sdk_duplexer_realtime-permissions-provider 1.0.2 → 1.0.3

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.
@@ -1,5 +1,5 @@
1
- import { p as provideHandlers$1 } from './service-plugins-error-classes-mW1UQMcm.js';
2
- export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, c as CheckSubscriberPermissionsResponse, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-mW1UQMcm.js';
1
+ import { p as provideHandlers$1 } from './service-plugins-error-classes-O4V6ESSE.js';
2
+ export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, c as CheckSubscriberPermissionsResponse, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-O4V6ESSE.js';
3
3
  import { BuildServicePluginDefinition } from '@wix/sdk-types';
4
4
 
5
5
  declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-realtime-v1-realtime-permissions-provider.public.ts","../../src/interfaces-realtime-v1-realtime-permissions-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-realtime-v1-realtime-permissions-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n /** When `true`, the subscriber may **send** client events on the channel. */\n write?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n CheckSubscriberPermissionsRequest,\n CheckSubscriberPermissionsResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface CheckSubscriberPermissionsEnvelope {\n request: CheckSubscriberPermissionsRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ``` */\n checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n ):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n}>('REALTIME_PERMISSIONS_PROVIDER', [\n {\n name: 'checkSubscriberPermissions',\n primaryHttpMappingPath: '/v1/check-subscriber-permissions',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-realtime-v1-realtime-permissions-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACgDO,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AA2FL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;AC3IZ,uBAAwC;AAMxC,oCAGO;AAOA,IAAM,sBAAkB,0CA8C5B,iCAAiC;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AC9ED,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;","names":["provideHandlers","SubscriberType","IdentityType","provideHandlers"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-realtime-v1-realtime-permissions-provider.public.ts","../../src/interfaces-realtime-v1-realtime-permissions-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-realtime-v1-realtime-permissions-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n CheckSubscriberPermissionsRequest,\n CheckSubscriberPermissionsResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface CheckSubscriberPermissionsEnvelope {\n request: CheckSubscriberPermissionsRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ``` */\n checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n ):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n}>('REALTIME_PERMISSIONS_PROVIDER', [\n {\n name: 'checkSubscriberPermissions',\n primaryHttpMappingPath: '/v1/check-subscriber-permissions',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-realtime-v1-realtime-permissions-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACgDO,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AAyFL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;ACzIZ,uBAAwC;AAMxC,oCAGO;AAOA,IAAM,sBAAkB,0CA8C5B,iCAAiC;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AC9ED,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;","names":["provideHandlers","SubscriberType","IdentityType","provideHandlers"]}
@@ -1,5 +1,5 @@
1
- import { i as CheckSubscriberPermissionsEnvelope, c as CheckSubscriberPermissionsResponse } from './service-plugins-error-classes-mW1UQMcm.js';
2
- export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-mW1UQMcm.js';
1
+ import { i as CheckSubscriberPermissionsEnvelope, c as CheckSubscriberPermissionsResponse } from './service-plugins-error-classes-O4V6ESSE.js';
2
+ export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-O4V6ESSE.js';
3
3
  import '@wix/sdk-types';
4
4
 
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import { CheckSubscriberPermissionsResponse } from './src/service-plugins-types.js';\nimport { CheckSubscriberPermissionsEnvelope } from './src/interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport { CheckSubscriberPermissionsEnvelope };\n\n/**\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ```\n * @throws InvalidArgumentWixError\n */\nexport declare function checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n /** When `true`, the subscriber may **send** client events on the channel. */\n write?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;;;ACmBpB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AA2FL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["SubscriberType","IdentityType"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import { CheckSubscriberPermissionsResponse } from './src/service-plugins-types.js';\nimport { CheckSubscriberPermissionsEnvelope } from './src/interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport { CheckSubscriberPermissionsEnvelope };\n\n/**\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ```\n * @throws InvalidArgumentWixError\n */\nexport declare function checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;;;ACmBpB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AAyFL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["SubscriberType","IdentityType"]}
@@ -58,8 +58,6 @@ declare enum SubscriberType {
58
58
  interface CheckSubscriberPermissionsResponse {
59
59
  /** When `true`, the subscriber may **receive** messages published on the channel. */
60
60
  read?: boolean;
61
- /** When `true`, the subscriber may **send** client events on the channel. */
62
- write?: boolean;
63
61
  }
64
62
  interface RealtimePermissionsProviderConfig {
65
63
  /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */
@@ -1,5 +1,5 @@
1
- import { p as provideHandlers$1 } from './service-plugins-error-classes-mW1UQMcm.mjs';
2
- export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, c as CheckSubscriberPermissionsResponse, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-mW1UQMcm.mjs';
1
+ import { p as provideHandlers$1 } from './service-plugins-error-classes-O4V6ESSE.mjs';
2
+ export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, c as CheckSubscriberPermissionsResponse, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-O4V6ESSE.mjs';
3
3
  import { BuildServicePluginDefinition } from '@wix/sdk-types';
4
4
 
5
5
  declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/service-plugins-types.ts","../../src/interfaces-realtime-v1-realtime-permissions-provider.public.ts","../../src/interfaces-realtime-v1-realtime-permissions-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n /** When `true`, the subscriber may **send** client events on the channel. */\n write?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n CheckSubscriberPermissionsRequest,\n CheckSubscriberPermissionsResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface CheckSubscriberPermissionsEnvelope {\n request: CheckSubscriberPermissionsRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ``` */\n checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n ):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n}>('REALTIME_PERMISSIONS_PROVIDER', [\n {\n name: 'checkSubscriberPermissions',\n primaryHttpMappingPath: '/v1/check-subscriber-permissions',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-realtime-v1-realtime-permissions-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";AAgDO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AA2FL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;AC3IZ,SAAS,+BAA+B;AAMxC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,IAAM,kBAAkB,wBA8C5B,iCAAiC;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AC9ED,SAAS,iCAAiC;AAMnC,IAAMC,mBAGoB;AAAA,EAC/B;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;","names":["SubscriberType","IdentityType","provideHandlers"]}
1
+ {"version":3,"sources":["../../src/service-plugins-types.ts","../../src/interfaces-realtime-v1-realtime-permissions-provider.public.ts","../../src/interfaces-realtime-v1-realtime-permissions-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n CheckSubscriberPermissionsRequest,\n CheckSubscriberPermissionsResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface CheckSubscriberPermissionsEnvelope {\n request: CheckSubscriberPermissionsRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ``` */\n checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n ):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n}>('REALTIME_PERMISSIONS_PROVIDER', [\n {\n name: 'checkSubscriberPermissions',\n primaryHttpMappingPath: '/v1/check-subscriber-permissions',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-realtime-v1-realtime-permissions-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";AAgDO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AAyFL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;ACzIZ,SAAS,+BAA+B;AAMxC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,IAAM,kBAAkB,wBA8C5B,iCAAiC;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AC9ED,SAAS,iCAAiC;AAMnC,IAAMC,mBAGoB;AAAA,EAC/B;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;","names":["SubscriberType","IdentityType","provideHandlers"]}
@@ -1,5 +1,5 @@
1
- import { i as CheckSubscriberPermissionsEnvelope, c as CheckSubscriberPermissionsResponse } from './service-plugins-error-classes-mW1UQMcm.mjs';
2
- export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-mW1UQMcm.mjs';
1
+ import { i as CheckSubscriberPermissionsEnvelope, c as CheckSubscriberPermissionsResponse } from './service-plugins-error-classes-O4V6ESSE.mjs';
2
+ export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-O4V6ESSE.mjs';
3
3
  import '@wix/sdk-types';
4
4
 
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n /** When `true`, the subscriber may **send** client events on the channel. */\n write?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";AAAO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;;;ACmBpB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AA2FL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["SubscriberType","IdentityType"]}
1
+ {"version":3,"sources":["../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";AAAO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;;;ACmBpB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AAyFL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["SubscriberType","IdentityType"]}
@@ -58,8 +58,6 @@ declare enum SubscriberType {
58
58
  interface CheckSubscriberPermissionsResponse {
59
59
  /** When `true`, the subscriber may **receive** messages published on the channel. */
60
60
  read?: boolean;
61
- /** When `true`, the subscriber may **send** client events on the channel. */
62
- write?: boolean;
63
61
  }
64
62
  interface RealtimePermissionsProviderConfig {
65
63
  /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */
@@ -1,5 +1,5 @@
1
- import { p as provideHandlers$1 } from './service-plugins-error-classes-mW1UQMcm.js';
2
- export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, c as CheckSubscriberPermissionsResponse, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-mW1UQMcm.js';
1
+ import { p as provideHandlers$1 } from './service-plugins-error-classes-O4V6ESSE.js';
2
+ export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, c as CheckSubscriberPermissionsResponse, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-O4V6ESSE.js';
3
3
  import { BuildServicePluginDefinition } from '@wix/sdk-types';
4
4
 
5
5
  declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.ts","../../../src/service-plugins-types.ts","../../../src/interfaces-realtime-v1-realtime-permissions-provider.public.ts","../../../src/interfaces-realtime-v1-realtime-permissions-provider.context.ts","../../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-realtime-v1-realtime-permissions-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n /** When `true`, the subscriber may **send** client events on the channel. */\n write?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n CheckSubscriberPermissionsRequest,\n CheckSubscriberPermissionsResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface CheckSubscriberPermissionsEnvelope {\n request: CheckSubscriberPermissionsRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ``` */\n checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n ):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n}>('REALTIME_PERMISSIONS_PROVIDER', [\n {\n name: 'checkSubscriberPermissions',\n primaryHttpMappingPath: '/v1/check-subscriber-permissions',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-realtime-v1-realtime-permissions-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACgDO,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AA2FL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;AC3IZ,uBAAwC;AAMxC,oCAGO;AAOA,IAAM,sBAAkB,0CA8C5B,iCAAiC;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AC9ED,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;","names":["provideHandlers","SubscriberType","IdentityType","provideHandlers"]}
1
+ {"version":3,"sources":["../../../index.ts","../../../src/service-plugins-types.ts","../../../src/interfaces-realtime-v1-realtime-permissions-provider.public.ts","../../../src/interfaces-realtime-v1-realtime-permissions-provider.context.ts","../../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-realtime-v1-realtime-permissions-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n CheckSubscriberPermissionsRequest,\n CheckSubscriberPermissionsResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface CheckSubscriberPermissionsEnvelope {\n request: CheckSubscriberPermissionsRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ``` */\n checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n ):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n}>('REALTIME_PERMISSIONS_PROVIDER', [\n {\n name: 'checkSubscriberPermissions',\n primaryHttpMappingPath: '/v1/check-subscriber-permissions',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-realtime-v1-realtime-permissions-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACgDO,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AAyFL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;ACzIZ,uBAAwC;AAMxC,oCAGO;AAOA,IAAM,sBAAkB,0CA8C5B,iCAAiC;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AC9ED,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;","names":["provideHandlers","SubscriberType","IdentityType","provideHandlers"]}
@@ -1,5 +1,5 @@
1
- import { i as CheckSubscriberPermissionsEnvelope, c as CheckSubscriberPermissionsResponse } from './service-plugins-error-classes-mW1UQMcm.js';
2
- export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-mW1UQMcm.js';
1
+ import { i as CheckSubscriberPermissionsEnvelope, c as CheckSubscriberPermissionsResponse } from './service-plugins-error-classes-O4V6ESSE.js';
2
+ export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-O4V6ESSE.js';
3
3
  import '@wix/sdk-types';
4
4
 
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.typings.ts","../../../src/service-plugins-error-classes.ts","../../../src/service-plugins-types.ts"],"sourcesContent":["import { CheckSubscriberPermissionsResponse } from './src/service-plugins-types.js';\nimport { CheckSubscriberPermissionsEnvelope } from './src/interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport { CheckSubscriberPermissionsEnvelope };\n\n/**\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ```\n * @throws InvalidArgumentWixError\n */\nexport declare function checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n /** When `true`, the subscriber may **send** client events on the channel. */\n write?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;;;ACmBpB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AA2FL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["SubscriberType","IdentityType"]}
1
+ {"version":3,"sources":["../../../index.typings.ts","../../../src/service-plugins-error-classes.ts","../../../src/service-plugins-types.ts"],"sourcesContent":["import { CheckSubscriberPermissionsResponse } from './src/service-plugins-types.js';\nimport { CheckSubscriberPermissionsEnvelope } from './src/interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport { CheckSubscriberPermissionsEnvelope };\n\n/**\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ```\n * @throws InvalidArgumentWixError\n */\nexport declare function checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;;;ACmBpB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AAyFL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["SubscriberType","IdentityType"]}
@@ -58,8 +58,6 @@ declare enum SubscriberType {
58
58
  interface CheckSubscriberPermissionsResponse {
59
59
  /** When `true`, the subscriber may **receive** messages published on the channel. */
60
60
  read?: boolean;
61
- /** When `true`, the subscriber may **send** client events on the channel. */
62
- write?: boolean;
63
61
  }
64
62
  interface RealtimePermissionsProviderConfig {
65
63
  /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */
@@ -1,5 +1,5 @@
1
- import { p as provideHandlers$1 } from './service-plugins-error-classes-mW1UQMcm.mjs';
2
- export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, c as CheckSubscriberPermissionsResponse, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-mW1UQMcm.mjs';
1
+ import { p as provideHandlers$1 } from './service-plugins-error-classes-O4V6ESSE.mjs';
2
+ export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, c as CheckSubscriberPermissionsResponse, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-O4V6ESSE.mjs';
3
3
  import { BuildServicePluginDefinition } from '@wix/sdk-types';
4
4
 
5
5
  declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/service-plugins-types.ts","../../../src/interfaces-realtime-v1-realtime-permissions-provider.public.ts","../../../src/interfaces-realtime-v1-realtime-permissions-provider.context.ts","../../../src/service-plugins-error-classes.ts"],"sourcesContent":["/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n /** When `true`, the subscriber may **send** client events on the channel. */\n write?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n CheckSubscriberPermissionsRequest,\n CheckSubscriberPermissionsResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface CheckSubscriberPermissionsEnvelope {\n request: CheckSubscriberPermissionsRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ``` */\n checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n ):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n}>('REALTIME_PERMISSIONS_PROVIDER', [\n {\n name: 'checkSubscriberPermissions',\n primaryHttpMappingPath: '/v1/check-subscriber-permissions',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-realtime-v1-realtime-permissions-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";AAgDO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AA2FL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;AC3IZ,SAAS,+BAA+B;AAMxC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,IAAM,kBAAkB,wBA8C5B,iCAAiC;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AC9ED,SAAS,iCAAiC;AAMnC,IAAMC,mBAGoB;AAAA,EAC/B;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;","names":["SubscriberType","IdentityType","provideHandlers"]}
1
+ {"version":3,"sources":["../../../src/service-plugins-types.ts","../../../src/interfaces-realtime-v1-realtime-permissions-provider.public.ts","../../../src/interfaces-realtime-v1-realtime-permissions-provider.context.ts","../../../src/service-plugins-error-classes.ts"],"sourcesContent":["/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n CheckSubscriberPermissionsRequest,\n CheckSubscriberPermissionsResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface CheckSubscriberPermissionsEnvelope {\n request: CheckSubscriberPermissionsRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Requests whether a subscriber may **read** and **write** on a Wix Realtime channel.\n *\n * Wix calls this method when the realtime stack evaluates a **channel subscription**\n * (for example, when `wix-duplexer-sockets-server` resolves access for a client).\n * The call is **synchronous**: Wix waits for your response before allowing or denying\n * receive / send capabilities for that subscription attempt.\n *\n * Wix uses your `read` and `write` flags to decide whether the subscriber may\n * *receive channel messages** and **publish client events**, respectively.\n * Normal **authorization denials** should be expressed with `read` / `write`\n * set to `false`, not by throwing.\n *\n * If your implementation **throws**, times out, or the outbound call fails after Wix\n * has selected your app as the implementer, the **Realtime Permissions host** reports\n * *gRPC `UNAVAILABLE` / HTTP 503** to its caller. It does **not** return a\n * structured “reason” field for that failure mode. Keep handlers fast and avoid\n * blocking calls where possible.\n *\n * Wix may **skip** calling this RPC when there is no registered implementer for the\n * channel owner app (`NO_IMPLEMENTER`) or when required **MetaSite / identity**\n * context is missing (`MISSING_CONTEXT`); those outcomes are resolved entirely by the host.\n *\n * *Your implementation should:**\n * - Use `channel`, `subscriber`, and `requesting_app_id` (see field comments) to enforce your rules.\n * - Return `read` / `write` explicitly for every successful decision.\n *\n * *Error handling:** Return **`InvalidArgumentError`** only when the **request payload**\n * is invalid for your implementation (for example, a channel or subscriber shape you\n * cannot interpret). Do **not** use that error for normal policy denials.\n *\n * Parameter: `CheckSubscriberPermissionsRequest`.\n * Response: `CheckSubscriberPermissionsResponse` — for example:\n * ```json\n * {\n * \"read\": true,\n * \"write\": false\n * }\n * ``` */\n checkSubscriberPermissions(\n payload: CheckSubscriberPermissionsEnvelope\n ):\n | CheckSubscriberPermissionsResponse\n | Promise<CheckSubscriberPermissionsResponse>;\n}>('REALTIME_PERMISSIONS_PROVIDER', [\n {\n name: 'checkSubscriberPermissions',\n primaryHttpMappingPath: '/v1/check-subscriber-permissions',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-realtime-v1-realtime-permissions-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-realtime-v1-realtime-permissions-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";AAgDO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AAyFL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;ACzIZ,SAAS,+BAA+B;AAMxC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,IAAM,kBAAkB,wBA8C5B,iCAAiC;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;AC9ED,SAAS,iCAAiC;AAMnC,IAAMC,mBAGoB;AAAA,EAC/B;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;","names":["SubscriberType","IdentityType","provideHandlers"]}
@@ -1,5 +1,5 @@
1
- import { i as CheckSubscriberPermissionsEnvelope, c as CheckSubscriberPermissionsResponse } from './service-plugins-error-classes-mW1UQMcm.mjs';
2
- export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-mW1UQMcm.mjs';
1
+ import { i as CheckSubscriberPermissionsEnvelope, c as CheckSubscriberPermissionsResponse } from './service-plugins-error-classes-O4V6ESSE.mjs';
2
+ export { A as AlternativeUri, a as Channel, C as CheckSubscriberPermissionsRequest, e as Context, f as IdentificationData, g as IdentificationDataIdOneOf, I as IdentityType, h as InvalidArgumentWixError, R as RealtimePermissionsProviderConfig, d as SpiBaseUri, S as Subscriber, b as SubscriberType } from './service-plugins-error-classes-O4V6ESSE.mjs';
3
3
  import '@wix/sdk-types';
4
4
 
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/service-plugins-error-classes.ts","../../../src/service-plugins-types.ts"],"sourcesContent":["export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n /** When `true`, the subscriber may **send** client events on the channel. */\n write?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";AAAO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;;;ACmBpB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AA2FL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["SubscriberType","IdentityType"]}
1
+ {"version":3,"sources":["../../../src/service-plugins-error-classes.ts","../../../src/service-plugins-types.ts"],"sourcesContent":["export class InvalidArgumentWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('InvalidArgumentError');\n\n this.httpCode = 400;\n this.statusCode = 'INVALID_ARGUMENT';\n this.applicationCode = 'INVALID_ARGUMENT';\n this.name = 'InvalidArgumentError';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'InvalidArgumentError',\n applicationCode: 'INVALID_ARGUMENT',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","/** Request to check subscriber permissions for a realtime channel. */\nexport interface CheckSubscriberPermissionsRequest {\n /** Realtime **channel** being subscribed to, including its logical name and optional resource scope. */\n channel?: Channel;\n /** *Subscriber** attempting the subscription (user id pattern depends on `type`; see `Subscriber.id`). */\n subscriber?: Subscriber;\n /**\n * App definition ID of the **caller's origin app** for this subscription check,\n * as injected by the Wix host from request identity context (not copied from the\n * duplexer `CheckPermissions` body). Identifies which third-party app is trying to\n * subscribe when that context exists.\n *\n * The host **always sets** this field on the wire. When the context has no origin\n * app id, the value may be an **empty string**—treat that as \"unknown origin app\"\n * rather than assuming a valid GUID.\n *\n * When non-empty, the value is a GUID string.\n * @format GUID\n */\n requestingAppId?: string | null;\n}\n\nexport interface Channel {\n /**\n * Logical channel name (for example, the name your app uses when publishing). Max 140 characters.\n * @maxLength 140\n */\n name?: string;\n /**\n * Optional id for a **resource** this channel is tied to (for example, a specific entity instance).\n * Use with `name` when multiple channels share the same name but differ by resource.\n * @maxLength 1000\n */\n resourceId?: string | null;\n}\n\nexport interface Subscriber {\n /**\n * Stable identifier for the subscriber when one exists in context (e.g. Wix user id\n * for `ADMIN` / `MEMBER`). For `VISITOR`, the host may send an anonymous or empty\n * identifier depending on platform context—do not assume a real member id.\n * @maxLength 1000\n */\n _id?: string;\n /** The type of subscriber */\n type?: SubscriberType;\n}\n\nexport enum SubscriberType {\n SUBSCRIBER_TYPE_UNSPECIFIED = 'SUBSCRIBER_TYPE_UNSPECIFIED',\n /** Subscriber is the site owner */\n ADMIN = 'ADMIN',\n /** Subscriber is a logged-in site member */\n MEMBER = 'MEMBER',\n /** Subscriber is not logged in */\n VISITOR = 'VISITOR',\n}\n\n/** Response containing the subscriber's permissions for the channel. */\nexport interface CheckSubscriberPermissionsResponse {\n /** When `true`, the subscriber may **receive** messages published on the channel. */\n read?: boolean;\n}\n\nexport interface RealtimePermissionsProviderConfig {\n /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */\n deploymentUri?: SpiBaseUri;\n /**\n * Display name for this permissions provider in the app dashboard (translatable short text).\n * @maxLength 100\n */\n providerName?: string;\n}\n\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";AAAO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAcjD,cAAc;AACZ,UAAM,sBAAsB;AAE5B,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,wBA6BK,SAAS;;;ACmBpB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,iCAA8B;AAE9B,EAAAA,gBAAA,WAAQ;AAER,EAAAA,gBAAA,YAAS;AAET,EAAAA,gBAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;AAyFL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["SubscriberType","IdentityType"]}
@@ -58,8 +58,6 @@ declare enum SubscriberType {
58
58
  interface CheckSubscriberPermissionsResponse {
59
59
  /** When `true`, the subscriber may **receive** messages published on the channel. */
60
60
  read?: boolean;
61
- /** When `true`, the subscriber may **send** client events on the channel. */
62
- write?: boolean;
63
61
  }
64
62
  interface RealtimePermissionsProviderConfig {
65
63
  /** Base URI where Wix should reach your service plugin **HTTPS** endpoints (see Auto SDK / SPI hosting). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_duplexer_realtime-permissions-provider",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -51,5 +51,5 @@
51
51
  "fqdn": "wix.interfaces.realtime.v1.realtime_permissions_provider"
52
52
  }
53
53
  },
54
- "falconPackageHash": "cf2731118a97223883ab65d4cf17c8e33f4c0eb4af75e10afe10970e"
54
+ "falconPackageHash": "3b31705abcdab1910062f0f508e762d3d718aecd1db91a6f11523f51"
55
55
  }