@rangka-os/create 0.5.0-alpha.25 → 0.5.0-alpha.27
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/package.json +1 -1
- package/template/base/connectors/email/connector.rk +144 -0
- package/template/base/connectors/email/fixtures/email_received.json +33 -0
- package/template/base/connectors/email/fixtures/email_received_reply.json +31 -0
- package/template/base/connectors/email/fixtures/expect.json +20 -0
- package/template/base/connectors/email/fixtures/fetch_email.json +66 -0
- package/template/base/connectors/email/fixtures/send_email.json +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rangka-os/create",
|
|
3
|
-
"version": "0.5.0-alpha.
|
|
3
|
+
"version": "0.5.0-alpha.27",
|
|
4
4
|
"description": "Start a Rangka OS project: npm create @rangka-os@latest my-shop",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"homepage": "https://rangka-os.github.io/rangka-os/guide/quick-start",
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/connector.json
|
|
2
|
+
# Email: the business's own mailbox. New mail is read over IMAP (or POP3) and replies go out over SMTP, with the
|
|
3
|
+
# user name and password (or app password) of that mailbox. Works with any provider that offers IMAP/POP3 and SMTP:
|
|
4
|
+
# the domain's hosting (cPanel, Niagahoster, Rumahweb), Google Workspace and Gmail (with an app password),
|
|
5
|
+
# Microsoft 365, Zoho Mail.
|
|
6
|
+
# Needs rangka-os contract 0068 (mail connectors): the mail: block and mail: actions are run by the kernel, not by HTTP.
|
|
7
|
+
# - Every connection is encrypted: tls (implicit, ports 993/995/465) or starttls (143/110/587); certificates are
|
|
8
|
+
# checked and there is no plain-text mode.
|
|
9
|
+
# - The first poll only notes where the mailbox is: mail already there is not replayed into flows.
|
|
10
|
+
# - Nothing is deleted on the server. IMAP reads with BODY.PEEK (mail stays unread unless mark_seen is true); POP3
|
|
11
|
+
# never sends DELE.
|
|
12
|
+
# - Attachments are kept in Rangka's attachments store; the event carries their ids.
|
|
13
|
+
# fixtures/ are synthetic (no real mailbox): the kernel's fetch answer and the event it emits.
|
|
14
|
+
name: email
|
|
15
|
+
label: {id: Email (IMAP/SMTP), en: Email (IMAP/SMTP)}
|
|
16
|
+
summary:
|
|
17
|
+
id: Terima dan kirim email lewat kotak masuk bisnismu (IMAP/POP3 dan SMTP).
|
|
18
|
+
en: Receive and send email through your business mailbox (IMAP/POP3 and SMTP).
|
|
19
|
+
category: messaging
|
|
20
|
+
icon: mail-line
|
|
21
|
+
version: 0.1.0
|
|
22
|
+
docs: https://www.rfc-editor.org/rfc/rfc9051
|
|
23
|
+
auth:
|
|
24
|
+
type: basic
|
|
25
|
+
fields:
|
|
26
|
+
- name: username
|
|
27
|
+
label: {id: Nama pengguna}
|
|
28
|
+
help: {id: 'Biasanya alamat email lengkap, misalnya toko@usahamu.id'}
|
|
29
|
+
- name: password
|
|
30
|
+
label: {id: Kata sandi}
|
|
31
|
+
secret: true
|
|
32
|
+
help: {id: 'Untuk Gmail dan Microsoft 365 pakai sandi aplikasi (app password), bukan sandi login'}
|
|
33
|
+
- name: from_address
|
|
34
|
+
label: {id: Alamat pengirim}
|
|
35
|
+
help: {id: Alamat yang tampil sebagai pengirim email keluar}
|
|
36
|
+
- name: from_name
|
|
37
|
+
label: {id: Nama pengirim}
|
|
38
|
+
required: false
|
|
39
|
+
help: {id: Misalnya nama usahamu}
|
|
40
|
+
- name: receive_protocol
|
|
41
|
+
label: {id: Cara menerima}
|
|
42
|
+
required: false
|
|
43
|
+
help: {id: imap (disarankan) atau pop3. Kosong berarti imap}
|
|
44
|
+
- name: receive_host
|
|
45
|
+
label: {id: Server email masuk}
|
|
46
|
+
required: false
|
|
47
|
+
help: {id: 'Misalnya imap.gmail.com, outlook.office365.com atau mail.usahamu.id'}
|
|
48
|
+
- name: receive_port
|
|
49
|
+
label: {id: Port email masuk}
|
|
50
|
+
required: false
|
|
51
|
+
help: {id: Kosong berarti 993 (IMAP) atau 995 (POP3)}
|
|
52
|
+
- name: receive_tls
|
|
53
|
+
label: {id: Enkripsi email masuk}
|
|
54
|
+
required: false
|
|
55
|
+
help: {id: tls (bawaan) atau starttls}
|
|
56
|
+
- name: folder
|
|
57
|
+
label: {id: Folder}
|
|
58
|
+
required: false
|
|
59
|
+
help: {id: Folder IMAP yang dibaca. Kosong berarti INBOX}
|
|
60
|
+
- name: mark_seen
|
|
61
|
+
label: {id: Tandai sudah dibaca}
|
|
62
|
+
required: false
|
|
63
|
+
help: {id: true menandai email yang sudah diambil sebagai dibaca (IMAP). Kosong berarti tidak}
|
|
64
|
+
- name: smtp_host
|
|
65
|
+
label: {id: Server email keluar (SMTP)}
|
|
66
|
+
required: false
|
|
67
|
+
help: {id: 'Misalnya smtp.gmail.com, smtp.office365.com atau mail.usahamu.id'}
|
|
68
|
+
- name: smtp_port
|
|
69
|
+
label: {id: Port SMTP}
|
|
70
|
+
required: false
|
|
71
|
+
help: {id: Kosong berarti 465 (tls) atau 587 (starttls)}
|
|
72
|
+
- name: smtp_tls
|
|
73
|
+
label: {id: Enkripsi SMTP}
|
|
74
|
+
required: false
|
|
75
|
+
help: {id: tls (bawaan) atau starttls. Microsoft 365 memakai starttls di port 587}
|
|
76
|
+
mail:
|
|
77
|
+
receive:
|
|
78
|
+
protocol: '{auth.receive_protocol}'
|
|
79
|
+
host: '{auth.receive_host}'
|
|
80
|
+
port: '{auth.receive_port}'
|
|
81
|
+
tls: '{auth.receive_tls}'
|
|
82
|
+
folder: '{auth.folder}'
|
|
83
|
+
mark_seen: '{auth.mark_seen}'
|
|
84
|
+
send:
|
|
85
|
+
host: '{auth.smtp_host}'
|
|
86
|
+
port: '{auth.smtp_port}'
|
|
87
|
+
tls: '{auth.smtp_tls}'
|
|
88
|
+
username: '{auth.username}'
|
|
89
|
+
password: '{auth.password}'
|
|
90
|
+
from: '{auth.from_address}'
|
|
91
|
+
from_name: '{auth.from_name}'
|
|
92
|
+
triggers:
|
|
93
|
+
# Every 2 minutes the kernel reads the mail after the cursor (an IMAP UID, or the POP3 UIDLs seen), at most 25 per
|
|
94
|
+
# poll, oldest first. An event is the message as it arrived; a message read again (a lost cursor) emits the same
|
|
95
|
+
# event and the kernel drops it. Flows that create records set idempotency: event.message_id.
|
|
96
|
+
- name: email_received
|
|
97
|
+
label: {id: Email masuk}
|
|
98
|
+
via: poll
|
|
99
|
+
every: 2m
|
|
100
|
+
action: fetch_email
|
|
101
|
+
input: {cursor: cursor}
|
|
102
|
+
cursor: cursor
|
|
103
|
+
for_each: 'messages[]'
|
|
104
|
+
emit:
|
|
105
|
+
message_id: item.message_id
|
|
106
|
+
from: item.from
|
|
107
|
+
from_name: item.from_name
|
|
108
|
+
to: item.to
|
|
109
|
+
cc: item.cc
|
|
110
|
+
reply_to: item.reply_to
|
|
111
|
+
subject: item.subject
|
|
112
|
+
text: item.text
|
|
113
|
+
html: item.html
|
|
114
|
+
date: item.date
|
|
115
|
+
in_reply_to: item.in_reply_to
|
|
116
|
+
references: item.references
|
|
117
|
+
# [{id, filename, content_type, size, sha256, url}]; a part too large or not kept has skipped: instead of id
|
|
118
|
+
attachments: item.attachments
|
|
119
|
+
truncated: item.truncated
|
|
120
|
+
actions:
|
|
121
|
+
- name: fetch_email
|
|
122
|
+
label: {id: Ambil email baru}
|
|
123
|
+
mail: fetch
|
|
124
|
+
input:
|
|
125
|
+
- {name: cursor, label: {id: Posisi terakhir}}
|
|
126
|
+
- name: send_email
|
|
127
|
+
label: {id: Kirim email}
|
|
128
|
+
mail: send
|
|
129
|
+
input:
|
|
130
|
+
- {name: to, label: {id: Kepada}, required: true, help: {id: Satu alamat atau daftar alamat}}
|
|
131
|
+
- {name: cc, label: {id: Tembusan}}
|
|
132
|
+
- {name: bcc, label: {id: Tembusan tersembunyi}}
|
|
133
|
+
- {name: subject, label: {id: Subjek}, required: true}
|
|
134
|
+
- {name: text, label: {id: Isi (teks)}}
|
|
135
|
+
- {name: html, label: {id: Isi (HTML)}}
|
|
136
|
+
- {name: reply_to, label: {id: Balas ke}}
|
|
137
|
+
- {name: in_reply_to, label: {id: Membalas email}, help: {id: 'message_id email yang dibalas, agar masuk ke utas yang sama'}}
|
|
138
|
+
- {name: references, label: {id: Rujukan utas}}
|
|
139
|
+
- {name: attachments, label: {id: Lampiran}, help: {id: Daftar id lampiran Rangka}}
|
|
140
|
+
output:
|
|
141
|
+
message_id: message_id
|
|
142
|
+
recipients: recipients
|
|
143
|
+
# SMTP 4xx replies and network errors are retried; 5xx (a refused address, a wrong password) are not
|
|
144
|
+
retry: {max: 5, backoff: exponential}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"item": {
|
|
3
|
+
"message_id": "po-0077@pelanggan-contoh.id",
|
|
4
|
+
"from": "budi@pelanggan-contoh.id",
|
|
5
|
+
"from_name": "Budi Contoh",
|
|
6
|
+
"to": [
|
|
7
|
+
"toko@kopi-contoh.id"
|
|
8
|
+
],
|
|
9
|
+
"cc": [
|
|
10
|
+
"sari@kopi-contoh.id"
|
|
11
|
+
],
|
|
12
|
+
"reply_to": [],
|
|
13
|
+
"subject": "PO 77: kopi arabika 10 kg",
|
|
14
|
+
"date": "2026-11-17T02:30:00Z",
|
|
15
|
+
"in_reply_to": "",
|
|
16
|
+
"references": [],
|
|
17
|
+
"text": "Halo, terlampir PO 77 untuk 10 kg arabika. Mohon konfirmasi.\n",
|
|
18
|
+
"html": "<p>Halo, terlampir PO 77 untuk 10 kg arabika. Mohon konfirmasi.</p>",
|
|
19
|
+
"truncated": false,
|
|
20
|
+
"attachments": [
|
|
21
|
+
{
|
|
22
|
+
"id": "att_0123456789abcdef0123",
|
|
23
|
+
"filename": "po-77.pdf",
|
|
24
|
+
"content_type": "application/pdf",
|
|
25
|
+
"size": 18234,
|
|
26
|
+
"sha256": "5f3c0de1a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a7b9c1d3e5f7a9b1c3d5",
|
|
27
|
+
"url": "/api/v1/attachments/att_0123456789abcdef0123"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"uid": "4812",
|
|
31
|
+
"size": 27410
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"item": {
|
|
3
|
+
"message_id": "re-0077@pelanggan-contoh.id",
|
|
4
|
+
"from": "budi@pelanggan-contoh.id",
|
|
5
|
+
"from_name": "Budi Contoh",
|
|
6
|
+
"to": [
|
|
7
|
+
"toko@kopi-contoh.id"
|
|
8
|
+
],
|
|
9
|
+
"cc": [],
|
|
10
|
+
"reply_to": [],
|
|
11
|
+
"subject": "Re: Konfirmasi PO 77",
|
|
12
|
+
"date": "2026-11-17T02:30:00Z",
|
|
13
|
+
"in_reply_to": "3f9a0c1d2e4b6a8c0e1f2a3b@kopi-contoh.id",
|
|
14
|
+
"references": [
|
|
15
|
+
"3f9a0c1d2e4b6a8c0e1f2a3b@kopi-contoh.id"
|
|
16
|
+
],
|
|
17
|
+
"text": "Oke, ditunggu pengirimannya.\n",
|
|
18
|
+
"html": "",
|
|
19
|
+
"truncated": false,
|
|
20
|
+
"attachments": [
|
|
21
|
+
{
|
|
22
|
+
"filename": "foto-gudang.mov",
|
|
23
|
+
"content_type": "video/quicktime",
|
|
24
|
+
"size": 41943040,
|
|
25
|
+
"skipped": "too_large"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"uid": "4813",
|
|
29
|
+
"size": 41960112
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"email_received.json": {
|
|
3
|
+
"message_id": "po-0077@pelanggan-contoh.id",
|
|
4
|
+
"from": "budi@pelanggan-contoh.id",
|
|
5
|
+
"from_name": "Budi Contoh",
|
|
6
|
+
"subject": "PO 77: kopi arabika 10 kg",
|
|
7
|
+
"date": "2026-11-17T02:30:00Z",
|
|
8
|
+
"in_reply_to": "",
|
|
9
|
+
"truncated": false
|
|
10
|
+
},
|
|
11
|
+
"email_received_reply.json": {
|
|
12
|
+
"message_id": "re-0077@pelanggan-contoh.id",
|
|
13
|
+
"in_reply_to": "3f9a0c1d2e4b6a8c0e1f2a3b@kopi-contoh.id",
|
|
14
|
+
"html": ""
|
|
15
|
+
},
|
|
16
|
+
"send_email.json": {
|
|
17
|
+
"message_id": "3f9a0c1d2e4b6a8c0e1f2a3b@kopi-contoh.id",
|
|
18
|
+
"recipients": 2
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"messages": [
|
|
3
|
+
{
|
|
4
|
+
"message_id": "po-0077@pelanggan-contoh.id",
|
|
5
|
+
"from": "budi@pelanggan-contoh.id",
|
|
6
|
+
"from_name": "Budi Contoh",
|
|
7
|
+
"to": [
|
|
8
|
+
"toko@kopi-contoh.id"
|
|
9
|
+
],
|
|
10
|
+
"cc": [
|
|
11
|
+
"sari@kopi-contoh.id"
|
|
12
|
+
],
|
|
13
|
+
"reply_to": [],
|
|
14
|
+
"subject": "PO 77: kopi arabika 10 kg",
|
|
15
|
+
"date": "2026-11-17T02:30:00Z",
|
|
16
|
+
"in_reply_to": "",
|
|
17
|
+
"references": [],
|
|
18
|
+
"text": "Halo, terlampir PO 77 untuk 10 kg arabika. Mohon konfirmasi.\n",
|
|
19
|
+
"html": "<p>Halo, terlampir PO 77 untuk 10 kg arabika. Mohon konfirmasi.</p>",
|
|
20
|
+
"truncated": false,
|
|
21
|
+
"attachments": [
|
|
22
|
+
{
|
|
23
|
+
"id": "att_0123456789abcdef0123",
|
|
24
|
+
"filename": "po-77.pdf",
|
|
25
|
+
"content_type": "application/pdf",
|
|
26
|
+
"size": 18234,
|
|
27
|
+
"sha256": "5f3c0de1a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a7b9c1d3e5f7a9b1c3d5",
|
|
28
|
+
"url": "/api/v1/attachments/att_0123456789abcdef0123"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"uid": "4812",
|
|
32
|
+
"size": 27410
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"message_id": "re-0077@pelanggan-contoh.id",
|
|
36
|
+
"from": "budi@pelanggan-contoh.id",
|
|
37
|
+
"from_name": "Budi Contoh",
|
|
38
|
+
"to": [
|
|
39
|
+
"toko@kopi-contoh.id"
|
|
40
|
+
],
|
|
41
|
+
"cc": [],
|
|
42
|
+
"reply_to": [],
|
|
43
|
+
"subject": "Re: Konfirmasi PO 77",
|
|
44
|
+
"date": "2026-11-17T02:30:00Z",
|
|
45
|
+
"in_reply_to": "3f9a0c1d2e4b6a8c0e1f2a3b@kopi-contoh.id",
|
|
46
|
+
"references": [
|
|
47
|
+
"3f9a0c1d2e4b6a8c0e1f2a3b@kopi-contoh.id"
|
|
48
|
+
],
|
|
49
|
+
"text": "Oke, ditunggu pengirimannya.\n",
|
|
50
|
+
"html": "",
|
|
51
|
+
"truncated": false,
|
|
52
|
+
"attachments": [
|
|
53
|
+
{
|
|
54
|
+
"filename": "foto-gudang.mov",
|
|
55
|
+
"content_type": "video/quicktime",
|
|
56
|
+
"size": 41943040,
|
|
57
|
+
"skipped": "too_large"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"uid": "4813",
|
|
61
|
+
"size": 41960112
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"cursor": "imap:1731800000:4813:INBOX",
|
|
65
|
+
"baseline": false
|
|
66
|
+
}
|