Skip to content

Commit 0748e04

Browse files
authored
fix: adding temporal binding support (#50)
* refactor: working on publishing package for connectors * feat: adding temporal binding --------- Co-authored-by: Dimy Jeannot <>
1 parent f73ae7b commit 0748e04

File tree

20 files changed

+2437
-23
lines changed

20 files changed

+2437
-23
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM gcr.io/distroless/static-debian11
2+
COPY --from=busybox:1.36.0-uclibc /bin/cp /bin/cp
3+
4+
WORKDIR /
5+
COPY v1alpha .
6+
7+
ENTRYPOINT ["/app"]
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
# Manually Deploy Docker Image
3+
4+
```bash
5+
cpln profile update jeannotcompany --login --org jeannotcompany
6+
export CPLN_PROFILE="jeannotcompany"
7+
cpln image docker-login
8+
```
9+
10+
```bash
11+
nx build workloads-public-communications-v1alpha-preference-center
12+
nx container workloads-public-communications-v1alpha-preference-center
13+
docker tag workloads/public/communications/v1alpha/preference-center:latest jeannotcompany.registry.cpln.io/communications-v1alpha-preference-center:JC-123
14+
docker push jeannotcompany.registry.cpln.io/communications-v1alpha-preference-center:JC-123
15+
cpln --org jeannotcompany --gvc local-gvc workload force-redeployment communications-v1alpha-preference-center
16+
```
17+
18+
```bash
19+
curl \
20+
--header "Content-Type: application/json" \
21+
--header "x-spec-workspace-slug:workspace123" \
22+
--header "x-spec-organization-slug:organization123" \
23+
http://localhost:6477/v1/communication/preference-center/options | jq .
24+
```
25+
26+
```bash
27+
curl \
28+
--header "Content-Type: application/json" \
29+
--header "x-spec-workspace-slug: workspace123" \
30+
--header "x-spec-organization-slug: organization123" \
31+
http://localhost:6477/v1/communication/preference-center/dimy | jq .
32+
```
33+
34+
# Get Preference Options
35+
```bash
36+
cd proto
37+
grpcurl \
38+
-protoset <(buf build -o -) -plaintext \
39+
-H "x-spec-workspace: workspace123" \
40+
-H "x-spec-organization: organization123" \
41+
-d '{}' \
42+
localhost:6477 platform.communication.v1alpha.PreferenceCenterService/GetPreferenceOptions
43+
```
44+
45+
# Create or Update Preferences
46+
```bash
47+
48+
curl -X POST \
49+
--header "Content-Type: application/json" \
50+
--header "x-spec-workspace-slug: workspace123" \
51+
--header "x-spec-organization-slug: organization123" \
52+
--header "x-spec-validate-only: true" \
53+
--header "x-spec-principal-id: djeannot" \
54+
--header "x-spec-ip: 123.0.0.0" \
55+
--header "x-spec-locale: en-us" \
56+
--header "x-spec-sent-at: 2022-12-10T04:08:31.581Z" \
57+
--header "x-spec-principal-id:12345678" \
58+
--header "x-spec-principal-email: dimy@jeannotfamily.com" \
59+
--header "x-spec-connection-id: sf-corporate" \
60+
--header "x-b3-traceid: 34bc6254cbf6c0ac2236ac7a8999ffa6" \
61+
--header "x-spec-workspace-jan: JURISDICTION_USA" \
62+
--header "x-spec-ip: 224.567.324.233" \
63+
--header "x-spec-locale: en_US" \
64+
--header "x-spec-timezone: America/New_York" \
65+
--header "x-spec-device-id: B5372DB0-C21E-11E4-8DFC-AA07A5B093DB" \
66+
--header "x-spec-device-adv-id: 7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB" \
67+
--header "x-spec-device-manufacturer: Apple" \
68+
--header "x-spec-device-model: iPhone16,2" \
69+
--header "x-spec-device-name: maguro" \
70+
--header "x-spec-device-type: ios" \
71+
--header "x-spec-device-token: ff15bc0c20c4aa6cd50854ff165fd265c838e5405bfeb9571066395b8c9da449" \
72+
--header "x-spec-city: Atlanta" \
73+
--header "x-spec-country: United States" \
74+
--header "x-spec-lat: 40.2964197" \
75+
--header "x-spec-long: -76.9411617" \
76+
--header "x-spec-speed: 0" \
77+
--header "x-spec-cellular: true" \
78+
--header "x-spec-carrier: Verizon" \
79+
--header "x-spec-os-name: iPhone OS" \
80+
--header "x-spec-os-version: 16.1.3" \
81+
--data '{"email": "dimy2@jeannot.company", "first_name": "Dimy2", "last_name": "Jeannot2", "phone_number": "770"}' \
82+
http://localhost:6477/v1/communication/preference-center | jq .
83+
84+
# Directly to Ingress
85+
curl -X POST \
86+
--header "Content-Type: application/json" \
87+
--header "x-spec-workspace-slug:workspace123" \
88+
--header "x-spec-organization-slug:organization123" \
89+
--header "x-spec-validate-only: true" \
90+
--data '{"email": "dimy2@jeannot.company", "first_name": "Dimy2", "last_name": "Jeannot2"}' \
91+
https://api.communication.dev-1.na-us-1.jeannot.company/v1/communication/preference-center | jq .
92+
93+
# Directly to Edge
94+
curl -X POST \
95+
--header "Content-Type: application/json" \
96+
--header "x-spec-apikey: 12345678" \
97+
--header "x-spec-validate-only: true" \
98+
--header "x-spec-debug: true" \
99+
--data '{"email": "dimy2@jeannot.company", "first_name": "Dimy2", "last_name": "Jeannot2"}' \
100+
https://api.communication.dev-1.jeannot.company/v1/communication/preference-center | jq .
101+
102+
103+
```
104+
105+
# Get preferences for a user
106+
```bash
107+
curl \
108+
--header "Content-Type: application/json" \
109+
--header "x-spec-workspace-slug: workspace123" \
110+
--header "x-spec-organization-slug: organization123" \
111+
http://localhost:6477/v1/communication/preference-center/7c25c3a0-0e69-4363-bf05-3df64c705320 | jq .
112+
```
113+
114+
115+
116+
cd proto
117+
grpcurl \
118+
-protoset <(buf build -o -) -plaintext \
119+
-H "x-spec-workspace: workspace123" \
120+
-H "x-spec-organization: organization123" \
121+
-d '{}' \
122+
localhost:6477 platform.communication.v1alpha.PreferenceCenterService/GetPreferenceOptions
123+
124+
125+
cd proto
126+
ghz --insecure --protoset <(buf build -o -) --call platform.audit.v2alpha.AuditService/Search --total 100000 localhost:6476
127+
128+
129+
130+
curl \
131+
--header "Content-Type: application/json" \
132+
--header "x-spec-apikey: 12987312kj13h2i371298312kj3u12i8371298371923" \
133+
http://localhost:6477/v1/communication/preference-center/options | jq .
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
module github.com/openecosystems/ecosystem/apps/connectors/poc/network-account/v1alpha
2+
3+
go 1.23.4
4+
5+
require (
6+
github.com/openecosystems/ecosystem/libs/partner/go/nats v0.0.0-20250314114941-6105506b389b
7+
github.com/openecosystems/ecosystem/libs/partner/go/nebula v0.0.0-20250314114941-6105506b389b
8+
github.com/openecosystems/ecosystem/libs/partner/go/sendgrid/v3 v3.0.0-20250313162807-9d78ed3460c3
9+
github.com/openecosystems/ecosystem/libs/partner/go/zap v0.0.0-20250314114941-6105506b389b
10+
github.com/openecosystems/ecosystem/libs/private/go/configuration/v2alpha v0.0.0-20250314114941-6105506b389b
11+
github.com/openecosystems/ecosystem/libs/public/go/sdk/v2alpha v0.0.0-20250314114941-6105506b389b
12+
github.com/openecosystems/ecosystem/libs/public/go/model v0.0.0-20250314114941-6105506b389b
13+
)
14+
15+
require (
16+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.35.1-20240920164238-5a7b106cbb87.1 // indirect
17+
connectrpc.com/connect v1.17.0 // indirect
18+
connectrpc.com/vanguard v0.3.0 // indirect
19+
dario.cat/mergo v1.0.1 // indirect
20+
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
21+
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
22+
github.com/apex/log v1.9.0 // indirect
23+
github.com/armon/go-radix v1.0.0 // indirect
24+
github.com/beorn7/perks v1.0.1 // indirect
25+
github.com/bits-and-blooms/bitset v1.13.0 // indirect
26+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
27+
github.com/cyberdelia/go-metrics-graphite v0.0.0-20161219230853-39f87cc3b432 // indirect
28+
github.com/ebitengine/purego v0.8.1 // indirect
29+
github.com/flynn/noise v1.1.0 // indirect
30+
github.com/fsnotify/fsnotify v1.8.0 // indirect
31+
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
32+
github.com/gaissmai/bart v0.11.1 // indirect
33+
github.com/getkin/kin-openapi v0.125.0 // indirect
34+
github.com/go-ole/go-ole v1.2.6 // indirect
35+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
36+
github.com/go-openapi/swag v0.23.0 // indirect
37+
github.com/go-playground/locales v0.14.1 // indirect
38+
github.com/go-playground/universal-translator v0.18.1 // indirect
39+
github.com/go-playground/validator/v10 v10.23.0 // indirect
40+
github.com/gogo/protobuf v1.3.2 // indirect
41+
github.com/google/btree v1.1.2 // indirect
42+
github.com/google/gopacket v1.1.19 // indirect
43+
github.com/google/uuid v1.6.0 // indirect
44+
github.com/hashicorp/hcl v1.0.0 // indirect
45+
github.com/iancoleman/strcase v0.3.0 // indirect
46+
github.com/invopop/yaml v0.3.1 // indirect
47+
github.com/joho/godotenv v1.5.1 // indirect
48+
github.com/josharian/intern v1.0.0 // indirect
49+
github.com/klauspost/compress v1.17.9 // indirect
50+
github.com/leodido/go-urn v1.4.0 // indirect
51+
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
52+
github.com/magiconair/properties v1.8.7 // indirect
53+
github.com/mailru/easyjson v0.7.7 // indirect
54+
github.com/mennanov/fmutils v0.3.0 // indirect
55+
github.com/miekg/dns v1.1.61 // indirect
56+
github.com/minio/highwayhash v1.0.3 // indirect
57+
github.com/mitchellh/go-homedir v1.1.0 // indirect
58+
github.com/mitchellh/mapstructure v1.5.0 // indirect
59+
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
60+
github.com/nats-io/jwt/v2 v2.5.8 // indirect
61+
github.com/nats-io/nats-server/v2 v2.10.20 // indirect
62+
github.com/nats-io/nats.go v1.37.0 // indirect
63+
github.com/nats-io/nkeys v0.4.7 // indirect
64+
github.com/nats-io/nuid v1.0.1 // indirect
65+
github.com/nbrownus/go-metrics-prometheus v0.0.0-20210712211119-974a6260965f // indirect
66+
github.com/oapi-codegen/oapi-codegen/v2 v2.3.0 // indirect
67+
github.com/oapi-codegen/runtime v1.1.1 // indirect
68+
github.com/openecosystems/ecosystem/libs/poc/go/protobuf v0.0.0-20250314114941-6105506b389b // indirect
69+
github.com/openecosystems/ecosystem/libs/private/go/protobuf v0.0.0-20250314114941-6105506b389b // indirect
70+
github.com/openecosystems/ecosystem/libs/protobuf/go/protobuf v0.0.0-20250314114941-6105506b389b // indirect
71+
github.com/openecosystems/ecosystem/libs/public/go/protobuf v0.0.0-20250314114941-6105506b389b // indirect
72+
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
73+
github.com/perimeterx/marshmallow v1.1.5 // indirect
74+
github.com/pkg/errors v0.9.1 // indirect
75+
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
76+
github.com/prometheus/client_golang v1.19.1 // indirect
77+
github.com/prometheus/client_model v0.5.0 // indirect
78+
github.com/prometheus/common v0.48.0 // indirect
79+
github.com/prometheus/procfs v0.12.0 // indirect
80+
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
81+
github.com/sagikazarmark/locafero v0.4.0 // indirect
82+
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
83+
github.com/segmentio/ksuid v1.0.4 // indirect
84+
github.com/shirou/gopsutil/v4 v4.24.11 // indirect
85+
github.com/sirupsen/logrus v1.9.3 // indirect
86+
github.com/slackhq/nebula v1.9.5 // indirect
87+
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 // indirect
88+
github.com/sourcegraph/conc v0.3.0 // indirect
89+
github.com/spf13/afero v1.11.0 // indirect
90+
github.com/spf13/cast v1.6.0 // indirect
91+
github.com/spf13/pflag v1.0.5 // indirect
92+
github.com/spf13/viper v1.19.0 // indirect
93+
github.com/subosito/gotenv v1.6.0 // indirect
94+
github.com/tklauser/go-sysconf v0.3.12 // indirect
95+
github.com/tklauser/numcpus v0.6.1 // indirect
96+
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
97+
github.com/vishvananda/netns v0.0.4 // indirect
98+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
99+
go.uber.org/multierr v1.10.0 // indirect
100+
go.uber.org/zap v1.27.0 // indirect
101+
golang.org/x/crypto v0.29.0 // indirect
102+
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
103+
golang.org/x/mod v0.21.0 // indirect
104+
golang.org/x/net v0.31.0 // indirect
105+
golang.org/x/sync v0.9.0 // indirect
106+
golang.org/x/sys v0.27.0 // indirect
107+
golang.org/x/term v0.26.0 // indirect
108+
golang.org/x/text v0.20.0 // indirect
109+
golang.org/x/time v0.6.0 // indirect
110+
golang.org/x/tools v0.26.0 // indirect
111+
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
112+
golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect
113+
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
114+
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
115+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
116+
google.golang.org/grpc v1.68.0 // indirect
117+
google.golang.org/protobuf v1.36.1 // indirect
118+
gopkg.in/ini.v1 v1.67.0 // indirect
119+
gopkg.in/yaml.v2 v2.4.0 // indirect
120+
gopkg.in/yaml.v3 v3.0.1 // indirect
121+
gvisor.dev/gvisor v0.0.0-20240423190808-9d7a357edefe // indirect
122+
)

0 commit comments

Comments
 (0)