@dailydotdev/schema 0.1.0 → 0.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.
@@ -1,201 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var engagement_pb_exports = {};
19
- __export(engagement_pb_exports, {
20
- Action: () => Action,
21
- Event: () => Event,
22
- GetUserEventRequest: () => GetUserEventRequest,
23
- GetUserEventResponse: () => GetUserEventResponse
24
- });
25
- module.exports = __toCommonJS(engagement_pb_exports);
26
- var import_protobuf = require("@bufbuild/protobuf");
27
- var import_error_pb = require("../../util/error_pb.js");
28
- var Action = /* @__PURE__ */ ((Action2) => {
29
- Action2[Action2["View"] = 0] = "View";
30
- Action2[Action2["Click"] = 1] = "Click";
31
- Action2[Action2["Comment"] = 2] = "Comment";
32
- Action2[Action2["UpVote"] = 3] = "UpVote";
33
- Action2[Action2["DownVote"] = 4] = "DownVote";
34
- Action2[Action2["RemoveUpVote"] = 5] = "RemoveUpVote";
35
- Action2[Action2["RemoveDownVote"] = 6] = "RemoveDownVote";
36
- Action2[Action2["FeedbackRequested"] = 7] = "FeedbackRequested";
37
- Action2[Action2["FeedbackReceived"] = 8] = "FeedbackReceived";
38
- Action2[Action2["BookmarkAdded"] = 9] = "BookmarkAdded";
39
- Action2[Action2["BookmarkDeleted"] = 10] = "BookmarkDeleted";
40
- return Action2;
41
- })(Action || {});
42
- import_protobuf.proto3.util.setEnumType(Action, "engagement.Action", [
43
- { no: 0, name: "View" },
44
- { no: 1, name: "Click" },
45
- { no: 2, name: "Comment" },
46
- { no: 3, name: "UpVote" },
47
- { no: 4, name: "DownVote" },
48
- { no: 5, name: "RemoveUpVote" },
49
- { no: 6, name: "RemoveDownVote" },
50
- { no: 7, name: "FeedbackRequested" },
51
- { no: 8, name: "FeedbackReceived" },
52
- { no: 9, name: "BookmarkAdded" },
53
- { no: 10, name: "BookmarkDeleted" }
54
- ]);
55
- class Event extends import_protobuf.Message {
56
- /**
57
- * @generated from field: string user_id = 1;
58
- */
59
- userId = "";
60
- /**
61
- * @generated from field: string post_id = 2;
62
- */
63
- postId = "";
64
- /**
65
- * @generated from field: engagement.Action action = 3;
66
- */
67
- action = 0 /* View */;
68
- /**
69
- * @generated from field: bytes options = 4;
70
- */
71
- options = new Uint8Array(0);
72
- /**
73
- * @generated from field: google.protobuf.Timestamp d_insert = 5;
74
- */
75
- dInsert;
76
- constructor(data) {
77
- super();
78
- import_protobuf.proto3.util.initPartial(data, this);
79
- }
80
- static runtime = import_protobuf.proto3;
81
- static typeName = "engagement.Event";
82
- static fields = import_protobuf.proto3.util.newFieldList(() => [
83
- {
84
- no: 1,
85
- name: "user_id",
86
- kind: "scalar",
87
- T: 9
88
- /* ScalarType.STRING */
89
- },
90
- {
91
- no: 2,
92
- name: "post_id",
93
- kind: "scalar",
94
- T: 9
95
- /* ScalarType.STRING */
96
- },
97
- { no: 3, name: "action", kind: "enum", T: import_protobuf.proto3.getEnumType(Action) },
98
- {
99
- no: 4,
100
- name: "options",
101
- kind: "scalar",
102
- T: 12
103
- /* ScalarType.BYTES */
104
- },
105
- { no: 5, name: "d_insert", kind: "message", T: import_protobuf.Timestamp }
106
- ]);
107
- static fromBinary(bytes, options) {
108
- return new Event().fromBinary(bytes, options);
109
- }
110
- static fromJson(jsonValue, options) {
111
- return new Event().fromJson(jsonValue, options);
112
- }
113
- static fromJsonString(jsonString, options) {
114
- return new Event().fromJsonString(jsonString, options);
115
- }
116
- static equals(a, b) {
117
- return import_protobuf.proto3.util.equals(Event, a, b);
118
- }
119
- }
120
- class GetUserEventRequest extends import_protobuf.Message {
121
- /**
122
- * @generated from field: string user_id = 1;
123
- */
124
- userId = "";
125
- /**
126
- * @generated from field: repeated engagement.Action actions = 2;
127
- */
128
- actions = [];
129
- /**
130
- * @generated from field: optional uint32 days = 3;
131
- */
132
- days;
133
- constructor(data) {
134
- super();
135
- import_protobuf.proto3.util.initPartial(data, this);
136
- }
137
- static runtime = import_protobuf.proto3;
138
- static typeName = "engagement.GetUserEventRequest";
139
- static fields = import_protobuf.proto3.util.newFieldList(() => [
140
- {
141
- no: 1,
142
- name: "user_id",
143
- kind: "scalar",
144
- T: 9
145
- /* ScalarType.STRING */
146
- },
147
- { no: 2, name: "actions", kind: "enum", T: import_protobuf.proto3.getEnumType(Action), repeated: true },
148
- { no: 3, name: "days", kind: "scalar", T: 13, opt: true }
149
- ]);
150
- static fromBinary(bytes, options) {
151
- return new GetUserEventRequest().fromBinary(bytes, options);
152
- }
153
- static fromJson(jsonValue, options) {
154
- return new GetUserEventRequest().fromJson(jsonValue, options);
155
- }
156
- static fromJsonString(jsonString, options) {
157
- return new GetUserEventRequest().fromJsonString(jsonString, options);
158
- }
159
- static equals(a, b) {
160
- return import_protobuf.proto3.util.equals(GetUserEventRequest, a, b);
161
- }
162
- }
163
- class GetUserEventResponse extends import_protobuf.Message {
164
- /**
165
- * @generated from field: repeated engagement.Event result = 1;
166
- */
167
- result = [];
168
- /**
169
- * @generated from field: repeated util.Error error = 2;
170
- */
171
- error = [];
172
- constructor(data) {
173
- super();
174
- import_protobuf.proto3.util.initPartial(data, this);
175
- }
176
- static runtime = import_protobuf.proto3;
177
- static typeName = "engagement.GetUserEventResponse";
178
- static fields = import_protobuf.proto3.util.newFieldList(() => [
179
- { no: 1, name: "result", kind: "message", T: Event, repeated: true },
180
- { no: 2, name: "error", kind: "message", T: import_error_pb.Error, repeated: true }
181
- ]);
182
- static fromBinary(bytes, options) {
183
- return new GetUserEventResponse().fromBinary(bytes, options);
184
- }
185
- static fromJson(jsonValue, options) {
186
- return new GetUserEventResponse().fromJson(jsonValue, options);
187
- }
188
- static fromJsonString(jsonString, options) {
189
- return new GetUserEventResponse().fromJsonString(jsonString, options);
190
- }
191
- static equals(a, b) {
192
- return import_protobuf.proto3.util.equals(GetUserEventResponse, a, b);
193
- }
194
- }
195
- // Annotate the CommonJS export names for ESM import in node:
196
- 0 && (module.exports = {
197
- Action,
198
- Event,
199
- GetUserEventRequest,
200
- GetUserEventResponse
201
- });
1
+ var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,a={};((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})(a,{Action:()=>m,Event:()=>u,GetUserEventRequest:()=>c,GetUserEventResponse:()=>d}),module.exports=(e=a,((e,a,s,i)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let m of o(a))r.call(e,m)||m===s||t(e,m,{get:()=>a[m],enumerable:!(i=n(a,m))||i.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s=require("@bufbuild/protobuf"),i=require("../../util/error_pb.cjs"),m=(e=>(e[e.View=0]="View",e[e.Click=1]="Click",e[e.Comment=2]="Comment",e[e.UpVote=3]="UpVote",e[e.DownVote=4]="DownVote",e[e.RemoveUpVote=5]="RemoveUpVote",e[e.RemoveDownVote=6]="RemoveDownVote",e[e.FeedbackRequested=7]="FeedbackRequested",e[e.FeedbackReceived=8]="FeedbackReceived",e[e.BookmarkAdded=9]="BookmarkAdded",e[e.BookmarkDeleted=10]="BookmarkDeleted",e))(m||{});s.proto3.util.setEnumType(m,"engagement.Action",[{no:0,name:"View"},{no:1,name:"Click"},{no:2,name:"Comment"},{no:3,name:"UpVote"},{no:4,name:"DownVote"},{no:5,name:"RemoveUpVote"},{no:6,name:"RemoveDownVote"},{no:7,name:"FeedbackRequested"},{no:8,name:"FeedbackReceived"},{no:9,name:"BookmarkAdded"},{no:10,name:"BookmarkDeleted"}]);class u extends s.Message{userId="";postId="";action=0;options=new Uint8Array(0);dInsert;constructor(e){super(),s.proto3.util.initPartial(e,this)}static runtime=s.proto3;static typeName="engagement.Event";static fields=s.proto3.util.newFieldList((()=>[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"post_id",kind:"scalar",T:9},{no:3,name:"action",kind:"enum",T:s.proto3.getEnumType(m)},{no:4,name:"options",kind:"scalar",T:12},{no:5,name:"d_insert",kind:"message",T:s.Timestamp}]));static fromBinary(e,t){return(new u).fromBinary(e,t)}static fromJson(e,t){return(new u).fromJson(e,t)}static fromJsonString(e,t){return(new u).fromJsonString(e,t)}static equals(e,t){return s.proto3.util.equals(u,e,t)}}class c extends s.Message{userId="";actions=[];days;constructor(e){super(),s.proto3.util.initPartial(e,this)}static runtime=s.proto3;static typeName="engagement.GetUserEventRequest";static fields=s.proto3.util.newFieldList((()=>[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"actions",kind:"enum",T:s.proto3.getEnumType(m),repeated:!0},{no:3,name:"days",kind:"scalar",T:13,opt:!0}]));static fromBinary(e,t){return(new c).fromBinary(e,t)}static fromJson(e,t){return(new c).fromJson(e,t)}static fromJsonString(e,t){return(new c).fromJsonString(e,t)}static equals(e,t){return s.proto3.util.equals(c,e,t)}}class d extends s.Message{result=[];error=[];constructor(e){super(),s.proto3.util.initPartial(e,this)}static runtime=s.proto3;static typeName="engagement.GetUserEventResponse";static fields=s.proto3.util.newFieldList((()=>[{no:1,name:"result",kind:"message",T:u,repeated:!0},{no:2,name:"error",kind:"message",T:i.Error,repeated:!0}]));static fromBinary(e,t){return(new d).fromBinary(e,t)}static fromJson(e,t){return(new d).fromJson(e,t)}static fromJsonString(e,t){return(new d).fromJsonString(e,t)}static equals(e,t){return s.proto3.util.equals(d,e,t)}}
@@ -1,175 +1 @@
1
- import { Message, proto3, Timestamp } from "@bufbuild/protobuf";
2
- import { Error } from "../../util/error_pb.js";
3
- var Action = /* @__PURE__ */ ((Action2) => {
4
- Action2[Action2["View"] = 0] = "View";
5
- Action2[Action2["Click"] = 1] = "Click";
6
- Action2[Action2["Comment"] = 2] = "Comment";
7
- Action2[Action2["UpVote"] = 3] = "UpVote";
8
- Action2[Action2["DownVote"] = 4] = "DownVote";
9
- Action2[Action2["RemoveUpVote"] = 5] = "RemoveUpVote";
10
- Action2[Action2["RemoveDownVote"] = 6] = "RemoveDownVote";
11
- Action2[Action2["FeedbackRequested"] = 7] = "FeedbackRequested";
12
- Action2[Action2["FeedbackReceived"] = 8] = "FeedbackReceived";
13
- Action2[Action2["BookmarkAdded"] = 9] = "BookmarkAdded";
14
- Action2[Action2["BookmarkDeleted"] = 10] = "BookmarkDeleted";
15
- return Action2;
16
- })(Action || {});
17
- proto3.util.setEnumType(Action, "engagement.Action", [
18
- { no: 0, name: "View" },
19
- { no: 1, name: "Click" },
20
- { no: 2, name: "Comment" },
21
- { no: 3, name: "UpVote" },
22
- { no: 4, name: "DownVote" },
23
- { no: 5, name: "RemoveUpVote" },
24
- { no: 6, name: "RemoveDownVote" },
25
- { no: 7, name: "FeedbackRequested" },
26
- { no: 8, name: "FeedbackReceived" },
27
- { no: 9, name: "BookmarkAdded" },
28
- { no: 10, name: "BookmarkDeleted" }
29
- ]);
30
- class Event extends Message {
31
- /**
32
- * @generated from field: string user_id = 1;
33
- */
34
- userId = "";
35
- /**
36
- * @generated from field: string post_id = 2;
37
- */
38
- postId = "";
39
- /**
40
- * @generated from field: engagement.Action action = 3;
41
- */
42
- action = 0 /* View */;
43
- /**
44
- * @generated from field: bytes options = 4;
45
- */
46
- options = new Uint8Array(0);
47
- /**
48
- * @generated from field: google.protobuf.Timestamp d_insert = 5;
49
- */
50
- dInsert;
51
- constructor(data) {
52
- super();
53
- proto3.util.initPartial(data, this);
54
- }
55
- static runtime = proto3;
56
- static typeName = "engagement.Event";
57
- static fields = proto3.util.newFieldList(() => [
58
- {
59
- no: 1,
60
- name: "user_id",
61
- kind: "scalar",
62
- T: 9
63
- /* ScalarType.STRING */
64
- },
65
- {
66
- no: 2,
67
- name: "post_id",
68
- kind: "scalar",
69
- T: 9
70
- /* ScalarType.STRING */
71
- },
72
- { no: 3, name: "action", kind: "enum", T: proto3.getEnumType(Action) },
73
- {
74
- no: 4,
75
- name: "options",
76
- kind: "scalar",
77
- T: 12
78
- /* ScalarType.BYTES */
79
- },
80
- { no: 5, name: "d_insert", kind: "message", T: Timestamp }
81
- ]);
82
- static fromBinary(bytes, options) {
83
- return new Event().fromBinary(bytes, options);
84
- }
85
- static fromJson(jsonValue, options) {
86
- return new Event().fromJson(jsonValue, options);
87
- }
88
- static fromJsonString(jsonString, options) {
89
- return new Event().fromJsonString(jsonString, options);
90
- }
91
- static equals(a, b) {
92
- return proto3.util.equals(Event, a, b);
93
- }
94
- }
95
- class GetUserEventRequest extends Message {
96
- /**
97
- * @generated from field: string user_id = 1;
98
- */
99
- userId = "";
100
- /**
101
- * @generated from field: repeated engagement.Action actions = 2;
102
- */
103
- actions = [];
104
- /**
105
- * @generated from field: optional uint32 days = 3;
106
- */
107
- days;
108
- constructor(data) {
109
- super();
110
- proto3.util.initPartial(data, this);
111
- }
112
- static runtime = proto3;
113
- static typeName = "engagement.GetUserEventRequest";
114
- static fields = proto3.util.newFieldList(() => [
115
- {
116
- no: 1,
117
- name: "user_id",
118
- kind: "scalar",
119
- T: 9
120
- /* ScalarType.STRING */
121
- },
122
- { no: 2, name: "actions", kind: "enum", T: proto3.getEnumType(Action), repeated: true },
123
- { no: 3, name: "days", kind: "scalar", T: 13, opt: true }
124
- ]);
125
- static fromBinary(bytes, options) {
126
- return new GetUserEventRequest().fromBinary(bytes, options);
127
- }
128
- static fromJson(jsonValue, options) {
129
- return new GetUserEventRequest().fromJson(jsonValue, options);
130
- }
131
- static fromJsonString(jsonString, options) {
132
- return new GetUserEventRequest().fromJsonString(jsonString, options);
133
- }
134
- static equals(a, b) {
135
- return proto3.util.equals(GetUserEventRequest, a, b);
136
- }
137
- }
138
- class GetUserEventResponse extends Message {
139
- /**
140
- * @generated from field: repeated engagement.Event result = 1;
141
- */
142
- result = [];
143
- /**
144
- * @generated from field: repeated util.Error error = 2;
145
- */
146
- error = [];
147
- constructor(data) {
148
- super();
149
- proto3.util.initPartial(data, this);
150
- }
151
- static runtime = proto3;
152
- static typeName = "engagement.GetUserEventResponse";
153
- static fields = proto3.util.newFieldList(() => [
154
- { no: 1, name: "result", kind: "message", T: Event, repeated: true },
155
- { no: 2, name: "error", kind: "message", T: Error, repeated: true }
156
- ]);
157
- static fromBinary(bytes, options) {
158
- return new GetUserEventResponse().fromBinary(bytes, options);
159
- }
160
- static fromJson(jsonValue, options) {
161
- return new GetUserEventResponse().fromJson(jsonValue, options);
162
- }
163
- static fromJsonString(jsonString, options) {
164
- return new GetUserEventResponse().fromJsonString(jsonString, options);
165
- }
166
- static equals(a, b) {
167
- return proto3.util.equals(GetUserEventResponse, a, b);
168
- }
169
- }
170
- export {
171
- Action,
172
- Event,
173
- GetUserEventRequest,
174
- GetUserEventResponse
175
- };
1
+ import{Message as e,proto3 as t,Timestamp as n}from"@bufbuild/protobuf";import{Error as o}from"../../util/error_pb.ts";var r=(e=>(e[e.View=0]="View",e[e.Click=1]="Click",e[e.Comment=2]="Comment",e[e.UpVote=3]="UpVote",e[e.DownVote=4]="DownVote",e[e.RemoveUpVote=5]="RemoveUpVote",e[e.RemoveDownVote=6]="RemoveDownVote",e[e.FeedbackRequested=7]="FeedbackRequested",e[e.FeedbackReceived=8]="FeedbackReceived",e[e.BookmarkAdded=9]="BookmarkAdded",e[e.BookmarkDeleted=10]="BookmarkDeleted",e))(r||{});t.util.setEnumType(r,"engagement.Action",[{no:0,name:"View"},{no:1,name:"Click"},{no:2,name:"Comment"},{no:3,name:"UpVote"},{no:4,name:"DownVote"},{no:5,name:"RemoveUpVote"},{no:6,name:"RemoveDownVote"},{no:7,name:"FeedbackRequested"},{no:8,name:"FeedbackReceived"},{no:9,name:"BookmarkAdded"},{no:10,name:"BookmarkDeleted"}]);class a extends e{userId="";postId="";action=0;options=new Uint8Array(0);dInsert;constructor(e){super(),t.util.initPartial(e,this)}static runtime=t;static typeName="engagement.Event";static fields=t.util.newFieldList((()=>[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"post_id",kind:"scalar",T:9},{no:3,name:"action",kind:"enum",T:t.getEnumType(r)},{no:4,name:"options",kind:"scalar",T:12},{no:5,name:"d_insert",kind:"message",T:n}]));static fromBinary(e,t){return(new a).fromBinary(e,t)}static fromJson(e,t){return(new a).fromJson(e,t)}static fromJsonString(e,t){return(new a).fromJsonString(e,t)}static equals(e,n){return t.util.equals(a,e,n)}}class i extends e{userId="";actions=[];days;constructor(e){super(),t.util.initPartial(e,this)}static runtime=t;static typeName="engagement.GetUserEventRequest";static fields=t.util.newFieldList((()=>[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"actions",kind:"enum",T:t.getEnumType(r),repeated:!0},{no:3,name:"days",kind:"scalar",T:13,opt:!0}]));static fromBinary(e,t){return(new i).fromBinary(e,t)}static fromJson(e,t){return(new i).fromJson(e,t)}static fromJsonString(e,t){return(new i).fromJsonString(e,t)}static equals(e,n){return t.util.equals(i,e,n)}}class s extends e{result=[];error=[];constructor(e){super(),t.util.initPartial(e,this)}static runtime=t;static typeName="engagement.GetUserEventResponse";static fields=t.util.newFieldList((()=>[{no:1,name:"result",kind:"message",T:a,repeated:!0},{no:2,name:"error",kind:"message",T:o,repeated:!0}]));static fromBinary(e,t){return(new s).fromBinary(e,t)}static fromJson(e,t){return(new s).fromJson(e,t)}static fromJsonString(e,t){return(new s).fromJsonString(e,t)}static equals(e,n){return t.util.equals(s,e,n)}}export{r as Action,a as Event,i as GetUserEventRequest,s as GetUserEventResponse};