@domino-sdk/relay 1.30.1 → 1.32.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,8 @@ import {
16
16
  automaticSchedulingRetrySchema,
17
17
  automaticSchedulingSchema,
18
18
  deploymentActionSchema,
19
+ deploymentHistoryPageSchema,
20
+ deploymentHistoryQuerySchema,
19
21
  deploymentPreviewSchema,
20
22
  deploymentRecordSchema,
21
23
  deploymentRejectionSchema,
@@ -25,7 +27,7 @@ import {
25
27
  publishDeploymentSchema,
26
28
  rejectDeploymentSchema,
27
29
  submitDeploymentSchema
28
- } from "../chunk-FU2KGJMQ.js";
30
+ } from "../chunk-BEGFBWEG.js";
29
31
  import "../chunk-4OC7REYX.js";
30
32
  import {
31
33
  DEFAULT_MANAGEMENT_TIMEOUT,
@@ -34,6 +36,8 @@ import {
34
36
  REFERRAL_INTEGRATION_REWARD_ERROR,
35
37
  actionIdOf,
36
38
  containsReferralIntegrationReward,
39
+ credentialSecretInputSchema,
40
+ credentialSecretSchema,
37
41
  identityIntegrationInputSchema,
38
42
  identityIntegrationSchema,
39
43
  identityIntegrationSecretSchema,
@@ -44,7 +48,7 @@ import {
44
48
  participantExchangeSchema,
45
49
  questConfiguration,
46
50
  sequenceCursorSchema
47
- } from "../chunk-4EX7JIGW.js";
51
+ } from "../chunk-BSOXLXQO.js";
48
52
  import {
49
53
  parseImageExtraction,
50
54
  parseImageResult
@@ -83,9 +87,10 @@ import {
83
87
  questEnrollmentSchema,
84
88
  questPublicationPreviewSchema,
85
89
  rewardDeliveriesSchema,
90
+ rewardDeliveryQuerySchema,
86
91
  rewardDeliverySchema,
87
92
  saveQuestDraftSchema
88
- } from "../chunk-6NWCLBXR.js";
93
+ } from "../chunk-MHPTCD5O.js";
89
94
  import {
90
95
  badgeMutationResultSchema,
91
96
  badgeMutationSchema,
@@ -130,6 +135,8 @@ import {
130
135
  publishedLeaderboardSchema,
131
136
  publishedReferralSchema,
132
137
  redemptionCancellationSchema,
138
+ redemptionPageSchema,
139
+ redemptionQuerySchema,
133
140
  redemptionSchema,
134
141
  referralControlSchema,
135
142
  referralHistorySchema,
@@ -137,14 +144,14 @@ import {
137
144
  referralQualificationSchema,
138
145
  referralRewardResolutionSchema,
139
146
  referralSuspensionSchema
140
- } from "../chunk-WPD4N3OP.js";
147
+ } from "../chunk-5QZGXYH7.js";
141
148
  import {
142
149
  telegramChatConnectionSchema,
143
150
  telegramChatIdSchema,
144
151
  telegramChatsSchema
145
152
  } from "../chunk-BUHGXKPY.js";
146
153
  import "../chunk-V7K7XXFB.js";
147
- import "../chunk-FTZG6KMQ.js";
154
+ import "../chunk-CCUJ4UJG.js";
148
155
  import "../chunk-466IRAJP.js";
149
156
  import {
150
157
  CompletionSourceKind,
@@ -1417,6 +1424,11 @@ var operatorUserSchema = z14.object({
1417
1424
  avatar: z14.string().nullable()
1418
1425
  });
1419
1426
  var projectSchema = z14.object({
1427
+ /**
1428
+ * Names the project's hosted addresses. The server gives a new project, and accepts in a
1429
+ * slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
1430
+ * checks only the format, so it parses every slug that exists.
1431
+ */
1420
1432
  slug: z14.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
1421
1433
  createdBy: z14.string().nullable().optional(),
1422
1434
  creator: operatorUserSchema.nullable().optional(),
@@ -1860,6 +1872,34 @@ var tokenSchema = z14.object({
1860
1872
  expiresAt: z14.number()
1861
1873
  });
1862
1874
  var issuedTokenSchema = tokenSchema.extend({ token: z14.string() });
1875
+ var serviceKeyInputSchema = z14.object({
1876
+ name: z14.string().trim().min(1).max(80),
1877
+ permissions: z14.array(permissionSchema).min(1).refine(
1878
+ (permissions) => !permissions.includes("access"),
1879
+ "Service keys cannot hold the access permission"
1880
+ ),
1881
+ /** Days until the first secret expires. Omit it for a key that never expires. */
1882
+ expiresInDays: z14.number().int().min(1).max(3650).optional()
1883
+ }).strict();
1884
+ var serviceKeySchema = z14.object({
1885
+ id: z14.string().uuid(),
1886
+ organization: z14.string(),
1887
+ project: z14.string(),
1888
+ environment: environmentSchema,
1889
+ name: z14.string(),
1890
+ permissions: permissionListSchema,
1891
+ /** The Clerk user ID of the administrator who created it. */
1892
+ createdBy: z14.string(),
1893
+ createdAt: z14.number(),
1894
+ /** The latest use of any of its secrets, revoked ones included; null when none was used. */
1895
+ lastUsedAt: z14.number().nullable(),
1896
+ /** Its working secrets, oldest first. Any of them authenticates the key. */
1897
+ secrets: z14.array(credentialSecretSchema)
1898
+ });
1899
+ var issuedServiceKeySchema = serviceKeySchema.extend({
1900
+ secret: z14.string().uuid(),
1901
+ token: z14.string()
1902
+ });
1863
1903
  var teamSchema = z14.array(
1864
1904
  z14.object({ id: z14.string(), label: z14.string() })
1865
1905
  );
@@ -2654,7 +2694,22 @@ function managementClient(options) {
2654
2694
  )
2655
2695
  },
2656
2696
  deployments: {
2697
+ /**
2698
+ * At most the 100 newest deployments, with both published heads added.
2699
+ *
2700
+ * @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
2701
+ */
2657
2702
  list: (call) => get("/deployments", z14.array(deploymentRecordSchema), call),
2703
+ /**
2704
+ * The project environment's deployments, newest first, one page at a time, with the two
2705
+ * newest published deployments beside every page. Pass a page's `nextCursor` back as
2706
+ * `cursor` for the next page.
2707
+ */
2708
+ history: (query = {}, call) => get(
2709
+ `/deployments/history${queryString(deploymentHistoryQuerySchema.parse(query))}`,
2710
+ deploymentHistoryPageSchema,
2711
+ call
2712
+ ),
2658
2713
  get: (deployment, call) => get(
2659
2714
  `/deployments/${identifier.parse(deployment)}`,
2660
2715
  deploymentRecordSchema,
@@ -2937,6 +2992,15 @@ function managementClient(options) {
2937
2992
  )
2938
2993
  },
2939
2994
  redemptions: {
2995
+ /**
2996
+ * Redemptions, newest first, one page at a time: everyone's, or one `member`'s. Pass a
2997
+ * page's `nextCursor` back as `cursor` for the next page.
2998
+ */
2999
+ history: (query = {}, call) => get(
3000
+ `/redemptions/history${queryString(redemptionQuerySchema.parse(query))}`,
3001
+ redemptionPageSchema,
3002
+ call
3003
+ ),
2940
3004
  pause: (input, call) => operationVerb("redemptions", true, input, call),
2941
3005
  resume: (input, call) => operationVerb("redemptions", false, input, call)
2942
3006
  },
@@ -3014,6 +3078,11 @@ function managementClient(options) {
3014
3078
  call
3015
3079
  ),
3016
3080
  list: (call) => get("/offers", z14.array(offerSchema), call),
3081
+ /**
3082
+ * Every redemption, or one member's, newest first, in one unbounded response.
3083
+ *
3084
+ * @deprecated Use `redemptions.history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
3085
+ */
3017
3086
  redemptions: (input = {}, call) => get(
3018
3087
  `/redemptions${queryString({ member: input.member })}`,
3019
3088
  z14.array(redemptionSchema),
@@ -3087,6 +3156,46 @@ function managementClient(options) {
3087
3156
  call
3088
3157
  )
3089
3158
  },
3159
+ /**
3160
+ * Service keys (`dsk_`): credentials for an app's own backend in the selected project and
3161
+ * environment, owned by no person. Only an organization administrator in Console manages them.
3162
+ */
3163
+ serviceKeys: {
3164
+ list: (call) => get("/service-keys", z14.array(serviceKeySchema), call),
3165
+ /** The secret `token` is in this response only. */
3166
+ create: (input, call) => post(
3167
+ "/service-keys",
3168
+ issuedServiceKeySchema,
3169
+ serviceKeyInputSchema.parse(input),
3170
+ call
3171
+ ),
3172
+ /**
3173
+ * Rotation: issues another secret. The key's other secrets keep working until you revoke
3174
+ * them with `revokeSecret`. The new `token` is in this response only.
3175
+ */
3176
+ addSecret: (id, input = {}, call) => post(
3177
+ `/service-keys/${z14.string().uuid().parse(id)}/secrets`,
3178
+ issuedServiceKeySchema,
3179
+ credentialSecretInputSchema.parse(input),
3180
+ call
3181
+ ),
3182
+ /** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
3183
+ revokeSecret: (id, secret, call) => request(
3184
+ `/service-keys/${z14.string().uuid().parse(id)}/secrets/${z14.string().uuid().parse(secret)}`,
3185
+ serviceKeySchema,
3186
+ void 0,
3187
+ "DELETE",
3188
+ call
3189
+ ),
3190
+ /** Deletes the key; every secret stops working. */
3191
+ revoke: (id, call) => request(
3192
+ `/service-keys/${z14.string().uuid().parse(id)}`,
3193
+ z14.null(),
3194
+ void 0,
3195
+ "DELETE",
3196
+ call
3197
+ )
3198
+ },
3090
3199
  /** Who holds which roles on the client's project; organization administrators only. */
3091
3200
  grants: {
3092
3201
  list: (call) => get("/grants", z14.array(grantRecordSchema), call),
@@ -3182,13 +3291,47 @@ function managementClient(options) {
3182
3291
  identityIntegrationInputSchema.parse(input),
3183
3292
  call
3184
3293
  ),
3185
- /** Replaces the key's secret and extends it by 90 days; the old secret stops working. */
3294
+ /**
3295
+ * Replaces every secret with one new secret that never expires; the old secrets stop working
3296
+ * at once.
3297
+ *
3298
+ * @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
3299
+ */
3186
3300
  rotate: (id, call) => post(
3187
3301
  `/identity-integrations/${z14.string().uuid().parse(id)}/rotate`,
3188
3302
  identityIntegrationSecretSchema,
3189
3303
  {},
3190
3304
  call
3191
3305
  ),
3306
+ /**
3307
+ * Rotation: issues another secret. The integration's other secrets keep working until you
3308
+ * revoke them with `revokeSecret`. The new `token` is in this response only.
3309
+ */
3310
+ addSecret: (id, input = {}, call) => post(
3311
+ `/identity-integrations/${z14.string().uuid().parse(id)}/secrets`,
3312
+ identityIntegrationSecretSchema,
3313
+ credentialSecretInputSchema.parse(input),
3314
+ call
3315
+ ),
3316
+ /**
3317
+ * Stops one secret working; member sessions stay signed in. The last secret cannot be
3318
+ * revoked; disconnect the integration with `revoke` instead.
3319
+ */
3320
+ revokeSecret: (id, secret, call) => request(
3321
+ `/identity-integrations/${z14.string().uuid().parse(id)}/secrets/${z14.string().uuid().parse(secret)}`,
3322
+ identityIntegrationSchema,
3323
+ void 0,
3324
+ "DELETE",
3325
+ call
3326
+ ),
3327
+ /** Makes one secret never expire. */
3328
+ removeSecretExpiry: (id, secret, call) => request(
3329
+ `/identity-integrations/${z14.string().uuid().parse(id)}/secrets/${z14.string().uuid().parse(secret)}/expiry`,
3330
+ identityIntegrationSchema,
3331
+ void 0,
3332
+ "DELETE",
3333
+ call
3334
+ ),
3192
3335
  /**
3193
3336
  * The `app:<name>` kinds claimed in the project and environment, each with the integration
3194
3337
  * that owns its identities, connected or not, and how many it has. A new integration reusing
@@ -3267,11 +3410,22 @@ function managementClient(options) {
3267
3410
  call
3268
3411
  )
3269
3412
  },
3270
- rewardDeliveries: (member, call) => get(
3271
- `/reward-deliveries${queryString({ member })}`,
3272
- rewardDeliveriesSchema,
3273
- call
3274
- ),
3413
+ /**
3414
+ * Reward deliveries, newest first, one page at a time: everyone's, or one member's. Pass a
3415
+ * member ID, or `{ member, cursor, limit }` with a page's `nextCursor` as `cursor` for older
3416
+ * deliveries.
3417
+ */
3418
+ rewardDeliveries: (query, call) => {
3419
+ const { member, ...page } = typeof query === "object" ? query : { member: query };
3420
+ return get(
3421
+ `/reward-deliveries${queryString({
3422
+ member,
3423
+ ...rewardDeliveryQuerySchema.parse(page)
3424
+ })}`,
3425
+ rewardDeliveriesSchema,
3426
+ call
3427
+ );
3428
+ },
3275
3429
  /**
3276
3430
  * Relinquish automatic removal for an external assignment; requires `review` and an audited reason.
3277
3431
  *
@@ -4024,6 +4178,9 @@ var managementResponseSchemas = lazyResponseReaders({
4024
4178
  get counterModerationResultSchema() {
4025
4179
  return knownResponse(counterModerationResultSchema);
4026
4180
  },
4181
+ get deploymentHistoryPageSchema() {
4182
+ return knownResponse(deploymentHistoryPageSchema);
4183
+ },
4027
4184
  get deploymentPreviewSchema() {
4028
4185
  return knownResponse(deploymentPreviewSchema);
4029
4186
  },
@@ -4078,6 +4235,12 @@ var managementResponseSchemas = lazyResponseReaders({
4078
4235
  get issuedTokenSchema() {
4079
4236
  return knownResponse(issuedTokenSchema);
4080
4237
  },
4238
+ get serviceKeySchema() {
4239
+ return knownResponse(serviceKeySchema);
4240
+ },
4241
+ get issuedServiceKeySchema() {
4242
+ return knownResponse(issuedServiceKeySchema);
4243
+ },
4081
4244
  get leaderboardPageSchema() {
4082
4245
  return knownResponse(leaderboardPageSchema);
4083
4246
  },
@@ -4225,6 +4388,9 @@ var managementResponseSchemas = lazyResponseReaders({
4225
4388
  get redemptionSchema() {
4226
4389
  return knownResponse(redemptionSchema);
4227
4390
  },
4391
+ get redemptionPageSchema() {
4392
+ return knownResponse(redemptionPageSchema);
4393
+ },
4228
4394
  get referralHistorySchema() {
4229
4395
  return knownResponse(referralHistorySchema);
4230
4396
  },
@@ -4361,6 +4527,7 @@ var managementResponses = {
4361
4527
  ),
4362
4528
  counterHistorySchema: responseSchema(counterHistorySchema),
4363
4529
  counterModerationResultSchema: responseSchema(counterModerationResultSchema),
4530
+ deploymentHistoryPageSchema: responseSchema(deploymentHistoryPageSchema),
4364
4531
  deploymentPreviewSchema: responseSchema(deploymentPreviewSchema),
4365
4532
  deploymentRecordSchema: responseSchema(deploymentRecordSchema),
4366
4533
  deploymentResultSchema: responseSchema(deploymentResultSchema),
@@ -4383,6 +4550,8 @@ var managementResponses = {
4383
4550
  ),
4384
4551
  identityKindClaimSchema: responseSchema(identityKindClaimSchema),
4385
4552
  issuedTokenSchema: responseSchema(issuedTokenSchema),
4553
+ serviceKeySchema: responseSchema(serviceKeySchema),
4554
+ issuedServiceKeySchema: responseSchema(issuedServiceKeySchema),
4386
4555
  leaderboardPageSchema: responseSchema(leaderboardPageSchema),
4387
4556
  leaderboardSettlementSchema: responseSchema(leaderboardSettlementSchema),
4388
4557
  leaderboardSettlementSummarySchema: responseSchema(
@@ -4434,6 +4603,7 @@ var managementResponses = {
4434
4603
  questPublicationPreviewSchema: responseSchema(questPublicationPreviewSchema),
4435
4604
  readinessSchema: responseSchema(readinessSchema),
4436
4605
  redemptionSchema: responseSchema(redemptionSchema),
4606
+ redemptionPageSchema: responseSchema(redemptionPageSchema),
4437
4607
  referralHistorySchema: responseSchema(referralHistorySchema),
4438
4608
  referralManagementSchema: responseSchema(referralManagementSchema),
4439
4609
  resourceLifecycleResultSchema: responseSchema(resourceLifecycleResultSchema),
@@ -4538,6 +4708,8 @@ export {
4538
4708
  createGroupSchema,
4539
4709
  createManagementClient,
4540
4710
  createRepositorySchema,
4711
+ credentialSecretInputSchema,
4712
+ credentialSecretSchema,
4541
4713
  deploymentActionSchema,
4542
4714
  deploymentRejectionSchema,
4543
4715
  developmentPreflightSchema,
@@ -4578,6 +4750,7 @@ export {
4578
4750
  isIntegrationParticipantPath,
4579
4751
  isManagementError,
4580
4752
  isParticipantRoute,
4753
+ issuedServiceKeySchema,
4581
4754
  issuedTokenSchema,
4582
4755
  leaderboardSettlementRejectionSchema,
4583
4756
  leaderboardSettlementReviewPageSchema,
@@ -4674,6 +4847,8 @@ export {
4674
4847
  roleSchema,
4675
4848
  scheduledInvocationSchema,
4676
4849
  sequenceCursorSchema,
4850
+ serviceKeyInputSchema,
4851
+ serviceKeySchema,
4677
4852
  sourceDataSchema,
4678
4853
  sourceRoles,
4679
4854
  stageRequestSchema,
@@ -1,5 +1,5 @@
1
1
  import { a as AuthProvider, b as TelegramSignInMethods } from './accounts-DRPENuZe.js';
2
- import { p as createRelayClient, k as RelayRequestOptions, g as RelayError } from './client-Ciy0g8Hx.js';
2
+ import { p as createRelayClient, k as RelayRequestOptions, g as RelayError } from './client-CFFgPnIX.js';
3
3
  import { b as ParticipantSession } from './participant-activity-BPZiW7m7.js';
4
4
  import { C as CosmosChain, a as CosmosNetwork, f as WalletSigner, d as WalletSignInNetwork } from './wallet-t7uNDg9p.js';
5
5