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