sdk renamings
This commit is contained in:
@@ -7,6 +7,8 @@ import type {
|
||||
UpdateProfilePayload,
|
||||
} from '@openpanel/web';
|
||||
|
||||
export * from '@openpanel/web';
|
||||
|
||||
const CDN_URL = 'https://openpanel.dev/op.js';
|
||||
|
||||
declare global {
|
||||
|
||||
@@ -2,12 +2,13 @@ import { AppState, Platform } from 'react-native';
|
||||
import * as Application from 'expo-application';
|
||||
import Constants from 'expo-constants';
|
||||
|
||||
import type { OpenpanelBaseOptions, PostEventPayload } from '@openpanel/sdk';
|
||||
import { Openpanel as OpenpanelBase } from '@openpanel/sdk';
|
||||
import type { OpenpanelSdkOptions, PostEventPayload } from '@openpanel/sdk';
|
||||
import { OpenpanelSdk } from '@openpanel/sdk';
|
||||
|
||||
export type OpenpanelOptions = OpenpanelBaseOptions;
|
||||
export * from '@openpanel/sdk';
|
||||
export type OpenpanelOptions = OpenpanelSdkOptions;
|
||||
|
||||
export class OpenpanelRN extends OpenpanelBase<OpenpanelOptions> {
|
||||
export class Openpanel extends OpenpanelSdk<OpenpanelOptions> {
|
||||
constructor(options: OpenpanelOptions) {
|
||||
super(options);
|
||||
|
||||
|
||||
@@ -2,7 +2,4 @@ import { defineConfig } from 'tsup';
|
||||
|
||||
import config from '@openpanel/tsconfig/tsup.config.json' assert { type: 'json' };
|
||||
|
||||
export default defineConfig({
|
||||
...(config as any),
|
||||
minify: false,
|
||||
});
|
||||
export default defineConfig(config as any);
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface DecrementProfilePayload {
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface OpenpanelBaseOptions {
|
||||
export interface OpenpanelSdkOptions {
|
||||
url: string;
|
||||
clientId: string;
|
||||
clientSecret?: string;
|
||||
@@ -125,8 +125,8 @@ function createApi(_url: string) {
|
||||
};
|
||||
}
|
||||
|
||||
export class Openpanel<
|
||||
Options extends OpenpanelBaseOptions = OpenpanelBaseOptions,
|
||||
export class OpenpanelSdk<
|
||||
Options extends OpenpanelSdkOptions = OpenpanelSdkOptions,
|
||||
> {
|
||||
public options: Options;
|
||||
public api: ReturnType<typeof createApi>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { OpenpanelBaseOptions, PostEventPayload } from '@openpanel/sdk';
|
||||
import { Openpanel as OpenpanelBase } from '@openpanel/sdk';
|
||||
import type { OpenpanelSdkOptions, PostEventPayload } from '@openpanel/sdk';
|
||||
import { OpenpanelSdk } from '@openpanel/sdk';
|
||||
|
||||
export * from '@openpanel/sdk';
|
||||
|
||||
export type OpenpanelOptions = OpenpanelBaseOptions & {
|
||||
export type OpenpanelOptions = OpenpanelSdkOptions & {
|
||||
trackOutgoingLinks?: boolean;
|
||||
trackScreenViews?: boolean;
|
||||
trackAttributes?: boolean;
|
||||
@@ -16,7 +16,7 @@ function toCamelCase(str: string) {
|
||||
);
|
||||
}
|
||||
|
||||
export class Openpanel extends OpenpanelBase<OpenpanelOptions> {
|
||||
export class Openpanel extends OpenpanelSdk<OpenpanelOptions> {
|
||||
private lastPath = '';
|
||||
|
||||
constructor(options: OpenpanelOptions) {
|
||||
|
||||
Reference in New Issue
Block a user