spectrum-ts 0.2.0 → 0.2.2

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.
@@ -1,5 +1,5 @@
1
1
  // src/utils/cloud.ts
2
- var SPECTRUM_CLOUD_URL = `https://${process.env.SPECTRUM_CLOUD_URL ?? "spectrum-cloud.photon.codes"}`;
2
+ var SPECTRUM_CLOUD_URL = `https://${process.env.SPECTRUM_CLOUD_URL ?? "spectrum.photon.codes"}`;
3
3
  var SpectrumCloudError = class extends Error {
4
4
  status;
5
5
  code;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import z__default from 'zod';
2
- import { P as ProviderMessage, a as PlatformDef, b as Platform, c as PlatformProviderConfig, S as SpectrumLike, C as CustomEventStreams, d as Space, M as Message, e as ContentBuilder } from './types-DQE0dQT4.js';
3
- export { A as AnyPlatformDef, f as Content, E as EventProducer, g as PlatformInstance, h as PlatformMessage, i as PlatformSpace, j as PlatformUser, k as SchemaMessage, U as User, l as attachment, m as custom, t as text } from './types-DQE0dQT4.js';
2
+ import { P as ProviderMessage, a as PlatformDef, b as Platform, c as PlatformProviderConfig, S as SpectrumLike, C as CustomEventStreams, d as Space, M as Message, e as ContentBuilder } from './types-DPrSH21Q.js';
3
+ export { A as AnyPlatformDef, f as Content, E as EventProducer, g as PlatformInstance, h as PlatformMessage, i as PlatformSpace, j as PlatformUser, k as SchemaMessage, U as User, l as attachment, m as custom, t as text } from './types-DPrSH21Q.js';
4
4
  export { M as ManagedStream, m as mergeStreams, s as stream } from './stream-DGy4geUK.js';
5
5
  import 'hotscript';
6
- import 'type-fest';
7
6
 
8
7
  declare function definePlatform<_Name extends string, _ConfigSchema extends z__default.ZodType<object>, _UserSchema extends z__default.ZodType<object> | undefined, _SpaceSchema extends z__default.ZodType<object> | undefined, _SpaceParamsSchema extends z__default.ZodType<object> | undefined, _Client, _ResolvedUser extends {
9
8
  id: string;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SpectrumCloudError,
3
3
  cloud
4
- } from "./chunk-XOBTWTFC.js";
4
+ } from "./chunk-HXM64ENV.js";
5
5
  import {
6
6
  mergeStreams,
7
7
  stream
@@ -3,10 +3,9 @@ import { AdvancedIMessage } from '@photon-ai/advanced-imessage';
3
3
  import { IMessageSDK } from '@photon-ai/imessage-kit';
4
4
  import * as z from 'zod';
5
5
  import z__default from 'zod';
6
- import { k as SchemaMessage, b as Platform, a as PlatformDef, P as ProviderMessage } from '../../types-DQE0dQT4.js';
6
+ import { k as SchemaMessage, b as Platform, a as PlatformDef, P as ProviderMessage } from '../../types-DPrSH21Q.js';
7
7
  import * as zod_v4_core from 'zod/v4/core';
8
8
  import 'hotscript';
9
- import 'type-fest';
10
9
 
11
10
  type IMessageClient = IMessageSDK | AdvancedIMessage[];
12
11
  declare const userSchema: z__default.ZodObject<{}, z__default.core.$strip>;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cloud
3
- } from "../../chunk-XOBTWTFC.js";
3
+ } from "../../chunk-HXM64ENV.js";
4
4
  import {
5
5
  mergeStreams,
6
6
  stream
@@ -55,7 +55,7 @@ async function createCloudClients(projectId, projectSecret) {
55
55
  };
56
56
  const buildClients = () => {
57
57
  if (tokenData.type === "shared") {
58
- const address = process.env.SPECTRUM_IMESSAGE_ADDRESS ?? "spectrum-imessage.photon.codes:443";
58
+ const address = process.env.SPECTRUM_IMESSAGE_ADDRESS ?? "imessage.spectrum.photon.codes:443";
59
59
  return [
60
60
  createClient({
61
61
  address,
@@ -1,8 +1,7 @@
1
- import { b as Platform, a as PlatformDef, P as ProviderMessage } from '../../types-DQE0dQT4.js';
1
+ import { b as Platform, a as PlatformDef, P as ProviderMessage } from '../../types-DPrSH21Q.js';
2
2
  import * as node_readline from 'node:readline';
3
3
  import z__default from 'zod';
4
4
  import 'hotscript';
5
- import 'type-fest';
6
5
 
7
6
  declare const terminal: Platform<PlatformDef<"terminal", z__default.ZodObject<{}, z__default.core.$strip>, z__default.ZodType<object, unknown, z__default.core.$ZodTypeInternals<object, unknown>> | undefined, z__default.ZodType<object, unknown, z__default.core.$ZodTypeInternals<object, unknown>> | undefined, z__default.ZodType<object, unknown, z__default.core.$ZodTypeInternals<object, unknown>> | undefined, node_readline.Interface, {
8
7
  id: string;
@@ -1,11 +1,10 @@
1
1
  import { M as ManagedStream } from '../../stream-DGy4geUK.js';
2
2
  import * as z from 'zod';
3
3
  import z__default from 'zod';
4
- import { k as SchemaMessage, b as Platform, a as PlatformDef, P as ProviderMessage } from '../../types-DQE0dQT4.js';
4
+ import { k as SchemaMessage, b as Platform, a as PlatformDef, P as ProviderMessage } from '../../types-DPrSH21Q.js';
5
5
  import * as zod_v4_core from 'zod/v4/core';
6
6
  import { WhatsAppClient } from '@photon-ai/whatsapp-business';
7
7
  import 'hotscript';
8
- import 'type-fest';
9
8
 
10
9
  declare const userSchema: z__default.ZodObject<{}, z__default.core.$strip>;
11
10
  declare const spaceSchema: z__default.ZodObject<{
@@ -1,6 +1,5 @@
1
1
  import { Pipe, Tuples, Fn } from 'hotscript';
2
2
  import z__default from 'zod';
3
- import { NonEmptyString } from 'type-fest';
4
3
 
5
4
  declare const contentSchema: z__default.ZodDiscriminatedUnion<[z__default.ZodObject<{
6
5
  type: z__default.ZodLiteral<"plain_text">;
@@ -18,7 +17,7 @@ type Content = z__default.infer<typeof contentSchema>;
18
17
  interface ContentBuilder {
19
18
  build(): Promise<Content>;
20
19
  }
21
- declare function text<T extends string>(text: NonEmptyString<T>): ContentBuilder;
20
+ declare function text(text: string): ContentBuilder;
22
21
  declare function custom(raw: z__default.infer<ReturnType<typeof z__default.json>>): ContentBuilder;
23
22
  declare function attachment(input: string | Buffer, options?: {
24
23
  mimeType?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spectrum-ts",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -36,7 +36,7 @@
36
36
  "dev": "tsup --watch"
37
37
  },
38
38
  "dependencies": {
39
- "@photon-ai/advanced-imessage": "^0.1.0",
39
+ "@photon-ai/advanced-imessage": "^0.4.2",
40
40
  "@photon-ai/whatsapp-business": "^0.1.1",
41
41
  "@photon-ai/imessage-kit": "^2.1.2",
42
42
  "@repeaterjs/repeater": "^3.0.6",
@@ -62,7 +62,7 @@ export async function createCloudClients(
62
62
  if (tokenData.type === "shared") {
63
63
  const address =
64
64
  process.env.SPECTRUM_IMESSAGE_ADDRESS ??
65
- "spectrum-imessage.photon.codes:443";
65
+ "imessage.spectrum.photon.codes:443";
66
66
 
67
67
  return [
68
68
  createClient({
@@ -29,8 +29,8 @@ export interface ContentBuilder {
29
29
  build(): Promise<Content>;
30
30
  }
31
31
 
32
- export function text<T extends string>(
33
- text: NonEmptyString<T>
32
+ export function text(
33
+ text: string
34
34
  ): ContentBuilder {
35
35
  return {
36
36
  build: (): Promise<Content> =>
@@ -1,4 +1,4 @@
1
- export const SPECTRUM_CLOUD_URL = `https://${process.env.SPECTRUM_CLOUD_URL ?? "spectrum-cloud.photon.codes"}`;
1
+ export const SPECTRUM_CLOUD_URL = `https://${process.env.SPECTRUM_CLOUD_URL ?? "spectrum.photon.codes"}`;
2
2
 
3
3
  // ---------------------------------------------------------------------------
4
4
  // API response types (aligned with OpenAPI spec)