@mestra-dev/contract 0.0.10 → 0.0.11

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 (2) hide show
  1. package/dist/index.d.ts +246 -22
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -93,6 +93,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
93
93
  {
94
94
  readonly name: "Chat";
95
95
  readonly description: "Matrix (Synapse) chat session bootstrap and chat-tenant collaborator listing; owners get an `owner_` username prefix; caches Matrix access tokens. Requires workspace access and crm::chats read.";
96
+ },
97
+ {
98
+ readonly name: "Notifications";
99
+ readonly description: "Cursor-based incremental notification sync for the authenticated user. Clients store the returned cursor and pass it on the next call to receive only notifications created or updated since.";
96
100
  }
97
101
  ];
98
102
  readonly components: {
@@ -219,6 +223,110 @@ declare const routes: import("hono/hono-base").HonoBase<{
219
223
  };
220
224
  };
221
225
  };
226
+ readonly Notification: {
227
+ readonly type: "object";
228
+ readonly required: readonly [
229
+ "id",
230
+ "userId",
231
+ "workspaceId",
232
+ "title",
233
+ "message",
234
+ "type",
235
+ "read",
236
+ "archive",
237
+ "created_at"
238
+ ];
239
+ readonly properties: {
240
+ readonly id: {
241
+ readonly type: "string";
242
+ readonly format: "uuid";
243
+ };
244
+ readonly userId: {
245
+ readonly type: "string";
246
+ readonly format: "uuid";
247
+ };
248
+ readonly workspaceId: {
249
+ readonly type: "string";
250
+ readonly format: "uuid";
251
+ };
252
+ readonly title: {
253
+ readonly type: "string";
254
+ readonly maxLength: 256;
255
+ };
256
+ readonly message: {
257
+ readonly type: "string";
258
+ readonly maxLength: 256;
259
+ };
260
+ readonly type: {
261
+ readonly type: "string";
262
+ readonly maxLength: 50;
263
+ readonly description: "Notification category (application-defined).";
264
+ };
265
+ readonly read: {
266
+ readonly type: "boolean";
267
+ };
268
+ readonly archive: {
269
+ readonly type: "boolean";
270
+ };
271
+ readonly created_at: {
272
+ readonly type: "string";
273
+ readonly format: "date-time";
274
+ };
275
+ readonly updated_at: {
276
+ readonly type: "string";
277
+ readonly format: "date-time";
278
+ readonly nullable: true;
279
+ readonly description: "Set when the notification is marked read or archived.";
280
+ };
281
+ readonly deleted_at: {
282
+ readonly type: "string";
283
+ readonly format: "date-time";
284
+ readonly nullable: true;
285
+ };
286
+ readonly verified_at: {
287
+ readonly type: "string";
288
+ readonly format: "date-time";
289
+ readonly nullable: true;
290
+ };
291
+ readonly suspended_at: {
292
+ readonly type: "string";
293
+ readonly format: "date-time";
294
+ readonly nullable: true;
295
+ };
296
+ };
297
+ };
298
+ readonly NotificationSyncSuccess: {
299
+ readonly type: "object";
300
+ readonly required: readonly [
301
+ "success",
302
+ "notifications",
303
+ "cursor",
304
+ "hasMore"
305
+ ];
306
+ readonly properties: {
307
+ readonly success: {
308
+ readonly type: "boolean";
309
+ readonly const: true;
310
+ };
311
+ readonly notifications: {
312
+ readonly type: "array";
313
+ readonly items: {
314
+ readonly $ref: "#/components/schemas/Notification";
315
+ };
316
+ readonly description: "Notifications created or updated after the request cursor, oldest change first.";
317
+ };
318
+ readonly cursor: {
319
+ readonly type: "string";
320
+ readonly format: "date-time";
321
+ readonly nullable: true;
322
+ readonly description: "Newest change timestamp in this page. Store it and pass it as `cursor` on the next sync. Null only when no cursor was sent and no notifications exist.";
323
+ };
324
+ readonly hasMore: {
325
+ readonly type: "boolean";
326
+ readonly description: "True when more changes remain; call again immediately with the returned cursor.";
327
+ };
328
+ };
329
+ };
222
330
  readonly CreateWorkspaceSuccess: {
223
331
  readonly type: "object";
224
332
  readonly required: readonly [
@@ -758,6 +866,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
758
866
  readonly workspaceName: {
759
867
  readonly type: "string";
760
868
  };
869
+ readonly profilePicture: {
870
+ readonly type: "string";
871
+ readonly nullable: true;
872
+ readonly description: "Presigned workspace avatar URL from `workspaces.picture` (7-day expiry); null or empty when unset.";
873
+ };
761
874
  readonly workspaceCategory: {
762
875
  readonly $ref: "#/components/schemas/WorkspaceCategory";
763
876
  };
@@ -4111,7 +4224,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
4111
4224
  "Workspace"
4112
4225
  ];
4113
4226
  readonly summary: "List workspaces for the authenticated user";
4114
- readonly description: "Returns workspaces the user collaborates on, each with category, role, billing flags, invitation state, and the resource grants effective for the caller.";
4227
+ readonly description: "Returns workspaces the user collaborates on, each with category, role, billing flags, invitation state, workspace profile picture URL, and the resource grants effective for the caller.";
4115
4228
  readonly security: readonly [
4116
4229
  never
4117
4230
  ];
@@ -9906,6 +10019,70 @@ declare const routes: import("hono/hono-base").HonoBase<{
9906
10019
  };
9907
10020
  };
