photon-msg 0.0.0-stage → 0.1.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.
Files changed (87) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +275 -2
  3. package/dist/args.d.ts +63 -0
  4. package/dist/args.d.ts.map +1 -0
  5. package/dist/args.js +68 -0
  6. package/dist/args.js.map +1 -0
  7. package/dist/bin.d.ts +3 -0
  8. package/dist/bin.d.ts.map +1 -0
  9. package/dist/bin.js +9 -0
  10. package/dist/bin.js.map +1 -0
  11. package/dist/cli.d.ts +13 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +163 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/client.d.ts +37 -0
  16. package/dist/client.d.ts.map +1 -0
  17. package/dist/client.js +68 -0
  18. package/dist/client.js.map +1 -0
  19. package/dist/commands/attachments.d.ts +25 -0
  20. package/dist/commands/attachments.d.ts.map +1 -0
  21. package/dist/commands/attachments.js +78 -0
  22. package/dist/commands/attachments.js.map +1 -0
  23. package/dist/commands/doctor.d.ts +9 -0
  24. package/dist/commands/doctor.d.ts.map +1 -0
  25. package/dist/commands/doctor.js +54 -0
  26. package/dist/commands/doctor.js.map +1 -0
  27. package/dist/commands/line.d.ts +51 -0
  28. package/dist/commands/line.d.ts.map +1 -0
  29. package/dist/commands/line.js +117 -0
  30. package/dist/commands/line.js.map +1 -0
  31. package/dist/commands/messages.d.ts +82 -0
  32. package/dist/commands/messages.d.ts.map +1 -0
  33. package/dist/commands/messages.js +163 -0
  34. package/dist/commands/messages.js.map +1 -0
  35. package/dist/commands/misc.d.ts +33 -0
  36. package/dist/commands/misc.d.ts.map +1 -0
  37. package/dist/commands/misc.js +61 -0
  38. package/dist/commands/misc.js.map +1 -0
  39. package/dist/commands/send.d.ts +107 -0
  40. package/dist/commands/send.d.ts.map +1 -0
  41. package/dist/commands/send.js +104 -0
  42. package/dist/commands/send.js.map +1 -0
  43. package/dist/commands/spaces.d.ts +56 -0
  44. package/dist/commands/spaces.d.ts.map +1 -0
  45. package/dist/commands/spaces.js +118 -0
  46. package/dist/commands/spaces.js.map +1 -0
  47. package/dist/commands/users.d.ts +34 -0
  48. package/dist/commands/users.d.ts.map +1 -0
  49. package/dist/commands/users.js +82 -0
  50. package/dist/commands/users.js.map +1 -0
  51. package/dist/config.d.ts +47 -0
  52. package/dist/config.d.ts.map +1 -0
  53. package/dist/config.js +77 -0
  54. package/dist/config.js.map +1 -0
  55. package/dist/content.d.ts +33 -0
  56. package/dist/content.d.ts.map +1 -0
  57. package/dist/content.js +287 -0
  58. package/dist/content.js.map +1 -0
  59. package/dist/errors.d.ts +62 -0
  60. package/dist/errors.d.ts.map +1 -0
  61. package/dist/errors.js +95 -0
  62. package/dist/errors.js.map +1 -0
  63. package/dist/help.d.ts +8 -0
  64. package/dist/help.d.ts.map +1 -0
  65. package/dist/help.js +177 -0
  66. package/dist/help.js.map +1 -0
  67. package/dist/index.d.ts +21 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +13 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/output.d.ts +35 -0
  72. package/dist/output.d.ts.map +1 -0
  73. package/dist/output.js +121 -0
  74. package/dist/output.js.map +1 -0
  75. package/dist/target.d.ts +34 -0
  76. package/dist/target.d.ts.map +1 -0
  77. package/dist/target.js +75 -0
  78. package/dist/target.js.map +1 -0
  79. package/dist/types.d.ts +200 -0
  80. package/dist/types.d.ts.map +1 -0
  81. package/dist/types.js +8 -0
  82. package/dist/types.js.map +1 -0
  83. package/dist/upload.d.ts +33 -0
  84. package/dist/upload.d.ts.map +1 -0
  85. package/dist/upload.js +119 -0
  86. package/dist/upload.js.map +1 -0
  87. package/package.json +49 -4
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Photon client construction, kept in its own module so the rest of the CLI
3
+ * never touches the SDK constructor directly and tests can build a client
4
+ * against a stubbed fetch.
5
+ */
6
+ import { Photon } from "@photon-ai/api";
7
+ import type { UserRecord } from "./types.js";
8
+ export interface ClientOptions {
9
+ apiKey: string;
10
+ baseUrl?: string;
11
+ timeoutMs?: number;
12
+ fetch?: typeof globalThis.fetch;
13
+ }
14
+ export declare function createPhotonClient({ apiKey, baseUrl, timeoutMs, fetch }: ClientOptions): Photon;
15
+ /**
16
+ * A client stand-in for `--dry-run`: every use throws, so an offline command
17
+ * cannot accidentally reach the network.
18
+ */
19
+ export declare function createOfflineClient(): Photon;
20
+ /**
21
+ * Extract the list carried by a paged response.
22
+ *
23
+ * Most endpoints use `items`, but a few (shared-line assignments, for example)
24
+ * name the array differently, so fall back to the first array property rather
25
+ * than silently reporting zero results.
26
+ */
27
+ export declare function pageItems<T>(page: unknown): T[];
28
+ /** Convenience accessor that tolerates slightly different snapshot shapes. */
29
+ export declare const handleOf: (user: {
30
+ handle?: string;
31
+ address?: string;
32
+ } | null | undefined) => string;
33
+ /** Reads a paged response's continuation token, whatever the endpoint calls it. */
34
+ export declare const nextPageToken: (page: unknown) => string | undefined;
35
+ /** Narrows an SDK user to the fields the CLI displays. */
36
+ export declare const asUserRecord: (user: unknown) => UserRecord;
37
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACjC;AAED,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,aAAa,GAAG,MAAM,CAc/F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAS5C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC,EAAE,CAS/C;AAED,8EAA8E;AAC9E,eAAO,MAAM,QAAQ,GAAI,MAAM;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,KAAG,MACrD,CAAC;AAEtC,mFAAmF;AACnF,eAAO,MAAM,aAAa,GAAI,MAAM,OAAO,KAAG,MAAM,GAAG,SAItD,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,YAAY,GAAI,MAAM,OAAO,KAAG,UAAgC,CAAC"}
package/dist/client.js ADDED
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Photon client construction, kept in its own module so the rest of the CLI
3
+ * never touches the SDK constructor directly and tests can build a client
4
+ * against a stubbed fetch.
5
+ */
6
+ import { Photon } from "@photon-ai/api";
7
+ import { CliError, EXIT, usageError } from "./errors.js";
8
+ export function createPhotonClient({ apiKey, baseUrl, timeoutMs, fetch }) {
9
+ if (!apiKey) {
10
+ throw new CliError("An API key is required to build a client.", {
11
+ exitCode: EXIT.AUTH,
12
+ hint: "Set PHOTON_API_KEY or pass --api-key.",
13
+ });
14
+ }
15
+ return new Photon({
16
+ headers: { Authorization: `Bearer ${apiKey}` },
17
+ ...(baseUrl ? { baseUrl } : {}),
18
+ ...(timeoutMs ? { timeoutMs } : {}),
19
+ ...(fetch ? { fetch } : {}),
20
+ });
21
+ }
22
+ /**
23
+ * A client stand-in for `--dry-run`: every use throws, so an offline command
24
+ * cannot accidentally reach the network.
25
+ */
26
+ export function createOfflineClient() {
27
+ const fail = () => {
28
+ throw usageError("--dry-run is offline: this command must not contact the API.");
29
+ };
30
+ return new Proxy({}, {
31
+ get: fail,
32
+ has: fail,
33
+ apply: fail,
34
+ });
35
+ }
36
+ /**
37
+ * Extract the list carried by a paged response.
38
+ *
39
+ * Most endpoints use `items`, but a few (shared-line assignments, for example)
40
+ * name the array differently, so fall back to the first array property rather
41
+ * than silently reporting zero results.
42
+ */
43
+ export function pageItems(page) {
44
+ if (!page || typeof page !== "object")
45
+ return [];
46
+ const record = page;
47
+ if (Array.isArray(record.items))
48
+ return record.items;
49
+ if (Array.isArray(record.assignments))
50
+ return record.assignments;
51
+ for (const value of Object.values(record)) {
52
+ if (Array.isArray(value))
53
+ return value;
54
+ }
55
+ return [];
56
+ }
57
+ /** Convenience accessor that tolerates slightly different snapshot shapes. */
58
+ export const handleOf = (user) => user?.handle ?? user?.address ?? "";
59
+ /** Reads a paged response's continuation token, whatever the endpoint calls it. */
60
+ export const nextPageToken = (page) => {
61
+ if (!page || typeof page !== "object")
62
+ return undefined;
63
+ const token = page.nextPageToken;
64
+ return typeof token === "string" ? token : undefined;
65
+ };
66
+ /** Narrows an SDK user to the fields the CLI displays. */
67
+ export const asUserRecord = (user) => user;
68
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUzD,MAAM,UAAU,kBAAkB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAiB;IACrF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,QAAQ,CAAC,2CAA2C,EAAE;YAC9D,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,IAAI,EAAE,uCAAuC;SAC9C,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,MAAM,CAAC;QAChB,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,MAAM,EAAE,EAAE;QAC9C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,MAAM,IAAI,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC;AAEtC,mFAAmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAa,EAAsB,EAAE;IACjE,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACxD,MAAM,KAAK,GAAI,IAAoC,CAAC,aAAa,CAAC;IAClE,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC,CAAC;AAEF,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAa,EAAc,EAAE,CAAC,IAAkB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `attachments` — upload files and fetch the ones a message references.
3
+ */
4
+ import type { CommandContext } from "../types.js";
5
+ export declare const upload: {
6
+ options: {
7
+ readonly "content-type": {
8
+ readonly type: "string";
9
+ };
10
+ };
11
+ run({ flags, positionals, out, upload: uploadFile, dryRun }: CommandContext): Promise<void>;
12
+ };
13
+ export declare const get: {
14
+ options: {};
15
+ run({ client, projectId, positionals, out }: CommandContext): Promise<void>;
16
+ };
17
+ export declare const download: {
18
+ options: {
19
+ readonly out: {
20
+ readonly type: "string";
21
+ };
22
+ };
23
+ run({ client, projectId, flags, positionals, out }: CommandContext): Promise<void>;
24
+ };
25
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/commands/attachments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,aAAa,CAAC;AAgBpE,eAAO,MAAM,MAAM;;;;;;iEAKkD,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAclG,CAAC;AAEF,eAAO,MAAM,GAAG;;iDAGqC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBlF,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;wDAKuC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAezF,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * `attachments` — upload files and fetch the ones a message references.
3
+ */
4
+ import { writeFile } from "node:fs/promises";
5
+ import { CliError, usageError } from "../errors.js";
6
+ import { formatTime } from "../output.js";
7
+ /** Normalizes the SDK's download result into a Buffer. */
8
+ async function toBytes(result) {
9
+ if (result instanceof Uint8Array)
10
+ return Buffer.from(result);
11
+ if (result instanceof ArrayBuffer)
12
+ return Buffer.from(new Uint8Array(result));
13
+ if (typeof Blob !== "undefined" && result instanceof Blob) {
14
+ return Buffer.from(new Uint8Array(await result.arrayBuffer()));
15
+ }
16
+ if (typeof result === "object" && result !== null && "data" in result) {
17
+ return toBytes(result.data);
18
+ }
19
+ if (typeof result === "string")
20
+ return Buffer.from(result);
21
+ throw new CliError("Download returned an unexpected payload type.");
22
+ }
23
+ export const upload = {
24
+ options: {
25
+ "content-type": { type: "string" },
26
+ },
27
+ async run({ flags, positionals, out, upload: uploadFile, dryRun }) {
28
+ const source = positionals[0];
29
+ if (!source)
30
+ throw usageError("Usage: photon-msg attachments upload <path|url> [--content-type image/png]");
31
+ if (dryRun) {
32
+ out.data({ dryRun: true, source });
33
+ out.line(`would upload ${source}`);
34
+ return;
35
+ }
36
+ const attachmentId = await uploadFile(source, { contentType: flags["content-type"] });
37
+ out.data({ attachmentId, source });
38
+ out.success(`uploaded ${source} → ${attachmentId}`);
39
+ },
40
+ };
41
+ export const get = {
42
+ options: {},
43
+ async run({ client, projectId, positionals, out }) {
44
+ const attachmentId = positionals[0];
45
+ if (!attachmentId)
46
+ throw usageError("Usage: photon-msg attachments get <attachmentId>");
47
+ const attachment = (await client.projects.getAttachment({
48
+ path: { id: projectId, attachmentId },
49
+ }));
50
+ out.data(attachment);
51
+ out.heading(`attachment ${attachment.id ?? attachmentId}`);
52
+ out.keyValue([
53
+ ["content type", attachment.contentType],
54
+ ["filename", attachment.filename ?? ""],
55
+ ["bytes", attachment.sizeBytes ?? ""],
56
+ ["created", formatTime(attachment.createdAt)],
57
+ ]);
58
+ },
59
+ };
60
+ export const download = {
61
+ options: {
62
+ out: { type: "string" },
63
+ },
64
+ async run({ client, projectId, flags, positionals, out }) {
65
+ const attachmentId = positionals[0];
66
+ if (!attachmentId)
67
+ throw usageError("Usage: photon-msg attachments download <attachmentId> --out ./file.png");
68
+ const result = await client.projects.downloadAttachment({
69
+ path: { id: projectId, attachmentId },
70
+ });
71
+ const bytes = await toBytes(result);
72
+ const target = flags.out ?? `${attachmentId}.bin`;
73
+ await writeFile(target, bytes);
74
+ out.data({ attachmentId, path: target, bytes: bytes.length });
75
+ out.success(`wrote ${bytes.length} bytes to ${target}`);
76
+ },
77
+ };
78
+ //# sourceMappingURL=attachments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.js","sourceRoot":"","sources":["../../src/commands/attachments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,0DAA0D;AAC1D,KAAK,UAAU,OAAO,CAAC,MAAe;IACpC,IAAI,MAAM,YAAY,UAAU;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,MAAM,YAAY,WAAW;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9E,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,MAAM,YAAY,IAAI,EAAE,CAAC;QAC1D,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC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AAY,EAAE;SACtC,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,YAAY,MAAM,CAAC;QAClD,MAAM,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAE/B,GAAG,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9D,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,CAAC,MAAM,aAAa,MAAM,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `doctor` — verifies credentials and project wiring before you send anything.
3
+ *
4
+ * Every check is read-only, so running it never mutates state.
5
+ */
6
+ import type { CommandContext } from "../types.js";
7
+ export declare const options: {};
8
+ export declare function run({ client, projectId, config, out, flags }: CommandContext): Promise<void>;
9
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,eAAO,MAAM,OAAO,IAA+C,CAAC;AAEpE,wBAAsB,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA+ClG"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * `doctor` — verifies credentials and project wiring before you send anything.
3
+ *
4
+ * Every check is read-only, so running it never mutates state.
5
+ */
6
+ import { CliError } from "../errors.js";
7
+ import { redact } from "../config.js";
8
+ import { pageItems } from "../client.js";
9
+ export const options = {};
10
+ export async function run({ client, projectId, config, out, flags }) {
11
+ const checks = [];
12
+ checks.push({ name: "api key", ok: Boolean(config.apiKey), detail: redact(config.apiKey) });
13
+ checks.push({ name: "project id", ok: Boolean(projectId), detail: projectId });
14
+ checks.push({
15
+ name: "base url",
16
+ ok: true,
17
+ detail: config.baseUrl ?? "https://api.photon.codes (default)",
18
+ });
19
+ checks.push({
20
+ name: "agent handle",
21
+ ok: Boolean(config.agentHandle),
22
+ detail: config.agentHandle ?? "(not set)",
23
+ });
24
+ try {
25
+ const page = await client.projects.listMessages({
26
+ path: { id: projectId },
27
+ query: { pageSize: 1 },
28
+ });
29
+ checks.push({
30
+ name: "list messages",
31
+ ok: true,
32
+ detail: `${pageItems(page).length} item(s) in probe page`,
33
+ });
34
+ }
35
+ catch (error) {
36
+ checks.push({ name: "list messages", ok: false, detail: error.message });
37
+ }
38
+ const required = checks.filter((check) => check.name !== "agent handle");
39
+ const ok = required.every((check) => check.ok);
40
+ out.data({ ok, checks });
41
+ if (!flags.quiet) {
42
+ out.heading("photon-msg doctor");
43
+ for (const check of checks) {
44
+ out.line(`${check.ok ? "✓" : "✗"} ${check.name.padEnd(16)} ${check.detail}`);
45
+ }
46
+ out.line("");
47
+ out.info(ok ? "configuration looks usable" : "fix the failing checks above");
48
+ }
49
+ if (!ok) {
50
+ const failure = required.find((check) => !check.ok);
51
+ throw new CliError(`Doctor check failed: ${failure?.name ?? "unknown"}`, { hint: failure?.detail });
52
+ }
53
+ }
54
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AASzC,MAAM,CAAC,MAAM,OAAO,GAAG,EAA4C,CAAC;AAEpE,MAAM,CAAC,K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 @@
1
+ /**
2
+ * `line` — iMessage shared-line assignments.
3
+ *
4
+ * A pooled shared line is the free way to get a sending identity: assign the
5
+ * human's handle to a line, and the line may reply once that human has written
6
+ * to it. Assignment is idempotent per handle when you reuse the key.
7
+ */
8
+ import type { CommandContext } from "../types.js";
9
+ export declare const assign: {
10
+ options: {
11
+ readonly handle: {
12
+ readonly type: "string";
13
+ };
14
+ readonly email: {
15
+ readonly type: "string";
16
+ };
17
+ readonly "first-name": {
18
+ readonly type: "string";
19
+ };
20
+ readonly "last-name": {
21
+ readonly type: "string";
22
+ };
23
+ readonly "idempotency-key": {
24
+ readonly type: "string";
25
+ };
26
+ };
27
+ run({ client, projectId, flags, positionals, out, dryRun }: CommandContext): Promise<void>;
28
+ };
29
+ export declare const list: {
30
+ options: {
31
+ readonly "include-released": {
32
+ readonly type: "boolean";
33
+ };
34
+ readonly "page-size": {
35
+ readonly type: "string";
36
+ };
37
+ readonly "page-token": {
38
+ readonly type: "string";
39
+ };
40
+ };
41
+ run({ client, projectId, flags, out }: CommandContext): Promise<void>;
42
+ };
43
+ export declare const get: {
44
+ options: {};
45
+ run({ client, projectId, positionals, out }: CommandContext): Promise<void>;
46
+ };
47
+ export declare const release: {
48
+ options: {};
49
+ run({ client, projectId, positionals, out, dryRun }: CommandContext): Promise<void>;
50
+ };
51
+ //# sourceMappingURL=line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../src/commands/line.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,aAAa,CAAC;AAUpE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;gEASiD,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA+BjG,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;2CAO8B,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAgB5E,CAAC;AAEF,eAAO,MAAM,GAAG;;iDAGqC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBlF,CAAC;AAEF,eAAO,MAAM,OAAO;;yDAGyC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAiB1F,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * `line` — iMessage shared-line assignments.
3
+ *
4
+ * A pooled shared line is the free way to get a sending identity: assign the
5
+ * human's handle to a line, and the line may reply once that human has written
6
+ * to it. Assignment is idempotent per handle when you reuse the key.
7
+ */
8
+ import { nextPageToken, pageItems } from "../client.js";
9
+ import { formatTime } from "../output.js";
10
+ import { usageError } from "../errors.js";
11
+ import { normalizeHandle } from "../target.js";
12
+ const columns = [
13
+ { header: "ASSIGNMENT", value: (assignment) => assignment.assignmentId },
14
+ { header: "HANDLE", value: (assignment) => assignment.handle },
15
+ { header: "LINE", value: (assignment) => assignment.assignedPhoneNumber },
16
+ { header: "CREATED", value: (assignment) => formatTime(assignment.createdAt) },
17
+ { header: "RELEASED", value: (assignment) => formatTime(assignment.releasedAt) },
18
+ ];
19
+ export const assign = {
20
+ options: {
21
+ handle: { type: "string" },
22
+ email: { type: "string" },
23
+ "first-name": { type: "string" },
24
+ "last-name": { type: "string" },
25
+ "idempotency-key": { type: "string" },
26
+ },
27
+ async run({ client, projectId, flags, positionals, out, dryRun }) {
28
+ const raw = flags.handle ?? positionals[0];
29
+ if (!raw) {
30
+ throw usageError("Usage: photon-msg line assign --handle <+15551234567> [--email you@example.com]");
31
+ }
32
+ const handle = normalizeHandle(raw);
33
+ const idempotencyKey = flags["idempotency-key"] ?? `photon-msg:line-assign:${handle}`;
34
+ if (dryRun) {
35
+ out.data({ dryRun: true, handle, idempotencyKey });
36
+ out.line(`would assign a shared line for ${handle}`);
37
+ return;
38
+ }
39
+ const assignment = (await client.projects.platforms.imessage.assignments.create({
40
+ path: { id: projectId },
41
+ headers: { idempotencyKey },
42
+ body: {
43
+ handle,
44
+ ...(flags.email ? { email: flags.email } : {}),
45
+ ...(flags["first-name"] ? { firstName: flags["first-name"] } : {}),
46
+ ...(flags["last-name"] ? { lastName: flags["last-name"] } : {}),
47
+ },
48
+ }));
49
+ out.data(assignment);
50
+ out.success(`line ${assignment.assignedPhoneNumber} assigned for ${assignment.handle}`);
51
+ out.info(`assignment ${assignment.assignmentId}`);
52
+ out.info("this line can reply after that handle writes to it; it cannot start the conversation");
53
+ },
54
+ };
55
+ export const list = {
56
+ options: {
57
+ "include-released": { type: "boolean" },
58
+ "page-size": { type: "string" },
59
+ "page-token": { type: "string" },
60
+ },
61
+ async run({ client, projectId, flags, out }) {
62
+ const query = {};
63
+ if (flags["include-released"])
64
+ query.includeReleased = "true";
65
+ if (flags["page-size"])
66
+ query.pageSize = Number(flags["page-size"]);
67
+ if (flags["page-token"])
68
+ query.pageToken = flags["page-token"];
69
+ const page = await client.projects.platforms.imessage.assignments.list({
70
+ path: { id: projectId },
71
+ query,
72
+ });
73
+ const items = pageItems(page);
74
+ out.data({ items, count: items.length, nextPageToken: nextPageToken(page) ?? null });
75
+ out.table(items, columns);
76
+ if (!flags.quiet)
77
+ out.info(`${items.length} assignment(s)`);
78
+ },
79
+ };
80
+ export const get = {
81
+ options: {},
82
+ async run({ client, projectId, positionals, out }) {
83
+ const assignmentId = positionals[0];
84
+ if (!assignmentId)
85
+ throw usageError("Usage: photon-msg line get <assignmentId>");
86
+ const assignment = (await client.projects.platforms.imessage.assignments.get({
87
+ path: { id: projectId, assignmentId },
88
+ }));
89
+ out.data(assignment);
90
+ out.heading(`assignment ${assignment.assignmentId}`);
91
+ out.keyValue([
92
+ ["handle", assignment.handle],
93
+ ["line", assignment.assignedPhoneNumber],
94
+ ["created", formatTime(assignment.createdAt)],
95
+ ["released", formatTime(assignment.releasedAt)],
96
+ ]);
97
+ },
98
+ };
99
+ export const release = {
100
+ options: {},
101
+ async run({ client, projectId, positionals, out, dryRun }) {
102
+ const assignmentId = positionals[0];
103
+ if (!assignmentId)
104
+ throw usageError("Usage: photon-msg line release <assignmentId>");
105
+ if (dryRun) {
106
+ out.data({ dryRun: true, assignmentId });
107
+ out.line(`would release ${assignmentId}`);
108
+ return;
109
+ }
110
+ const released = await client.projects.platforms.imessage.assignments.release({
111
+ path: { id: projectId, assignmentId },
112
+ });
113
+ out.data(released ?? { assignmentId, released: true });
114
+ out.success(`released ${assignmentId}`);
115
+ },
116
+ };
117
+ //# sourceMappingURL=line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.js","sourceRoot":"","sources":["../../src/commands/line.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,UAAU,EAAoB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,OAAO,GAAyC;IACpD,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE;IACxE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE;IAC9D,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,mBAAmB,EAAE;IACzE,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;IAC9E,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;CACjF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,IAAI,EAAE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AC7B,CAAC,MAAM,EAAE,UAAU,CAAC,mBAAmB,CAAC;YACxC,CAAC,SAAS,EAAE,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YAC7C,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;SAChD,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,OAAO,EAAE,EAA4C;IAErD,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAkB;QACvE,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,YAAY;YAAE,MAAM,UAAU,CAAC,+CAA+C,CAAC,CAAC;QAErF,IAAI,MAAM,EAAE,CAAC;YACX,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;YACzC,GAAG,CAAC,IAAI,CAAC,iBAAiB,YAAY,EAAE,CAAC,CAAC;YAC1C,OAAO;QACT,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC;YAC5E,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE;SACtC,CAAC,CAAC;QAEH,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,GAAG,CAAC,OAAO,CAAC,YAAY,YAAY,EAAE,CAAC,CAAC;IAC1C,CAAC;CACF,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * `messages` — list, fetch, and follow messages.
3
+ */
4
+ import type { CommandContext } from "../types.js";
5
+ export declare const list: {
6
+ options: {
7
+ readonly platform: {
8
+ readonly type: "string";
9
+ };
10
+ readonly direction: {
11
+ readonly type: "string";
12
+ };
13
+ readonly order: {
14
+ readonly type: "string";
15
+ };
16
+ readonly "order-by": {
17
+ readonly type: "string";
18
+ };
19
+ readonly space: {
20
+ readonly type: "string";
21
+ };
22
+ readonly resource: {
23
+ readonly type: "string";
24
+ };
25
+ readonly "perspective-user": {
26
+ readonly type: "string";
27
+ };
28
+ readonly "created-since": {
29
+ readonly type: "string";
30
+ };
31
+ readonly "created-before": {
32
+ readonly type: "string";
33
+ };
34
+ readonly "updated-since": {
35
+ readonly type: "string";
36
+ };
37
+ readonly "updated-before": {
38
+ readonly type: "string";
39
+ };
40
+ readonly "exclude-content-types": {
41
+ readonly type: "string";
42
+ };
43
+ readonly "page-size": {
44
+ readonly type: "string";
45
+ };
46
+ readonly "page-token": {
47
+ readonly type: "string";
48
+ };
49
+ readonly limit: {
50
+ readonly type: "string";
51
+ };
52
+ };
53
+ run({ client, projectId, flags, out }: CommandContext): Promise<void>;
54
+ };
55
+ export declare const get: {
56
+ options: {};
57
+ run({ client, projectId, positionals, out }: CommandContext): Promise<void>;
58
+ };
59
+ export declare const watch: {
60
+ options: {
61
+ readonly platform: {
62
+ readonly type: "string";
63
+ };
64
+ readonly space: {
65
+ readonly type: "string";
66
+ };
67
+ readonly direction: {
68
+ readonly type: "string";
69
+ };
70
+ readonly interval: {
71
+ readonly type: "string";
72
+ };
73
+ readonly for: {
74
+ readonly type: "string";
75
+ };
76
+ readonly since: {
77
+ readonly type: "string";
78
+ };
79
+ };
80
+ run({ client, projectId, flags, out }: CommandContext): Promise<void>;
81
+ };
82
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/commands/messages.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAuCxE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAmB8B,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAgC5E,CAAC;AAEF,eAAO,MAAM,GAAG;;iDAGqC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAqBlF,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;2CAU6B,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAqC5E,CAAC"}