@wix/auto_sdk_identity_oauth 1.0.9 → 1.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 (121) hide show
  1. package/build/cjs/{src/identity-oauth-v1-refresh-token-oauth.types.d.ts → identity-oauth-v1-refresh-token-oauth.universal-DIzKUWYi.d.ts} +53 -35
  2. package/build/cjs/index.d.ts +37 -1
  3. package/build/cjs/index.js +256 -15
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/meta.d.ts +81 -1
  6. package/build/cjs/meta.js +179 -15
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/{internal/cjs/src/identity-oauth-v1-refresh-token-oauth.types.d.ts → es/identity-oauth-v1-refresh-token-oauth.universal-DIzKUWYi.d.mts} +53 -35
  9. package/build/es/index.d.mts +37 -0
  10. package/build/es/index.mjs +233 -0
  11. package/build/es/index.mjs.map +1 -0
  12. package/build/es/meta.d.mts +81 -0
  13. package/build/es/meta.mjs +154 -0
  14. package/build/es/meta.mjs.map +1 -0
  15. package/build/internal/{es/src/identity-oauth-v1-refresh-token-oauth.types.d.ts → cjs/identity-oauth-v1-refresh-token-oauth.universal-DIzKUWYi.d.ts} +53 -35
  16. package/build/internal/cjs/index.d.ts +37 -1
  17. package/build/internal/cjs/index.js +256 -15
  18. package/build/internal/cjs/index.js.map +1 -1
  19. package/build/internal/cjs/meta.d.ts +81 -1
  20. package/build/internal/cjs/meta.js +179 -15
  21. package/build/internal/cjs/meta.js.map +1 -1
  22. package/build/{es/src/identity-oauth-v1-refresh-token-oauth.types.d.ts → internal/es/identity-oauth-v1-refresh-token-oauth.universal-DIzKUWYi.d.mts} +53 -35
  23. package/build/internal/es/index.d.mts +37 -0
  24. package/build/internal/es/index.mjs +233 -0
  25. package/build/internal/es/index.mjs.map +1 -0
  26. package/build/internal/es/meta.d.mts +81 -0
  27. package/build/internal/es/meta.mjs +154 -0
  28. package/build/internal/es/meta.mjs.map +1 -0
  29. package/package.json +10 -9
  30. package/build/cjs/index.typings.d.ts +0 -1
  31. package/build/cjs/index.typings.js +0 -18
  32. package/build/cjs/index.typings.js.map +0 -1
  33. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.context.d.ts +0 -6
  34. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.context.js +0 -10
  35. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.context.js.map +0 -1
  36. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.http.d.ts +0 -21
  37. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.http.js +0 -134
  38. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.http.js.map +0 -1
  39. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.d.ts +0 -14
  40. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.js +0 -66
  41. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.js.map +0 -1
  42. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.public.d.ts +0 -34
  43. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.public.js +0 -20
  44. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.public.js.map +0 -1
  45. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.types.js +0 -17
  46. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.types.js.map +0 -1
  47. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.d.ts +0 -294
  48. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.js +0 -143
  49. package/build/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.js.map +0 -1
  50. package/build/es/index.d.ts +0 -1
  51. package/build/es/index.js +0 -2
  52. package/build/es/index.js.map +0 -1
  53. package/build/es/index.typings.d.ts +0 -1
  54. package/build/es/index.typings.js +0 -2
  55. package/build/es/index.typings.js.map +0 -1
  56. package/build/es/meta.d.ts +0 -1
  57. package/build/es/meta.js +0 -2
  58. package/build/es/meta.js.map +0 -1
  59. package/build/es/src/identity-oauth-v1-refresh-token-oauth.context.d.ts +0 -6
  60. package/build/es/src/identity-oauth-v1-refresh-token-oauth.context.js +0 -6
  61. package/build/es/src/identity-oauth-v1-refresh-token-oauth.context.js.map +0 -1
  62. package/build/es/src/identity-oauth-v1-refresh-token-oauth.http.d.ts +0 -21
  63. package/build/es/src/identity-oauth-v1-refresh-token-oauth.http.js +0 -129
  64. package/build/es/src/identity-oauth-v1-refresh-token-oauth.http.js.map +0 -1
  65. package/build/es/src/identity-oauth-v1-refresh-token-oauth.meta.d.ts +0 -14
  66. package/build/es/src/identity-oauth-v1-refresh-token-oauth.meta.js +0 -38
  67. package/build/es/src/identity-oauth-v1-refresh-token-oauth.meta.js.map +0 -1
  68. package/build/es/src/identity-oauth-v1-refresh-token-oauth.public.d.ts +0 -34
  69. package/build/es/src/identity-oauth-v1-refresh-token-oauth.public.js +0 -14
  70. package/build/es/src/identity-oauth-v1-refresh-token-oauth.public.js.map +0 -1
  71. package/build/es/src/identity-oauth-v1-refresh-token-oauth.types.js +0 -14
  72. package/build/es/src/identity-oauth-v1-refresh-token-oauth.types.js.map +0 -1
  73. package/build/es/src/identity-oauth-v1-refresh-token-oauth.universal.d.ts +0 -294
  74. package/build/es/src/identity-oauth-v1-refresh-token-oauth.universal.js +0 -115
  75. package/build/es/src/identity-oauth-v1-refresh-token-oauth.universal.js.map +0 -1
  76. package/build/internal/cjs/index.typings.d.ts +0 -1
  77. package/build/internal/cjs/index.typings.js +0 -18
  78. package/build/internal/cjs/index.typings.js.map +0 -1
  79. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.context.d.ts +0 -6
  80. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.context.js +0 -10
  81. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.context.js.map +0 -1
  82. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.http.d.ts +0 -21
  83. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.http.js +0 -134
  84. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.http.js.map +0 -1
  85. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.d.ts +0 -14
  86. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.js +0 -66
  87. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.meta.js.map +0 -1
  88. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.public.d.ts +0 -34
  89. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.public.js +0 -20
  90. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.public.js.map +0 -1
  91. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.types.js +0 -17
  92. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.types.js.map +0 -1
  93. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.d.ts +0 -294
  94. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.js +0 -143
  95. package/build/internal/cjs/src/identity-oauth-v1-refresh-token-oauth.universal.js.map +0 -1
  96. package/build/internal/es/index.d.ts +0 -1
  97. package/build/internal/es/index.js +0 -2
  98. package/build/internal/es/index.js.map +0 -1
  99. package/build/internal/es/index.typings.d.ts +0 -1
  100. package/build/internal/es/index.typings.js +0 -2
  101. package/build/internal/es/index.typings.js.map +0 -1
  102. package/build/internal/es/meta.d.ts +0 -1
  103. package/build/internal/es/meta.js +0 -2
  104. package/build/internal/es/meta.js.map +0 -1
  105. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.context.d.ts +0 -6
  106. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.context.js +0 -6
  107. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.context.js.map +0 -1
  108. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.http.d.ts +0 -21
  109. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.http.js +0 -129
  110. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.http.js.map +0 -1
  111. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.meta.d.ts +0 -14
  112. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.meta.js +0 -38
  113. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.meta.js.map +0 -1
  114. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.public.d.ts +0 -34
  115. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.public.js +0 -14
  116. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.public.js.map +0 -1
  117. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.types.js +0 -14
  118. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.types.js.map +0 -1
  119. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.universal.d.ts +0 -294
  120. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.universal.js +0 -115
  121. package/build/internal/es/src/identity-oauth-v1-refresh-token-oauth.universal.js.map +0 -1