9908
10021
  };
10022
+ readonly "/notifications/sync": {
10023
+ readonly get: {
10024
+ readonly tags: readonly [
10025
+ "Notifications"
10026
+ ];
10027
+ readonly summary: "Sync notifications incrementally";
10028
+ readonly description: "Returns the authenticated user's notifications created or updated after the given `cursor` (change timestamp = greatest of created_at/updated_at), ordered oldest change first. Without a cursor, returns notifications from the beginning. Responses are paged by `limit`; when `hasMore` is true, call again with the returned cursor until it is false. Marking notifications read or archived bumps their change timestamp, so state changes propagate to all of the user's devices. Requires a valid access token (no workspace policy check).";
10029
+ readonly security: readonly [
10030
+ never
10031
+ ];
10032
+ readonly parameters: readonly [
10033
+ {
10034
+ readonly name: "cursor";
10035
+ readonly in: "query";
10036
+ readonly required: false;
10037
+ readonly schema: {
10038
+ readonly type: "string";
10039
+ readonly format: "date-time";
10040
+ };
10041
+ readonly description: "Change timestamp returned by the previous sync call (ISO 8601). Omit for a full initial sync.";
10042
+ },
10043
+ {
10044
+ readonly name: "limit";
10045
+ readonly in: "query";
10046
+ readonly required: false;
10047
+ readonly schema: {
10048
+ readonly type: "integer";
10049
+ readonly minimum: 1;
10050
+ readonly maximum: 200;
10051
+ readonly default: 100;
10052
+ };
10053
+ readonly description: "Maximum notifications per page.";
10054
+ }
10055
+ ];
10056
+ readonly responses: {
10057
+ readonly 200: {
10058
+ readonly description: "Changed notifications with the next cursor.";
10059
+ readonly content: {
10060
+ readonly "application/json": {
10061
+ readonly schema: {
10062
+ readonly $ref: "#/components/schemas/NotificationSyncSuccess";
10063
+ };
10064
+ };
10065
+ };
10066
+ };
10067
+ readonly 400: {
10068
+ readonly description: "Invalid cursor or limit query parameter.";
10069
+ readonly content: {
10070
+ readonly "application/json": {
10071
+ readonly schema: {
10072
+ readonly $ref: "#/components/schemas/ErrorResponse";
10073
+ };
10074
+ };
10075
+ };
10076
+ };
10077
+ readonly 401: {
10078
+ readonly description: "Unauthorized - Missing or invalid access token.";
10079
+ };
10080
+ readonly 403: {
10081
+ readonly description: "Forbidden - Token issuer is not 'access'.";
10082
+ };
10083
+ };
10084
+ };
10085
+ };
9909
10086
  readonly "/chat/start": {
9910
10087
  readonly post: {
9911
10088
  readonly tags: readonly [
@@ -10321,6 +10498,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
10321
10498
  workspaces: {
10322
10499
  workspaceId: string;
10323
10500
  workspaceName: string;
10501
+ profilePicture: string | null;
10324
10502
  workspaceCategory: string;
10325
10503
  role: string;
10326
10504
  maxCollaborators: number;
@@ -10806,9 +10984,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
10806
10984
  output: {
10807
10985
  success: true;
10808
10986
  task: {
10809
- status: string | null;
10810
10987
  id: string;
10811
10988
  workspaceId: string;
10989
+ created_at: string;
10990
+ status: string | null;
10812
10991
  description: string | null;
10813
10992
  subject: string;
10814
10993
  created_by: string;
@@ -10817,7 +10996,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
10817
10996
  deleted_at: string | null;
10818
10997
  verified_at: string | null;
10819
10998
  suspended_at: string | null;
10820
- created_at: string;
10821
10999
  priority: string | null;
10822
11000
  visibility: string | null;
10823
11001
  };
@@ -11067,16 +11245,16 @@ declare const routes: import("hono/hono-base").HonoBase<{
11067
11245
  output: {
11068
11246
  success: true;
11069
11247
  template: {
11070
- title: string;
11071
11248
  id: string;
11072
11249
  workspaceId: string;
11250
+ title: string;
11251
+ created_at: string;
11073
11252
  created_by: string;
11074
11253
  content: string;
11075
11254
  updated_at: string | null;
11076
11255
  deleted_at: string | null;
11077
11256
  verified_at: string | null;
11078
11257
  suspended_at: string | null;
11079
- created_at: string;
11080
11258
  }[];
11081
11259
  };
11082
11260
  outputFormat: "json";
@@ -11125,20 +11303,20 @@ declare const routes: import("hono/hono-base").HonoBase<{
11125
11303
  output: {
11126
11304
  success: true;
11127
11305
  service: {
11128
- name: string;
11129
- active: boolean | null;
11130
11306
  id: string;
11131
11307
  workspaceId: string;
11308
+ type: string | null;
11309
+ created_at: string;
11310
+ name: string;
11311
+ active: boolean | null;
11132
11312
  description: string | null;
11133
11313
  price: number | null;
11134
11314
  stock: number | null;
11135
11315
  currency: string | null;
11136
- type: string | null;
11137
11316
  updated_at: string | null;
11138
11317
  deleted_at: string | null;
11139
11318
  verified_at: string | null;
11140
11319
  suspended_at: string | null;
11141
- created_at: string;
11142
11320
  qrCode: string | null;
11143
11321
  }[];
11144
11322
  };
@@ -11295,19 +11473,19 @@ declare const routes: import("hono/hono-base").HonoBase<{
11295
11473
  output: {
11296
11474
  success: true;
11297
11475
  customer: {
11476
+ id: string;
11477
+ workspaceId: string;
11478
+ type: string | null;
11479
+ created_at: string;
11298
11480
  name: string;
11299
11481
  active: boolean | null;
11300
11482
  email: string | null;
11301
- id: string;
11302
- workspaceId: string;
11303
11483
  description: string | null;
11304
- type: string | null;
11305
11484
  phone: string | null;
11306
11485
  updated_at: string | null;
11307
11486
  deleted_at: string | null;
11308
11487
  verified_at: string | null;
11309
11488
  suspended_at: string | null;
11310
- created_at: string;
11311
11489
  website: string | null;
11312
11490
  companyPhone: string | null;
11313
11491
  companyAddress: string | null;
@@ -11527,9 +11705,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
11527
11705
  output: {
11528
11706
  success: true;
11529
11707
  billing: {
11530
- active: boolean | null;
11531
11708
  id: string;
11532
11709
  workspaceId: string;
11710
+ created_at: string;
11711
+ active: boolean | null;
11533
11712
  country: string;
11534
11713
  companyName: string;
11535
11714
  inn: string;
@@ -11544,7 +11723,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
11544
11723
  deleted_at: string | null;
11545
11724
  verified_at: string | null;
11546
11725
  suspended_at: string | null;
11547
- created_at: string;
11548
11726
  }[];
11549
11727
  };
11550
11728
  outputFormat: "json";
@@ -11765,11 +11943,12 @@ declare const routes: import("hono/hono-base").HonoBase<{
11765
11943
  output: {
11766
11944
  success: true;
11767
11945
  assignee: {
11946
+ id: string;
11947
+ workspaceId: string;
11948
+ created_at: string;
11768
11949
  startDate: string | null;
11769
11950
  endDate: string | null;
11770
11951
  collaboratorId: string;
11771
- id: string;
11772
- workspaceId: string;
11773
11952
  description: string | null;
11774
11953
  created_by: string;
11775
11954
  taskId: string;
@@ -11777,7 +11956,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
11777
11956
  deleted_at: string | null;
11778
11957
  verified_at: string | null;
11779
11958
  suspended_at: string | null;
11780
- created_at: string;
11781
11959
  };
11782
11960
  };
11783
11961
  outputFormat: "json";
@@ -11887,15 +12065,15 @@ declare const routes: import("hono/hono-base").HonoBase<{
11887
12065
  output: {
11888
12066
  success: true;
11889
12067
  tag: {
11890
- name: string;
11891
12068
  id: string;
11892
12069
  workspaceId: string;
12070
+ created_at: string;
12071
+ name: string;
11893
12072
  description: string | null;
11894
12073
  updated_at: string | null;
11895
12074
  deleted_at: string | null;
11896
12075
  verified_at: string | null;
11897
12076
  suspended_at: string | null;
11898
- created_at: string;
11899
12077
  }[];
11900
12078
  };
11901
12079
  outputFormat: "json";
@@ -12828,10 +13006,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
12828
13006
  "www-authenticate"?: string | undefined | undefined;
12829
13007
  ":status"?: number | undefined | undefined;
12830
13008
  };
13009
+ readonly type: ResponseType;
12831
13010
  readonly url: string;
12832
13011
  readonly status: number;
12833
13012
  readonly ok: boolean;
12834
- readonly type: ResponseType;
12835
13013
  data: {
12836
13014
  anyoneCanAddSelf?: boolean | null | undefined;
12837
13015
  attachments?: {
@@ -15632,5 +15810,51 @@ declare const routes: import("hono/hono-base").HonoBase<{
15632
15810
  status: 200;
15633
15811
  };
15634
15812
  };
15635
- }, "/chat">, "/", "/">;
15813
+ }, "/chat"> | import("hono/types").MergeSchemaPath<{
15814
+ "/sync": {
15815
+ $get: {
15816
+ input: {};
15817
+ output: {
15818
+ success: false;
15819
+ error: {
15820
+ _errors: string[];
15821
+ limit?: {
15822
+ [x: string]: any;
15823
+ _errors: string[];
15824
+ } | undefined;
15825
+ cursor?: {
15826
+ [x: string]: any;
15827
+ _errors: string[];
15828
+ } | undefined;
15829
+ };
15830
+ };
15831
+ outputFormat: "json";
15832
+ status: 400;
15833
+ } | {
15834
+ input: {};
15835
+ output: {
15836
+ success: true;
15837
+ notifications: {
15838
+ updated_at: string | null;
15839
+ deleted_at: string | null;
15840
+ verified_at: string | null;
15841
+ suspended_at: string | null;
15842
+ created_at: string;
15843
+ id: string;
15844
+ userId: string;
15845
+ workspaceId: string;
15846
+ title: string;
15847
+ message: string;
15848
+ type: string;
15849
+ read: boolean;
15850
+ archive: boolean;
15851
+ }[];
15852
+ cursor: string | null;
15853
+ hasMore: boolean;
15854
+ };
15855
+ outputFormat: "json";
15856
+ status: 200;
15857
+ };
15858
+ };
15859
+ }, "/notifications">, "/", "/">;
15636
15860
  export type AppType = typeof routes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,