@yaks/phone 0.0.0-stage → 0.2.36

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 (81) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +251 -2
  3. package/_dist/call.d.ts +37 -0
  4. package/_dist/call.d.ts.map +1 -0
  5. package/_dist/effects.d.ts +5 -0
  6. package/_dist/effects.d.ts.map +1 -0
  7. package/_dist/mobile.d.ts +41 -0
  8. package/_dist/mobile.d.ts.map +1 -0
  9. package/_dist/mod.d.ts +27 -0
  10. package/_dist/mod.d.ts.map +1 -0
  11. package/_dist/numbers.d.ts +150 -0
  12. package/_dist/numbers.d.ts.map +1 -0
  13. package/_dist/options.d.ts +21 -0
  14. package/_dist/options.d.ts.map +1 -0
  15. package/_dist/plugin.d.ts +54 -0
  16. package/_dist/plugin.d.ts.map +1 -0
  17. package/_dist/provider.d.ts +72 -0
  18. package/_dist/provider.d.ts.map +1 -0
  19. package/_dist/received.d.ts +24 -0
  20. package/_dist/received.d.ts.map +1 -0
  21. package/_dist/replies.d.ts +18 -0
  22. package/_dist/replies.d.ts.map +1 -0
  23. package/_dist/send.d.ts +16 -0
  24. package/_dist/send.d.ts.map +1 -0
  25. package/_dist/stash.d.ts +19 -0
  26. package/_dist/stash.d.ts.map +1 -0
  27. package/_dist/text.d.ts +102 -0
  28. package/_dist/text.d.ts.map +1 -0
  29. package/_dist/tools.d.ts +3 -0
  30. package/_dist/tools.d.ts.map +1 -0
  31. package/_dist/vocab.d.ts +8 -0
  32. package/_dist/vocab.d.ts.map +1 -0
  33. package/call.js +5 -0
  34. package/call.js.map +1 -0
  35. package/call.ts +53 -0
  36. package/deno.json +1 -0
  37. package/effects.js +30 -0
  38. package/effects.js.map +1 -0
  39. package/effects.ts +35 -0
  40. package/mobile.js +75 -0
  41. package/mobile.js.map +1 -0
  42. package/mobile.ts +72 -0
  43. package/mod.js +28 -0
  44. package/mod.js.map +1 -0
  45. package/mod.ts +78 -0
  46. package/numbers.js +72 -0
  47. package/numbers.js.map +1 -0
  48. package/numbers.ts +259 -0
  49. package/options.js +3 -0
  50. package/options.js.map +1 -0
  51. package/options.ts +23 -0
  52. package/package.json +44 -4
  53. package/plugin.js +155 -0
  54. package/plugin.js.map +1 -0
  55. package/plugin.ts +226 -0
  56. package/provider.js +48 -0
  57. package/provider.js.map +1 -0
  58. package/provider.ts +119 -0
  59. package/received.js +72 -0
  60. package/received.js.map +1 -0
  61. package/received.ts +76 -0
  62. package/recipients.js +58 -0
  63. package/replies.js +23 -0
  64. package/replies.js.map +1 -0
  65. package/replies.ts +38 -0
  66. package/send.js +136 -0
  67. package/send.js.map +1 -0
  68. package/send.ts +131 -0
  69. package/stash.js +26 -0
  70. package/stash.js.map +1 -0
  71. package/stash.ts +41 -0
  72. package/text.js +127 -0
  73. package/text.js.map +1 -0
  74. package/text.ts +192 -0
  75. package/tools.js +62 -0
  76. package/tools.js.map +1 -0
  77. package/tools.ts +55 -0
  78. package/vocab.js +18 -0
  79. package/vocab.js.map +1 -0
  80. package/vocab.json +245 -0
  81. package/vocab.ts +19 -0