@@ -1,11 +1,11 @@
1
- export interface RefreshToken {
1
+ interface RefreshToken {
2
2
  token?: string;
3
3
  }
4
4
  /**
5
5
  * AuthorizeRequest is sent by the client to the authorization server to initiate
6
6
  * the authorization process.
7
7
  */
8
- export interface AuthorizeRequest {
8
+ interface AuthorizeRequest {
9
9
  /**
10
10
  * ID of the Wix OAuth app requesting authorization.
11
11
  * @format GUID
@@ -70,16 +70,16 @@ export interface AuthorizeRequest {
70
70
  */
71
71
  signInUrl?: string | null;
72
72
  }
73
- export interface RawHttpResponse {
73
+ interface RawHttpResponse {
74
74
  body?: Uint8Array;
75
75
  statusCode?: number | null;
76
76
  headers?: HeadersEntry[];
77
77
  }
78
- export interface HeadersEntry {
78
+ interface HeadersEntry {
79
79
  key?: string;
80
80
  value?: string;
81
81
  }
82
- export interface RawHttpRequest {
82
+ interface RawHttpRequest {
83
83
  body?: Uint8Array;
84
84
  pathParams?: PathParametersEntry[];
85
85
  queryParams?: QueryParametersEntry[];
@@ -88,15 +88,15 @@ export interface RawHttpRequest {
88
88
  rawPath?: string;
89
89
  rawQuery?: string;
90
90
  }
91
- export interface PathParametersEntry {
91
+ interface PathParametersEntry {
92
92
  key?: string;
93
93
  value?: string;
94
94
  }
95
- export interface QueryParametersEntry {
95
+ interface QueryParametersEntry {
96
96
  key?: string;
97
97
  value?: string;
98
98
  }
99
- export interface DeviceCodeRequest {
99
+ interface DeviceCodeRequest {
100
100
  /** The ID of the application that asks for authorization. */
101
101
  clientId?: string;
102
102
  /**
@@ -105,7 +105,7 @@ export interface DeviceCodeRequest {
105
105
  */
106
106
  scope?: string | null;
107
107
  }
108
- export interface DeviceCodeResponse {
108
+ interface DeviceCodeResponse {
109
109
  /** is the unique code for the device. When the user goes to the verification_uri in their browser-based device, this code will be bound to their session. */
110
110
  deviceCode?: string;
111
111
  /** contains the code that should be input at the verification_uri to authorize the device. */
@@ -117,13 +117,13 @@ export interface DeviceCodeResponse {
117
117
  /** indicates the interval (in seconds) at which the app should poll the token URL to request a token. clients MUST use 5 as the default */
118
118
  interval?: number | null;
119
119
  }
120
- export interface DeviceVerifyRequest {
120
+ interface DeviceVerifyRequest {
121
121
  /** User code representing a currently authorizing device. */
122
122
  userCode?: string;
123
123
  }
124
- export interface DeviceVerifyResponse {
124
+ interface DeviceVerifyResponse {
125
125
  }
126
- export interface DeviceVerifyV2Request {
126
+ interface DeviceVerifyV2Request {
127
127
  /**
128
128
  * User code representing a currently authorizing device.
129
129
  * @minLength 8
@@ -131,21 +131,21 @@ export interface DeviceVerifyV2Request {
131
131
  */
132
132
  userCode?: string;
133
133
  }
134
- export interface DeviceVerifyV2Response {
134
+ interface DeviceVerifyV2Response {
135
135
  }
136
- export interface InvalidateUserCodeRequest {
136
+ interface InvalidateUserCodeRequest {
137
137
  /** user code to invalidate. Only the authorizing identity is able to invalidate it. */
138
138
  userCode?: string;
139
139
  }
140
- export interface InvalidateUserCodeResponse {
140
+ interface InvalidateUserCodeResponse {
141
141
  }
142
- export interface RevokeRefreshTokenRequest {
142
+ interface RevokeRefreshTokenRequest {
143
143
  /** The refresh token itself. Anyone with the token itself is able to revoke it. */
144
144
  token?: string;
145
145
  }
146
- export interface RevokeRefreshTokenResponse {
146
+ interface RevokeRefreshTokenResponse {
147
147
  }
148
- export interface TokenInfoResponse {
148
+ interface TokenInfoResponse {
149
149
  active?: boolean;
150
150
  /** subject type. */
151
151
  subjectType?: SubjectTypeWithLiterals;
@@ -169,7 +169,7 @@ export interface TokenInfoResponse {
169
169
  */
170
170
  vendorProductId?: string | null;
171
171
  }
172
- export declare enum SubjectType {
172
+ declare enum SubjectType {
173
173
  /** unknown subject type */
174
174
  UNKNOWN = "UNKNOWN",
175
175
  /** user subject type */
@@ -182,16 +182,16 @@ export declare enum SubjectType {
182
182
  APP = "APP"
183
183
  }
184
184
  /** @enumType */
185
- export type SubjectTypeWithLiterals = SubjectType | 'UNKNOWN' | 'USER' | 'VISITOR' | 'MEMBER' | 'APP';
186
- export interface Empty {
185
+ type SubjectTypeWithLiterals = SubjectType | 'UNKNOWN' | 'USER' | 'VISITOR' | 'MEMBER' | 'APP';
186
+ interface Empty {
187
187
  }
188
- export interface DomainEvent extends DomainEventBodyOneOf {
188
+ interface DomainEvent extends DomainEventBodyOneOf {
189
189
  createdEvent?: EntityCreatedEvent;
190
190
  updatedEvent?: EntityUpdatedEvent;
191
191
  deletedEvent?: EntityDeletedEvent;
192
192
  actionEvent?: ActionEvent;
193
193
  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
194
- id?: string;
194
+ _id?: string;
195
195
  /**
196
196
  * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
197
197
  * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
@@ -220,32 +220,50 @@ export interface DomainEvent extends DomainEventBodyOneOf {
220
220
  entityEventSequence?: string | null;
221
221
  }
222
222
  /** @oneof */
223
- export interface DomainEventBodyOneOf {
223
+ interface DomainEventBodyOneOf {
224
224
  createdEvent?: EntityCreatedEvent;
225
225
  updatedEvent?: EntityUpdatedEvent;
226
226
  deletedEvent?: EntityDeletedEvent;
227
227
  actionEvent?: ActionEvent;
228
228
  }
229
- export interface EntityCreatedEvent {
230
- entityAsJson?: string;
231
- /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
232
- restoreInfo?: RestoreInfo;
229
+ interface EntityCreatedEvent {
230
+ entity?: string;
233
231
  }
234
- export interface RestoreInfo {
232
+ interface RestoreInfo {
235
233
  deletedDate?: Date | null;
236
234
  }
237
- export interface EntityUpdatedEvent {
235
+ interface EntityUpdatedEvent {
238
236
  /**
239
237
  * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
240
238
  * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
241
239
  * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
242
240
  */
243
- currentEntityAsJson?: string;
241
+ currentEntity?: string;
244
242
  }
245
- export interface EntityDeletedEvent {
243
+ interface EntityDeletedEvent {
246
244
  /** Entity that was deleted. */
247
- deletedEntityAsJson?: string | null;
245
+ deletedEntity?: string | null;
248
246
  }
249
- export interface ActionEvent {
250
- bodyAsJson?: string;
247
+ interface ActionEvent {
248
+ body?: string;
251
249
  }
250
+ interface TokenOptions {
251
+ body?: Uint8Array;
252
+ pathParams?: PathParametersEntry[];
253
+ queryParams?: QueryParametersEntry[];
254
+ headers?: HeadersEntry[];
255
+ method?: string;
256
+ rawPath?: string;
257
+ rawQuery?: string;
258
+ }
259
+ interface TokenInfoOptions {
260
+ body?: Uint8Array;
261
+ pathParams?: PathParametersEntry[];
262
+ queryParams?: QueryParametersEntry[];
263
+ headers?: HeadersEntry[];
264
+ method?: string;
265
+ rawPath?: string;
266
+ rawQuery?: string;
267
+ }
268
+
269
+ export { type AuthorizeRequest as A, type DeviceCodeRequest as D, type Empty as E, type HeadersEntry as H, type InvalidateUserCodeRequest as I, type PathParametersEntry as P, type QueryParametersEntry as Q, type RawHttpResponse as R, SubjectType as S, type TokenOptions as T, type TokenInfoOptions as a, type TokenInfoResponse as b, type RefreshToken as c, type RawHttpRequest as d, type DeviceCodeResponse as e, type DeviceVerifyRequest as f, type DeviceVerifyResponse as g, type DeviceVerifyV2Request as h, type DeviceVerifyV2Response as i, type InvalidateUserCodeResponse as j, type RevokeRefreshTokenRequest as k, type RevokeRefreshTokenResponse as l, type DomainEvent as m, type DomainEventBodyOneOf as n, type EntityCreatedEvent as o, type RestoreInfo as p, type EntityUpdatedEvent as q, type EntityDeletedEvent as r, type ActionEvent as s };
@@ -1 +1,37 @@
1
- export * from './src/identity-oauth-v1-refresh-token-oauth.context.js';
1
+ import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { T as TokenOptions, R as RawHttpResponse, a as TokenInfoOptions, b as TokenInfoResponse } from './identity-oauth-v1-refresh-token-oauth.universal-DIzKUWYi.js';
3
+ export { s as ActionEvent, A as AuthorizeRequest, D as DeviceCodeRequest, e as DeviceCodeResponse, f as DeviceVerifyRequest, g as DeviceVerifyResponse, h as DeviceVerifyV2Request, i as DeviceVerifyV2Response, m as DomainEvent, n as DomainEventBodyOneOf, E as Empty, o as EntityCreatedEvent, r as EntityDeletedEvent, q as EntityUpdatedEvent, H as HeadersEntry, I as InvalidateUserCodeRequest, j as InvalidateUserCodeResponse, P as PathParametersEntry, Q as QueryParametersEntry, d as RawHttpRequest, c as RefreshToken, p as RestoreInfo, k as RevokeRefreshTokenRequest, l as RevokeRefreshTokenResponse, S as SubjectType } from './identity-oauth-v1-refresh-token-oauth.universal-DIzKUWYi.js';
4
+
5
+ declare function token$1(httpClient: HttpClient): TokenSignature;
6
+ interface TokenSignature {
7
+ /**
8
+ * Creates an access token.
9
+ *
10
+ *
11
+ * The endpoint accepts raw HTTP requests. You must pass the request's body
12
+ * parameters formatted as bytes in the raw HTTP request's `body` field,
13
+ * following this template:
14
+ * `{"grantType": "client_credentials", "client_id": "<APP_ID>", "client_secret": "<APP_SECRET_KEY>", "instance_id": "<INSTANCE_ID>"}`.
15
+ *
16
+ * When the call succeeds, Wix returns `{"statusCode": 200}` and the created access
17
+ * token in the `body` field of the raw HTTP response.
18
+ *
19
+ * In case the call fails, Wix returns the relevant `4XX` error code in the raw
20
+ * HTTP response's `statusCode` field and details
21
+ * about the error in `body`. Error details follow the
22
+ * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).
23
+ */
24
+ (options?: TokenOptions | undefined): Promise<RawHttpResponse>;
25
+ }
26
+ declare function tokenInfo$1(httpClient: HttpClient): TokenInfoSignature;
27
+ interface TokenInfoSignature {
28
+ /**
29
+ * Token Introspection Endpoint.
30
+ */
31
+ (options?: TokenInfoOptions | undefined): Promise<TokenInfoResponse>;
32
+ }
33
+
34
+ declare const token: MaybeContext<BuildRESTFunction<typeof token$1> & typeof token$1>;
35
+ declare const tokenInfo: MaybeContext<BuildRESTFunction<typeof tokenInfo$1> & typeof tokenInfo$1>;
36
+
37
+ export { RawHttpResponse, TokenInfoOptions, TokenInfoResponse, TokenOptions, token, tokenInfo };
@@ -1,18 +1,259 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
15
9
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/identity-oauth-v1-refresh-token-oauth.context.js"), exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ SubjectType: () => SubjectType,
24
+ token: () => token4,
25
+ tokenInfo: () => tokenInfo4
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+
29
+ // src/identity-oauth-v1-refresh-token-oauth.universal.ts
30
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
31
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
32
+
33
+ // src/identity-oauth-v1-refresh-token-oauth.http.ts
34
+ var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
35
+ var import_bytes2 = require("@wix/sdk-runtime/transformations/bytes");
36
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
37
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
38
+ function resolveWixIdentityOauth2V1Oauth2NgUrl(opts) {
39
+ const domainToMappings = {
40
+ "manage._base_domain_": [
41
+ {
42
+ srcPath: "/oauth2",
43
+ destPath: "/v1/oauth"
44
+ }
45
+ ],
46
+ "www.wixapis.com": [
47
+ {
48
+ srcPath: "/oauth2",
49
+ destPath: "/v1/oauth"
50
+ },
51
+ {
52
+ srcPath: "/oauth2/token_info",
53
+ destPath: "/v1/token_info"
54
+ }
55
+ ],
56
+ "users._base_domain_": [
57
+ {
58
+ srcPath: "/v1/oauth/device/verify",
59
+ destPath: "/v1/oauth/device/verify"
60
+ },
61
+ {
62
+ srcPath: "/v1/oauth/manage/user-code",
63
+ destPath: "/v1/oauth/manage/user-code"
64
+ },
65
+ {
66
+ srcPath: "/v2/oauth/device/verify",
67
+ destPath: "/v2/oauth/device/verify"
68
+ },
69
+ {
70
+ srcPath: "/v1/oauth/authorize",
71
+ destPath: "/v1/oauth/authorize"
72
+ }
73
+ ],
74
+ _: [
75
+ {
76
+ srcPath: "/_api/oauth2",
77
+ destPath: "/v1/oauth"
78
+ }
79
+ ],
80
+ "platform.rise.ai": [
81
+ {
82
+ srcPath: "/oauth2",
83
+ destPath: "/v1/oauth"
84
+ }
85
+ ],
86
+ "api._api_base_domain_": [
87
+ {
88
+ srcPath: "/oauth2-ng",
89
+ destPath: ""
90
+ }
91
+ ]
92
+ };
93
+ return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
94
+ }
95
+ var PACKAGE_NAME = "@wix/auto_sdk_identity_oauth";
96
+ function token(payload) {
97
+ function __token({ host }) {
98
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
99
+ { transformFn: import_bytes.transformSDKBytesToRESTBytes, paths: [{ path: "body" }] }
100
+ ]);
101
+ const metadata = {
102
+ entityFqdn: "wix.identity.oauth.v1.refresh_token",
103
+ method: "POST",
104
+ methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.Token",
105
+ packageName: PACKAGE_NAME,
106
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
107
+ protoPath: "/v1/oauth/token",
108
+ data: serializedData,
109
+ host
110
+ }),
111
+ data: serializedData,
112
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
113
+ {
114
+ transformFn: import_bytes2.transformRESTBytesToSDKBytes,
115
+ paths: [{ path: "body" }]
116
+ }
117
+ ])
118
+ };
119
+ return metadata;
120
+ }
121
+ return __token;
122
+ }
123
+ function tokenInfo(payload) {
124
+ function __tokenInfo({ host }) {
125
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
126
+ { transformFn: import_bytes.transformSDKBytesToRESTBytes, paths: [{ path: "body" }] }
127
+ ]);
128
+ const metadata = {
129
+ entityFqdn: "wix.identity.oauth.v1.refresh_token",
130
+ method: "POST",
131
+ methodFqn: "wix.identity.oauth2.v1.Oauth2Ng.TokenInfo",
132
+ packageName: PACKAGE_NAME,
133
+ url: resolveWixIdentityOauth2V1Oauth2NgUrl({
134
+ protoPath: "/v1/oauth/token-info",
135
+ data: serializedData,
136
+ host
137
+ }),
138
+ data: serializedData
139
+ };
140
+ return metadata;
141
+ }
142
+ return __tokenInfo;
143
+ }
144
+
145
+ // src/identity-oauth-v1-refresh-token-oauth.universal.ts
146
+ var SubjectType = /* @__PURE__ */ ((SubjectType2) => {
147
+ SubjectType2["UNKNOWN"] = "UNKNOWN";
148
+ SubjectType2["USER"] = "USER";
149
+ SubjectType2["VISITOR"] = "VISITOR";
150
+ SubjectType2["MEMBER"] = "MEMBER";
151
+ SubjectType2["APP"] = "APP";
152
+ return SubjectType2;
153
+ })(SubjectType || {});
154
+ async function token2(options) {
155
+ const { httpClient, sideEffects } = arguments[1];
156
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
157
+ body: options?.body,
158
+ pathParams: options?.pathParams,
159
+ queryParams: options?.queryParams,
160
+ headers: options?.headers,
161
+ method: options?.method,
162
+ rawPath: options?.rawPath,
163
+ rawQuery: options?.rawQuery
164
+ });
165
+ const reqOpts = token(payload);
166
+ sideEffects?.onSiteCall?.();
167
+ try {
168
+ const result = await httpClient.request(reqOpts);
169
+ sideEffects?.onSuccess?.(result);
170
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
171
+ } catch (err) {
172
+ const transformedError = (0, import_transform_error.transformError)(
173
+ err,
174
+ {
175
+ spreadPathsToArguments: {},
176
+ explicitPathsToArguments: {
177
+ body: "$[0].body",
178
+ pathParams: "$[0].pathParams",
179
+ queryParams: "$[0].queryParams",
180
+ headers: "$[0].headers",
181
+ method: "$[0].method",
182
+ rawPath: "$[0].rawPath",
183
+ rawQuery: "$[0].rawQuery"
184
+ },
185
+ singleArgumentUnchanged: false
186
+ },
187
+ ["options"]
188
+ );
189
+ sideEffects?.onError?.(err);
190
+ throw transformedError;
191
+ }
192
+ }
193
+ async function tokenInfo2(options) {
194
+ const { httpClient, sideEffects } = arguments[1];
195
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
196
+ body: options?.body,
197
+ pathParams: options?.pathParams,
198
+ queryParams: options?.queryParams,
199
+ headers: options?.headers,
200
+ method: options?.method,
201
+ rawPath: options?.rawPath,
202
+ rawQuery: options?.rawQuery
203
+ });
204
+ const reqOpts = tokenInfo(payload);
205
+ sideEffects?.onSiteCall?.();
206
+ try {
207
+ const result = await httpClient.request(reqOpts);
208
+ sideEffects?.onSuccess?.(result);
209
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
210
+ } catch (err) {
211
+ const transformedError = (0, import_transform_error.transformError)(
212
+ err,
213
+ {
214
+ spreadPathsToArguments: {},
215
+ explicitPathsToArguments: {
216
+ body: "$[0].body",
217
+ pathParams: "$[0].pathParams",
218
+ queryParams: "$[0].queryParams",
219
+ headers: "$[0].headers",
220
+ method: "$[0].method",
221
+ rawPath: "$[0].rawPath",
222
+ rawQuery: "$[0].rawQuery"
223
+ },
224
+ singleArgumentUnchanged: false
225
+ },
226
+ ["options"]
227
+ );
228
+ sideEffects?.onError?.(err);
229
+ throw transformedError;
230
+ }
231
+ }
232
+
233
+ // src/identity-oauth-v1-refresh-token-oauth.public.ts
234
+ function token3(httpClient) {
235
+ return (options) => token2(
236
+ options,
237
+ // @ts-ignore
238
+ { httpClient }
239
+ );
240
+ }
241
+ function tokenInfo3(httpClient) {
242
+ return (options) => tokenInfo2(
243
+ options,
244
+ // @ts-ignore
245
+ { httpClient }
246
+ );
247
+ }
248
+
249
+ // src/identity-oauth-v1-refresh-token-oauth.context.ts
250
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
251
+ var token4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(token3);
252
+ var tokenInfo4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(tokenInfo3);
253
+ // Annotate the CommonJS export names for ESM import in node:
254
+ 0 && (module.exports = {
255
+ SubjectType,
256
+ token,
257
+ tokenInfo
258
+ });
18
259
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yFAAuE"}
1
+ {"version":3,"sources":["../../index.ts","../../src/identity-oauth-v1-refresh-token-oauth.universal.ts","../../src/identity-oauth-v1-refresh-token-oauth.http.ts","../../src/identity-oauth-v1-refresh-token-oauth.public.ts","../../src/identity-oauth-v1-refresh-token-oauth.context.ts"],"sourcesContent":["export * from './src/identity-oauth-v1-refresh-token-oauth.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixIdentityOauthV1RefreshToken from './identity-oauth-v1-refresh-token-oauth.http.js';\n\nexport interface RefreshToken {\n token?: string;\n}\n\n/**\n * AuthorizeRequest is sent by the client to the authorization server to initiate\n * the authorization process.\n */\nexport interface AuthorizeRequest {\n /**\n * ID of the Wix OAuth app requesting authorization.\n * @format GUID\n */\n clientId?: string;\n /**\n * Desired authorization [grant type](https://auth0.com/docs/authenticate/protocols/oauth#grant-types).\n *\n * Supported values:\n * + `code`: The endpoint returns an authorization code that can be used to obtain an access token.\n * @minLength 1\n */\n responseType?: string;\n /**\n * URI to redirect the browser to after authentication and authorization. The browser is redirected to this URI whether the authentication and authorization process is successful or not.\n * @minLength 1\n */\n redirectUri?: string | null;\n /**\n * Desired scope of access. If this field is left empty, only an access token is granted.\n * To received a refresh token, pass `offline_access` as the value of this field.\n */\n scope?: string | null;\n /**\n * A value used to confirm the state of an application before and after it makes an authorization\n * request. If a value for this field is set in the request, it's added to the `redirectUri` when the browser\n * is redirected there.\n * Learn more about [using the state parameter](https://auth0.com/docs/secure/attack-protection/state-parameters).\n * @minLength 1\n */\n state?: string;\n /**\n * esired response format.\n *\n * Supported values:\n * + `query`: The response parameters are encoded as query string parameters and added to the `redirectUri` when redirecting.\n * + `fragment`: The response parameters are encoded as URI fragment parameters and added to the `redirectUri` when redirecting.\n * + `web_message`: The response parameters are encoded as a JSON object and added to the body of a [web message response](https://datatracker.ietf.org/doc/html/draft-sakimura-oauth-wmrm-00).\n *\n * Default value: `query`\n */\n responseMode?: string | null;\n /**\n * Code challenge to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n */\n codeChallenge?: string | null;\n /**\n * Code challenge method to use for PKCE verification.\n * This field is only used if `responseType` is set to `code`.\n *\n * Supported values:\n * + `S256`: The code challenge is transformed using SHA-256 encyption.\n * + `S512`: The code challenge is transformed using SHA-512 encyption.\n */\n codeChallengeMethod?: string | null;\n /** Session token of the site visitor to authorize. */\n sessionToken?: string | null;\n /**\n * URL to redirect user to sign in\n * @format SECURE_WEB_URL\n */\n signInUrl?: string | null;\n}\n\nexport interface RawHttpResponse {\n body?: Uint8Array;\n statusCode?: number | null;\n headers?: HeadersEntry[];\n}\n\nexport interface HeadersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface RawHttpRequest {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n\nexport interface PathParametersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface QueryParametersEntry {\n key?: string;\n value?: string;\n}\n\nexport interface DeviceCodeRequest {\n /** The ID of the application that asks for authorization. */\n clientId?: string;\n /**\n * scope is a space-delimited string that specifies the requested scope of the\n * access request.\n */\n scope?: string | null;\n}\n\nexport interface DeviceCodeResponse {\n /** is the unique code for the device. When the user goes to the verification_uri in their browser-based device, this code will be bound to their session. */\n deviceCode?: string;\n /** contains the code that should be input at the verification_uri to authorize the device. */\n userCode?: string;\n /** contains the URL the user should visit to authorize the device. */\n verificationUri?: string;\n /** indicates the lifetime (in seconds) of the device_code and user_code. */\n expiresIn?: number;\n /** indicates the interval (in seconds) at which the app should poll the token URL to request a token. clients MUST use 5 as the default */\n interval?: number | null;\n}\n\nexport interface DeviceVerifyRequest {\n /** User code representing a currently authorizing device. */\n userCode?: string;\n}\n\nexport interface DeviceVerifyResponse {}\n\nexport interface DeviceVerifyV2Request {\n /**\n * User code representing a currently authorizing device.\n * @minLength 8\n * @maxLength 8\n */\n userCode?: string;\n}\n\nexport interface DeviceVerifyV2Response {}\n\nexport interface InvalidateUserCodeRequest {\n /** user code to invalidate. Only the authorizing identity is able to invalidate it. */\n userCode?: string;\n}\n\nexport interface InvalidateUserCodeResponse {}\n\nexport interface RevokeRefreshTokenRequest {\n /** The refresh token itself. Anyone with the token itself is able to revoke it. */\n token?: string;\n}\n\nexport interface RevokeRefreshTokenResponse {}\n\nexport interface TokenInfoResponse {\n active?: boolean;\n /** subject type. */\n subjectType?: SubjectTypeWithLiterals;\n /** subject id */\n subjectId?: string;\n /** Expiration time of the token */\n exp?: string | null;\n /** Issued time of the token */\n iat?: string | null;\n /** Client id */\n clientId?: string;\n /** Account id */\n accountId?: string | null;\n /** Site id */\n siteId?: string | null;\n /** Instance Id */\n instanceId?: string | null;\n /**\n * Vendor Product Id\n * @maxLength 100\n */\n vendorProductId?: string | null;\n}\n\nexport enum SubjectType {\n /** unknown subject type */\n UNKNOWN = 'UNKNOWN',\n /** user subject type */\n USER = 'USER',\n /** visitor subject type */\n VISITOR = 'VISITOR',\n /** member subject type */\n MEMBER = 'MEMBER',\n /** app subject type */\n APP = 'APP',\n}\n\n/** @enumType */\nexport type SubjectTypeWithLiterals =\n | SubjectType\n | 'UNKNOWN'\n | 'USER'\n | 'VISITOR'\n | 'MEMBER'\n | 'APP';\n\nexport interface Empty {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\n/**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n * @public\n * @fqn wix.identity.oauth2.v1.Oauth2Ng.Token\n */\nexport async function token(\n options?: TokenOptions\n): Promise<\n NonNullablePaths<\n RawHttpResponse,\n `body` | `headers` | `headers.${number}.key` | `headers.${number}.value`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n body: options?.body,\n pathParams: options?.pathParams,\n queryParams: options?.queryParams,\n headers: options?.headers,\n method: options?.method,\n rawPath: options?.rawPath,\n rawQuery: options?.rawQuery,\n });\n\n const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.token(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n body: '$[0].body',\n pathParams: '$[0].pathParams',\n queryParams: '$[0].queryParams',\n headers: '$[0].headers',\n method: '$[0].method',\n rawPath: '$[0].rawPath',\n rawQuery: '$[0].rawQuery',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TokenOptions {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n\n/**\n * Token Introspection Endpoint.\n * @public\n * @fqn wix.identity.oauth2.v1.Oauth2Ng.TokenInfo\n */\nexport async function tokenInfo(\n options?: TokenInfoOptions\n): Promise<\n NonNullablePaths<\n TokenInfoResponse,\n `active` | `subjectType` | `subjectId` | `clientId`\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n body: options?.body,\n pathParams: options?.pathParams,\n queryParams: options?.queryParams,\n headers: options?.headers,\n method: options?.method,\n rawPath: options?.rawPath,\n rawQuery: options?.rawQuery,\n });\n\n const reqOpts = ambassadorWixIdentityOauthV1RefreshToken.tokenInfo(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n body: '$[0].body',\n pathParams: '$[0].pathParams',\n queryParams: '$[0].queryParams',\n headers: '$[0].headers',\n method: '$[0].method',\n rawPath: '$[0].rawPath',\n rawQuery: '$[0].rawQuery',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TokenInfoOptions {\n body?: Uint8Array;\n pathParams?: PathParametersEntry[];\n queryParams?: QueryParametersEntry[];\n headers?: HeadersEntry[];\n method?: string;\n rawPath?: string;\n rawQuery?: string;\n}\n","import { transformSDKBytesToRESTBytes } from '@wix/sdk-runtime/transformations/bytes';\nimport { transformRESTBytesToSDKBytes } from '@wix/sdk-runtime/transformations/bytes';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixIdentityOauth2V1Oauth2NgUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n {\n srcPath: '/oauth2/token_info',\n destPath: '/v1/token_info',\n },\n ],\n 'users._base_domain_': [\n {\n srcPath: '/v1/oauth/device/verify',\n destPath: '/v1/oauth/device/verify',\n },\n {\n srcPath: '/v1/oauth/manage/user-code',\n destPath: '/v1/oauth/manage/user-code',\n },\n {\n srcPath: '/v2/oauth/device/verify',\n destPath: '/v2/oauth/device/verify',\n },\n {\n srcPath: '/v1/oauth/authorize',\n destPath: '/v1/oauth/authorize',\n },\n ],\n _: [\n {\n srcPath: '/_api/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/oauth2',\n destPath: '/v1/oauth',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/oauth2-ng',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_identity_oauth';\n\n/**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n */\nexport function token(payload: object): RequestOptionsFactory<any> {\n function __token({ host }: any) {\n const serializedData = transformPaths(payload, [\n { transformFn: transformSDKBytesToRESTBytes, paths: [{ path: 'body' }] },\n ]);\n const metadata = {\n entityFqdn: 'wix.identity.oauth.v1.refresh_token',\n method: 'POST' as any,\n methodFqn: 'wix.identity.oauth2.v1.Oauth2Ng.Token',\n packageName: PACKAGE_NAME,\n url: resolveWixIdentityOauth2V1Oauth2NgUrl({\n protoPath: '/v1/oauth/token',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTBytesToSDKBytes,\n paths: [{ path: 'body' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __token;\n}\n\n/** Token Introspection Endpoint. */\nexport function tokenInfo(payload: object): RequestOptionsFactory<any> {\n function __tokenInfo({ host }: any) {\n const serializedData = transformPaths(payload, [\n { transformFn: transformSDKBytesToRESTBytes, paths: [{ path: 'body' }] },\n ]);\n const metadata = {\n entityFqdn: 'wix.identity.oauth.v1.refresh_token',\n method: 'POST' as any,\n methodFqn: 'wix.identity.oauth2.v1.Oauth2Ng.TokenInfo',\n packageName: PACKAGE_NAME,\n url: resolveWixIdentityOauth2V1Oauth2NgUrl({\n protoPath: '/v1/oauth/token-info',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __tokenInfo;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n RawHttpResponse,\n TokenInfoOptions,\n TokenInfoResponse,\n TokenOptions,\n token as universalToken,\n tokenInfo as universalTokenInfo,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/identity' };\n\nexport function token(httpClient: HttpClient): TokenSignature {\n return (options?: TokenOptions) =>\n universalToken(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TokenSignature {\n /**\n * Creates an access token.\n *\n *\n * The endpoint accepts raw HTTP requests. You must pass the request's body\n * parameters formatted as bytes in the raw HTTP request's `body` field,\n * following this template:\n * `{\"grantType\": \"client_credentials\", \"client_id\": \"<APP_ID>\", \"client_secret\": \"<APP_SECRET_KEY>\", \"instance_id\": \"<INSTANCE_ID>\"}`.\n *\n * When the call succeeds, Wix returns `{\"statusCode\": 200}` and the created access\n * token in the `body` field of the raw HTTP response.\n *\n * In case the call fails, Wix returns the relevant `4XX` error code in the raw\n * HTTP response's `statusCode` field and details\n * about the error in `body`. Error details follow the\n * [conventions of the Internet Engineering Task Force (IETF)](https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.7).\n */\n (options?: TokenOptions | undefined): Promise<RawHttpResponse>;\n}\n\nexport function tokenInfo(httpClient: HttpClient): TokenInfoSignature {\n return (options?: TokenInfoOptions) =>\n universalTokenInfo(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TokenInfoSignature {\n /**\n * Token Introspection Endpoint.\n */\n (options?: TokenInfoOptions | undefined): Promise<TokenInfoResponse>;\n}\n\nexport {\n ActionEvent,\n AuthorizeRequest,\n DeviceCodeRequest,\n DeviceCodeResponse,\n DeviceVerifyRequest,\n DeviceVerifyResponse,\n DeviceVerifyV2Request,\n DeviceVerifyV2Response,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n HeadersEntry,\n InvalidateUserCodeRequest,\n InvalidateUserCodeResponse,\n PathParametersEntry,\n QueryParametersEntry,\n RawHttpRequest,\n RawHttpResponse,\n RefreshToken,\n RestoreInfo,\n RevokeRefreshTokenRequest,\n RevokeRefreshTokenResponse,\n SubjectType,\n TokenInfoOptions,\n TokenInfoResponse,\n TokenOptions,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n","import {\n token as publicToken,\n tokenInfo as publicTokenInfo,\n} from './identity-oauth-v1-refresh-token-oauth.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const token: MaybeContext<\n BuildRESTFunction<typeof publicToken> & typeof publicToken\n> = /*#__PURE__*/ createRESTModule(publicToken);\nexport const tokenInfo: MaybeContext<\n BuildRESTFunction<typeof publicTokenInfo> & typeof publicTokenInfo\n> = /*#__PURE__*/ createRESTModule(publicTokenInfo);\n\nexport { SubjectType } from './identity-oauth-v1-refresh-token-oauth.universal.js';\nexport {\n RefreshToken,\n AuthorizeRequest,\n RawHttpResponse,\n HeadersEntry,\n RawHttpRequest,\n PathParametersEntry,\n QueryParametersEntry,\n DeviceCodeRequest,\n DeviceCodeResponse,\n DeviceVerifyRequest,\n DeviceVerifyResponse,\n DeviceVerifyV2Request,\n DeviceVerifyV2Response,\n InvalidateUserCodeRequest,\n InvalidateUserCodeResponse,\n RevokeRefreshTokenRequest,\n RevokeRefreshTokenResponse,\n TokenInfoResponse,\n Empty,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n TokenOptions,\n TokenInfoOptions,\n} from './identity-oauth-v1-refresh-token-oauth.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,eAAAA;AAAA,E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,UACb,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,UAAU;AAAA,QACZ;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AElaO,SAASE,OAAM,YAAwC;AAC5D,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAuBO,SAASC,WAAU,YAA4C;AACpE,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC7CA,IAAAC,uBAAiC;AAG1B,IAAMC,SAEK,2DAAiBA,MAAW;AACvC,IAAMC,aAEK,2DAAiBA,UAAe;","names":["token","tokenInfo","import_bytes","payload","SubjectType","token","sdkTransformError","tokenInfo","token","tokenInfo","import_rest_modules","token","tokenInfo"]}
@@ -1 +1,81 @@
1
- export * from './src/identity-oauth-v1-refresh-token-oauth.meta.js';
1
+ import { d as RawHttpRequest$1, R as RawHttpResponse$1, b as TokenInfoResponse$1 } from './identity-oauth-v1-refresh-token-oauth.universal-DIzKUWYi.js';
2
+
3
+ interface RawHttpResponse {
4
+ body?: Uint8Array;
5
+ statusCode?: number | null;
6
+ headers?: HeadersEntry[];
7
+ }
8
+ interface HeadersEntry {
9
+ key?: string;
10
+ value?: string;
11
+ }
12
+ interface RawHttpRequest {
13
+ body?: Uint8Array;
14
+ pathParams?: PathParametersEntry[];
15
+ queryParams?: QueryParametersEntry[];
16
+ headers?: HeadersEntry[];
17
+ method?: string;
18
+ rawPath?: string;
19
+ rawQuery?: string;
20
+ }
21
+ interface PathParametersEntry {
22
+ key?: string;
23
+ value?: string;
24
+ }
25
+ interface QueryParametersEntry {
26
+ key?: string;
27
+ value?: string;
28
+ }
29
+ interface TokenInfoResponse {
30
+ active?: boolean;
31
+ /** subject type. */
32
+ subjectType?: SubjectTypeWithLiterals;
33
+ /** subject id */
34
+ subjectId?: string;
35
+ /** Expiration time of the token */
36
+ exp?: string | null;
37
+ /** Issued time of the token */
38
+ iat?: string | null;
39
+ /** Client id */
40
+ clientId?: string;
41
+ /** Account id */
42
+ accountId?: string | null;
43
+ /** Site id */
44
+ siteId?: string | null;
45
+ /** Instance Id */
46
+ instanceId?: string | null;
47
+ /**
48
+ * Vendor Product Id
49
+ * @maxLength 100
50
+ */
51
+ vendorProductId?: string | null;
52
+ }
53
+ declare enum SubjectType {
54
+ /** unknown subject type */
55
+ UNKNOWN = "UNKNOWN",
56
+ /** user subject type */
57
+ USER = "USER",
58
+ /** visitor subject type */
59
+ VISITOR = "VISITOR",
60
+ /** member subject type */
61
+ MEMBER = "MEMBER",
62
+ /** app subject type */
63
+ APP = "APP"
64
+ }
65
+ /** @enumType */
66
+ type SubjectTypeWithLiterals = SubjectType | 'UNKNOWN' | 'USER' | 'VISITOR' | 'MEMBER' | 'APP';
67
+
68
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
69
+ getUrl: (context: any) => string;
70
+ httpMethod: K;
71
+ path: string;
72
+ pathParams: M;
73
+ __requestType: T;
74
+ __originalRequestType: S;
75
+ __responseType: Q;
76
+ __originalResponseType: R;
77
+ };
78
+ declare function token(): __PublicMethodMetaInfo<'POST', {}, RawHttpRequest$1, RawHttpRequest, RawHttpResponse$1, RawHttpResponse>;
79
+ declare function tokenInfo(): __PublicMethodMetaInfo<'POST', {}, RawHttpRequest$1, RawHttpRequest, TokenInfoResponse$1, TokenInfoResponse>;
80
+
81
+ export { type __PublicMethodMetaInfo, token, tokenInfo };