@stripchatdev/ext-helper 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # @stripchatdev/ext-helper
2
+
3
+ SDK for building extensions on the Stripchat Extension Platform. Provides typed methods for context, events, settings,
4
+ whisper messaging, and backend actions — all from inside sandboxed iframes.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ npm install @stripchatdev/ext-helper
10
+ ```
11
+
12
+ ## Quick Start
13
+
14
+ Call `createExtHelper()` once at the entry point of each page:
15
+
16
+ ```ts
17
+ import {createExtHelper} from '@stripchatdev/ext-helper';
18
+
19
+ const ext = createExtHelper();
20
+ ```
21
+
22
+ ### Make requests
23
+
24
+ ```ts
25
+ const ctx = await ext.makeRequest('v1.ext.context.get', null);
26
+ ```
27
+
28
+ ### Subscribe to events
29
+
30
+ ```ts
31
+ ext.subscribe('v1.ext.context.updated', ({context}) => {
32
+ // handle context update
33
+ });
34
+ ```
35
+
36
+ ### Send a whisper to other slots
37
+
38
+ ```ts
39
+ await ext.makeRequest('v1.ext.whisper.local', {
40
+ data: {type: 'READY'},
41
+ });
42
+ ```
43
+
44
+ ### Call a backend action
45
+
46
+ ```ts
47
+ const result = await ext.makeRequest('v1.ext.actions.call', {
48
+ actionName: 'stopDevice',
49
+ params: {deviceId: 'dev_456', token: 'tok_abc'},
50
+ });
51
+ ```
52
+
53
+ ## TypeScript
54
+
55
+ Full type definitions are included. You get autocompletion and type safety for all methods and events out of the box.
56
+
57
+ ## Documentation
58
+
59
+ For the full guide — manifest setup, slots, resolver scripts, settings, communication, and more — see
60
+ the [Extension Platform Documentation](https://extensions.stripchat.com/docs/).
61
+
62
+ ## Browser Support
63
+
64
+ - Chrome 91+
65
+ - Firefox 90+
66
+ - Safari 15+
67
+ - Edge 91+
@@ -0,0 +1,315 @@
1
+ const M = (r) => !!r && typeof r == "object" && "protocol" in r && r.protocol === "iframe_pubsub" && "version" in r && r.version === "1.0", E = (r, e) => r, g = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
2
+ var u;
3
+ (function(r) {
4
+ r.Base32IncorrectEncoding = "B32_ENC_INVALID", r.DecodeTimeInvalidCharacter = "DEC_TIME_CHAR", r.DecodeTimeValueMalformed = "DEC_TIME_MALFORMED", r.EncodeTimeNegative = "ENC_TIME_NEG", r.EncodeTimeSizeExceeded = "ENC_TIME_SIZE_EXCEED", r.EncodeTimeValueMalformed = "ENC_TIME_MALFORMED", r.PRNGDetectFailure = "PRNG_DETECT", r.ULIDInvalid = "ULID_INVALID", r.Unexpected = "UNEXPECTED", r.UUIDInvalid = "UUID_INVALID";
5
+ })(u || (u = {}));
6
+ class l extends Error {
7
+ constructor(e, t) {
8
+ super(`${t} (${e})`), this.name = "ULIDError", this.code = e;
9
+ }
10
+ }
11
+ function R(r) {
12
+ const e = Math.floor(r() * 32) % 32;
13
+ return g.charAt(e);
14
+ }
15
+ function m(r) {
16
+ const e = N(), t = e && (e.crypto || e.msCrypto) || null;
17
+ if (typeof (t == null ? void 0 : t.getRandomValues) == "function")
18
+ return () => {
19
+ const s = new Uint8Array(1);
20
+ return t.getRandomValues(s), s[0] / 255;
21
+ };
22
+ if (typeof (t == null ? void 0 : t.randomBytes) == "function")
23
+ return () => t.randomBytes(1).readUInt8() / 255;
24
+ throw new l(u.PRNGDetectFailure, "Failed to find a reliable PRNG");
25
+ }
26
+ function N() {
27
+ return v() ? self : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : null;
28
+ }
29
+ function y(r, e) {
30
+ let t = "";
31
+ for (; r > 0; r--)
32
+ t = R(e) + t;
33
+ return t;
34
+ }
35
+ function I(r, e = 10) {
36
+ if (isNaN(r))
37
+ throw new l(u.EncodeTimeValueMalformed, `Time must be a number: ${r}`);
38
+ if (r > 281474976710655)
39
+ throw new l(u.EncodeTimeSizeExceeded, `Cannot encode a time larger than ${281474976710655}: ${r}`);
40
+ if (r < 0)
41
+ throw new l(u.EncodeTimeNegative, `Time must be positive: ${r}`);
42
+ if (Number.isInteger(r) === !1)
43
+ throw new l(u.EncodeTimeValueMalformed, `Time must be an integer: ${r}`);
44
+ let t, s = "";
45
+ for (let n = e; n > 0; n--)
46
+ t = r % 32, s = g.charAt(t) + s, r = (r - t) / 32;
47
+ return s;
48
+ }
49
+ function v() {
50
+ return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope;
51
+ }
52
+ function f(r, e) {
53
+ const t = m(), s = Date.now();
54
+ return I(s, 10) + y(16, t);
55
+ }
56
+ const T = ({ seq: r, uniqId: e }) => (t) => ({
57
+ ...{
58
+ protocol: "iframe_pubsub",
59
+ version: "1.0",
60
+ id: e(),
61
+ seq: r(),
62
+ timestamp: Date.now()
63
+ },
64
+ ...t
65
+ }), b = T({
66
+ uniqId: () => f(),
67
+ seq: () => f()
68
+ });
69
+ class _ {
70
+ constructor(e) {
71
+ this.eventHandlerMap = /* @__PURE__ */ new Map(), this.globalMessageHandler = (n, o) => {
72
+ if (M(n)) {
73
+ if (n.type === "event") {
74
+ const { eventName: c } = n, i = this.eventHandlerMap.get(c);
75
+ if (!i)
76
+ return;
77
+ i.forEach((a) => {
78
+ try {
79
+ a(n.data, o.id);
80
+ } catch (d) {
81
+ console.error("[PubSubSubscriber] globalMessageHandler: failed to handle income message", d);
82
+ }
83
+ });
84
+ return;
85
+ }
86
+ console.error("[PubSubSubscriber] globalMessageHandler: unhandled message", n);
87
+ }
88
+ };
89
+ const { brokerId: t, transport: s } = e;
90
+ this.brokerId = t, this.transport = s, this.transport.onMessage(this.globalMessageHandler);
91
+ }
92
+ subscribe(e, t) {
93
+ const s = E(e);
94
+ let n = this.eventHandlerMap.get(s);
95
+ n || (n = /* @__PURE__ */ new Set(), this.eventHandlerMap.set(s, n)), n.add(t);
96
+ const o = b({
97
+ type: "subscribe",
98
+ eventName: e
99
+ });
100
+ this.transport.send(this.brokerId, o);
101
+ }
102
+ unsubscribe(e, t) {
103
+ const s = E(e);
104
+ let n = this.eventHandlerMap.get(s);
105
+ if (!n)
106
+ return;
107
+ t ? n.delete(t) : this.eventHandlerMap.delete(s);
108
+ const o = b({
109
+ type: "unsubscribe",
110
+ eventName: e
111
+ });
112
+ this.transport.send(this.brokerId, o);
113
+ }
114
+ }
115
+ const w = !!Error.captureStackTrace, P = "APP_ERROR";
116
+ class p extends Error {
117
+ constructor(e, t) {
118
+ super(e), this.name = new.target.name || P, this.cause = t, w && Error.captureStackTrace(this, this.constructor);
119
+ }
120
+ static getChainedMessage(e) {
121
+ let { message: t } = e;
122
+ return e instanceof p && e.cause && (t += `
123
+ Caused by: ${p.getChainedMessage(e.cause)}`), t;
124
+ }
125
+ toJSON() {
126
+ return {
127
+ name: this.name,
128
+ message: this.message,
129
+ cause: this.cause ? p.getChainedMessage(this.cause) : void 0
130
+ };
131
+ }
132
+ }
133
+ const O = {
134
+ INTERNAL_ERROR: "INTERNAL_ERROR"
135
+ }, C = "RPC_ERROR";
136
+ class D extends p {
137
+ constructor(e) {
138
+ super(e.message || "unknown rpc error"), this.name = C, this.code = (e == null ? void 0 : e.code) || O.INTERNAL_ERROR;
139
+ }
140
+ }
141
+ const A = (r) => !!r && typeof r == "object" && "protocol" in r && r.protocol === "iframe_rpc" && "version" in r && r.version === "1.0", S = ({ uniqId: r }) => (e) => ({
142
+ ...{
143
+ protocol: "iframe_rpc",
144
+ version: "1.0",
145
+ id: r(),
146
+ timestamp: Date.now()
147
+ },
148
+ ...e
149
+ }), H = S({
150
+ uniqId: () => f()
151
+ });
152
+ class k {
153
+ constructor(e) {
154
+ this.pendingEntryMap = /* @__PURE__ */ new Map(), this.globalMessageHandler = (n) => {
155
+ if (A(n)) {
156
+ if (n.type === "response" && n.status === "ok") {
157
+ const o = n.id, c = this.pendingEntryMap.get(o);
158
+ if (!c) {
159
+ console.error("[RpcClient] globalMessageHandler: got success response without pending request", n);
160
+ return;
161
+ }
162
+ this.pendingEntryMap.delete(o), c.resolve(n.result);
163
+ return;
164
+ }
165
+ if (n.type === "response" && n.status === "error") {
166
+ const o = n.id, c = this.pendingEntryMap.get(o);
167
+ if (!c) {
168
+ console.error("[RpcClient] globalMessageHandler: got error response without pending request", n);
169
+ return;
170
+ }
171
+ this.pendingEntryMap.delete(o), c.reject(new D(n.error));
172
+ return;
173
+ }
174
+ console.error("[RpcClient] globalMessageHandler: invalid message schema", n);
175
+ }
176
+ };
177
+ const { serverId: t, transport: s } = e;
178
+ this.serverId = t, this.transport = s, this.transport.onMessage(this.globalMessageHandler);
179
+ }
180
+ makeRequest(e, t) {
181
+ const s = H({
182
+ type: "request",
183
+ method: e,
184
+ params: t
185
+ }), n = new Promise((o, c) => {
186
+ this.pendingEntryMap.set(s.id, {
187
+ method: e,
188
+ resolve: (i) => {
189
+ o(i);
190
+ },
191
+ reject: (i) => {
192
+ c(i);
193
+ }
194
+ });
195
+ });
196
+ try {
197
+ this.transport.send(this.serverId, s);
198
+ } catch (o) {
199
+ console.error("[RpcClient] makeRequest: failed to send rpc message", o);
200
+ const c = this.pendingEntryMap.get(s.id);
201
+ c && (this.pendingEntryMap.delete(s.id), c.reject(o));
202
+ }
203
+ return n;
204
+ }
205
+ }
206
+ class L {
207
+ constructor(e) {
208
+ this.peers = /* @__PURE__ */ new Map(), this.onMessage = (s) => {
209
+ const n = (o) => {
210
+ const { data: c, origin: i, source: a } = o;
211
+ if (!a) {
212
+ console.error("[PostMessageTransport] onMessage: source could not be empty");
213
+ return;
214
+ }
215
+ const d = this.findPeer(a, i);
216
+ if (d)
217
+ try {
218
+ s(c, d);
219
+ } catch (h) {
220
+ console.error("[PostMessageTransport] onMessage: failed to call cb on message", h);
221
+ }
222
+ };
223
+ return this.localWindow.addEventListener("message", n), () => {
224
+ this.localWindow.removeEventListener("message", n);
225
+ };
226
+ };
227
+ const { localWindow: t } = e;
228
+ this.localWindow = t || window;
229
+ }
230
+ send(e, t) {
231
+ const s = this.peers.get(e);
232
+ s && s.source.postMessage(t, s.origin);
233
+ }
234
+ broadcast(e) {
235
+ this.peers.forEach((t) => {
236
+ t.source.postMessage(e, t.origin);
237
+ });
238
+ }
239
+ broadcastGroup(e, t) {
240
+ e.forEach((s) => {
241
+ this.send(s, t);
242
+ });
243
+ }
244
+ addPeer(e) {
245
+ this.peers.set(e.id, e);
246
+ }
247
+ removePeer(e) {
248
+ this.peers.delete(e);
249
+ }
250
+ findPeer(e, t) {
251
+ for (const [s, n] of this.peers)
252
+ if (n.source === e && n.origin === t)
253
+ return n;
254
+ return null;
255
+ }
256
+ }
257
+ class G {
258
+ constructor(e) {
259
+ const {
260
+ serverId: t,
261
+ serverOrigin: s,
262
+ serverSource: n,
263
+ theme: o
264
+ } = e, c = {
265
+ id: t,
266
+ origin: s,
267
+ source: n
268
+ }, i = new L({});
269
+ i.addPeer(c), this.rpcClient = new k({
270
+ transport: i,
271
+ serverId: t
272
+ }), this.subscriber = new _({
273
+ transport: i,
274
+ brokerId: c.id
275
+ }), document.documentElement.dataset.theme = o;
276
+ }
277
+ makeRequest(e, t) {
278
+ return this.rpcClient.makeRequest(e, t);
279
+ }
280
+ subscribe(e, t) {
281
+ return this.subscriber.subscribe(e, t);
282
+ }
283
+ unsubscribe(e, t) {
284
+ return this.subscriber.unsubscribe(e, t);
285
+ }
286
+ bootstrap() {
287
+ let e = { height: 0, width: 0 };
288
+ const t = document.documentElement, s = (i, a) => {
289
+ (e.height !== a || e.width !== i) && (e = { height: a, width: i }, this.makeRequest("v1.system.resize.notify", { height: a, width: i }));
290
+ }, n = (i) => {
291
+ for (const a of i) {
292
+ if (a.target !== t)
293
+ continue;
294
+ const { height: d, width: h } = a.contentRect;
295
+ s(h, d);
296
+ }
297
+ };
298
+ (() => {
299
+ const { height: i, width: a } = t.getBoundingClientRect();
300
+ s(a, i);
301
+ })(), new ResizeObserver(n).observe(document.documentElement);
302
+ }
303
+ }
304
+ const q = () => {
305
+ const r = new URL(window.location.href), e = r.searchParams.get("origin") || "", t = r.searchParams.get("theme") || "dark", s = new G({
306
+ serverId: "server",
307
+ serverOrigin: e || window.parent.origin,
308
+ serverSource: window.parent,
309
+ theme: t
310
+ });
311
+ return s.bootstrap(), s;
312
+ };
313
+ export {
314
+ q as createExtHelper
315
+ };
@@ -0,0 +1,277 @@
1
+ export declare const createExtHelper: () => ExtHelper;
2
+
3
+ declare class ExtHelper {
4
+ private rpcClient;
5
+ private subscriber;
6
+ constructor(props: TExtHelperProps);
7
+ makeRequest<M extends Extract<keyof TApiContract['methods'], string>>(method: M, params: TApiContract['methods'][M]['params']): Promise<TV1Methods[M]["result"]>;
8
+ subscribe<E extends Extract<keyof TApiContract['events'], string>>(eventName: E, handler: TAnyPubSubHandler<TApiContract['events'][E]>): void;
9
+ unsubscribe<E extends Extract<keyof TApiContract['events'], string>>(eventName: E, handler?: TAnyPubSubHandler<TApiContract['events'][E]>): void;
10
+ bootstrap(): void;
11
+ }
12
+
13
+ export declare type IV1ResolveSlotPage = (slotType: string, context: TV1ExtContext, extSettings: TV1ExtSettings) => void;
14
+
15
+ export declare type TAnyApiEventData<D = unknown> = D;
16
+
17
+ export declare type TAnyApiEventName = string;
18
+
19
+ export declare type TAnyApiMethodMeta<P = unknown, R = unknown> = {
20
+ params: P;
21
+ result: R;
22
+ };
23
+
24
+ export declare type TAnyApiMethodName = string;
25
+
26
+ export declare type TAnyApiSchema<Events extends Record<TAnyApiEventName, TAnyApiEventData> = Record<TAnyApiEventName, TAnyApiEventData>, Methods extends Record<TAnyApiMethodName, TAnyApiMethodMeta> = Record<TAnyApiMethodName, TAnyApiMethodMeta>> = {
27
+ events: Events;
28
+ methods: Methods;
29
+ };
30
+
31
+ declare type TAnyPubSubHandler<D = unknown> = (data: D, peerId: TTransportPeer['id']) => void;
32
+
33
+ export declare type TApiContract = TApiSchema;
34
+
35
+ export declare type TApiSchema = TAnyApiSchema<TEvents, TMethods>;
36
+
37
+ export declare type TEvents = TV1Events;
38
+
39
+ /** UUID */
40
+ export declare type TExtensionId = string;
41
+
42
+ declare type TExtHelperProps = {
43
+ serverId: string;
44
+ serverOrigin: string;
45
+ serverSource: Window;
46
+ theme: TTheme;
47
+ };
48
+
49
+ export declare type TExtPageResolverMethods = {
50
+ 'page.resolve': {
51
+ params: {
52
+ context: unknown;
53
+ extSettings: unknown;
54
+ resolvePageScriptUrl: string;
55
+ slotType: string;
56
+ };
57
+ result: {
58
+ pageName: string | null;
59
+ };
60
+ };
61
+ };
62
+
63
+ export declare type TMethods = TV1Methods;
64
+
65
+ export declare type TModelId = TUserId;
66
+
67
+ export declare type TTheme = 'light' | 'dark';
68
+
69
+ declare type TTransportPeer = {
70
+ id: string;
71
+ };
72
+
73
+ declare type TUnknownDictionary = Record<string, unknown>;
74
+
75
+ export declare type TUserId = number;
76
+
77
+ export declare type TV1ActionParamValue = string | number | boolean | null | undefined | TV1ActionParamValue[] | {
78
+ [key: string]: TV1ActionParamValue;
79
+ };
80
+
81
+ export declare type TV1ActionRequestParams = {
82
+ actionName: string;
83
+ params: Record<string, TV1ActionParamValue>;
84
+ };
85
+
86
+ export declare type TV1ActionResult = {
87
+ body: unknown;
88
+ code: number;
89
+ };
90
+
91
+ export declare type TV1AvailableGenders = 'male' | 'female' | 'tranny' | 'maleFemale' | 'males' | 'females' | 'trannies' | 'maleTranny' | 'femaleTranny';
92
+
93
+ declare type TV1ChatMethods = {
94
+ 'v1.chat.message.send': {
95
+ params: {
96
+ isAnonymous: boolean;
97
+ message: string;
98
+ user: TV1ExtUser | null;
99
+ };
100
+ result: null;
101
+ };
102
+ };
103
+
104
+ export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents;
105
+
106
+ export declare type TV1ExtContext = {
107
+ model?: TV1ExtModel;
108
+ user?: TV1ExtUser;
109
+ };
110
+
111
+ declare type TV1ExtEvents = {
112
+ 'v1.ext.context.updated': {
113
+ context: TV1ExtContext;
114
+ };
115
+ 'v1.ext.whispered': TV1WhisperData;
116
+ };
117
+
118
+ declare type TV1ExtMethods = {
119
+ 'v1.ext.actions.call': {
120
+ params: TV1ActionRequestParams;
121
+ result: TV1ActionResult;
122
+ };
123
+ 'v1.ext.activity.request': {
124
+ params: {
125
+ durationMs: number;
126
+ };
127
+ result: {
128
+ isGranted: boolean;
129
+ };
130
+ };
131
+ 'v1.ext.context.get': {
132
+ params: null;
133
+ result: TV1ExtContext;
134
+ };
135
+ 'v1.ext.movableOverlay.update': {
136
+ params: {
137
+ message?: string;
138
+ status?: 'active' | 'inactive' | 'connecting' | 'error';
139
+ };
140
+ result: null;
141
+ };
142
+ 'v1.ext.settings.get': {
143
+ params: null;
144
+ result: {
145
+ settings: TV1ExtSettings;
146
+ };
147
+ };
148
+ 'v1.ext.signup.open': {
149
+ params: {
150
+ type: 'user';
151
+ };
152
+ result: null;
153
+ };
154
+ 'v1.ext.whisper': {
155
+ params: {
156
+ data: TV1WhisperData;
157
+ };
158
+ result: null;
159
+ };
160
+ 'v1.ext.whisper.local': {
161
+ params: {
162
+ data: TV1WhisperData;
163
+ };
164
+ result: null;
165
+ };
166
+ };
167
+
168
+ export declare type TV1ExtModel = {
169
+ avatarUrlThumb: string;
170
+ doP2p: boolean;
171
+ doPrivate: boolean;
172
+ doSpy: boolean;
173
+ gender: TV1AvailableGenders;
174
+ id: TUserId;
175
+ isNonNude: boolean;
176
+ name: string;
177
+ status: TV1ModelStatus;
178
+ username: string;
179
+ };
180
+
181
+ export declare type TV1ExtSettings = unknown;
182
+
183
+ export declare type TV1ExtUser = {
184
+ id: TUserId;
185
+ isExGreen: boolean;
186
+ isGreen: boolean;
187
+ isModel: boolean;
188
+ isRegular: boolean;
189
+ isStudio: boolean;
190
+ isUltimate: boolean;
191
+ status: TV1UserStatus;
192
+ username: string;
193
+ userRanking?: {
194
+ isEx: boolean;
195
+ league: TV1UserLeague;
196
+ level: number;
197
+ } | null;
198
+ };
199
+
200
+ export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods;
201
+
202
+ declare type TV1ModelEvents = {
203
+ 'v1.model.ext.settings.set.requested': null;
204
+ };
205
+
206
+ declare type TV1ModelMethods = {
207
+ 'v1.model.ext.settings.get': {
208
+ params: null;
209
+ result: {
210
+ settings: TV1ExtSettings;
211
+ };
212
+ };
213
+ 'v1.model.ext.settings.set': {
214
+ params: {
215
+ isError: boolean;
216
+ settings: TV1ExtSettings;
217
+ };
218
+ result: null;
219
+ };
220
+ };
221
+
222
+ export declare type TV1ModelStatus = (typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES];
223
+
224
+ declare type TV1PaymentEvents = {
225
+ 'v1.payment.tokens.spend.succeeded': {
226
+ isAnonymous: boolean;
227
+ tokensAmount: number;
228
+ tokensSpendData: TV1TokenSpendData;
229
+ };
230
+ };
231
+
232
+ declare type TV1PaymentMethods = {
233
+ 'v1.payment.tokens.spend': {
234
+ params: {
235
+ tokensAmount: number;
236
+ tokensSpendData: TV1TokenSpendData;
237
+ };
238
+ result: null;
239
+ };
240
+ };
241
+
242
+ declare type TV1PrivateMethods = {
243
+ 'v1.private.request': {
244
+ params: null;
245
+ result: null;
246
+ };
247
+ };
248
+
249
+ declare type TV1SystemMethods = {
250
+ 'v1.system.resize.notify': {
251
+ params: {
252
+ height: number;
253
+ width: number;
254
+ };
255
+ result: null;
256
+ };
257
+ };
258
+
259
+ export declare type TV1TokenSpendData = TUnknownDictionary;
260
+
261
+ declare type TV1UserLeague = 'grey' | 'bronze' | 'silver' | 'gold' | 'diamond' | 'royal' | 'legend';
262
+
263
+ export declare type TV1UserStatus = (typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES];
264
+
265
+ export declare type TV1WhisperData = TUnknownDictionary;
266
+
267
+ export declare const V1_SHOW_STATUSES: {
268
+ readonly STATUS_TICKET_SHOW: "ticketShow";
269
+ readonly STATUS_GROUP_SHOW: "groupShow";
270
+ readonly STATUS_OFF: "off";
271
+ readonly STATUS_PRIVATE: "private";
272
+ readonly STATUS_EXCLUSIVE_PRIVATE: "exclusivePrivate";
273
+ readonly STATUS_PUBLIC: "public";
274
+ readonly STATUS_IDLE: "idle";
275
+ };
276
+
277
+ export { }
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@stripchatdev/ext-helper",
3
+ "private": false,
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "module": "./dist/ext-helper.js",
7
+ "types": "./dist/index.d.ts",
8
+ "scripts": {
9
+ "build:code": "vite build",
10
+ "build:clean": "rm -rf ./dist ./dist-types",
11
+ "build:types": "tsc -b --force && api-extractor run --local",
12
+ "build:clean-artefacts": "rm -rf ./dist-types",
13
+ "build": "npm run build:clean && npm run build:code && npm run build:types && npm run build:clean-artefacts"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "publishConfig": {
19
+ "registry": "https://registry.npmjs.org/",
20
+ "access": "public"
21
+ },
22
+ "sideEffects": false,
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/ext-helper.js",
27
+ "default": "./dist/ext-helper.js"
28
+ }
29
+ },
30
+ "dependencies": {
31
+ "ulid": "*"
32
+ }
33
+ }