package/vocab.json ADDED
@@ -0,0 +1,245 @@
1
+ {
2
+ "$id": "urn:uuid:7a3e7e12-be9b-4b8e-b587-3c8b2a8023e7",
3
+ "$vocabulary": {
4
+ "https://yak.sh/vocab/core": true
5
+ },
6
+ "title": "phone",
7
+ "$defs": {
8
+ "phone": {
9
+ "$id": "urn:uuid:e29a5cd9-71c6-4eb6-87c7-1409e45aa1ee",
10
+ "component": true,
11
+ "type": "object",
12
+ "description": "a phone number, as a component of what it reaches \u2014 on a person, their mobile, beside the `email{address}` they wear",
13
+ "properties": {
14
+ "number": {
15
+ "$id": "urn:uuid:f00536ce-3037-4020-b595-28fe70177404",
16
+ "type": "string",
17
+ "description": "the number in E.164 form (see `mobile`)",
18
+ "examples": [
19
+ "+12695550142"
20
+ ]
21
+ }
22
+ }
23
+ },
24
+ "own_number": {
25
+ "$id": "urn:uuid:13890af2-1192-430b-88a6-c9c66a4a23c3",
26
+ "component": true,
27
+ "type": "object",
28
+ "description": "a number held by a person's own account at a phone provider, as it was listed when they connected it: what it is called there, whether it texts, where its texts went before its host pointed them at itself, and the 10DLC campaign it texts many people under. Its eid is derived from its connection and number",
29
+ "properties": {
30
+ "connection": {
31
+ "$id": "urn:uuid:95c0633d-f6a4-4d00-ad85-675008497f1d",
32
+ "type": "string",
33
+ "ref": "entity",
34
+ "death": "cascade",
35
+ "identity": true,
36
+ "description": "the connection to the account that holds it"
37
+ },
38
+ "number": {
39
+ "$id": "urn:uuid:759a76c7-a75c-4717-b010-16cafd242b36",
40
+ "type": "string",
41
+ "identity": true,
42
+ "description": "the number in E.164 form",
43
+ "examples": [
44
+ "+12695550100"
45
+ ]
46
+ },
47
+ "sms": {
48
+ "$id": "urn:uuid:03f68a64-cdb9-493c-80b4-99cc744b3f82",
49
+ "type": "boolean",
50
+ "description": "whether it sends and receives texts"
51
+ },
52
+ "label": {
53
+ "$id": "urn:uuid:50565f5a-529d-43a4-a06b-5cc57e7d089b",
54
+ "type": "string",
55
+ "description": "what the account calls it, as the person named it there",
56
+ "examples": [
57
+ "Church line"
58
+ ]
59
+ },
60
+ "callback": {
61
+ "$id": "urn:uuid:857ea0ba-2db7-48a7-b713-8bc1d9db0bee",
62
+ "type": "string",
63
+ "description": "the URL its texts were sent to before its host pointed them at itself; absent when none was. They go back there when the number stops taking texts in"
64
+ },
65
+ "pointed": {
66
+ "$id": "urn:uuid:ae5536f3-8594-4d05-ab79-d39021559c4a",
67
+ "type": "boolean",
68
+ "description": "whether the carrier last had this connection's SMS callback, or the host tried to set it and has yet to confirm the result"
69
+ },
70
+ "campaign": {
71
+ "$id": "urn:uuid:76bb1e22-6235-46f2-aa81-de33b23348eb",
72
+ "type": "string",
73
+ "description": "the 10DLC campaign id its texts to many people are registered under, recorded once the provider approved it; absent until then, while carriers block those texts",
74
+ "examples": [
75
+ "CX7Y2ZQ"
76
+ ]
77
+ }
78
+ }
79
+ },
80
+ "keyword_replies": {
81
+ "$id": "urn:uuid:0964ba95-9272-45a1-bbfe-4eaf874ac1ae",
82
+ "component": true,
83
+ "type": "object",
84
+ "description": "the words a number answers carrier keywords with, as its 10DLC campaign registers them, on the row that holds the number beside its campaign. A keyword with no words here is answered in defaults naming the number's space (`replies`)",
85
+ "properties": {
86
+ "start": {
87
+ "$id": "urn:uuid:08f7f5e6-6ced-4b94-aa2e-b8adea38a189",
88
+ "type": "string",
89
+ "description": "the opt-in confirmation, answered to JOIN, START or YES",
90
+ "examples": [
91
+ "Locust Grove Church: You're signed up for church texts. Msg frequency varies. Msg&data rates may apply. Reply HELP for help, STOP to opt out."
92
+ ]
93
+ },
94
+ "stop": {
95
+ "$id": "urn:uuid:cce8d978-60e5-486f-ac00-c5414e3128f9",
96
+ "type": "string",
97
+ "description": "the opt-out confirmation, answered to STOP, END, CANCEL, UNSUBSCRIBE or QUIT"
98
+ },
99
+ "help": {
100
+ "$id": "urn:uuid:37594180-25f6-4662-b76f-d8143348cfe7",
101
+ "type": "string",
102
+ "description": "who is texting and how to reach them, answered to HELP or INFO"
103
+ }
104
+ }
105
+ },
106
+ "sms_consent": {
107
+ "$id": "urn:uuid:0cc16a71-cb2c-436b-9651-05ebab86e8ae",
108
+ "component": true,
109
+ "type": "object",
110
+ "description": "a person agreed to be texted at their `phone{number}`, in these words; removed when they stop texts; in an app, read only by its owners and editors, whatever the app's access",
111
+ "readers": "editor",
112
+ "properties": {
113
+ "person": {
114
+ "$id": "urn:uuid:76730d55-862d-4fd7-83fe-b0c95144dcf9",
115
+ "type": "string",
116
+ "ref": "entity",
117
+ "death": "cascade",
118
+ "identity": true,
119
+ "description": "who agreed; the eid is derived from it, so a person has one consent"
120
+ },
121
+ "consent": {
122
+ "$id": "urn:uuid:fbd3e51c-fae1-4d41-9a59-312616b44256",
123
+ "type": "string",
124
+ "description": "the words they agreed to, exactly as they were shown"
125
+ },
126
+ "source": {
127
+ "$id": "urn:uuid:05439f0d-b240-4cdf-9fc7-a7ab663d7ecd",
128
+ "type": "string",
129
+ "ref": "entity",
130
+ "death": "keep",
131
+ "description": "the conversation entry or authenticated form confirmation that gave this consent"
132
+ },
133
+ "at": {
134
+ "$id": "urn:uuid:c19c0a62-6b94-4d81-83a6-fc74a559f67b",
135
+ "type": "string",
136
+ "format": "date-time",
137
+ "description": "when they agreed"
138
+ },
139
+ "space": {
140
+ "$id": "urn:uuid:7451bd6f-b24a-426e-98f9-a2e7a06e6665",
141
+ "type": "string",
142
+ "ref": "entity",
143
+ "death": "keep",
144
+ "description": "the space whose Operator texts them: the one they agreed on, and where a text from them goes"
145
+ }
146
+ }
147
+ },
148
+ "text": {
149
+ "$id": "urn:uuid:a5d13d52-0637-42de-9a56-20ecbe72a539",
150
+ "component": true,
151
+ "type": "object",
152
+ "description": "one SMS or RCS text message, sent or received; its words are `doc{body}`. One with @yaks/mail's `deliver{to}` asks to be sent to the `phone{number}` of `deliver.to`, and its outcome is `delivered` or `bounced`; in an app, read only by its owners and editors, whatever the app's access",
153
+ "readers": "editor",
154
+ "properties": {
155
+ "from": {
156
+ "$id": "urn:uuid:6446f986-f863-4296-bbd9-c1c87dda45e6",
157
+ "type": "string",
158
+ "description": "the number it came from, in E.164 form; on one sent, the number it left from, written once it leaves (absent before, when it goes from the sender's own)",
159
+ "examples": [
160
+ "+12695550142"
161
+ ]
162
+ },
163
+ "to": {
164
+ "$id": "urn:uuid:e414defd-678f-4d52-99e0-81f6d0036ce7",
165
+ "type": "string",
166
+ "description": "the number it went to, or the RCS agent's id for an RCS text that arrived; on an outbound text this can be set before sending to require that exact number on the consenting recipient",
167
+ "examples": [
168
+ "+12695550100"
169
+ ]
170
+ },
171
+ "at": {
172
+ "$id": "urn:uuid:3942a3ed-a606-4d53-a841-b01f2875e1ab",
173
+ "type": "string",
174
+ "format": "date-time",
175
+ "description": "when it arrived"
176
+ },
177
+ "message_id": {
178
+ "$id": "urn:uuid:ed9eebd4-9c2f-4f68-98ca-21da82189701",
179
+ "type": "string",
180
+ "description": "the provider's id for it: read from one that arrived, or returned by the sender for one that left"
181
+ },
182
+ "rcs": {
183
+ "$id": "urn:uuid:9c1f0032-3e08-47b6-8bba-19af0d82a630",
184
+ "type": "boolean",
185
+ "description": "whether it came, or goes, as RCS rather than SMS"
186
+ },
187
+ "via": {
188
+ "$id": "urn:uuid:95e871b7-a5f6-45b2-ba6e-4bb278c72459",
189
+ "type": "string",
190
+ "description": "The transport that carried the message, scoping its opaque message_id."
191
+ }
192
+ }
193
+ },
194
+ "text_post": {
195
+ "effect": true,
196
+ "created": [
197
+ "text",
198
+ "deliver"
199
+ ],
200
+ "target": ".text",
201
+ "tries": 6,
202
+ "description": "Hand an outbound text to the sender and record its outcome. A send the sender knows never left is tried again."
203
+ },
204
+ "sender": {
205
+ "$id": "urn:uuid:7dce26e3-24e2-4108-9581-a2ab08b943c3",
206
+ "component": true,
207
+ "type": "object",
208
+ "description": "The phone provider selected for this entity; its sending number is phone{number}. Without one the host selection applies. Credentials belong to the host.",
209
+ "properties": {
210
+ "via": {
211
+ "$id": "urn:uuid:8debb673-22e9-4439-abf6-9e97fa6833bf",
212
+ "type": "string",
213
+ "description": "The phone provider, such as telnyx, voipms or pinnacle."
214
+ }
215
+ }
216
+ },
217
+ "text_send": {
218
+ "tool": true,
219
+ "noun": "text",
220
+ "verb": "send",
221
+ "title": "Text a person",
222
+ "description": "Text a person who agreed to be texted, from this graph's own number, through the sender its config names. `to` is the id or name of a person here who wears a `phone{number}` and an `sms_consent`, or that number; anyone else is refused. Their reply arrives as a `text` from their number and is told to the session that texted them. The text goes asynchronously and `delivered` or `bounced` is written onto it; read it again for its outcome. A sent text cannot be recalled.",
223
+ "input": {
224
+ "to": {
225
+ "type": "string",
226
+ "description": "the person's id or name, or their number"
227
+ },
228
+ "body": {
229
+ "type": "string",
230
+ "description": "the words of the text",
231
+ "short": "b"
232
+ }
233
+ },
234
+ "required": [
235
+ "to",
236
+ "body"
237
+ ],
238
+ "openWorld": true,
239
+ "positional": [
240
+ "to",
241
+ "body"
242
+ ]
243
+ }
244
+ }
245
+ }
package/vocab.ts ADDED
@@ -0,0 +1,19 @@
1
+ // The component declarations, and nothing else: the module a server or a
2
+ // browser page imports at `@yaks/phone/vocab`. It reaches no storage, no SQL
3
+ // and no runtime.
4
+
5
+ import type { VocabDoc } from 'jsr:@yaks/vocab@0.2.36'
6
+ import doc from './vocab.json' with { type: 'json' }
7
+ import manifest from './package.json' with { type: 'json' }
8
+
9
+ /** The phone vocabulary: `phone{number}`, `sms_consent{person, consent,
10
+ * at, space}` and `text{from, to, at, message_id, rcs}`, in the form
11
+ * `loadVocab` accepts. */
12
+ export let phoneDoc: VocabDoc = doc as VocabDoc
13
+
14
+ /** What this package is: its manifest's description, the one place it is
15
+ * written, which a host stamps on each document here. */
16
+ export let description: string = manifest.description
17
+
18
+ /** Every document this package declares. */
19
+ export let docs: VocabDoc[] = [phoneDoc]