@vrplatform/api 1.3.1-stage.4776 → 1.3.1-stage.4789

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,5 +1,6 @@
1
1
  import type { ApiClient } from './types';
2
2
  export * from './client';
3
+ export * from './embed-lifecycle';
3
4
  export * from './error';
4
5
  export type * from './generated/v1';
5
6
  export * from './routing';
@@ -1,4 +1,5 @@
1
1
  export * from './client';
2
+ export * from './embed-lifecycle';
2
3
  export * from './error';
3
4
  export * from './routing';
4
5
  export * from './sec';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC","sourcesContent":["import type { ApiClient } from './types';\n\nexport * from './client';\nexport * from './error';\nexport type * from './generated/v1';\nexport * from './routing';\nexport * from './sec';\nexport * from './types';\n\nexport type VRPlatformApi = ApiClient;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC","sourcesContent":["import type { ApiClient } from './types';\n\nexport * from './client';\nexport * from './embed-lifecycle';\nexport * from './error';\nexport type * from './generated/v1';\nexport * from './routing';\nexport * from './sec';\nexport * from './types';\n\nexport type VRPlatformApi = ApiClient;\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.3.1-stage.4776",
6
+ "version": "1.3.1-stage.4789",
7
7
  "description": "",
8
8
  "main": "build/main/index.js",
9
9
  "module": "build/module/index.js",
@@ -27,7 +27,8 @@
27
27
  "dependencies": {
28
28
  "openapi-fetch": "0.15.0",
29
29
  "openapi-typescript": "^7.13.0",
30
- "openapi-typescript-helpers": "^0.0.15"
30
+ "openapi-typescript-helpers": "^0.0.15",
31
+ "zod": "^4.4.3"
31
32
  },
