@1mtx/did-api-contract 1.0.1 → 1.1.1
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/dist/index.d.mts +4045 -396
- package/dist/index.d.ts +4045 -396
- package/dist/index.js +487 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +463 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { initContract as
|
|
2
|
+
import { initContract as initContract9 } from "@ts-rest/core";
|
|
3
3
|
|
|
4
4
|
// src/v1/auth.ts
|
|
5
5
|
import { initContract } from "@ts-rest/core";
|
|
@@ -7,7 +7,7 @@ import { z } from "zod";
|
|
|
7
7
|
var c = initContract();
|
|
8
8
|
var AuthScheme = z.enum(["eip191"]);
|
|
9
9
|
var VerifyRequestSchema = z.object({
|
|
10
|
-
did: z.string().min(1).describe("DID of the authenticating user (e.g. `did:ethr:0xABC...`)"),
|
|
10
|
+
did: z.string().min(1).describe("DID of the authenticating user (e.g. `did:ethr:0xABC...` or `did:vbsn:0xABC...`)"),
|
|
11
11
|
signature: z.string().min(1).describe(
|
|
12
12
|
"Hex signature of the `message` string, produced by the scheme specified in the message"
|
|
13
13
|
),
|
|
@@ -40,7 +40,7 @@ var authContract = c.router({
|
|
|
40
40
|
"|----------|-------|",
|
|
41
41
|
'| **Signing scheme** | ECDSA secp256k1 (`scheme: "eip191"`) |',
|
|
42
42
|
"| **Signature format** | [EIP-191](https://eips.ethereum.org/EIPS/eip-191) `personal_sign` (65-byte `r\u2016s\u2016v`, hex-encoded with `0x` prefix) |",
|
|
43
|
-
"| **DID method** | `did:ethr` \u2014 the Ethereum address in the DID must match the signer |",
|
|
43
|
+
"| **DID method** | `did:ethr` or `did:vbsn` \u2014 the Ethereum address in the DID must match the signer |",
|
|
44
44
|
"| **Message encoding** | UTF-8 JSON string |",
|
|
45
45
|
"",
|
|
46
46
|
"### Steps",
|
|
@@ -86,28 +86,37 @@ import { initContract as initContract2 } from "@ts-rest/core";
|
|
|
86
86
|
import { z as z2 } from "zod";
|
|
87
87
|
var c2 = initContract2();
|
|
88
88
|
var SUPPORTED_FIELDS = [
|
|
89
|
+
"documentNumber",
|
|
89
90
|
"fullName",
|
|
90
|
-
"
|
|
91
|
-
"portrait",
|
|
91
|
+
"dateOfBirth",
|
|
92
92
|
"gender",
|
|
93
93
|
"nationality",
|
|
94
|
+
"ethnicity",
|
|
95
|
+
"hometown",
|
|
94
96
|
"permanentAddress",
|
|
95
|
-
"
|
|
97
|
+
"identifyingMarks",
|
|
98
|
+
"issueDate",
|
|
99
|
+
"expiryDate",
|
|
100
|
+
"fatherName",
|
|
101
|
+
"motherName",
|
|
102
|
+
"photo"
|
|
96
103
|
];
|
|
97
104
|
var CreateEventSchema = z2.object({
|
|
98
105
|
name: z2.string().min(1).max(255).describe("T\xEAn s\u1EF1 ki\u1EC7n"),
|
|
99
|
-
|
|
106
|
+
coverImageId: z2.string().optional().describe("ID \u1EA3nh b\xECa s\u1EF1 ki\u1EC7n"),
|
|
100
107
|
description: z2.string().optional().describe("M\xF4 t\u1EA3 s\u1EF1 ki\u1EC7n"),
|
|
101
108
|
maxGuests: z2.number().int().positive().describe("S\u1ED1 l\u01B0\u1EE3ng kh\xE1ch t\u1ED1i \u0111a"),
|
|
102
|
-
|
|
109
|
+
startDateTime: z2.string().datetime().describe("Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u s\u1EF1 ki\u1EC7n"),
|
|
110
|
+
endDateTime: z2.string().datetime().describe("Th\u1EDDi gian k\u1EBFt th\xFAc s\u1EF1 ki\u1EC7n"),
|
|
103
111
|
requestedFields: z2.array(z2.enum(SUPPORTED_FIELDS)).min(1).describe("C\xE1c tr\u01B0\u1EDDng d\u1EEF li\u1EC7u y\xEAu c\u1EA7u x\xE1c th\u1EF1c")
|
|
104
112
|
});
|
|
105
113
|
var UpdateEventSchema = z2.object({
|
|
106
114
|
name: z2.string().min(1).max(255).optional(),
|
|
107
|
-
|
|
115
|
+
coverImageId: z2.string().nullable().optional(),
|
|
108
116
|
description: z2.string().nullable().optional(),
|
|
109
117
|
maxGuests: z2.number().int().positive().optional(),
|
|
110
|
-
|
|
118
|
+
startDateTime: z2.string().datetime().optional(),
|
|
119
|
+
endDateTime: z2.string().datetime().optional(),
|
|
111
120
|
status: z2.enum(["ACTIVE", "CANCELLED", "COMPLETED"]).optional()
|
|
112
121
|
});
|
|
113
122
|
var ParticipantSchema = z2.object({
|
|
@@ -120,9 +129,11 @@ var EventResponseSchema = z2.object({
|
|
|
120
129
|
id: z2.string(),
|
|
121
130
|
name: z2.string(),
|
|
122
131
|
coverImageUrl: z2.string().nullable(),
|
|
132
|
+
thumbnailUrl: z2.string().nullable(),
|
|
123
133
|
description: z2.string().nullable(),
|
|
124
134
|
maxGuests: z2.number(),
|
|
125
|
-
|
|
135
|
+
startDateTime: z2.string(),
|
|
136
|
+
endDateTime: z2.string().nullable(),
|
|
126
137
|
userId: z2.string(),
|
|
127
138
|
requestedFields: z2.array(z2.string()),
|
|
128
139
|
status: z2.enum(["ACTIVE", "CANCELLED", "COMPLETED"]),
|
|
@@ -134,8 +145,27 @@ var EventDetailResponseSchema = EventResponseSchema.extend({
|
|
|
134
145
|
participants: z2.array(ParticipantSchema),
|
|
135
146
|
vpRequest: z2.record(z2.unknown())
|
|
136
147
|
});
|
|
148
|
+
var EventDiscoverSchema = z2.object({
|
|
149
|
+
id: z2.string(),
|
|
150
|
+
name: z2.string(),
|
|
151
|
+
coverImageUrl: z2.string().nullable(),
|
|
152
|
+
thumbnailUrl: z2.string().nullable(),
|
|
153
|
+
description: z2.string().nullable(),
|
|
154
|
+
startDateTime: z2.string(),
|
|
155
|
+
endDateTime: z2.string().nullable(),
|
|
156
|
+
participantCount: z2.number()
|
|
157
|
+
});
|
|
137
158
|
var SECURITY = [{ bearerAuth: [] }];
|
|
138
159
|
var eventsContract = c2.router({
|
|
160
|
+
discover: {
|
|
161
|
+
method: "GET",
|
|
162
|
+
path: "/v1/events/public/discover",
|
|
163
|
+
responses: {
|
|
164
|
+
200: z2.array(EventDiscoverSchema)
|
|
165
|
+
},
|
|
166
|
+
summary: "List public events for discovery (public)",
|
|
167
|
+
metadata: { openApiTags: ["Events"], openApiSecurity: [] }
|
|
168
|
+
},
|
|
139
169
|
create: {
|
|
140
170
|
method: "POST",
|
|
141
171
|
path: "/v1/events",
|
|
@@ -219,9 +249,11 @@ var EventPublicInfoSchema = z3.object({
|
|
|
219
249
|
id: z3.string(),
|
|
220
250
|
name: z3.string(),
|
|
221
251
|
coverImageUrl: z3.string().nullable(),
|
|
252
|
+
thumbnailUrl: z3.string().nullable(),
|
|
222
253
|
description: z3.string().nullable(),
|
|
223
254
|
maxGuests: z3.number(),
|
|
224
|
-
|
|
255
|
+
startDateTime: z3.string(),
|
|
256
|
+
endDateTime: z3.string().nullable(),
|
|
225
257
|
currentGuests: z3.number(),
|
|
226
258
|
status: z3.enum(["ACTIVE", "CANCELLED", "COMPLETED"])
|
|
227
259
|
});
|
|
@@ -255,11 +287,12 @@ var checkinContract = c3.router({
|
|
|
255
287
|
responses: {
|
|
256
288
|
200: CheckinSubmitResponseSchema,
|
|
257
289
|
400: z3.object({ message: z3.string(), errors: z3.array(z3.string()).optional() }),
|
|
290
|
+
401: z3.object({ message: z3.string() }),
|
|
258
291
|
404: z3.object({ message: z3.string() }),
|
|
259
292
|
409: z3.object({ message: z3.string() })
|
|
260
293
|
},
|
|
261
|
-
summary: "Submit VP for event check-in \u2014 issues participation VC on success
|
|
262
|
-
metadata: { openApiTags: ["Check-in"], openApiSecurity: [] }
|
|
294
|
+
summary: "Submit VP for event check-in \u2014 issues participation VC on success",
|
|
295
|
+
metadata: { openApiTags: ["Check-in"], openApiSecurity: [{ bearerAuth: [] }] }
|
|
263
296
|
},
|
|
264
297
|
myCheckins: {
|
|
265
298
|
method: "GET",
|
|
@@ -270,6 +303,7 @@ var checkinContract = c3.router({
|
|
|
270
303
|
id: z3.string(),
|
|
271
304
|
eventId: z3.string(),
|
|
272
305
|
checkedInAt: z3.string(),
|
|
306
|
+
disclosedFields: z3.record(z3.unknown()),
|
|
273
307
|
event: EventPublicInfoSchema
|
|
274
308
|
})
|
|
275
309
|
),
|
|
@@ -306,14 +340,401 @@ var turnContract = c4.router({
|
|
|
306
340
|
}
|
|
307
341
|
});
|
|
308
342
|
|
|
309
|
-
// src/
|
|
343
|
+
// src/v1/uploads.ts
|
|
344
|
+
import { initContract as initContract5 } from "@ts-rest/core";
|
|
345
|
+
import { z as z5 } from "zod";
|
|
310
346
|
var c5 = initContract5();
|
|
311
|
-
var
|
|
312
|
-
|
|
347
|
+
var UploadPresignedUrlSchema = z5.object({
|
|
348
|
+
fileId: z5.string(),
|
|
349
|
+
original: z5.object({
|
|
350
|
+
uploadUrl: z5.string(),
|
|
351
|
+
key: z5.string(),
|
|
352
|
+
publicUrl: z5.string()
|
|
353
|
+
}),
|
|
354
|
+
resize: z5.object({
|
|
355
|
+
uploadUrl: z5.string(),
|
|
356
|
+
key: z5.string(),
|
|
357
|
+
publicUrl: z5.string()
|
|
358
|
+
})
|
|
359
|
+
});
|
|
360
|
+
var uploadsContract = c5.router(
|
|
361
|
+
{
|
|
362
|
+
generatePresignedUrls: {
|
|
363
|
+
method: "POST",
|
|
364
|
+
path: "/urls",
|
|
365
|
+
body: z5.object({}),
|
|
366
|
+
responses: {
|
|
367
|
+
201: UploadPresignedUrlSchema
|
|
368
|
+
},
|
|
369
|
+
summary: "Generate pre-signed URLs for event image upload",
|
|
370
|
+
metadata: { openApiTags: ["Uploads"], openApiSecurity: [{ bearerAuth: [] }] }
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
pathPrefix: "/v1/uploads"
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
// src/v1/tracking.ts
|
|
379
|
+
import { initContract as initContract6 } from "@ts-rest/core";
|
|
380
|
+
import { z as z6 } from "zod";
|
|
381
|
+
var c6 = initContract6();
|
|
382
|
+
var TrackScanRequestSchema = z6.object({
|
|
383
|
+
platform: z6.string(),
|
|
384
|
+
appVersion: z6.string().optional()
|
|
385
|
+
});
|
|
386
|
+
var TrackScanResponseSchema = z6.object({
|
|
387
|
+
id: z6.string()
|
|
388
|
+
});
|
|
389
|
+
var trackingContract = c6.router({
|
|
390
|
+
scan: {
|
|
391
|
+
method: "POST",
|
|
392
|
+
path: "/v1/tracking/scan",
|
|
393
|
+
body: TrackScanRequestSchema,
|
|
394
|
+
responses: {
|
|
395
|
+
201: TrackScanResponseSchema,
|
|
396
|
+
401: z6.object({ message: z6.string() })
|
|
397
|
+
},
|
|
398
|
+
summary: "Record a successful NFC scan event",
|
|
399
|
+
metadata: { openApiTags: ["Tracking"], openApiSecurity: [{ bearerAuth: [] }] }
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
// src/v1/config.ts
|
|
404
|
+
import { initContract as initContract7 } from "@ts-rest/core";
|
|
405
|
+
import { z as z7 } from "zod";
|
|
406
|
+
var c7 = initContract7();
|
|
407
|
+
var appConfigContract = c7.router({
|
|
408
|
+
appConfig: {
|
|
409
|
+
method: "GET",
|
|
410
|
+
path: "/v1/config/app",
|
|
411
|
+
responses: {
|
|
412
|
+
200: z7.object({
|
|
413
|
+
demoMode: z7.object({ enabled: z7.boolean() }),
|
|
414
|
+
publicEvents: z7.object({ enabled: z7.boolean() })
|
|
415
|
+
})
|
|
416
|
+
},
|
|
417
|
+
summary: "Get app configuration (public)",
|
|
418
|
+
metadata: { openApiTags: ["Config"], openApiSecurity: [] }
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// src/v1/organisations.ts
|
|
423
|
+
import { initContract as initContract8 } from "@ts-rest/core";
|
|
424
|
+
import { z as z8 } from "zod";
|
|
425
|
+
var c8 = initContract8();
|
|
426
|
+
var SECURITY2 = [{ bearerAuth: [] }];
|
|
427
|
+
var CreateOrganisationSchema = z8.object({
|
|
428
|
+
name: z8.string().min(1).max(255),
|
|
429
|
+
description: z8.string().optional(),
|
|
430
|
+
verifiablePresentation: z8.record(z8.unknown())
|
|
431
|
+
});
|
|
432
|
+
var UpdateOrganisationSchema = z8.object({
|
|
433
|
+
name: z8.string().min(1).max(255).optional(),
|
|
434
|
+
description: z8.string().nullable().optional(),
|
|
435
|
+
avatarUrl: z8.string().nullable().optional()
|
|
436
|
+
});
|
|
437
|
+
var OrgResponseSchema = z8.object({
|
|
438
|
+
id: z8.string(),
|
|
439
|
+
name: z8.string(),
|
|
440
|
+
description: z8.string().nullable(),
|
|
441
|
+
avatarUrl: z8.string().nullable(),
|
|
442
|
+
didUri: z8.string().nullable(),
|
|
443
|
+
memberCount: z8.number(),
|
|
444
|
+
createdAt: z8.string(),
|
|
445
|
+
updatedAt: z8.string()
|
|
446
|
+
});
|
|
447
|
+
var OrgListItemSchema = OrgResponseSchema.extend({
|
|
448
|
+
role: z8.enum(["OWNER", "ADMIN", "ISSUER", "MEMBER"])
|
|
449
|
+
});
|
|
450
|
+
var OrgDetailResponseSchema = OrgListItemSchema.extend({
|
|
451
|
+
members: z8.array(z8.object({
|
|
452
|
+
id: z8.string(),
|
|
453
|
+
userId: z8.string(),
|
|
454
|
+
displayName: z8.string().nullable(),
|
|
455
|
+
role: z8.enum(["OWNER", "ADMIN", "ISSUER", "MEMBER"]),
|
|
456
|
+
joinedAt: z8.string()
|
|
457
|
+
}))
|
|
458
|
+
});
|
|
459
|
+
var MemberResponseSchema = z8.object({
|
|
460
|
+
id: z8.string(),
|
|
461
|
+
userId: z8.string(),
|
|
462
|
+
displayName: z8.string().nullable(),
|
|
463
|
+
role: z8.enum(["OWNER", "ADMIN", "ISSUER", "MEMBER"]),
|
|
464
|
+
joinedAt: z8.string()
|
|
465
|
+
});
|
|
466
|
+
var UpdateMemberRoleSchema = z8.object({
|
|
467
|
+
role: z8.enum(["ADMIN", "ISSUER", "MEMBER"])
|
|
468
|
+
});
|
|
469
|
+
var CreateInvitationSchema = z8.object({
|
|
470
|
+
expiresInDays: z8.number().int().positive().default(7).optional()
|
|
471
|
+
});
|
|
472
|
+
var InvitationResponseSchema = z8.object({
|
|
473
|
+
id: z8.string(),
|
|
474
|
+
orgId: z8.string(),
|
|
475
|
+
orgName: z8.string(),
|
|
476
|
+
token: z8.string(),
|
|
477
|
+
status: z8.enum(["PENDING", "SUBMITTED", "ACCEPTED", "DECLINED", "EXPIRED"]),
|
|
478
|
+
inviteeDisplayName: z8.string().nullable(),
|
|
479
|
+
createdAt: z8.string(),
|
|
480
|
+
expiresAt: z8.string()
|
|
481
|
+
});
|
|
482
|
+
var JoinInvitationSchema = z8.object({
|
|
483
|
+
verifiablePresentation: z8.record(z8.unknown())
|
|
484
|
+
});
|
|
485
|
+
var IssueVCSchema = z8.object({
|
|
486
|
+
holderDid: z8.string(),
|
|
487
|
+
credentialSubject: z8.record(z8.unknown()),
|
|
488
|
+
type: z8.array(z8.string()).optional()
|
|
489
|
+
});
|
|
490
|
+
var ErrorSchema = z8.object({ message: z8.string() });
|
|
491
|
+
var VpRequestResponseSchema = z8.object({
|
|
492
|
+
vpRequest: z8.record(z8.unknown()),
|
|
493
|
+
expiresAt: z8.string()
|
|
494
|
+
});
|
|
495
|
+
var orgCrudContract = c8.router({
|
|
496
|
+
createVpRequest: {
|
|
497
|
+
method: "POST",
|
|
498
|
+
path: "/v1/organisations/vp-request",
|
|
499
|
+
body: z8.object({}),
|
|
500
|
+
responses: {
|
|
501
|
+
200: VpRequestResponseSchema,
|
|
502
|
+
401: ErrorSchema
|
|
503
|
+
},
|
|
504
|
+
summary: "Get VP request for creating an organisation",
|
|
505
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
506
|
+
},
|
|
507
|
+
create: {
|
|
508
|
+
method: "POST",
|
|
509
|
+
path: "/v1/organisations",
|
|
510
|
+
body: CreateOrganisationSchema,
|
|
511
|
+
responses: {
|
|
512
|
+
201: OrgResponseSchema,
|
|
513
|
+
400: ErrorSchema,
|
|
514
|
+
401: ErrorSchema
|
|
515
|
+
},
|
|
516
|
+
summary: "Create a new organisation (requires CCCD VP)",
|
|
517
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
518
|
+
},
|
|
519
|
+
list: {
|
|
520
|
+
method: "GET",
|
|
521
|
+
path: "/v1/organisations",
|
|
522
|
+
responses: {
|
|
523
|
+
200: z8.array(OrgListItemSchema),
|
|
524
|
+
401: ErrorSchema
|
|
525
|
+
},
|
|
526
|
+
summary: "List user's organisations",
|
|
527
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
528
|
+
},
|
|
529
|
+
getById: {
|
|
530
|
+
method: "GET",
|
|
531
|
+
path: "/v1/organisations/:orgId",
|
|
532
|
+
responses: {
|
|
533
|
+
200: OrgDetailResponseSchema,
|
|
534
|
+
401: ErrorSchema,
|
|
535
|
+
403: ErrorSchema,
|
|
536
|
+
404: ErrorSchema
|
|
537
|
+
},
|
|
538
|
+
summary: "Get organisation details (members only)",
|
|
539
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
540
|
+
},
|
|
541
|
+
update: {
|
|
542
|
+
method: "PATCH",
|
|
543
|
+
path: "/v1/organisations/:orgId",
|
|
544
|
+
body: UpdateOrganisationSchema,
|
|
545
|
+
responses: {
|
|
546
|
+
200: OrgResponseSchema,
|
|
547
|
+
400: ErrorSchema,
|
|
548
|
+
401: ErrorSchema,
|
|
549
|
+
403: ErrorSchema,
|
|
550
|
+
404: ErrorSchema
|
|
551
|
+
},
|
|
552
|
+
summary: "Update organisation details (owner/admin only)",
|
|
553
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
554
|
+
},
|
|
555
|
+
delete: {
|
|
556
|
+
method: "DELETE",
|
|
557
|
+
path: "/v1/organisations/:orgId",
|
|
558
|
+
body: c8.noBody(),
|
|
559
|
+
responses: {
|
|
560
|
+
204: z8.undefined(),
|
|
561
|
+
401: ErrorSchema,
|
|
562
|
+
403: ErrorSchema,
|
|
563
|
+
404: ErrorSchema
|
|
564
|
+
},
|
|
565
|
+
summary: "Delete organisation (owner only)",
|
|
566
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
var orgMembersContract = c8.router({
|
|
570
|
+
listMembers: {
|
|
571
|
+
method: "GET",
|
|
572
|
+
path: "/v1/organisations/:orgId/members",
|
|
573
|
+
responses: {
|
|
574
|
+
200: z8.array(MemberResponseSchema),
|
|
575
|
+
401: ErrorSchema,
|
|
576
|
+
403: ErrorSchema
|
|
577
|
+
},
|
|
578
|
+
summary: "List organisation members",
|
|
579
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
580
|
+
},
|
|
581
|
+
updateMemberRole: {
|
|
582
|
+
method: "PATCH",
|
|
583
|
+
path: "/v1/organisations/:orgId/members/:memberId",
|
|
584
|
+
body: UpdateMemberRoleSchema,
|
|
585
|
+
responses: {
|
|
586
|
+
200: MemberResponseSchema,
|
|
587
|
+
400: ErrorSchema,
|
|
588
|
+
401: ErrorSchema,
|
|
589
|
+
403: ErrorSchema,
|
|
590
|
+
404: ErrorSchema
|
|
591
|
+
},
|
|
592
|
+
summary: "Update member role (owner/admin only)",
|
|
593
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
594
|
+
},
|
|
595
|
+
removeMember: {
|
|
596
|
+
method: "DELETE",
|
|
597
|
+
path: "/v1/organisations/:orgId/members/:memberId",
|
|
598
|
+
body: c8.noBody(),
|
|
599
|
+
responses: {
|
|
600
|
+
204: z8.undefined(),
|
|
601
|
+
400: ErrorSchema,
|
|
602
|
+
401: ErrorSchema,
|
|
603
|
+
403: ErrorSchema,
|
|
604
|
+
404: ErrorSchema
|
|
605
|
+
},
|
|
606
|
+
summary: "Remove member from organisation (owner/admin only)",
|
|
607
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
var orgInvitationsContract = c8.router({
|
|
611
|
+
createInvitation: {
|
|
612
|
+
method: "POST",
|
|
613
|
+
path: "/v1/organisations/:orgId/invitations",
|
|
614
|
+
body: CreateInvitationSchema,
|
|
615
|
+
responses: {
|
|
616
|
+
201: InvitationResponseSchema,
|
|
617
|
+
401: ErrorSchema,
|
|
618
|
+
403: ErrorSchema
|
|
619
|
+
},
|
|
620
|
+
summary: "Create invitation (owner/admin only)",
|
|
621
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
622
|
+
},
|
|
623
|
+
listInvitations: {
|
|
624
|
+
method: "GET",
|
|
625
|
+
path: "/v1/organisations/:orgId/invitations",
|
|
626
|
+
responses: {
|
|
627
|
+
200: z8.array(InvitationResponseSchema),
|
|
628
|
+
401: ErrorSchema,
|
|
629
|
+
403: ErrorSchema
|
|
630
|
+
},
|
|
631
|
+
summary: "List pending invitations (owner/admin only)",
|
|
632
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
633
|
+
},
|
|
634
|
+
joinVpRequest: {
|
|
635
|
+
method: "POST",
|
|
636
|
+
path: "/v1/organisations/invitations/:token/vp-request",
|
|
637
|
+
body: z8.object({}),
|
|
638
|
+
responses: {
|
|
639
|
+
200: VpRequestResponseSchema,
|
|
640
|
+
401: ErrorSchema,
|
|
641
|
+
404: ErrorSchema,
|
|
642
|
+
410: ErrorSchema
|
|
643
|
+
},
|
|
644
|
+
summary: "Get VP request for joining via invitation",
|
|
645
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
646
|
+
},
|
|
647
|
+
joinInvitation: {
|
|
648
|
+
method: "POST",
|
|
649
|
+
path: "/v1/organisations/invitations/:token/join",
|
|
650
|
+
body: JoinInvitationSchema,
|
|
651
|
+
responses: {
|
|
652
|
+
200: z8.object({ message: z8.string() }),
|
|
653
|
+
400: ErrorSchema,
|
|
654
|
+
401: ErrorSchema,
|
|
655
|
+
410: ErrorSchema
|
|
656
|
+
},
|
|
657
|
+
summary: "Invitee submits CCCD VP to join",
|
|
658
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
659
|
+
},
|
|
660
|
+
acceptInvitation: {
|
|
661
|
+
method: "POST",
|
|
662
|
+
path: "/v1/organisations/:orgId/invitations/:invitationId/accept",
|
|
663
|
+
body: z8.object({}),
|
|
664
|
+
responses: {
|
|
665
|
+
200: z8.object({ message: z8.string(), memberId: z8.string() }),
|
|
666
|
+
401: ErrorSchema,
|
|
667
|
+
403: ErrorSchema,
|
|
668
|
+
409: ErrorSchema
|
|
669
|
+
},
|
|
670
|
+
summary: "Accept invitation (owner/admin only)",
|
|
671
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
672
|
+
},
|
|
673
|
+
declineInvitation: {
|
|
674
|
+
method: "POST",
|
|
675
|
+
path: "/v1/organisations/:orgId/invitations/:invitationId/decline",
|
|
676
|
+
body: z8.object({}),
|
|
677
|
+
responses: {
|
|
678
|
+
200: z8.object({ message: z8.string() }),
|
|
679
|
+
401: ErrorSchema,
|
|
680
|
+
403: ErrorSchema,
|
|
681
|
+
409: ErrorSchema
|
|
682
|
+
},
|
|
683
|
+
summary: "Decline invitation (owner/admin only)",
|
|
684
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
var orgCredentialsContract = c8.router({
|
|
688
|
+
issueVC: {
|
|
689
|
+
method: "POST",
|
|
690
|
+
path: "/v1/organisations/:orgId/credentials/issue",
|
|
691
|
+
body: IssueVCSchema,
|
|
692
|
+
responses: {
|
|
693
|
+
201: z8.record(z8.unknown()),
|
|
694
|
+
400: ErrorSchema,
|
|
695
|
+
401: ErrorSchema,
|
|
696
|
+
403: ErrorSchema
|
|
697
|
+
},
|
|
698
|
+
summary: "Issue VC on behalf of organisation (owner/admin/issuer)",
|
|
699
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
700
|
+
},
|
|
701
|
+
listIssuedCredentials: {
|
|
702
|
+
method: "GET",
|
|
703
|
+
path: "/v1/organisations/:orgId/credentials",
|
|
704
|
+
responses: {
|
|
705
|
+
200: z8.array(z8.object({
|
|
706
|
+
id: z8.string(),
|
|
707
|
+
holderDid: z8.string(),
|
|
708
|
+
issuingMemberId: z8.string(),
|
|
709
|
+
credentialJson: z8.record(z8.unknown()),
|
|
710
|
+
issuedAt: z8.string()
|
|
711
|
+
})),
|
|
712
|
+
401: ErrorSchema,
|
|
713
|
+
403: ErrorSchema
|
|
714
|
+
},
|
|
715
|
+
summary: "List issued credentials (owner/admin only)",
|
|
716
|
+
metadata: { openApiTags: ["Organisations"], openApiSecurity: SECURITY2 }
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
var organisationsContract = c8.router({
|
|
720
|
+
crud: orgCrudContract,
|
|
721
|
+
members: orgMembersContract,
|
|
722
|
+
invitations: orgInvitationsContract,
|
|
723
|
+
credentials: orgCredentialsContract
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
// src/index.ts
|
|
727
|
+
var c9 = initContract9();
|
|
728
|
+
var contract = c9.router({
|
|
729
|
+
v1: c9.router({
|
|
313
730
|
auth: authContract,
|
|
314
731
|
events: eventsContract,
|
|
315
732
|
checkin: checkinContract,
|
|
316
|
-
turn: turnContract
|
|
733
|
+
turn: turnContract,
|
|
734
|
+
uploads: uploadsContract,
|
|
735
|
+
tracking: trackingContract,
|
|
736
|
+
config: appConfigContract,
|
|
737
|
+
organisations: organisationsContract
|
|
317
738
|
})
|
|
318
739
|
});
|
|
319
740
|
export {
|
|
@@ -322,20 +743,43 @@ export {
|
|
|
322
743
|
CheckinSubmitRequestSchema,
|
|
323
744
|
CheckinSubmitResponseSchema,
|
|
324
745
|
CreateEventSchema,
|
|
746
|
+
CreateInvitationSchema,
|
|
747
|
+
CreateOrganisationSchema,
|
|
325
748
|
EventDetailResponseSchema,
|
|
749
|
+
EventDiscoverSchema,
|
|
326
750
|
EventPublicInfoSchema,
|
|
327
751
|
EventResponseSchema,
|
|
752
|
+
InvitationResponseSchema,
|
|
753
|
+
IssueVCSchema,
|
|
754
|
+
JoinInvitationSchema,
|
|
755
|
+
MemberResponseSchema,
|
|
756
|
+
OrgDetailResponseSchema,
|
|
757
|
+
OrgListItemSchema,
|
|
758
|
+
OrgResponseSchema,
|
|
328
759
|
ParticipantSchema,
|
|
329
760
|
SUPPORTED_FIELDS,
|
|
761
|
+
TrackScanRequestSchema,
|
|
762
|
+
TrackScanResponseSchema,
|
|
330
763
|
TurnCredentialsResponseSchema,
|
|
331
764
|
UpdateEventSchema,
|
|
765
|
+
UpdateMemberRoleSchema,
|
|
766
|
+
UpdateOrganisationSchema,
|
|
767
|
+
UploadPresignedUrlSchema,
|
|
332
768
|
VerifyRequestSchema,
|
|
333
769
|
VerifyResponseSchema,
|
|
770
|
+
appConfigContract,
|
|
334
771
|
authContract,
|
|
335
772
|
buildAuthMessage,
|
|
336
773
|
checkinContract,
|
|
337
774
|
contract,
|
|
338
775
|
eventsContract,
|
|
339
|
-
|
|
776
|
+
orgCredentialsContract,
|
|
777
|
+
orgCrudContract,
|
|
778
|
+
orgInvitationsContract,
|
|
779
|
+
orgMembersContract,
|
|
780
|
+
organisationsContract,
|
|
781
|
+
trackingContract,
|
|
782
|
+
turnContract,
|
|
783
|
+
uploadsContract
|
|
340
784
|
};
|
|
341
785
|
//# sourceMappingURL=index.mjs.map
|