@spectrum-ts/imessage 12.1.0 → 12.2.0

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AdvancedIMessage, ChatServiceType } from "@photon-ai/advanced-imessage";
1
+ import { AdvancedIMessage, ChatServiceType } from "@photon-ai/advanced-imessage/grpc";
2
2
  import { Attachment, ContentBuilder, ContentInput, SchemaMessage, Space, read } from "@spectrum-ts/core";
3
3
  import { PhotoInput } from "@spectrum-ts/core/authoring";
4
4
  import z from "zod";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { NotFoundError, ValidationError, createClient } from "@photon-ai/advanced-imessage";
1
+ import { NotFoundError, ValidationError, createGrpcClient } from "@photon-ai/advanced-imessage/grpc";
2
2
  import { sanitizePhone, withSpan } from "@photon-ai/otel";
3
3
  import { UnsupportedError, appLayoutSchema, cloud, definePlatform, fromVCard, mergeStreams, read, text, toVCard } from "@spectrum-ts/core";
4
4
  import { addMemberSchema, asAttachment, asContact, asCustom, asGroup, asPoll, asPollOption, asReply, asText, asVoice, avatarSchema, buildPhotoAction, createLogger, createTokenRenewal, ensureM4a, errorAttrs, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, resumableOrderedStream, sanitizeErrorMessage } from "@spectrum-ts/core/authoring";
@@ -265,7 +265,7 @@ async function createCloudClients(projectId, projectSecret) {
265
265
  if (tokenData.type === "shared") {
266
266
  const entries = [{
267
267
  phone: SHARED_PHONE,
268
- client: createClient({
268
+ client: createGrpcClient({
269
269
  address: process.env.SPECTRUM_IMESSAGE_ADDRESS ?? "imessage.spectrum.photon.codes:443",
270
270
  autoIdempotency: true,
271
271
  retry: true,
@@ -283,7 +283,7 @@ async function createCloudClients(projectId, projectSecret) {
283
283
  for (const [instanceId, token] of Object.entries(dedicated.auth)) {
284
284
  const entry = {
285
285
  phone: requirePhone(dedicated, instanceId),
286
- client: createClient({
286
+ client: createGrpcClient({
287
287
  address: `${instanceId}.imsg.photon.codes:443`,
288
288
  autoIdempotency: true,
289
289
  retry: true,
@@ -2197,7 +2197,7 @@ const imessage = definePlatform(IMESSAGE_PLATFORM, {
2197
2197
  createClient: async ({ config, projectId, projectSecret }) => {
2198
2198
  if (config.clients) return (Array.isArray(config.clients) ? config.clients : [config.clients]).map((e) => ({
2199
2199
  phone: e.phone,
2200
- client: createClient({
2200
+ client: createGrpcClient({
2201
2201
  address: e.address,
2202
2202
  autoIdempotency: true,
2203
2203
  retry: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-ts/imessage",
3
- "version": "12.1.0",
3
+ "version": "12.2.0",
4
4
  "description": "iMessage provider for spectrum-ts.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,10 +31,13 @@
31
31
  "label": "imessage"
32
32
  },
33
33
  "dependencies": {
34
- "@photon-ai/advanced-imessage": "^1.0.0",
34
+ "@grpc/grpc-js": "^1.14.4",
35
+ "@photon-ai/advanced-imessage": "^2.0.2",
35
36
  "@photon-ai/otel": "^3.1.0",
36
37
  "lru-cache": "^11.0.0",
37
38
  "marked": "^18.0.5",
39
+ "nice-grpc": "^2.1.16",
40
+ "nice-grpc-common": "^2.0.3",
38
41
  "zod": "^4.2.1"
39
42
  },
40
43
  "peerDependencies": {