32
33
  "peerDependencies": {
33
34
  "@vrplatform/utils": "*",
@@ -0,0 +1,96 @@
1
+ import { z } from 'zod';
2
+
3
+ const protocol = 'vrplatform.embed.lifecycle';
4
+ const version = 1;
5
+ const envelope = {
6
+ channelId: z.uuid(),
7
+ protocol: z.literal(protocol),
8
+ version: z.literal(version),
9
+ };
10
+ const channelRequestSchema = z
11
+ .object({
12
+ ...envelope,
13
+ requestId: z.uuid(),
14
+ type: z.literal('channel.request'),
15
+ })
16
+ .strict();
17
+ const channelConnectSchema = z
18
+ .object({
19
+ ...envelope,
20
+ replyTo: z.uuid(),
21
+ type: z.literal('channel.connect'),
22
+ })
23
+ .strict();
24
+ const iframeMessageSchema = z.discriminatedUnion('type', [
25
+ z
26
+ .object({
27
+ ...envelope,
28
+ type: z.literal('ready'),
29
+ })
30
+ .strict(),
31
+ z
32
+ .object({
33
+ ...envelope,
34
+ code: z.enum([
35
+ 'authentication_failed',
36
+ 'access_denied',
37
+ 'session_expired',
38
+ 'renewal_failed',
39
+ 'unsupported_version',
40
+ 'internal_error',
41
+ ]),
42
+ correlationId: z.string().min(1).max(128),
43
+ recoverable: z.boolean(),
44
+ replyTo: z.uuid().optional(),
45
+ type: z.literal('error'),
46
+ })
47
+ .strict(),
48
+ z
49
+ .object({
50
+ ...envelope,
51
+ expiresAt: z.iso.datetime({ offset: true }),
52
+ requestId: z.uuid(),
53
+ type: z.literal('session.expiring'),
54
+ })
55
+ .strict(),
56
+ z
57
+ .object({
58
+ ...envelope,
59
+ expiresAt: z.iso.datetime({ offset: true }),
60
+ replyTo: z.uuid(),
61
+ type: z.literal('session.renewed'),
62
+ })
63
+ .strict(),
64
+ z
65
+ .object({
66
+ ...envelope,
67
+ height: z.number().int().positive(),
68
+ type: z.literal('resize'),
69
+ })
70
+ .strict(),
71
+ ]);
72
+ const parentMessageSchema = z.discriminatedUnion('type', [
73
+ z
74
+ .object({
75
+ ...envelope,
76
+ embedUrl: z.url(),
77
+ replyTo: z.uuid(),
78
+ requestId: z.uuid(),
79
+ type: z.literal('session.renew'),
80
+ })
81
+ .strict(),
82
+ ]);
83
+
84
+ export const embedLifecycle = {
85
+ channelConnectSchema,
86
+ channelRequestSchema,
87
+ iframeMessageSchema,
88
+ parentMessageSchema,
89
+ protocol,
90
+ version,
91
+ } as const;
92
+
93
+ export type EmbedLifecycleChannelConnect = z.infer<typeof channelConnectSchema>;
94
+ export type EmbedLifecycleChannelRequest = z.infer<typeof channelRequestSchema>;
95
+ export type EmbedLifecycleIframeMessage = z.infer<typeof iframeMessageSchema>;
96
+ export type EmbedLifecycleParentMessage = z.infer<typeof parentMessageSchema>;
@@ -270,7 +270,7 @@ export interface paths {
270
270
  /** @description List API token metadata for the current team without revealing token secrets. Requires an authenticated team admin or global VRP admin. */
271
271
  get: operations["getApiTokens"];
272
272
  put?: never;
273
- /** @description Generate an API token for the current team and return its secret. Partner teams may provide capability bundles to restrict the token; omission grants unrestricted partner API access. An optional IP allowlist is enforced on every API-key request. Requires an authenticated team admin or global VRP admin. The token secret is never written to audit records. */
273
+ /** @description Generate an API token for the current team and return its secret. Partner teams may provide capability bundles to restrict the token; omission grants unrestricted partner API access. An optional IP allowlist is enforced on every API-key request, and an optional exact parent-origin allowlist restricts embedded-session creation and renewal. Requires an authenticated team admin or global VRP admin. The token secret is never written to audit records. */
274
274
  post: operations["postApiTokens"];
275
275
  delete?: never;
276
276
  options?: never;
@@ -2683,6 +2683,27 @@ export interface paths {
2683
2683
  patch?: never;
2684
2684
  trace?: never;
2685
2685
  };
2686
+ "/partner/embed-sessions/{id}/renewals": {
2687
+ parameters: {
2688
+ query?: never;
2689
+ header?: never;
2690
+ path?: never;
2691
+ cookie?: never;
2692
+ };
2693
+ get?: never;
2694
+ put?: never;
2695
+ /**
2696
+ * @description Issue a single-use successor for an active embedded session without changing its grant or revoking it before exchange.
2697
+ *
2698
+ * Required scope: embedded-sessions:issue
2699
+ */
2700
+ post: operations["renewEmbedSession"];
2701
+ delete?: never;
2702
+ options?: never;
2703
+ head?: never;
2704
+ patch?: never;
2705
+ trace?: never;
2706
+ };
2686
2707
  "/partner/listings": {
2687
2708
  parameters: {
2688
2709
  query?: never;
@@ -8950,6 +8971,7 @@ export interface operations {
8950
8971
  content: {
8951
8972
  "application/json": {
8952
8973
  data: {
8974
+ allowedEmbedParentOrigins: string[];
8953
8975
  allowedIpCidrs: string[];
8954
8976
  bundles: ("embed:exports:v1" | "embed:reports:v1" | "embed:statements:v1" | "partner:accounting-data:v1" | "partner:banking:v1" | "partner:onboarding:v1" | "partner:provisioning:v1" | "partner:reports:v1" | "partner:statements:v1" | "partner:webhooks:v1")[];
8955
8977
  /** Format: uuid */
@@ -9121,6 +9143,8 @@ export interface operations {
9121
9143
  requestBody?: {
9122
9144
  content: {
9123
9145
  "application/json": {
9146
+ /** @description Exact HTTP(S) parent origins allowed when this partner token creates embedded sessions. A non-empty list is enforced exactly on issuance and renewal; omission currently leaves parent origins unrestricted. An empty array is rejected. Rejected for ordinary teams. */
9147
+ allowedEmbedParentOrigins?: string[];
9124
9148
  /** @description Optional IPv4 or IPv6 addresses and CIDRs allowed to use this token. Individual addresses are normalized to /32 or /128. Omit or send an empty array for no IP restriction. */
9125
9149
  allowedIpCidrs?: string[];
9126
9150
  /** @description Optional capability restrictions for a partner-owned API token. Omit for unrestricted partner API access. Rejected for ordinary teams. */
@@ -9136,6 +9160,7 @@ export interface operations {
9136
9160
  };
9137
9161
  content: {
9138
9162
  "application/json": {
9163
+ allowedEmbedParentOrigins: string[];
9139
9164
  allowedIpCidrs: string[];
9140
9165
  bundles: ("embed:exports:v1" | "embed:reports:v1" | "embed:statements:v1" | "partner:accounting-data:v1" | "partner:banking:v1" | "partner:onboarding:v1" | "partner:provisioning:v1" | "partner:reports:v1" | "partner:statements:v1" | "partner:webhooks:v1")[];
9141
9166
  /** Format: uuid */
@@ -9306,6 +9331,7 @@ export interface operations {
9306
9331
  };
9307
9332
  content: {
9308
9333
  "application/json": {
9334
+ allowedEmbedParentOrigins: string[];
9309
9335
  allowedIpCidrs: string[];
9310
9336
  bundles: ("embed:exports:v1" | "embed:reports:v1" | "embed:statements:v1" | "partner:accounting-data:v1" | "partner:banking:v1" | "partner:onboarding:v1" | "partner:provisioning:v1" | "partner:reports:v1" | "partner:statements:v1" | "partner:webhooks:v1")[];
9311
9337
  /** Format: uuid */
@@ -21322,11 +21348,21 @@ export interface operations {
21322
21348
  accessToken: string;
21323
21349
  /** @description Embedded capability bundles granted to the session. */
21324
21350
  bundles: ("embed:exports:v1" | "embed:reports:v1" | "embed:statements:v1")[];
21351
+ /**
21352
+ * Format: uuid
21353
+ * @description Stable lifecycle channel ID for this iframe.
21354
+ */
21355
+ channelId: string;
21325
21356
  /**
21326
21357
  * Format: date-time
21327
21358
  * @description Bearer-token expiration timestamp.
21328
21359
  */
21329
21360
  expiresAt: string;
21361
+ /**
21362
+ * Format: uri
21363
+ * @description Exact parent-page origin bound to the lifecycle channel.
21364
+ */
21365
+ parentOrigin: string;
21330
21366
  /**
21331
21367
  * Format: uuid
21332
21368
  * @description Session ID created by the partner backend.
@@ -42735,6 +42771,16 @@ export interface operations {
42735
42771
  autoProvision?: boolean;
42736
42772
  /** @description Embedded capability bundles granted to the session. */
42737
42773
  bundles: ("embed:exports:v1" | "embed:reports:v1" | "embed:statements:v1")[];
42774
+ /**
42775
+ * Format: uri
42776
+ * @description Exact embedded-application origin that will exchange the bootstrap.
42777
+ */
42778
+ embedOrigin: string;
42779
+ /**
42780
+ * Format: uri
42781
+ * @description Exact parent-page origin to bind to this iframe lifecycle channel.
42782
+ */
42783
+ parentOrigin: string;
42738
42784
  /** @description Stable external user identifier in the partner system. */
42739
42785
  sub: string;
42740
42786
  /**
@@ -42762,6 +42808,11 @@ export interface operations {
42762
42808
  * @description Deadline for exchanging the one-time bootstrap code.
42763
42809
  */
42764
42810
  bootstrapExpiresAt: string;
42811
+ /**
42812
+ * Format: uuid
42813
+ * @description Stable lifecycle channel ID for this iframe.
42814
+ */
42815
+ channelId: string;
42765
42816
  /**
42766
42817
  * Format: uri
42767
42818
  * @description Ready-to-mount embedded application URL.
@@ -42772,6 +42823,11 @@ export interface operations {
42772
42823
  * @description Session ID used for explicit revocation.
42773
42824
  */
42774
42825
  id: string;
42826
+ /**
42827
+ * Format: uri
42828
+ * @description Exact parent-page origin bound to the lifecycle channel.
42829
+ */
42830
+ parentOrigin: string;
42775
42831
  /**
42776
42832
  * @description Bearer-session lifetime, starting when the code is exchanged.
42777
42833
  * @constant
@@ -43084,6 +43140,204 @@ export interface operations {
43084
43140
  };
43085
43141
  };
43086
43142
  };
43143
+ renewEmbedSession: {
43144
+ parameters: {
43145
+ query?: never;
43146
+ header?: never;
43147
+ path: {
43148
+ /** @description Active embedded session to replace. */
43149
+ id: string;
43150
+ };
43151
+ cookie?: never;
43152
+ };
43153
+ requestBody?: never;
43154
+ responses: {
43155
+ /** @description Successful response */
43156
+ 200: {
43157
+ headers: {
43158
+ /** @description Prevents storage of the successor bootstrap URL and code. */
43159
+ "Cache-Control"?: "no-store";
43160
+ [name: string]: unknown;
43161
+ };
43162
+ content: {
43163
+ "application/json": {
43164
+ /**
43165
+ * Format: date-time
43166
+ * @description Deadline for exchanging the one-time bootstrap code.
43167
+ */
43168
+ bootstrapExpiresAt: string;
43169
+ /**
43170
+ * Format: uuid
43171
+ * @description Stable lifecycle channel ID for this iframe.
43172
+ */
43173
+ channelId: string;
43174
+ /**
43175
+ * Format: uri
43176
+ * @description Ready-to-mount embedded application URL.
43177
+ */
43178
+ embedUrl: string;
43179
+ /**
43180
+ * Format: uuid
43181
+ * @description Session ID used for explicit revocation.
43182
+ */
43183
+ id: string;
43184
+ /**
43185
+ * Format: uri
43186
+ * @description Exact parent-page origin bound to the lifecycle channel.
43187
+ */
43188
+ parentOrigin: string;
43189
+ /**
43190
+ * @description Bearer-session lifetime, starting when the code is exchanged.
43191
+ * @constant
43192
+ */
43193
+ sessionTtlSeconds: 900;
43194
+ /**
43195
+ * Format: uuid
43196
+ * @description Team bound to the embedded session.
43197
+ */
43198
+ teamId: string;
43199
+ /**
43200
+ * Format: uuid
43201
+ * @description VRPlatform user bound to the session.
43202
+ */
43203
+ userId: string;
43204
+ };
43205
+ };
43206
+ };
43207
+ /** @description Bad request */
43208
+ 400: {
43209
+ headers: {
43210
+ [name: string]: unknown;
43211
+ };
43212
+ content: {
43213
+ "application/json": {
43214
+ code: string;
43215
+ message: string;
43216
+ links?: {
43217
+ docs: string;
43218
+ schema: string;
43219
+ };
43220
+ issues?: {
43221
+ message: string;
43222
+ path?: (string | number)[];
43223
+ schema?: string;
43224
+ }[];
43225
+ context?: unknown;
43226
+ };
43227
+ };
43228
+ };
43229
+ /** @description Unauthorized */
43230
+ 401: {
43231
+ headers: {
43232
+ [name: string]: unknown;
43233
+ };
43234
+ content: {
43235
+ "application/json": {
43236
+ code: string;
43237
+ message: string;
43238
+ links?: {
43239
+ docs: string;
43240
+ schema: string;
43241
+ };
43242
+ issues?: {
43243
+ message: string;
43244
+ path?: (string | number)[];
43245
+ schema?: string;
43246
+ }[];
43247
+ context?: unknown;
43248
+ };
43249
+ };
43250
+ };
43251
+ /** @description Forbidden */
43252
+ 403: {
43253
+ headers: {
43254
+ [name: string]: unknown;
43255
+ };
43256
+ content: {
43257
+ "application/json": {
43258
+ code: string;
43259
+ message: string;
43260
+ links?: {
43261
+ docs: string;
43262
+ schema: string;
43263
+ };
43264
+ issues?: {
43265
+ message: string;
43266
+ path?: (string | number)[];
43267
+ schema?: string;
43268
+ }[];
43269
+ context?: unknown;
43270
+ };
43271
+ };
43272
+ };
43273
+ /** @description Not found */
43274
+ 404: {
43275
+ headers: {
43276
+ [name: string]: unknown;
43277
+ };
43278
+ content: {
43279
+ "application/json": {
43280
+ code: string;
43281
+ message: string;
43282
+ links?: {
43283
+ docs: string;
43284
+ schema: string;
43285
+ };
43286
+ issues?: {
43287
+ message: string;
43288
+ path?: (string | number)[];
43289
+ schema?: string;
43290
+ }[];
43291
+ context?: unknown;
43292
+ };
43293
+ };
43294
+ };
43295
+ /** @description Internal server error */
43296
+ 500: {
43297
+ headers: {
43298
+ [name: string]: unknown;
43299
+ };
43300
+ content: {
43301
+ "application/json": {
43302
+ code: string;
43303
+ message: string;
43304
+ links?: {
43305
+ docs: string;
43306
+ schema: string;
43307
+ };
43308
+ issues?: {
43309
+ message: string;
43310
+ path?: (string | number)[];
43311
+ schema?: string;
43312
+ }[];
43313
+ context?: unknown;
43314
+ };
43315
+ };
43316
+ };
43317
+ /** @description Service unavailable */
43318
+ 503: {
43319
+ headers: {
43320
+ [name: string]: unknown;
43321
+ };
43322
+ content: {
43323
+ "application/json": {
43324
+ code: string;
43325
+ message: string;
43326
+ links?: {
43327
+ docs: string;
43328
+ schema: string;
43329
+ };
43330
+ issues?: {
43331
+ message: string;
43332
+ path?: (string | number)[];
43333
+ schema?: string;
43334
+ }[];
43335
+ context?: unknown;
43336
+ };
43337
+ };
43338
+ };
43339
+ };
43340
+ };
43087
43341
  getPartnerListings: {
43088
43342
  parameters: {
43089
43343
  query?: {
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { ApiClient } from './types';
2
2
 
3
3
  export * from './client';
4
+ export * from './embed-lifecycle';
4
5
  export * from './error';
5
6
  export type * from './generated/v1';
6
7
  export * from './routing';