weave-typescript 0.24.0 → 0.25.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.
|
@@ -16,6 +16,10 @@ export interface CreateOrganizationRequest {
|
|
|
16
16
|
/** IANA timezone. Empty string means "use default" (UTC). */
|
|
17
17
|
timezone: string;
|
|
18
18
|
location: string;
|
|
19
|
+
/** Optional organization logo bytes. Empty means no logo. */
|
|
20
|
+
logo: Uint8Array;
|
|
21
|
+
/** MIME type for logo bytes. Empty means no logo. */
|
|
22
|
+
logoContentType: string;
|
|
19
23
|
}
|
|
20
24
|
export interface CreateOrganizationResponse {
|
|
21
25
|
organization: Organization | undefined;
|
|
@@ -65,6 +69,25 @@ export interface DeleteOrganizationRequest {
|
|
|
65
69
|
export interface DeleteOrganizationResponse {
|
|
66
70
|
deleted: boolean;
|
|
67
71
|
}
|
|
72
|
+
export interface GetOrganizationLogoRequest {
|
|
73
|
+
slug: string;
|
|
74
|
+
}
|
|
75
|
+
export interface GetOrganizationLogoResponse {
|
|
76
|
+
logo: Uint8Array;
|
|
77
|
+
logoContentType: string;
|
|
78
|
+
}
|
|
79
|
+
export interface PutOrganizationLogoRequest {
|
|
80
|
+
slug: string;
|
|
81
|
+
logo: Uint8Array;
|
|
82
|
+
logoContentType: string;
|
|
83
|
+
}
|
|
84
|
+
export interface PutOrganizationLogoResponse {
|
|
85
|
+
}
|
|
86
|
+
export interface DeleteOrganizationLogoRequest {
|
|
87
|
+
slug: string;
|
|
88
|
+
}
|
|
89
|
+
export interface DeleteOrganizationLogoResponse {
|
|
90
|
+
}
|
|
68
91
|
export declare const ListOrganizationsRequest: MessageFns<ListOrganizationsRequest>;
|
|
69
92
|
export declare const ListOrganizationsResponse: MessageFns<ListOrganizationsResponse>;
|
|
70
93
|
export declare const CreateOrganizationRequest: MessageFns<CreateOrganizationRequest>;
|
|
@@ -77,6 +100,12 @@ export declare const UpdateOrganizationRequest: MessageFns<UpdateOrganizationReq
|
|
|
77
100
|
export declare const UpdateOrganizationResponse: MessageFns<UpdateOrganizationResponse>;
|
|
78
101
|
export declare const DeleteOrganizationRequest: MessageFns<DeleteOrganizationRequest>;
|
|
79
102
|
export declare const DeleteOrganizationResponse: MessageFns<DeleteOrganizationResponse>;
|
|
103
|
+
export declare const GetOrganizationLogoRequest: MessageFns<GetOrganizationLogoRequest>;
|
|
104
|
+
export declare const GetOrganizationLogoResponse: MessageFns<GetOrganizationLogoResponse>;
|
|
105
|
+
export declare const PutOrganizationLogoRequest: MessageFns<PutOrganizationLogoRequest>;
|
|
106
|
+
export declare const PutOrganizationLogoResponse: MessageFns<PutOrganizationLogoResponse>;
|
|
107
|
+
export declare const DeleteOrganizationLogoRequest: MessageFns<DeleteOrganizationLogoRequest>;
|
|
108
|
+
export declare const DeleteOrganizationLogoResponse: MessageFns<DeleteOrganizationLogoResponse>;
|
|
80
109
|
export interface OrganizationService {
|
|
81
110
|
ListOrganizations(request: ListOrganizationsRequest): Promise<ListOrganizationsResponse>;
|
|
82
111
|
CreateOrganization(request: CreateOrganizationRequest): Promise<CreateOrganizationResponse>;
|
|
@@ -84,6 +113,9 @@ export interface OrganizationService {
|
|
|
84
113
|
GetOrganizationById(request: GetOrganizationByIdRequest): Promise<GetOrganizationByIdResponse>;
|
|
85
114
|
UpdateOrganization(request: UpdateOrganizationRequest): Promise<UpdateOrganizationResponse>;
|
|
86
115
|
DeleteOrganization(request: DeleteOrganizationRequest): Promise<DeleteOrganizationResponse>;
|
|
116
|
+
GetOrganizationLogo(request: GetOrganizationLogoRequest): Promise<GetOrganizationLogoResponse>;
|
|
117
|
+
PutOrganizationLogo(request: PutOrganizationLogoRequest): Promise<PutOrganizationLogoResponse>;
|
|
118
|
+
DeleteOrganizationLogo(request: DeleteOrganizationLogoRequest): Promise<DeleteOrganizationLogoResponse>;
|
|
87
119
|
}
|
|
88
120
|
export declare const OrganizationServiceServiceName = "weaveapi.organization.v1.OrganizationService";
|
|
89
121
|
export declare class OrganizationServiceClientImpl implements OrganizationService {
|
|
@@ -98,6 +130,9 @@ export declare class OrganizationServiceClientImpl implements OrganizationServic
|
|
|
98
130
|
GetOrganizationById(request: GetOrganizationByIdRequest): Promise<GetOrganizationByIdResponse>;
|
|
99
131
|
UpdateOrganization(request: UpdateOrganizationRequest): Promise<UpdateOrganizationResponse>;
|
|
100
132
|
DeleteOrganization(request: DeleteOrganizationRequest): Promise<DeleteOrganizationResponse>;
|
|
133
|
+
GetOrganizationLogo(request: GetOrganizationLogoRequest): Promise<GetOrganizationLogoResponse>;
|
|
134
|
+
PutOrganizationLogo(request: PutOrganizationLogoRequest): Promise<PutOrganizationLogoResponse>;
|
|
135
|
+
DeleteOrganizationLogo(request: DeleteOrganizationLogoRequest): Promise<DeleteOrganizationLogoResponse>;
|
|
101
136
|
}
|
|
102
137
|
export type OrganizationServiceDefinition = typeof OrganizationServiceDefinition;
|
|
103
138
|
export declare const OrganizationServiceDefinition: {
|
|
@@ -176,6 +211,30 @@ export declare const OrganizationServiceDefinition: {
|
|
|
176
211
|
};
|
|
177
212
|
};
|
|
178
213
|
};
|
|
214
|
+
readonly getOrganizationLogo: {
|
|
215
|
+
readonly name: "GetOrganizationLogo";
|
|
216
|
+
readonly requestType: typeof GetOrganizationLogoRequest;
|
|
217
|
+
readonly requestStream: false;
|
|
218
|
+
readonly responseType: typeof GetOrganizationLogoResponse;
|
|
219
|
+
readonly responseStream: false;
|
|
220
|
+
readonly options: {};
|
|
221
|
+
};
|
|
222
|
+
readonly putOrganizationLogo: {
|
|
223
|
+
readonly name: "PutOrganizationLogo";
|
|
224
|
+
readonly requestType: typeof PutOrganizationLogoRequest;
|
|
225
|
+
readonly requestStream: false;
|
|
226
|
+
readonly responseType: typeof PutOrganizationLogoResponse;
|
|
227
|
+
readonly responseStream: false;
|
|
228
|
+
readonly options: {};
|
|
229
|
+
};
|
|
230
|
+
readonly deleteOrganizationLogo: {
|
|
231
|
+
readonly name: "DeleteOrganizationLogo";
|
|
232
|
+
readonly requestType: typeof DeleteOrganizationLogoRequest;
|
|
233
|
+
readonly requestStream: false;
|
|
234
|
+
readonly responseType: typeof DeleteOrganizationLogoResponse;
|
|
235
|
+
readonly responseStream: false;
|
|
236
|
+
readonly options: {};
|
|
237
|
+
};
|
|
179
238
|
};
|
|
180
239
|
};
|
|
181
240
|
interface Rpc {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: weaveapi/organization/v1/service.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.OrganizationServiceDefinition = exports.OrganizationServiceClientImpl = exports.OrganizationServiceServiceName = exports.DeleteOrganizationResponse = exports.DeleteOrganizationRequest = exports.UpdateOrganizationResponse = exports.UpdateOrganizationRequest = exports.GetOrganizationByIdResponse = exports.GetOrganizationByIdRequest = exports.GetOrganizationBySlugResponse = exports.GetOrganizationBySlugRequest = exports.CreateOrganizationResponse = exports.CreateOrganizationRequest = exports.ListOrganizationsResponse = exports.ListOrganizationsRequest = exports.protobufPackage = void 0;
|
|
8
|
+
exports.OrganizationServiceDefinition = exports.OrganizationServiceClientImpl = exports.OrganizationServiceServiceName = exports.DeleteOrganizationLogoResponse = exports.DeleteOrganizationLogoRequest = exports.PutOrganizationLogoResponse = exports.PutOrganizationLogoRequest = exports.GetOrganizationLogoResponse = exports.GetOrganizationLogoRequest = exports.DeleteOrganizationResponse = exports.DeleteOrganizationRequest = exports.UpdateOrganizationResponse = exports.UpdateOrganizationRequest = exports.GetOrganizationByIdResponse = exports.GetOrganizationByIdRequest = exports.GetOrganizationBySlugResponse = exports.GetOrganizationBySlugRequest = exports.CreateOrganizationResponse = exports.CreateOrganizationRequest = exports.ListOrganizationsResponse = exports.ListOrganizationsRequest = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const organization_pb_1 = require("./organization.pb");
|
|
@@ -105,7 +105,16 @@ exports.ListOrganizationsResponse = {
|
|
|
105
105
|
},
|
|
106
106
|
};
|
|
107
107
|
function createBaseCreateOrganizationRequest() {
|
|
108
|
-
return {
|
|
108
|
+
return {
|
|
109
|
+
slug: "",
|
|
110
|
+
name: "",
|
|
111
|
+
description: "",
|
|
112
|
+
primaryColor: "",
|
|
113
|
+
timezone: "",
|
|
114
|
+
location: "",
|
|
115
|
+
logo: new Uint8Array(0),
|
|
116
|
+
logoContentType: "",
|
|
117
|
+
};
|
|
109
118
|
}
|
|
110
119
|
exports.CreateOrganizationRequest = {
|
|
111
120
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -127,6 +136,12 @@ exports.CreateOrganizationRequest = {
|
|
|
127
136
|
if (message.location !== "") {
|
|
128
137
|
writer.uint32(50).string(message.location);
|
|
129
138
|
}
|
|
139
|
+
if (message.logo.length !== 0) {
|
|
140
|
+
writer.uint32(58).bytes(message.logo);
|
|
141
|
+
}
|
|
142
|
+
if (message.logoContentType !== "") {
|
|
143
|
+
writer.uint32(66).string(message.logoContentType);
|
|
144
|
+
}
|
|
130
145
|
return writer;
|
|
131
146
|
},
|
|
132
147
|
decode(input, length) {
|
|
@@ -178,6 +193,20 @@ exports.CreateOrganizationRequest = {
|
|
|
178
193
|
message.location = reader.string();
|
|
179
194
|
continue;
|
|
180
195
|
}
|
|
196
|
+
case 7: {
|
|
197
|
+
if (tag !== 58) {
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
message.logo = reader.bytes();
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
case 8: {
|
|
204
|
+
if (tag !== 66) {
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
message.logoContentType = reader.string();
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
181
210
|
}
|
|
182
211
|
if ((tag & 7) === 4 || tag === 0) {
|
|
183
212
|
break;
|
|
@@ -198,6 +227,12 @@ exports.CreateOrganizationRequest = {
|
|
|
198
227
|
: "",
|
|
199
228
|
timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : "",
|
|
200
229
|
location: isSet(object.location) ? globalThis.String(object.location) : "",
|
|
230
|
+
logo: isSet(object.logo) ? bytesFromBase64(object.logo) : new Uint8Array(0),
|
|
231
|
+
logoContentType: isSet(object.logoContentType)
|
|
232
|
+
? globalThis.String(object.logoContentType)
|
|
233
|
+
: isSet(object.logo_content_type)
|
|
234
|
+
? globalThis.String(object.logo_content_type)
|
|
235
|
+
: "",
|
|
201
236
|
};
|
|
202
237
|
},
|
|
203
238
|
toJSON(message) {
|
|
@@ -220,13 +255,19 @@ exports.CreateOrganizationRequest = {
|
|
|
220
255
|
if (message.location !== "") {
|
|
221
256
|
obj.location = message.location;
|
|
222
257
|
}
|
|
258
|
+
if (message.logo.length !== 0) {
|
|
259
|
+
obj.logo = base64FromBytes(message.logo);
|
|
260
|
+
}
|
|
261
|
+
if (message.logoContentType !== "") {
|
|
262
|
+
obj.logoContentType = message.logoContentType;
|
|
263
|
+
}
|
|
223
264
|
return obj;
|
|
224
265
|
},
|
|
225
266
|
create(base) {
|
|
226
267
|
return exports.CreateOrganizationRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
227
268
|
},
|
|
228
269
|
fromPartial(object) {
|
|
229
|
-
var _a, _b, _c, _d, _e, _f;
|
|
270
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
230
271
|
const message = createBaseCreateOrganizationRequest();
|
|
231
272
|
message.slug = (_a = object.slug) !== null && _a !== void 0 ? _a : "";
|
|
232
273
|
message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
|
|
@@ -234,6 +275,8 @@ exports.CreateOrganizationRequest = {
|
|
|
234
275
|
message.primaryColor = (_d = object.primaryColor) !== null && _d !== void 0 ? _d : "";
|
|
235
276
|
message.timezone = (_e = object.timezone) !== null && _e !== void 0 ? _e : "";
|
|
236
277
|
message.location = (_f = object.location) !== null && _f !== void 0 ? _f : "";
|
|
278
|
+
message.logo = (_g = object.logo) !== null && _g !== void 0 ? _g : new Uint8Array(0);
|
|
279
|
+
message.logoContentType = (_h = object.logoContentType) !== null && _h !== void 0 ? _h : "";
|
|
237
280
|
return message;
|
|
238
281
|
},
|
|
239
282
|
};
|
|
@@ -809,6 +852,345 @@ exports.DeleteOrganizationResponse = {
|
|
|
809
852
|
return message;
|
|
810
853
|
},
|
|
811
854
|
};
|
|
855
|
+
function createBaseGetOrganizationLogoRequest() {
|
|
856
|
+
return { slug: "" };
|
|
857
|
+
}
|
|
858
|
+
exports.GetOrganizationLogoRequest = {
|
|
859
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
860
|
+
if (message.slug !== "") {
|
|
861
|
+
writer.uint32(10).string(message.slug);
|
|
862
|
+
}
|
|
863
|
+
return writer;
|
|
864
|
+
},
|
|
865
|
+
decode(input, length) {
|
|
866
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
867
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
868
|
+
const message = createBaseGetOrganizationLogoRequest();
|
|
869
|
+
while (reader.pos < end) {
|
|
870
|
+
const tag = reader.uint32();
|
|
871
|
+
switch (tag >>> 3) {
|
|
872
|
+
case 1: {
|
|
873
|
+
if (tag !== 10) {
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
message.slug = reader.string();
|
|
877
|
+
continue;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
reader.skip(tag & 7);
|
|
884
|
+
}
|
|
885
|
+
return message;
|
|
886
|
+
},
|
|
887
|
+
fromJSON(object) {
|
|
888
|
+
return { slug: isSet(object.slug) ? globalThis.String(object.slug) : "" };
|
|
889
|
+
},
|
|
890
|
+
toJSON(message) {
|
|
891
|
+
const obj = {};
|
|
892
|
+
if (message.slug !== "") {
|
|
893
|
+
obj.slug = message.slug;
|
|
894
|
+
}
|
|
895
|
+
return obj;
|
|
896
|
+
},
|
|
897
|
+
create(base) {
|
|
898
|
+
return exports.GetOrganizationLogoRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
899
|
+
},
|
|
900
|
+
fromPartial(object) {
|
|
901
|
+
var _a;
|
|
902
|
+
const message = createBaseGetOrganizationLogoRequest();
|
|
903
|
+
message.slug = (_a = object.slug) !== null && _a !== void 0 ? _a : "";
|
|
904
|
+
return message;
|
|
905
|
+
},
|
|
906
|
+
};
|
|
907
|
+
function createBaseGetOrganizationLogoResponse() {
|
|
908
|
+
return { logo: new Uint8Array(0), logoContentType: "" };
|
|
909
|
+
}
|
|
910
|
+
exports.GetOrganizationLogoResponse = {
|
|
911
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
912
|
+
if (message.logo.length !== 0) {
|
|
913
|
+
writer.uint32(10).bytes(message.logo);
|
|
914
|
+
}
|
|
915
|
+
if (message.logoContentType !== "") {
|
|
916
|
+
writer.uint32(18).string(message.logoContentType);
|
|
917
|
+
}
|
|
918
|
+
return writer;
|
|
919
|
+
},
|
|
920
|
+
decode(input, length) {
|
|
921
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
922
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
923
|
+
const message = createBaseGetOrganizationLogoResponse();
|
|
924
|
+
while (reader.pos < end) {
|
|
925
|
+
const tag = reader.uint32();
|
|
926
|
+
switch (tag >>> 3) {
|
|
927
|
+
case 1: {
|
|
928
|
+
if (tag !== 10) {
|
|
929
|
+
break;
|
|
930
|
+
}
|
|
931
|
+
message.logo = reader.bytes();
|
|
932
|
+
continue;
|
|
933
|
+
}
|
|
934
|
+
case 2: {
|
|
935
|
+
if (tag !== 18) {
|
|
936
|
+
break;
|
|
937
|
+
}
|
|
938
|
+
message.logoContentType = reader.string();
|
|
939
|
+
continue;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
reader.skip(tag & 7);
|
|
946
|
+
}
|
|
947
|
+
return message;
|
|
948
|
+
},
|
|
949
|
+
fromJSON(object) {
|
|
950
|
+
return {
|
|
951
|
+
logo: isSet(object.logo) ? bytesFromBase64(object.logo) : new Uint8Array(0),
|
|
952
|
+
logoContentType: isSet(object.logoContentType)
|
|
953
|
+
? globalThis.String(object.logoContentType)
|
|
954
|
+
: isSet(object.logo_content_type)
|
|
955
|
+
? globalThis.String(object.logo_content_type)
|
|
956
|
+
: "",
|
|
957
|
+
};
|
|
958
|
+
},
|
|
959
|
+
toJSON(message) {
|
|
960
|
+
const obj = {};
|
|
961
|
+
if (message.logo.length !== 0) {
|
|
962
|
+
obj.logo = base64FromBytes(message.logo);
|
|
963
|
+
}
|
|
964
|
+
if (message.logoContentType !== "") {
|
|
965
|
+
obj.logoContentType = message.logoContentType;
|
|
966
|
+
}
|
|
967
|
+
return obj;
|
|
968
|
+
},
|
|
969
|
+
create(base) {
|
|
970
|
+
return exports.GetOrganizationLogoResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
971
|
+
},
|
|
972
|
+
fromPartial(object) {
|
|
973
|
+
var _a, _b;
|
|
974
|
+
const message = createBaseGetOrganizationLogoResponse();
|
|
975
|
+
message.logo = (_a = object.logo) !== null && _a !== void 0 ? _a : new Uint8Array(0);
|
|
976
|
+
message.logoContentType = (_b = object.logoContentType) !== null && _b !== void 0 ? _b : "";
|
|
977
|
+
return message;
|
|
978
|
+
},
|
|
979
|
+
};
|
|
980
|
+
function createBasePutOrganizationLogoRequest() {
|
|
981
|
+
return { slug: "", logo: new Uint8Array(0), logoContentType: "" };
|
|
982
|
+
}
|
|
983
|
+
exports.PutOrganizationLogoRequest = {
|
|
984
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
985
|
+
if (message.slug !== "") {
|
|
986
|
+
writer.uint32(10).string(message.slug);
|
|
987
|
+
}
|
|
988
|
+
if (message.logo.length !== 0) {
|
|
989
|
+
writer.uint32(18).bytes(message.logo);
|
|
990
|
+
}
|
|
991
|
+
if (message.logoContentType !== "") {
|
|
992
|
+
writer.uint32(26).string(message.logoContentType);
|
|
993
|
+
}
|
|
994
|
+
return writer;
|
|
995
|
+
},
|
|
996
|
+
decode(input, length) {
|
|
997
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
998
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
999
|
+
const message = createBasePutOrganizationLogoRequest();
|
|
1000
|
+
while (reader.pos < end) {
|
|
1001
|
+
const tag = reader.uint32();
|
|
1002
|
+
switch (tag >>> 3) {
|
|
1003
|
+
case 1: {
|
|
1004
|
+
if (tag !== 10) {
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
message.slug = reader.string();
|
|
1008
|
+
continue;
|
|
1009
|
+
}
|
|
1010
|
+
case 2: {
|
|
1011
|
+
if (tag !== 18) {
|
|
1012
|
+
break;
|
|
1013
|
+
}
|
|
1014
|
+
message.logo = reader.bytes();
|
|
1015
|
+
continue;
|
|
1016
|
+
}
|
|
1017
|
+
case 3: {
|
|
1018
|
+
if (tag !== 26) {
|
|
1019
|
+
break;
|
|
1020
|
+
}
|
|
1021
|
+
message.logoContentType = reader.string();
|
|
1022
|
+
continue;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
1028
|
+
reader.skip(tag & 7);
|
|
1029
|
+
}
|
|
1030
|
+
return message;
|
|
1031
|
+
},
|
|
1032
|
+
fromJSON(object) {
|
|
1033
|
+
return {
|
|
1034
|
+
slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
|
|
1035
|
+
logo: isSet(object.logo) ? bytesFromBase64(object.logo) : new Uint8Array(0),
|
|
1036
|
+
logoContentType: isSet(object.logoContentType)
|
|
1037
|
+
? globalThis.String(object.logoContentType)
|
|
1038
|
+
: isSet(object.logo_content_type)
|
|
1039
|
+
? globalThis.String(object.logo_content_type)
|
|
1040
|
+
: "",
|
|
1041
|
+
};
|
|
1042
|
+
},
|
|
1043
|
+
toJSON(message) {
|
|
1044
|
+
const obj = {};
|
|
1045
|
+
if (message.slug !== "") {
|
|
1046
|
+
obj.slug = message.slug;
|
|
1047
|
+
}
|
|
1048
|
+
if (message.logo.length !== 0) {
|
|
1049
|
+
obj.logo = base64FromBytes(message.logo);
|
|
1050
|
+
}
|
|
1051
|
+
if (message.logoContentType !== "") {
|
|
1052
|
+
obj.logoContentType = message.logoContentType;
|
|
1053
|
+
}
|
|
1054
|
+
return obj;
|
|
1055
|
+
},
|
|
1056
|
+
create(base) {
|
|
1057
|
+
return exports.PutOrganizationLogoRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1058
|
+
},
|
|
1059
|
+
fromPartial(object) {
|
|
1060
|
+
var _a, _b, _c;
|
|
1061
|
+
const message = createBasePutOrganizationLogoRequest();
|
|
1062
|
+
message.slug = (_a = object.slug) !== null && _a !== void 0 ? _a : "";
|
|
1063
|
+
message.logo = (_b = object.logo) !== null && _b !== void 0 ? _b : new Uint8Array(0);
|
|
1064
|
+
message.logoContentType = (_c = object.logoContentType) !== null && _c !== void 0 ? _c : "";
|
|
1065
|
+
return message;
|
|
1066
|
+
},
|
|
1067
|
+
};
|
|
1068
|
+
function createBasePutOrganizationLogoResponse() {
|
|
1069
|
+
return {};
|
|
1070
|
+
}
|
|
1071
|
+
exports.PutOrganizationLogoResponse = {
|
|
1072
|
+
encode(_, writer = new wire_1.BinaryWriter()) {
|
|
1073
|
+
return writer;
|
|
1074
|
+
},
|
|
1075
|
+
decode(input, length) {
|
|
1076
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1077
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1078
|
+
const message = createBasePutOrganizationLogoResponse();
|
|
1079
|
+
while (reader.pos < end) {
|
|
1080
|
+
const tag = reader.uint32();
|
|
1081
|
+
switch (tag >>> 3) {
|
|
1082
|
+
}
|
|
1083
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
reader.skip(tag & 7);
|
|
1087
|
+
}
|
|
1088
|
+
return message;
|
|
1089
|
+
},
|
|
1090
|
+
fromJSON(_) {
|
|
1091
|
+
return {};
|
|
1092
|
+
},
|
|
1093
|
+
toJSON(_) {
|
|
1094
|
+
const obj = {};
|
|
1095
|
+
return obj;
|
|
1096
|
+
},
|
|
1097
|
+
create(base) {
|
|
1098
|
+
return exports.PutOrganizationLogoResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1099
|
+
},
|
|
1100
|
+
fromPartial(_) {
|
|
1101
|
+
const message = createBasePutOrganizationLogoResponse();
|
|
1102
|
+
return message;
|
|
1103
|
+
},
|
|
1104
|
+
};
|
|
1105
|
+
function createBaseDeleteOrganizationLogoRequest() {
|
|
1106
|
+
return { slug: "" };
|
|
1107
|
+
}
|
|
1108
|
+
exports.DeleteOrganizationLogoRequest = {
|
|
1109
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1110
|
+
if (message.slug !== "") {
|
|
1111
|
+
writer.uint32(10).string(message.slug);
|
|
1112
|
+
}
|
|
1113
|
+
return writer;
|
|
1114
|
+
},
|
|
1115
|
+
decode(input, length) {
|
|
1116
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1117
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1118
|
+
const message = createBaseDeleteOrganizationLogoRequest();
|
|
1119
|
+
while (reader.pos < end) {
|
|
1120
|
+
const tag = reader.uint32();
|
|
1121
|
+
switch (tag >>> 3) {
|
|
1122
|
+
case 1: {
|
|
1123
|
+
if (tag !== 10) {
|
|
1124
|
+
break;
|
|
1125
|
+
}
|
|
1126
|
+
message.slug = reader.string();
|
|
1127
|
+
continue;
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1131
|
+
break;
|
|
1132
|
+
}
|
|
1133
|
+
reader.skip(tag & 7);
|
|
1134
|
+
}
|
|
1135
|
+
return message;
|
|
1136
|
+
},
|
|
1137
|
+
fromJSON(object) {
|
|
1138
|
+
return { slug: isSet(object.slug) ? globalThis.String(object.slug) : "" };
|
|
1139
|
+
},
|
|
1140
|
+
toJSON(message) {
|
|
1141
|
+
const obj = {};
|
|
1142
|
+
if (message.slug !== "") {
|
|
1143
|
+
obj.slug = message.slug;
|
|
1144
|
+
}
|
|
1145
|
+
return obj;
|
|
1146
|
+
},
|
|
1147
|
+
create(base) {
|
|
1148
|
+
return exports.DeleteOrganizationLogoRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1149
|
+
},
|
|
1150
|
+
fromPartial(object) {
|
|
1151
|
+
var _a;
|
|
1152
|
+
const message = createBaseDeleteOrganizationLogoRequest();
|
|
1153
|
+
message.slug = (_a = object.slug) !== null && _a !== void 0 ? _a : "";
|
|
1154
|
+
return message;
|
|
1155
|
+
},
|
|
1156
|
+
};
|
|
1157
|
+
function createBaseDeleteOrganizationLogoResponse() {
|
|
1158
|
+
return {};
|
|
1159
|
+
}
|
|
1160
|
+
exports.DeleteOrganizationLogoResponse = {
|
|
1161
|
+
encode(_, writer = new wire_1.BinaryWriter()) {
|
|
1162
|
+
return writer;
|
|
1163
|
+
},
|
|
1164
|
+
decode(input, length) {
|
|
1165
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1166
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1167
|
+
const message = createBaseDeleteOrganizationLogoResponse();
|
|
1168
|
+
while (reader.pos < end) {
|
|
1169
|
+
const tag = reader.uint32();
|
|
1170
|
+
switch (tag >>> 3) {
|
|
1171
|
+
}
|
|
1172
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1173
|
+
break;
|
|
1174
|
+
}
|
|
1175
|
+
reader.skip(tag & 7);
|
|
1176
|
+
}
|
|
1177
|
+
return message;
|
|
1178
|
+
},
|
|
1179
|
+
fromJSON(_) {
|
|
1180
|
+
return {};
|
|
1181
|
+
},
|
|
1182
|
+
toJSON(_) {
|
|
1183
|
+
const obj = {};
|
|
1184
|
+
return obj;
|
|
1185
|
+
},
|
|
1186
|
+
create(base) {
|
|
1187
|
+
return exports.DeleteOrganizationLogoResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1188
|
+
},
|
|
1189
|
+
fromPartial(_) {
|
|
1190
|
+
const message = createBaseDeleteOrganizationLogoResponse();
|
|
1191
|
+
return message;
|
|
1192
|
+
},
|
|
1193
|
+
};
|
|
812
1194
|
exports.OrganizationServiceServiceName = "weaveapi.organization.v1.OrganizationService";
|
|
813
1195
|
class OrganizationServiceClientImpl {
|
|
814
1196
|
constructor(rpc, opts) {
|
|
@@ -820,6 +1202,9 @@ class OrganizationServiceClientImpl {
|
|
|
820
1202
|
this.GetOrganizationById = this.GetOrganizationById.bind(this);
|
|
821
1203
|
this.UpdateOrganization = this.UpdateOrganization.bind(this);
|
|
822
1204
|
this.DeleteOrganization = this.DeleteOrganization.bind(this);
|
|
1205
|
+
this.GetOrganizationLogo = this.GetOrganizationLogo.bind(this);
|
|
1206
|
+
this.PutOrganizationLogo = this.PutOrganizationLogo.bind(this);
|
|
1207
|
+
this.DeleteOrganizationLogo = this.DeleteOrganizationLogo.bind(this);
|
|
823
1208
|
}
|
|
824
1209
|
ListOrganizations(request) {
|
|
825
1210
|
const data = exports.ListOrganizationsRequest.encode(request).finish();
|
|
@@ -851,6 +1236,21 @@ class OrganizationServiceClientImpl {
|
|
|
851
1236
|
const promise = this.rpc.request(this.service, "DeleteOrganization", data);
|
|
852
1237
|
return promise.then((data) => exports.DeleteOrganizationResponse.decode(new wire_1.BinaryReader(data)));
|
|
853
1238
|
}
|
|
1239
|
+
GetOrganizationLogo(request) {
|
|
1240
|
+
const data = exports.GetOrganizationLogoRequest.encode(request).finish();
|
|
1241
|
+
const promise = this.rpc.request(this.service, "GetOrganizationLogo", data);
|
|
1242
|
+
return promise.then((data) => exports.GetOrganizationLogoResponse.decode(new wire_1.BinaryReader(data)));
|
|
1243
|
+
}
|
|
1244
|
+
PutOrganizationLogo(request) {
|
|
1245
|
+
const data = exports.PutOrganizationLogoRequest.encode(request).finish();
|
|
1246
|
+
const promise = this.rpc.request(this.service, "PutOrganizationLogo", data);
|
|
1247
|
+
return promise.then((data) => exports.PutOrganizationLogoResponse.decode(new wire_1.BinaryReader(data)));
|
|
1248
|
+
}
|
|
1249
|
+
DeleteOrganizationLogo(request) {
|
|
1250
|
+
const data = exports.DeleteOrganizationLogoRequest.encode(request).finish();
|
|
1251
|
+
const promise = this.rpc.request(this.service, "DeleteOrganizationLogo", data);
|
|
1252
|
+
return promise.then((data) => exports.DeleteOrganizationLogoResponse.decode(new wire_1.BinaryReader(data)));
|
|
1253
|
+
}
|
|
854
1254
|
}
|
|
855
1255
|
exports.OrganizationServiceClientImpl = OrganizationServiceClientImpl;
|
|
856
1256
|
exports.OrganizationServiceDefinition = {
|
|
@@ -1105,8 +1505,57 @@ exports.OrganizationServiceDefinition = {
|
|
|
1105
1505
|
},
|
|
1106
1506
|
},
|
|
1107
1507
|
},
|
|
1508
|
+
getOrganizationLogo: {
|
|
1509
|
+
name: "GetOrganizationLogo",
|
|
1510
|
+
requestType: exports.GetOrganizationLogoRequest,
|
|
1511
|
+
requestStream: false,
|
|
1512
|
+
responseType: exports.GetOrganizationLogoResponse,
|
|
1513
|
+
responseStream: false,
|
|
1514
|
+
options: {},
|
|
1515
|
+
},
|
|
1516
|
+
putOrganizationLogo: {
|
|
1517
|
+
name: "PutOrganizationLogo",
|
|
1518
|
+
requestType: exports.PutOrganizationLogoRequest,
|
|
1519
|
+
requestStream: false,
|
|
1520
|
+
responseType: exports.PutOrganizationLogoResponse,
|
|
1521
|
+
responseStream: false,
|
|
1522
|
+
options: {},
|
|
1523
|
+
},
|
|
1524
|
+
deleteOrganizationLogo: {
|
|
1525
|
+
name: "DeleteOrganizationLogo",
|
|
1526
|
+
requestType: exports.DeleteOrganizationLogoRequest,
|
|
1527
|
+
requestStream: false,
|
|
1528
|
+
responseType: exports.DeleteOrganizationLogoResponse,
|
|
1529
|
+
responseStream: false,
|
|
1530
|
+
options: {},
|
|
1531
|
+
},
|
|
1108
1532
|
},
|
|
1109
1533
|
};
|
|
1534
|
+
function bytesFromBase64(b64) {
|
|
1535
|
+
if (globalThis.Buffer) {
|
|
1536
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
1537
|
+
}
|
|
1538
|
+
else {
|
|
1539
|
+
const bin = globalThis.atob(b64);
|
|
1540
|
+
const arr = new Uint8Array(bin.length);
|
|
1541
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
1542
|
+
arr[i] = bin.charCodeAt(i);
|
|
1543
|
+
}
|
|
1544
|
+
return arr;
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
function base64FromBytes(arr) {
|
|
1548
|
+
if (globalThis.Buffer) {
|
|
1549
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
1550
|
+
}
|
|
1551
|
+
else {
|
|
1552
|
+
const bin = [];
|
|
1553
|
+
arr.forEach((byte) => {
|
|
1554
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
1555
|
+
});
|
|
1556
|
+
return globalThis.btoa(bin.join(""));
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1110
1559
|
function isSet(value) {
|
|
1111
1560
|
return value !== null && value !== undefined;
|
|
1112
1561
|
}
|
|
@@ -2,12 +2,14 @@ import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
|
2
2
|
interface Client {
|
|
3
3
|
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
4
|
}
|
|
5
|
-
export declare const createOrganizationQuery = "-- name: CreateOrganization :one\nINSERT INTO weave.organizations (\n slug,\n name,\n description,\n primary_color,\n timezone,\n location\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6\n)\nON CONFLICT (slug) DO NOTHING\nRETURNING\n id,\n slug,\n name,\n description,\n primary_color,\n (logo IS NOT NULL) AS has_logo,\n timezone,\n location,\n created_at,\n updated_at";
|
|
5
|
+
export declare const createOrganizationQuery = "-- name: CreateOrganization :one\nINSERT INTO weave.organizations (\n slug,\n name,\n description,\n primary_color,\n logo,\n logo_content_type,\n timezone,\n location\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8\n)\nON CONFLICT (slug) DO NOTHING\nRETURNING\n id,\n slug,\n name,\n description,\n primary_color,\n (logo IS NOT NULL) AS has_logo,\n timezone,\n location,\n created_at,\n updated_at";
|
|
6
6
|
export interface CreateOrganizationArgs {
|
|
7
7
|
slug: string;
|
|
8
8
|
name: string;
|
|
9
9
|
description: string;
|
|
10
10
|
primaryColor: string;
|
|
11
|
+
logo: Buffer | null;
|
|
12
|
+
logoContentType: string | null;
|
|
11
13
|
timezone: string;
|
|
12
14
|
location: string;
|
|
13
15
|
}
|
|
@@ -13,6 +13,8 @@ INSERT INTO weave.organizations (
|
|
|
13
13
|
name,
|
|
14
14
|
description,
|
|
15
15
|
primary_color,
|
|
16
|
+
logo,
|
|
17
|
+
logo_content_type,
|
|
16
18
|
timezone,
|
|
17
19
|
location
|
|
18
20
|
) VALUES (
|
|
@@ -21,7 +23,9 @@ INSERT INTO weave.organizations (
|
|
|
21
23
|
$3,
|
|
22
24
|
$4,
|
|
23
25
|
$5,
|
|
24
|
-
$6
|
|
26
|
+
$6,
|
|
27
|
+
$7,
|
|
28
|
+
$8
|
|
25
29
|
)
|
|
26
30
|
ON CONFLICT (slug) DO NOTHING
|
|
27
31
|
RETURNING
|
|
@@ -38,7 +42,7 @@ RETURNING
|
|
|
38
42
|
async function createOrganization(client, args) {
|
|
39
43
|
const result = await client.query({
|
|
40
44
|
text: exports.createOrganizationQuery,
|
|
41
|
-
values: [args.slug, args.name, args.description, args.primaryColor, args.timezone, args.location],
|
|
45
|
+
values: [args.slug, args.name, args.description, args.primaryColor, args.logo, args.logoContentType, args.timezone, args.location],
|
|
42
46
|
rowMode: "array"
|
|
43
47
|
});
|
|
44
48
|
if (result.rows.length !== 1) {
|