@rentaltide/app-sdk 0.1.0 → 0.1.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/dist/app.d.ts CHANGED
@@ -10,8 +10,8 @@
10
10
  * app.toast('Loaded!', 'success');
11
11
  * ```
12
12
  */
13
- import type { ApiRequest, ApiResponse, HostContext, ThemeTokens, ToastSeverity } from './types';
14
- export declare const SDK_VERSION = "0.1.0";
13
+ import type { ApiRequest, ApiResponse, HostContext, ThemeTokens, ToastSeverity } from './types.js';
14
+ export declare const SDK_VERSION = "0.1.1";
15
15
  export interface CreateAppOptions {
16
16
  /**
17
17
  * Origins of the RentalTide host(s) allowed to talk to this app. Defaults to
package/dist/app.js CHANGED
@@ -10,8 +10,8 @@
10
10
  * app.toast('Loaded!', 'success');
11
11
  * ```
12
12
  */
13
- import { envelope, isBridgeEnvelope } from './protocol';
14
- export const SDK_VERSION = '0.1.0';
13
+ import { envelope, isBridgeEnvelope } from './protocol.js';
14
+ export const SDK_VERSION = '0.1.1';
15
15
  function safeOrigin(url) {
16
16
  try {
17
17
  return url ? new URL(url).origin : '';
@@ -3,8 +3,8 @@
3
3
  * provides there and sensible scope suggestions. Drives the app-creation form,
4
4
  * the sandbox location picker, and the developer docs — one source of truth.
5
5
  */
6
- import type { EmbedLocation, EmbedResourceType } from './types';
7
- import type { Scope } from './scopes';
6
+ import type { EmbedLocation, EmbedResourceType } from './types.js';
7
+ import type { Scope } from './scopes.js';
8
8
  export interface EmbedLocationMeta {
9
9
  id: EmbedLocation;
10
10
  label: string;
package/dist/host.d.ts CHANGED
@@ -9,8 +9,8 @@
9
9
  * - `onApiRequest` is responsible for enforcing the installation's granted
10
10
  * scopes (see {@link requiredScope}/{@link hasScope} in `./scopes`).
11
11
  */
12
- import { BridgeEnvelope } from './protocol';
13
- import type { ApiRequest, ApiResponse, HostContext, ThemeTokens, ToastSeverity } from './types';
12
+ import { BridgeEnvelope } from './protocol.js';
13
+ import type { ApiRequest, ApiResponse, HostContext, ThemeTokens, ToastSeverity } from './types.js';
14
14
  export interface CreateHostBridgeOptions {
15
15
  /** The iframe element the app is mounted in. */
16
16
  iframe: HTMLIFrameElement;
package/dist/host.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * - `onApiRequest` is responsible for enforcing the installation's granted
10
10
  * scopes (see {@link requiredScope}/{@link hasScope} in `./scopes`).
11
11
  */
12
- import { envelope, isBridgeEnvelope } from './protocol';
12
+ import { envelope, isBridgeEnvelope } from './protocol.js';
13
13
  export function createHostBridge(options) {
14
14
  const { iframe, appOrigin, getContext, onApiRequest, onResize, onToast, onNavigate, onClose, onMessage, } = options;
15
15
  // `srcdoc`/sandboxed iframes report a `null` origin; postMessage must use '*'.
package/dist/index.d.ts CHANGED
@@ -7,12 +7,12 @@
7
7
  * The RentalTide host (and the developer sandbox) import the host bridge:
8
8
  * import { createHostBridge } from '@rentaltide/app-sdk';
9
9
  */
10
- export * from './types';
11
- export * from './protocol';
12
- export * from './scopes';
13
- export * from './embedLocations';
14
- export * from './events';
15
- export { createApp, SDK_VERSION } from './app';
16
- export type { CreateAppOptions, ApiCallOptions, RentalTideApp } from './app';
17
- export { createHostBridge } from './host';
18
- export type { CreateHostBridgeOptions, HostBridge } from './host';
10
+ export * from './types.js';
11
+ export * from './protocol.js';
12
+ export * from './scopes.js';
13
+ export * from './embedLocations.js';
14
+ export * from './events.js';
15
+ export { createApp, SDK_VERSION } from './app.js';
16
+ export type { CreateAppOptions, ApiCallOptions, RentalTideApp } from './app.js';
17
+ export { createHostBridge } from './host.js';
18
+ export type { CreateHostBridgeOptions, HostBridge } from './host.js';
package/dist/index.js CHANGED
@@ -8,16 +8,16 @@
8
8
  * import { createHostBridge } from '@rentaltide/app-sdk';
9
9
  */
10
10
  // Data shapes
11
- export * from './types';
11
+ export * from './types.js';
12
12
  // Wire protocol (envelopes, request/event maps, helpers)
13
- export * from './protocol';
13
+ export * from './protocol.js';
14
14
  // OAuth scopes + the API-proxy scope policy
15
- export * from './scopes';
15
+ export * from './scopes.js';
16
16
  // Embed-location registry
17
- export * from './embedLocations';
17
+ export * from './embedLocations.js';
18
18
  // Webhook event catalog
19
- export * from './events';
19
+ export * from './events.js';
20
20
  // App-side client (runs in the iframe)
21
- export { createApp, SDK_VERSION } from './app';
21
+ export { createApp, SDK_VERSION } from './app.js';
22
22
  // Host-side bridge (runs in RentalTide / the sandbox)
23
- export { createHostBridge } from './host';
23
+ export { createHostBridge } from './host.js';
@@ -6,7 +6,7 @@
6
6
  * protocol version so unrelated `message` events (and other postMessage users on
7
7
  * the page) are ignored.
8
8
  */
9
- import type { ApiRequest, ApiResponse, HostContext, ThemeTokens, ToastSeverity } from './types';
9
+ import type { ApiRequest, ApiResponse, HostContext, ThemeTokens, ToastSeverity } from './types.js';
10
10
  export declare const PROTOCOL_VERSION = "1";
11
11
  /** Marker present on every bridge message; used to filter foreign messages. */
12
12
  export declare const BRIDGE_NAMESPACE = "rentaltide-app-bridge";
package/dist/scopes.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * form). The host may layer additional, stricter rules on top — but it should
7
7
  * never grant access broader than what's declared here.
8
8
  */
9
- import type { ApiMethod } from './types';
9
+ import type { ApiMethod } from './types.js';
10
10
  export declare const SCOPES: readonly ["read:bookings", "write:bookings", "read:customers", "write:customers", "read:inventory", "write:inventory", "read:pos", "write:pos", "read:transactions", "write:transactions", "read:analytics", "read:reports", "read:geofence", "write:geofence", "audio_calling", "webhooks:receive"];
11
11
  export type Scope = (typeof SCOPES)[number];
12
12
  export interface ScopeMeta {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rentaltide/app-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Official SDK for building embedded apps on the RentalTide platform.",
5
5
  "license": "MIT",
6
6
  "author": "RentalTide Inc.",
@@ -31,7 +31,7 @@
31
31
  "README.md"
32
32
  ],
33
33
  "scripts": {
34
- "build": "tsc -p tsconfig.json",
34
+ "build": "tsc -p tsconfig.json && node scripts/fix-esm-extensions.mjs",
35
35
  "typecheck": "tsc -p tsconfig.json --noEmit",
36
36
  "prepublishOnly": "npm run build"
37
37
  },
package/src/app.ts CHANGED
@@ -21,7 +21,7 @@ import type {
21
21
  ToastSeverity,
22
22
  } from './types';
23
23
 
24
- export const SDK_VERSION = '0.1.0';
24
+ export const SDK_VERSION = '0.1.1';
25
25
 
26
26
  export interface CreateAppOptions {
27
27
  /**