@snokam/platform-client 3.0.0 → 3.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.
@@ -22,6 +22,8 @@ import type {
22
22
  AppCatalogEntry,
23
23
  AppModule,
24
24
  ApproveDeviceRequest,
25
+ AuthorizationPreview,
26
+ AuthorizationRequest,
25
27
  BillingPaymentMethod,
26
28
  BillingSessionRequest,
27
29
  BillingSessionResponse,
@@ -57,6 +59,7 @@ import type {
57
59
  IntegrationSummary,
58
60
  InviteCredentialRequest,
59
61
  InvoiceBasis,
62
+ IssuedAuthorizationCode,
60
63
  LoginConfig,
61
64
  MeApp,
62
65
  MeterEnforcementDecision,
@@ -133,6 +136,10 @@ export interface ApproveDeviceOperationRequest {
133
136
  approveDeviceRequest: ApproveDeviceRequest;
134
137
  }
135
138
 
139
+ export interface ApproveOAuthAuthorizationRequest {
140
+ authorizationRequest: AuthorizationRequest;
141
+ }
142
+
136
143
  export interface AssignBusinessEmployeeSystemRequest {
137
144
  id: string;
138
145
  upn: string;
@@ -454,6 +461,10 @@ export interface PreviewDeviceRequest {
454
461
  code: string;
455
462
  }
456
463
 
464
+ export interface PreviewOAuthAuthorizationRequest {
465
+ authorizationRequest: AuthorizationRequest;
466
+ }
467
+
457
468
  export interface ProvisionBusinessRequest {
458
469
  id: string;
459
470
  }
@@ -748,6 +759,60 @@ export class PlatformClient extends runtime.BaseAPI {
748
759
  return await response.value();
749
760
  }
750
761
 
762
+ /**
763
+ * Creates request options for approveOAuthAuthorization without sending the request
764
+ */
765
+ async approveOAuthAuthorizationRequestOpts(requestParameters: ApproveOAuthAuthorizationRequest): Promise<runtime.RequestOpts> {
766
+ if (requestParameters['authorizationRequest'] == null) {
767
+ throw new runtime.RequiredError(
768
+ 'authorizationRequest',
769
+ 'Required parameter "authorizationRequest" was null or undefined when calling approveOAuthAuthorization().'
770
+ );
771
+ }
772
+
773
+ const queryParameters: any = {};
774
+
775
+ const headerParameters: runtime.HTTPHeaders = {};
776
+
777
+ headerParameters['Content-Type'] = 'application/json';
778
+
779
+ if (this.configuration && this.configuration.accessToken) {
780
+ // oauth required
781
+ headerParameters["Authorization"] = await this.configuration.accessToken("Implicit", []);
782
+ }
783
+
784
+
785
+ let urlPath = `/v1.0/protected/oauth/authorization`;
786
+
787
+ return {
788
+ path: urlPath,
789
+ method: 'POST',
790
+ headers: headerParameters,
791
+ query: queryParameters,
792
+ body: requestParameters['authorizationRequest'],
793
+ };
794
+ }
795
+
796
+ /**
797
+ * Called by the login site after the user consents. Issues a single-use authorization code the app redeems at the token endpoint.
798
+ * Record the user\'s approval of an app\'s sign-in request
799
+ */
800
+ async approveOAuthAuthorizationRaw(requestParameters: ApproveOAuthAuthorizationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IssuedAuthorizationCode>> {
801
+ const requestOptions = await this.approveOAuthAuthorizationRequestOpts(requestParameters);
802
+ const response = await this.request(requestOptions, initOverrides);
803
+
804
+ return new runtime.JSONApiResponse(response);
805
+ }
806
+
807
+ /**
808
+ * Called by the login site after the user consents. Issues a single-use authorization code the app redeems at the token endpoint.
809
+ * Record the user\'s approval of an app\'s sign-in request
810
+ */
811
+ async approveOAuthAuthorization(requestParameters: ApproveOAuthAuthorizationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IssuedAuthorizationCode> {
812
+ const response = await this.approveOAuthAuthorizationRaw(requestParameters, initOverrides);
813
+ return await response.value();
814
+ }
815
+
751
816
  /**
752
817
  * Creates request options for assignBusinessEmployeeSystem without sending the request
753
818
  */
@@ -5434,6 +5499,60 @@ export class PlatformClient extends runtime.BaseAPI {
5434
5499
  return await response.value();
5435
5500
  }
5436
5501
 
5502
+ /**
5503
+ * Creates request options for previewOAuthAuthorization without sending the request
5504
+ */
5505
+ async previewOAuthAuthorizationRequestOpts(requestParameters: PreviewOAuthAuthorizationRequest): Promise<runtime.RequestOpts> {
5506
+ if (requestParameters['authorizationRequest'] == null) {
5507
+ throw new runtime.RequiredError(
5508
+ 'authorizationRequest',
5509
+ 'Required parameter "authorizationRequest" was null or undefined when calling previewOAuthAuthorization().'
5510
+ );
5511
+ }
5512
+
5513
+ const queryParameters: any = {};
5514
+
5515
+ const headerParameters: runtime.HTTPHeaders = {};
5516
+
5517
+ headerParameters['Content-Type'] = 'application/json';
5518
+
5519
+ if (this.configuration && this.configuration.accessToken) {
5520
+ // oauth required
5521
+ headerParameters["Authorization"] = await this.configuration.accessToken("Implicit", []);
5522
+ }
5523
+
5524
+
5525
+ let urlPath = `/v1.0/protected/oauth/authorization/preview`;
5526
+
5527
+ return {
5528
+ path: urlPath,
5529
+ method: 'POST',
5530
+ headers: headerParameters,
5531
+ query: queryParameters,
5532
+ body: requestParameters['authorizationRequest'],
5533
+ };
5534
+ }
5535
+
5536
+ /**
5537
+ * Called by the login site. Validates the app, redirect URI and resource for the user whose access token is in the body, and names the app.
5538
+ * Describe an app\'s sign-in request before the user approves it
5539
+ */
5540
+ async previewOAuthAuthorizationRaw(requestParameters: PreviewOAuthAuthorizationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthorizationPreview>> {
5541
+ const requestOptions = await this.previewOAuthAuthorizationRequestOpts(requestParameters);
5542
+ const response = await this.request(requestOptions, initOverrides);
5543
+
5544
+ return new runtime.JSONApiResponse(response);
5545
+ }
5546
+
5547
+ /**
5548
+ * Called by the login site. Validates the app, redirect URI and resource for the user whose access token is in the body, and names the app.
5549
+ * Describe an app\'s sign-in request before the user approves it
5550
+ */
5551
+ async previewOAuthAuthorization(requestParameters: PreviewOAuthAuthorizationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthorizationPreview> {
5552
+ const response = await this.previewOAuthAuthorizationRaw(requestParameters, initOverrides);
5553
+ return await response.value();
5554
+ }
5555
+
5437
5556
  /**
5438
5557
  * Creates request options for provisionBusiness without sending the request
5439
5558
  */
@@ -5908,7 +6027,7 @@ export class PlatformClient extends runtime.BaseAPI {
5908
6027
  }
5909
6028
 
5910
6029
  /**
5911
- * Returns the shared platform Sanity project, dataset, studio URL and read token used as the content fallback layer for every tenant. All four values live in platform Key Vault (editable in platform-web), so nothing Sanity-related is baked onto frontends. This is a render-path config endpoint, so it accepts any principal from the platform Entra tenant — the platform managed identity in production, or a Snøkam developer\'s az session locally — with no operator role required.
6030
+ * Returns the shared platform Sanity project, dataset, studio URL and read token used as the content fallback layer for every tenant. All four values live in platform Key Vault (editable in platform-web), so nothing Sanity-related is baked onto frontends. The answer is cached in-process for five minutes and served stale if Key Vault is briefly unreachable. This is a render-path config endpoint, so it accepts any principal from the platform Entra tenant — the platform managed identity in production, or a Snøkam developer\'s az session locally — with no operator role required.
5912
6031
  * Resolve the platform Sanity read config
5913
6032
  */
5914
6033
  async resolvePlatformSanityConfigRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PlatformSanityConfig>> {
@@ -5919,7 +6038,7 @@ export class PlatformClient extends runtime.BaseAPI {
5919
6038
  }
5920
6039
 
5921
6040
  /**
5922
- * Returns the shared platform Sanity project, dataset, studio URL and read token used as the content fallback layer for every tenant. All four values live in platform Key Vault (editable in platform-web), so nothing Sanity-related is baked onto frontends. This is a render-path config endpoint, so it accepts any principal from the platform Entra tenant — the platform managed identity in production, or a Snøkam developer\'s az session locally — with no operator role required.
6041
+ * Returns the shared platform Sanity project, dataset, studio URL and read token used as the content fallback layer for every tenant. All four values live in platform Key Vault (editable in platform-web), so nothing Sanity-related is baked onto frontends. The answer is cached in-process for five minutes and served stale if Key Vault is briefly unreachable. This is a render-path config endpoint, so it accepts any principal from the platform Entra tenant — the platform managed identity in production, or a Snøkam developer\'s az session locally — with no operator role required.
5923
6042
  * Resolve the platform Sanity read config
5924
6043
  */
5925
6044
  async resolvePlatformSanityConfig(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PlatformSanityConfig> {
@@ -279,6 +279,68 @@ export interface ApproveDeviceRequest {
279
279
  */
280
280
  name?: string | null;
281
281
  }
282
+ /**
283
+ *
284
+ * @export
285
+ * @interface AuthorizationPreview
286
+ */
287
+ export interface AuthorizationPreview {
288
+ /**
289
+ *
290
+ * @type {string}
291
+ * @memberof AuthorizationPreview
292
+ */
293
+ businessName?: string | null;
294
+ /**
295
+ *
296
+ * @type {string}
297
+ * @memberof AuthorizationPreview
298
+ */
299
+ clientName?: string | null;
300
+ }
301
+ /**
302
+ *
303
+ * @export
304
+ * @interface AuthorizationRequest
305
+ */
306
+ export interface AuthorizationRequest {
307
+ /**
308
+ *
309
+ * @type {string}
310
+ * @memberof AuthorizationRequest
311
+ */
312
+ clientId?: string | null;
313
+ /**
314
+ *
315
+ * @type {string}
316
+ * @memberof AuthorizationRequest
317
+ */
318
+ codeChallenge?: string | null;
319
+ /**
320
+ *
321
+ * @type {string}
322
+ * @memberof AuthorizationRequest
323
+ */
324
+ codeChallengeMethod?: string | null;
325
+ /**
326
+ *
327
+ * @type {string}
328
+ * @memberof AuthorizationRequest
329
+ */
330
+ redirectUri?: string | null;
331
+ /**
332
+ *
333
+ * @type {string}
334
+ * @memberof AuthorizationRequest
335
+ */
336
+ resource?: string | null;
337
+ /**
338
+ *
339
+ * @type {string}
340
+ * @memberof AuthorizationRequest
341
+ */
342
+ userToken?: string | null;
343
+ }
282
344
  /**
283
345
  *
284
346
  * @export
@@ -2398,6 +2460,19 @@ export interface InvoiceBasisLine {
2398
2460
  */
2399
2461
  unitPriceOre?: number | null;
2400
2462
  }
2463
+ /**
2464
+ *
2465
+ * @export
2466
+ * @interface IssuedAuthorizationCode
2467
+ */
2468
+ export interface IssuedAuthorizationCode {
2469
+ /**
2470
+ *
2471
+ * @type {string}
2472
+ * @memberof IssuedAuthorizationCode
2473
+ */
2474
+ code?: string | null;
2475
+ }
2401
2476
  /**
2402
2477
  *
2403
2478
  * @export
@@ -3342,6 +3417,12 @@ export interface PatchEmployee {
3342
3417
  * @memberof PatchEmployee
3343
3418
  */
3344
3419
  isSeekingProject?: boolean | null;
3420
+ /**
3421
+ *
3422
+ * @type {boolean}
3423
+ * @memberof PatchEmployee
3424
+ */
3425
+ leadershipGroupMember?: boolean | null;
3345
3426
  /**
3346
3427
  *
3347
3428
  * @type {string}
@@ -3390,12 +3471,6 @@ export interface PatchEmployee {
3390
3471
  * @memberof PatchEmployee
3391
3472
  */
3392
3473
  parentalLeaveCoverage?: PatchEmployeeParentalLeaveCoverageEnum | null;
3393
- /**
3394
- *
3395
- * @type {string}
3396
- * @memberof PatchEmployee
3397
- */
3398
- parentalLeaveStartDate?: string;
3399
3474
  /**
3400
3475
  *
3401
3476
  * @type {string}
@@ -4122,6 +4197,12 @@ export interface ProtectedEmployee {
4122
4197
  * @memberof ProtectedEmployee
4123
4198
  */
4124
4199
  isSeekingProject?: boolean;
4200
+ /**
4201
+ *
4202
+ * @type {boolean}
4203
+ * @memberof ProtectedEmployee
4204
+ */
4205
+ leadershipGroupMember?: boolean;
4125
4206
  /**
4126
4207
  *
4127
4208
  * @type {string}
@@ -4170,12 +4251,6 @@ export interface ProtectedEmployee {
4170
4251
  * @memberof ProtectedEmployee
4171
4252
  */
4172
4253
  parentalLeaveCoverage?: ProtectedEmployeeParentalLeaveCoverageEnum | null;
4173
- /**
4174
- *
4175
- * @type {string}
4176
- * @memberof ProtectedEmployee
4177
- */
4178
- parentalLeaveStartDate?: string;
4179
4254
  /**
4180
4255
  *
4181
4256
  * @type {string}
@@ -4955,6 +5030,12 @@ export interface SanityEmployeeGroupsInner {
4955
5030
  * @memberof SanityEmployeeGroupsInner
4956
5031
  */
4957
5032
  scopeGrants?: Array<string>;
5033
+ /**
5034
+ *
5035
+ * @type {string}
5036
+ * @memberof SanityEmployeeGroupsInner
5037
+ */
5038
+ slackChannel?: string;
4958
5039
  }
4959
5040
 
4960
5041