@adapty/capacitor
Version:
Official Adapty SDK for Capacitor
55 lines • 2.4 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import { Coder } from './coder';
import { AdaptyRemoteConfigCoder } from './adapty-remote-config';
import { AdaptyOnboardingBuilderCoder } from './adapty-onboarding-builder';
import { AdaptyPlacementCoder } from './adapty-placement';
export class AdaptyOnboardingCoder extends Coder {
constructor() {
super(...arguments);
this.properties = {
placement: {
key: 'placement',
required: true,
type: 'object',
converter: new AdaptyPlacementCoder(),
},
id: { key: 'onboarding_id', required: true, type: 'string' },
name: { key: 'onboarding_name', required: true, type: 'string' },
remoteConfig: {
key: 'remote_config',
required: false,
type: 'object',
converter: new AdaptyRemoteConfigCoder(),
},
variationId: { key: 'variation_id', required: true, type: 'string' },
version: { key: 'response_created_at', required: false, type: 'number' },
onboardingBuilder: {
key: 'onboarding_builder',
required: false,
type: 'object',
converter: new AdaptyOnboardingBuilderCoder(),
},
payloadData: { key: 'payload_data', required: false, type: 'string' },
requestLocale: { key: 'request_locale', required: true, type: 'string' },
};
}
decode(data) {
const codablePart = super.decode(data);
return Object.assign(Object.assign({}, codablePart), { hasViewConfiguration: codablePart.onboardingBuilder !== undefined });
}
encode(data) {
const { hasViewConfiguration } = data, codablePart = __rest(data, ["hasViewConfiguration"]);
return super.encode(codablePart);
}
}
//# sourceMappingURL=adapty-onboarding.js.map