@gbg/go-core 0.0.1-alpha.25 → 0.0.1-alpha.27

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 (105) hide show
  1. package/FUNCTIONS.md +1 -7
  2. package/README.md +14 -43
  3. package/dist/commonjs/funcs/tokens-generate.d.ts +2 -2
  4. package/dist/commonjs/funcs/tokens-generate.d.ts.map +1 -1
  5. package/dist/commonjs/funcs/tokens-generate.js +7 -9
  6. package/dist/commonjs/funcs/tokens-generate.js.map +1 -1
  7. package/dist/commonjs/hooks/registration.js +4 -4
  8. package/dist/commonjs/hooks/registration.js.map +1 -1
  9. package/dist/commonjs/hooks/x-gbg-source.d.ts +36 -0
  10. package/dist/commonjs/hooks/x-gbg-source.d.ts.map +1 -0
  11. package/dist/commonjs/hooks/x-gbg-source.js +41 -0
  12. package/dist/commonjs/hooks/x-gbg-source.js.map +1 -0
  13. package/dist/commonjs/lib/config.d.ts +3 -3
  14. package/dist/commonjs/lib/config.js +3 -3
  15. package/dist/commonjs/models/client-credentials-grant-request.d.ts +25 -0
  16. package/dist/commonjs/models/client-credentials-grant-request.d.ts.map +1 -0
  17. package/dist/commonjs/models/client-credentials-grant-request.js +58 -0
  18. package/dist/commonjs/models/client-credentials-grant-request.js.map +1 -0
  19. package/dist/commonjs/models/index.d.ts +2 -0
  20. package/dist/commonjs/models/index.d.ts.map +1 -1
  21. package/dist/commonjs/models/index.js +2 -0
  22. package/dist/commonjs/models/index.js.map +1 -1
  23. package/dist/commonjs/models/operations/fetch-interaction.d.ts +41 -12
  24. package/dist/commonjs/models/operations/fetch-interaction.d.ts.map +1 -1
  25. package/dist/commonjs/models/operations/fetch-interaction.js +45 -16
  26. package/dist/commonjs/models/operations/fetch-interaction.js.map +1 -1
  27. package/dist/commonjs/models/operations/index.d.ts +1 -1
  28. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  29. package/dist/commonjs/models/operations/index.js +1 -1
  30. package/dist/commonjs/models/operations/index.js.map +1 -1
  31. package/dist/commonjs/models/operations/post-as-token-oauth2.d.ts +32 -0
  32. package/dist/commonjs/models/operations/post-as-token-oauth2.d.ts.map +1 -0
  33. package/dist/commonjs/models/operations/{post-auth-realms-go-protocol-openid-connect-token.js → post-as-token-oauth2.js} +16 -35
  34. package/dist/commonjs/models/operations/post-as-token-oauth2.js.map +1 -0
  35. package/dist/commonjs/models/password-grant-request.d.ts +35 -0
  36. package/dist/commonjs/models/password-grant-request.d.ts.map +1 -0
  37. package/dist/commonjs/models/password-grant-request.js +60 -0
  38. package/dist/commonjs/models/password-grant-request.js.map +1 -0
  39. package/dist/commonjs/sdk/tokens.d.ts +2 -2
  40. package/dist/commonjs/sdk/tokens.d.ts.map +1 -1
  41. package/dist/commonjs/sdk/tokens.js +1 -1
  42. package/dist/commonjs/sdk/tokens.js.map +1 -1
  43. package/dist/esm/funcs/tokens-generate.d.ts +2 -2
  44. package/dist/esm/funcs/tokens-generate.d.ts.map +1 -1
  45. package/dist/esm/funcs/tokens-generate.js +7 -9
  46. package/dist/esm/funcs/tokens-generate.js.map +1 -1
  47. package/dist/esm/hooks/registration.js +4 -4
  48. package/dist/esm/hooks/registration.js.map +1 -1
  49. package/dist/esm/hooks/x-gbg-source.d.ts +36 -0
  50. package/dist/esm/hooks/x-gbg-source.d.ts.map +1 -0
  51. package/dist/esm/hooks/x-gbg-source.js +37 -0
  52. package/dist/esm/hooks/x-gbg-source.js.map +1 -0
  53. package/dist/esm/lib/config.d.ts +3 -3
  54. package/dist/esm/lib/config.js +3 -3
  55. package/dist/esm/models/client-credentials-grant-request.d.ts +25 -0
  56. package/dist/esm/models/client-credentials-grant-request.d.ts.map +1 -0
  57. package/dist/esm/models/client-credentials-grant-request.js +21 -0
  58. package/dist/esm/models/client-credentials-grant-request.js.map +1 -0
  59. package/dist/esm/models/index.d.ts +2 -0
  60. package/dist/esm/models/index.d.ts.map +1 -1
  61. package/dist/esm/models/index.js +2 -0
  62. package/dist/esm/models/index.js.map +1 -1
  63. package/dist/esm/models/operations/fetch-interaction.d.ts +41 -12
  64. package/dist/esm/models/operations/fetch-interaction.d.ts.map +1 -1
  65. package/dist/esm/models/operations/fetch-interaction.js +38 -11
  66. package/dist/esm/models/operations/fetch-interaction.js.map +1 -1
  67. package/dist/esm/models/operations/index.d.ts +1 -1
  68. package/dist/esm/models/operations/index.d.ts.map +1 -1
  69. package/dist/esm/models/operations/index.js +1 -1
  70. package/dist/esm/models/operations/index.js.map +1 -1
  71. package/dist/esm/models/operations/post-as-token-oauth2.d.ts +32 -0
  72. package/dist/esm/models/operations/post-as-token-oauth2.d.ts.map +1 -0
  73. package/dist/esm/models/operations/post-as-token-oauth2.js +35 -0
  74. package/dist/esm/models/operations/post-as-token-oauth2.js.map +1 -0
  75. package/dist/esm/models/password-grant-request.d.ts +35 -0
  76. package/dist/esm/models/password-grant-request.d.ts.map +1 -0
  77. package/dist/esm/models/password-grant-request.js +23 -0
  78. package/dist/esm/models/password-grant-request.js.map +1 -0
  79. package/dist/esm/sdk/tokens.d.ts +2 -2
  80. package/dist/esm/sdk/tokens.d.ts.map +1 -1
  81. package/dist/esm/sdk/tokens.js +1 -1
  82. package/dist/esm/sdk/tokens.js.map +1 -1
  83. package/examples/tokensGenerate.example.ts +1 -7
  84. package/jsr.json +1 -1
  85. package/package.json +1 -1
  86. package/src/__tests__/x-gbg-source.test.mjs +59 -0
  87. package/src/funcs/tokens-generate.ts +12 -23
  88. package/src/hooks/registration.ts +4 -4
  89. package/src/hooks/x-gbg-source.ts +70 -0
  90. package/src/lib/config.ts +3 -3
  91. package/src/models/client-credentials-grant-request.ts +57 -0
  92. package/src/models/index.ts +2 -0
  93. package/src/models/operations/fetch-interaction.ts +105 -34
  94. package/src/models/operations/index.ts +1 -1
  95. package/src/models/operations/post-as-token-oauth2.ts +88 -0
  96. package/src/models/password-grant-request.ts +67 -0
  97. package/src/sdk/tokens.ts +3 -5
  98. package/dist/commonjs/models/operations/post-auth-realms-go-protocol-openid-connect-token.d.ts +0 -71
  99. package/dist/commonjs/models/operations/post-auth-realms-go-protocol-openid-connect-token.d.ts.map +0 -1
  100. package/dist/commonjs/models/operations/post-auth-realms-go-protocol-openid-connect-token.js.map +0 -1
  101. package/dist/esm/models/operations/post-auth-realms-go-protocol-openid-connect-token.d.ts +0 -71
  102. package/dist/esm/models/operations/post-auth-realms-go-protocol-openid-connect-token.d.ts.map +0 -1
  103. package/dist/esm/models/operations/post-auth-realms-go-protocol-openid-connect-token.js +0 -54
  104. package/dist/esm/models/operations/post-auth-realms-go-protocol-openid-connect-token.js.map +0 -1
  105. package/src/models/operations/post-auth-realms-go-protocol-openid-connect-token.ts +0 -150
package/FUNCTIONS.md CHANGED
@@ -27,13 +27,7 @@ import { tokensGenerate } from "@gbg/go-core/funcs/tokens-generate.js";
27
27
  const go = new GoCore();
28
28
 
29
29
  async function run() {
30
- const res = await tokensGenerate(go, {
31
- clientId: "your-client-id",
32
- clientSecret: "your-client-secret",
33
- username: "api-user@example.com",
34
- password: "your-secure-password",
35
- grantType: "password",
36
- });
30
+ const res = await tokensGenerate(go);
37
31
  if (res.ok) {
38
32
  const { value: result } = res;
39
33
  console.log(result);
package/README.md CHANGED
@@ -25,6 +25,7 @@ GBG GO Next Gen Flow Captain API: API for Customers and End Users to interact wi
25
25
  * [Error Handling](#error-handling)
26
26
  * [Server Selection](#server-selection)
27
27
  * [Custom HTTP Client](#custom-http-client)
28
+ * [Analytics](#analytics)
28
29
  * [Debugging](#debugging)
29
30
  * [Development](#development)
30
31
  * [Maturity](#maturity)
@@ -82,13 +83,7 @@ import { Go } from "@gbg/go-core";
82
83
  const go = new Go();
83
84
 
84
85
  async function run() {
85
- const result = await go.tokens.generate({
86
- clientId: "your-client-id",
87
- clientSecret: "your-client-secret",
88
- username: "api-user@example.com",
89
- password: "your-secure-password",
90
- grantType: "password",
91
- });
86
+ const result = await go.tokens.generate();
92
87
 
93
88
  console.log(result);
94
89
  }
@@ -118,13 +113,7 @@ const go = new Go({
118
113
  });
119
114
 
120
115
  async function run() {
121
- const result = await go.tokens.generate({
122
- clientId: "your-client-id",
123
- clientSecret: "your-client-secret",
124
- username: "api-user@example.com",
125
- password: "your-secure-password",
126
- grantType: "password",
127
- });
116
+ const result = await go.tokens.generate();
128
117
 
129
118
  console.log(result);
130
119
  }
@@ -248,13 +237,7 @@ import { Go } from "@gbg/go-core";
248
237
  const go = new Go();
249
238
 
250
239
  async function run() {
251
- const result = await go.tokens.generate({
252
- clientId: "your-client-id",
253
- clientSecret: "your-client-secret",
254
- username: "api-user@example.com",
255
- password: "your-secure-password",
256
- grantType: "password",
257
- }, {
240
+ const result = await go.tokens.generate(undefined, {
258
241
  retries: {
259
242
  strategy: "backoff",
260
243
  backoff: {
@@ -292,13 +275,7 @@ const go = new Go({
292
275
  });
293
276
 
294
277
  async function run() {
295
- const result = await go.tokens.generate({
296
- clientId: "your-client-id",
297
- clientSecret: "your-client-secret",
298
- username: "api-user@example.com",
299
- password: "your-secure-password",
300
- grantType: "password",
301
- });
278
+ const result = await go.tokens.generate();
302
279
 
303
280
  console.log(result);
304
281
  }
@@ -330,13 +307,7 @@ const go = new Go();
330
307
 
331
308
  async function run() {
332
309
  try {
333
- const result = await go.tokens.generate({
334
- clientId: "your-client-id",
335
- clientSecret: "your-client-secret",
336
- username: "api-user@example.com",
337
- password: "your-secure-password",
338
- grantType: "password",
339
- });
310
+ const result = await go.tokens.generate();
340
311
 
341
312
  console.log(result);
342
313
  } catch (error) {
@@ -438,14 +409,8 @@ import { Go } from "@gbg/go-core";
438
409
  const go = new Go();
439
410
 
440
411
  async function run() {
441
- const result = await go.tokens.generate({
442
- clientId: "your-client-id",
443
- clientSecret: "your-client-secret",
444
- username: "api-user@example.com",
445
- password: "your-secure-password",
446
- grantType: "password",
447
- }, {
448
- serverURL: "https://au.platform.go.gbgplc.com",
412
+ const result = await go.tokens.generate(undefined, {
413
+ serverURL: "https://api.auth.gbgplc.com",
449
414
  });
450
415
 
451
416
  console.log(result);
@@ -509,6 +474,12 @@ const sdk = new Go({ httpClient: httpClient });
509
474
  ```
510
475
  <!-- End Custom HTTP Client [http-client] -->
511
476
 
477
+ ## Analytics
478
+
479
+ The SDK sends an `X-GBG-Source` request header identifying the SDK and its
480
+ version (the same value as the user agent). GBG uses it for anonymous usage
481
+ analytics. It carries no personal or request data.
482
+
512
483
  <!-- Start Debugging [debug] -->
513
484
  ## Debugging
514
485
 
@@ -11,7 +11,7 @@ import { Result } from "../types/fp.js";
11
11
  * Generate access token
12
12
  *
13
13
  * @remarks
14
- * Get an access token to authenticate API requests. If you're unfamiliar with the authentication process, check out the [authentication guide](/docs/developer-integration/execute-customer-journeys/authenticate) for more details.
14
+ * Get an access token to authenticate API requests. If you're unfamiliar with the authentication process, check out the [authentication guide](/docs/go-v2/developer-integration/execute-customer-journeys/authenticate) for more details.
15
15
  */
16
- export declare function tokensGenerate(client: GoCore, request?: operations.PostAuthRealmsGoProtocolOpenidConnectTokenRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.PostAuthRealmsGoProtocolOpenidConnectTokenResponse, GoError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
16
+ export declare function tokensGenerate(client: GoCore, request?: operations.PostAsTokenOauth2Request | undefined, options?: RequestOptions): APIPromise<Result<operations.PostAsTokenOauth2Response, GoError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
17
17
  //# sourceMappingURL=tokens-generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens-generate.d.ts","sourceRoot":"","sources":["../../../src/funcs/tokens-generate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAMpC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EACL,eAAe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EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,UAAU,CAAC,wBAAwB,GAAG,SAAS,EACzD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,yBAAyB,EAClC,OAAO,GACP,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
@@ -45,20 +45,19 @@ const primitives_js_1 = require("../lib/primitives.js");
45
45
  const schemas_js_1 = require("../lib/schemas.js");
46
46
  const url_js_1 = require("../lib/url.js");
47
47
  const operations = __importStar(require("../models/operations/index.js"));
48
- const post_auth_realms_go_protocol_openid_connect_token_js_1 = require("../models/operations/post-auth-realms-go-protocol-openid-connect-token.js");
48
+ const post_as_token_oauth2_js_1 = require("../models/operations/post-as-token-oauth2.js");
49
49
  const async_js_1 = require("../types/async.js");
50
50
  /**
51
51
  * Generate access token
52
52
  *
53
53
  * @remarks
54
- * Get an access token to authenticate API requests. If you're unfamiliar with the authentication process, check out the [authentication guide](/docs/developer-integration/execute-customer-journeys/authenticate) for more details.
54
+ * Get an access token to authenticate API requests. If you're unfamiliar with the authentication process, check out the [authentication guide](/docs/go-v2/developer-integration/execute-customer-journeys/authenticate) for more details.
55
55
  */
56
56
  function tokensGenerate(client, request, options) {
57
57
  return new async_js_1.APIPromise($do(client, request, options));
58
58
  }
59
59
  async function $do(client, request, options) {
60
- const parsed = (0, schemas_js_1.safeParse)(request, (value) => z.parse(z.optional(operations
61
- .PostAuthRealmsGoProtocolOpenidConnectTokenRequest$outboundSchema), value), "Input validation failed");
60
+ const parsed = (0, schemas_js_1.safeParse)(request, (value) => z.parse(z.optional(operations.PostAsTokenOauth2Request$outboundSchema), value), "Input validation failed");
62
61
  if (!parsed.ok) {
63
62
  return [parsed, { status: "invalid" }];
64
63
  }
@@ -67,10 +66,10 @@ async function $do(client, request, options) {
67
66
  return (0, encodings_js_1.encodeBodyForm)(k, v, { charEncoding: "percent" });
68
67
  }).join("&");
69
68
  const baseURL = options?.serverURL
70
- || (0, url_js_1.pathToFunc)(post_auth_realms_go_protocol_openid_connect_token_js_1.PostAuthRealmsGoProtocolOpenidConnectTokenServerList[0], {
69
+ || (0, url_js_1.pathToFunc)(post_as_token_oauth2_js_1.PostAsTokenOauth2ServerList[0], {
71
70
  charEncoding: "percent",
72
71
  })();
73
- const path = (0, url_js_1.pathToFunc)("/auth/realms/go/protocol/openid-connect/token")();
72
+ const path = (0, url_js_1.pathToFunc)("/as/token.oauth2")();
74
73
  const headers = new Headers((0, primitives_js_1.compactMap)({
75
74
  "Content-Type": "application/x-www-form-urlencoded",
76
75
  Accept: "application/json",
@@ -78,7 +77,7 @@ async function $do(client, request, options) {
78
77
  const context = {
79
78
  options: client._options,
80
79
  baseURL: baseURL ?? "",
81
- operationID: "post_/auth/realms/go/protocol/openid-connect/token",
80
+ operationID: "post_/as/token.oauth2",
82
81
  oAuth2Scopes: null,
83
82
  resolvedSecurity: null,
84
83
  securitySource: null,
@@ -110,8 +109,7 @@ async function $do(client, request, options) {
110
109
  return [doResult, { status: "request-error", request: req }];
111
110
  }
112
111
  const response = doResult.value;
113
- const [result] = await M.match(M.json(200, operations
114
- .PostAuthRealmsGoProtocolOpenidConnectTokenResponse$inboundSchema), M.fail([400, 401, "4XX"]), M.fail("5XX"))(response, req);
112
+ const [result] = await M.match(M.json(200, operations.PostAsTokenOauth2Response$inboundSchema), M.fail([400, 401, "4XX"]), M.fail("5XX"))(response, req);
115
113
  if (!result.ok) {
116
114
  return [result, { status: "complete", request: req, response }];
117
115
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tokens-generate.js","sourceRoot":"","sources":["../../../src/funcs/tokens-generate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCH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AAC,EAAE,MAAM,EAAE,UAAU,EAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACrE,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAW5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,uCAAuC,CAAC,EAC/D,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,EACzB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initHooks = initHooks;
4
+ const x_gbg_source_js_1 = require("./x-gbg-source.js");
4
5
  /*
5
6
  * This file is only ever generated once on the first generation and then is free to be modified.
6
7
  * Any hooks you wish to add should be registered in the initHooks function. Feel free to define them
7
8
  * in this file or in separate files in the hooks folder.
8
9
  */
9
- // @ts-expect-error remove this line when you add your first hook and hooks is used
10
10
  function initHooks(hooks) {
11
- // Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook
12
- // with an instance of a hook that implements that specific Hook interface
13
- // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance
11
+ // Stamp an X-GBG-Source usage-tracking header on every outgoing request.
12
+ // See ./x-gbg-source.ts (GGO-16030 / issue #34).
13
+ hooks.registerBeforeCreateRequestHook(new x_gbg_source_js_1.GbgSourceHook());
14
14
  }
15
15
  //# sourceMappingURL=registration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registration.js","sourceRoot":"","sources":["../../../src/hooks/registration.ts"],"names":[],"mappings":";;AASA,8BAIC;AAXD;;;;GAIG;AAEH,mFAAmF;AACnF,SAAgB,SAAS,CAAC,KAAY;IACpC,gHAAgH;IAChH,0EAA0E;IAC1E,4FAA4F;AAC9F,CAAC"}
1
+ {"version":3,"file":"registration.js","sourceRoot":"","sources":["../../../src/hooks/registration.ts"],"names":[],"mappings":";;AASA,8BAIC;AAZD,uDAAkD;AAElD;;;;GAIG;AAEH,SAAgB,SAAS,CAAC,KAAY;IACpC,yEAAyE;IACzE,iDAAiD;IACjD,KAAK,CAAC,+BAA+B,CAAC,IAAI,+BAAa,EAAE,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { SDKOptions } from "../lib/config.js";
2
+ import { RequestInput } from "../lib/http.js";
3
+ import { BeforeCreateRequestContext, BeforeCreateRequestHook } from "./types.js";
4
+ /** The usage-tracking header sent on every request. */
5
+ export declare const X_GBG_SOURCE_HEADER = "X-GBG-Source";
6
+ /**
7
+ * SDK options extended with the optional `source` override. Use this to get
8
+ * type-safety for the client-creation override without depending on the
9
+ * regenerated `SDKOptions` declaration:
10
+ *
11
+ * ```ts
12
+ * import { Go } from "@gbg/go-core";
13
+ * import type { GoOptions } from "@gbg/go-core/hooks/x-gbg-source";
14
+ *
15
+ * const sdk = new Go({ source: "acme-portal" } satisfies GoOptions);
16
+ * ```
17
+ */
18
+ export type GoOptions = SDKOptions & {
19
+ /**
20
+ * Value sent in the `X-GBG-Source` header on every request, identifying the
21
+ * integration making the call. Defaults to the SDK's user-agent string. Can
22
+ * also be overridden per-request via `RequestOptions.headers`.
23
+ */
24
+ source?: string | undefined;
25
+ };
26
+ /**
27
+ * Sets the `X-GBG-Source` header on every request. Precedence, highest first:
28
+ *
29
+ * 1. a per-request header (set via `RequestOptions.headers`) — left untouched
30
+ * 2. the client-creation `source` option
31
+ * 3. the SDK user-agent string (auto-tracks the SDK version)
32
+ */
33
+ export declare class GbgSourceHook implements BeforeCreateRequestHook {
34
+ beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput;
35
+ }
36
+ //# sourceMappingURL=x-gbg-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-gbg-source.d.ts","sourceRoot":"","sources":["../../../src/hooks/x-gbg-source.ts"],"names":[],"mappings":"AAaA,OAAO,EAAgB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAEpB,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG;IACnC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,aAAc,YAAW,uBAAuB;IAC3D,mBAAmB,CACjB,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,YAAY,GAClB,YAAY;CAchB"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /*
3
+ * Custom hook: stamps an `X-GBG-Source` usage-tracking header on every
4
+ * outgoing request.
5
+ *
6
+ * This file is NOT managed by Speakeasy — it is not tracked in
7
+ * `.speakeasy/gen.lock`, and it is imported from `registration.ts` which
8
+ * Speakeasy generates only once. Both therefore survive the weekly forced SDK
9
+ * regeneration. Do not move this logic into generated files (`config.ts`,
10
+ * `sdks.ts`, `index.ts`, `package.json`): those are overwritten on regen.
11
+ *
12
+ * See GGO-16030 / GitHub issue #34.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.GbgSourceHook = exports.X_GBG_SOURCE_HEADER = void 0;
16
+ const config_js_1 = require("../lib/config.js");
17
+ /** The usage-tracking header sent on every request. */
18
+ exports.X_GBG_SOURCE_HEADER = "X-GBG-Source";
19
+ /**
20
+ * Sets the `X-GBG-Source` header on every request. Precedence, highest first:
21
+ *
22
+ * 1. a per-request header (set via `RequestOptions.headers`) — left untouched
23
+ * 2. the client-creation `source` option
24
+ * 3. the SDK user-agent string (auto-tracks the SDK version)
25
+ */
26
+ class GbgSourceHook {
27
+ beforeCreateRequest(hookCtx, input) {
28
+ const options = input.options ?? {};
29
+ const headers = new Headers(options.headers);
30
+ // Respect a per-request override if one was already set on the request.
31
+ if (!headers.has(exports.X_GBG_SOURCE_HEADER)) {
32
+ const source = hookCtx.options.source;
33
+ headers.set(exports.X_GBG_SOURCE_HEADER, source ?? config_js_1.SDK_METADATA.userAgent);
34
+ }
35
+ options.headers = headers;
36
+ input.options = options;
37
+ return input;
38
+ }
39
+ }
40
+ exports.GbgSourceHook = GbgSourceHook;
41
+ //# sourceMappingURL=x-gbg-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-gbg-source.js","sourceRoot":"","sources":["../../../src/hooks/x-gbg-source.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,gDAA4D;AAO5D,uDAAuD;AAC1C,QAAA,mBAAmB,GAAG,cAAc,CAAC;AAuBlD;;;;;;GAMG;AACH,MAAa,aAAa;IACxB,mBAAmB,CACjB,OAAmC,EACnC,KAAmB;QAEnB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE7C,wEAAwE;QACxE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAAmB,CAAC,EAAE,CAAC;YACtC,MAAM,MAAM,GAAI,OAAO,CAAC,OAAqB,CAAC,MAAM,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,2BAAmB,EAAE,MAAM,IAAI,wBAAY,CAAC,SAAS,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;QAC1B,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAlBD,sCAkBC"}
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
31
31
  export declare const SDK_METADATA: {
32
32
  readonly language: "typescript";
33
33
  readonly openapiDocVersion: "1.0.0";
34
- readonly sdkVersion: "0.0.1-alpha.25";
35
- readonly genVersion: "2.907.0";
36
- readonly userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.25 2.907.0 1.0.0 @gbg/go-core";
34
+ readonly sdkVersion: "0.0.1-alpha.27";
35
+ readonly genVersion: "2.915.1";
36
+ readonly userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.27 2.915.1 1.0.0 @gbg/go-core";
37
37
  };
38
38
  //# sourceMappingURL=config.d.ts.map
@@ -30,8 +30,8 @@ function serverURLFromOptions(options) {
30
30
  exports.SDK_METADATA = {
31
31
  language: "typescript",
32
32
  openapiDocVersion: "1.0.0",
33
- sdkVersion: "0.0.1-alpha.25",
34
- genVersion: "2.907.0",
35
- userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.25 2.907.0 1.0.0 @gbg/go-core",
33
+ sdkVersion: "0.0.1-alpha.27",
34
+ genVersion: "2.915.1",
35
+ userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.27 2.915.1 1.0.0 @gbg/go-core",
36
36
  };
37
37
  //# sourceMappingURL=config.js.map
@@ -0,0 +1,25 @@
1
+ import * as z from "zod/v4-mini";
2
+ export type ClientCredentialsGrantRequest = {
3
+ /**
4
+ * The client ID assigned to your organization.
5
+ */
6
+ clientId: string;
7
+ /**
8
+ * The client secret assigned to your organization.
9
+ */
10
+ clientSecret: string;
11
+ /**
12
+ * Must always be set to 'client_credentials'.
13
+ */
14
+ grantType: "client_credentials";
15
+ };
16
+ /** @internal */
17
+ export type ClientCredentialsGrantRequest$Outbound = {
18
+ client_id: string;
19
+ client_secret: string;
20
+ grant_type: "client_credentials";
21
+ };
22
+ /** @internal */
23
+ export declare const ClientCredentialsGrantRequest$outboundSchema: z.ZodMiniType<ClientCredentialsGrantRequest$Outbound, ClientCredentialsGrantRequest>;
24
+ export declare function clientCredentialsGrantRequestToJSON(clientCredentialsGrantRequest: ClientCredentialsGrantRequest): string;
25
+ //# sourceMappingURL=client-credentials-grant-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-credentials-grant-request.d.ts","sourceRoot":"","sources":["../../../src/models/client-credentials-grant-request.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAGjC,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,EAAE,oBAAoB,CAAC;CACjC,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,sCAAsC,GAAG;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,oBAAoB,CAAC;CAClC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,4CAA4C,EAAE,CAAC,CAAC,WAAW,CACtE,sCAAsC,EACtC,6BAA6B,CAc9B,CAAC;AAEF,wBAAgB,mCAAmC,CACjD,6BAA6B,EAAE,6BAA6B,GAC3D,MAAM,CAMR"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ClientCredentialsGrantRequest$outboundSchema = void 0;
40
+ exports.clientCredentialsGrantRequestToJSON = clientCredentialsGrantRequestToJSON;
41
+ const z = __importStar(require("zod/v4-mini"));
42
+ const primitives_js_1 = require("../lib/primitives.js");
43
+ /** @internal */
44
+ exports.ClientCredentialsGrantRequest$outboundSchema = z.pipe(z.object({
45
+ clientId: z.string(),
46
+ clientSecret: z.string(),
47
+ grantType: z.literal("client_credentials"),
48
+ }), z.transform((v) => {
49
+ return (0, primitives_js_1.remap)(v, {
50
+ clientId: "client_id",
51
+ clientSecret: "client_secret",
52
+ grantType: "grant_type",
53
+ });
54
+ }));
55
+ function clientCredentialsGrantRequestToJSON(clientCredentialsGrantRequest) {
56
+ return JSON.stringify(exports.ClientCredentialsGrantRequest$outboundSchema.parse(clientCredentialsGrantRequest));
57
+ }
58
+ //# sourceMappingURL=client-credentials-grant-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-credentials-grant-request.js","sourceRoot":"","sources":["../../../src/models/client-credentials-grant-request.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CH,kFAQC;AApDD,+CAAiC;AACjC,wDAAuD;AAwBvD,gBAAgB;AACH,QAAA,4CAA4C,GAGrD,CAAC,CAAC,IAAI,CACR,CAAC,CAAC,MAAM,CAAC;IACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;CAC3C,CAAC,EACF,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IAChB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,QAAQ,EAAE,WAAW;QACrB,YAAY,EAAE,eAAe;QAC7B,SAAS,EAAE,YAAY;KACxB,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC;AAEF,SAAgB,mCAAmC,CACjD,6BAA4D;IAE5D,OAAO,IAAI,CAAC,SAAS,CACnB,oDAA4C,CAAC,KAAK,CAChD,6BAA6B,CAC9B,CACF,CAAC;AACJ,CAAC"}
@@ -1,2 +1,4 @@
1
+ export * from "./client-credentials-grant-request.js";
2
+ export * from "./password-grant-request.js";
1
3
  export * from "./security.js";
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAIA,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
@@ -17,5 +17,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
17
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
+ __exportStar(require("./client-credentials-grant-request.js"), exports);
21
+ __exportStar(require("./password-grant-request.js"), exports);
20
22
  __exportStar(require("./security.js"), exports);
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,wEAAsD;AACtD,8DAA4C;AAC5C,gDAA8B"}
@@ -11,6 +11,27 @@ export type FetchInteractionRequest = {
11
11
  */
12
12
  instanceId: string;
13
13
  };
14
+ export declare const JourneyStatus2: {
15
+ readonly Completed: "Completed";
16
+ readonly InProgress: "InProgress";
17
+ readonly Failed: "Failed";
18
+ readonly Paused: "Paused";
19
+ };
20
+ export type JourneyStatus2 = OpenEnum<typeof JourneyStatus2>;
21
+ export type Journey2 = {
22
+ status: JourneyStatus2;
23
+ };
24
+ export type ResponseBody2 = {
25
+ /**
26
+ * Journey instance identifier
27
+ */
28
+ instanceId: string;
29
+ journey: Journey2;
30
+ /**
31
+ * True when the journey is still working and no interaction is available yet. Clients should poll /journey/interaction/fetch until this is absent/false and an `interaction` is returned.
32
+ */
33
+ processing?: boolean | undefined;
34
+ };
14
35
  export declare const FetchInteractionStatusError: {
15
36
  readonly Error: "error";
16
37
  };
@@ -26,15 +47,15 @@ export type FetchInteractionError = {
26
47
  */
27
48
  message: string;
28
49
  };
29
- export declare const JourneyStatus: {
50
+ export declare const JourneyStatus1: {
30
51
  readonly Completed: "Completed";
31
52
  readonly InProgress: "InProgress";
32
53
  readonly Failed: "Failed";
33
54
  readonly Paused: "Paused";
34
55
  };
35
- export type JourneyStatus = OpenEnum<typeof JourneyStatus>;
36
- export type Journey = {
37
- status: JourneyStatus;
56
+ export type JourneyStatus1 = OpenEnum<typeof JourneyStatus1>;
57
+ export type Journey1 = {
58
+ status: JourneyStatus1;
38
59
  };
39
60
  export declare const ResourceType: {
40
61
  readonly Brand: "brand";
@@ -1297,7 +1318,7 @@ export type FetchInteractionSubject = {
1297
1318
  export type FetchInteractionContext = {
1298
1319
  subject?: FetchInteractionSubject | undefined;
1299
1320
  };
1300
- export type ResponseBody = {
1321
+ export type ResponseBody1 = {
1301
1322
  /**
1302
1323
  * Journey instance identifier
1303
1324
  */
@@ -1306,7 +1327,7 @@ export type ResponseBody = {
1306
1327
  * Interaction identifier
1307
1328
  */
1308
1329
  interactionId: string;
1309
- journey: Journey;
1330
+ journey: Journey1;
1310
1331
  interaction: Interaction;
1311
1332
  context?: FetchInteractionContext | undefined;
1312
1333
  instructions?: Array<string> | undefined;
@@ -1315,7 +1336,7 @@ export type ResponseBody = {
1315
1336
  /**
1316
1337
  * Success
1317
1338
  */
1318
- export type FetchInteractionResponse = ResponseBody | FetchInteractionError;
1339
+ export type FetchInteractionResponse = ResponseBody1 | FetchInteractionError | ResponseBody2;
1319
1340
  /** @internal */
1320
1341
  export type FetchInteractionSecurity$Outbound = {
1321
1342
  InteractionAccess: string;
@@ -1331,15 +1352,23 @@ export type FetchInteractionRequest$Outbound = {
1331
1352
  export declare const FetchInteractionRequest$outboundSchema: z.ZodMiniType<FetchInteractionRequest$Outbound, FetchInteractionRequest>;
1332
1353
  export declare function fetchInteractionRequestToJSON(fetchInteractionRequest: FetchInteractionRequest): string;
1333
1354
  /** @internal */
1355
+ export declare const JourneyStatus2$inboundSchema: z.ZodMiniType<JourneyStatus2, unknown>;
1356
+ /** @internal */
1357
+ export declare const Journey2$inboundSchema: z.ZodMiniType<Journey2, unknown>;
1358
+ export declare function journey2FromJSON(jsonString: string): SafeParseResult<Journey2, SDKValidationError>;
1359
+ /** @internal */
1360
+ export declare const ResponseBody2$inboundSchema: z.ZodMiniType<ResponseBody2, unknown>;
1361
+ export declare function responseBody2FromJSON(jsonString: string): SafeParseResult<ResponseBody2, SDKValidationError>;
1362
+ /** @internal */
1334
1363
  export declare const FetchInteractionStatusError$inboundSchema: z.ZodMiniEnum<typeof FetchInteractionStatusError>;
1335
1364
  /** @internal */
1336
1365
  export declare const FetchInteractionError$inboundSchema: z.ZodMiniType<FetchInteractionError, unknown>;
1337
1366
  export declare function fetchInteractionErrorFromJSON(jsonString: string): SafeParseResult<FetchInteractionError, SDKValidationError>;
1338
1367
  /** @internal */
1339
- export declare const JourneyStatus$inboundSchema: z.ZodMiniType<JourneyStatus, unknown>;
1368
+ export declare const JourneyStatus1$inboundSchema: z.ZodMiniType<JourneyStatus1, unknown>;
1340
1369
  /** @internal */
1341
- export declare const Journey$inboundSchema: z.ZodMiniType<Journey, unknown>;
1342
- export declare function journeyFromJSON(jsonString: string): SafeParseResult<Journey, SDKValidationError>;
1370
+ export declare const Journey1$inboundSchema: z.ZodMiniType<Journey1, unknown>;
1371
+ export declare function journey1FromJSON(jsonString: string): SafeParseResult<Journey1, SDKValidationError>;
1343
1372
  /** @internal */
1344
1373
  export declare const ResourceType$inboundSchema: z.ZodMiniType<ResourceType, unknown>;
1345
1374
  /** @internal */
@@ -1614,8 +1643,8 @@ export declare function fetchInteractionSubjectFromJSON(jsonString: string): Saf
1614
1643
  export declare const FetchInteractionContext$inboundSchema: z.ZodMiniType<FetchInteractionContext, unknown>;
1615
1644
  export declare function fetchInteractionContextFromJSON(jsonString: string): SafeParseResult<FetchInteractionContext, SDKValidationError>;
1616
1645
  /** @internal */
1617
- export declare const ResponseBody$inboundSchema: z.ZodMiniType<ResponseBody, unknown>;
1618
- export declare function responseBodyFromJSON(jsonString: string): SafeParseResult<ResponseBody, SDKValidationError>;
1646
+ export declare const ResponseBody1$inboundSchema: z.ZodMiniType<ResponseBody1, unknown>;
1647
+ export declare function responseBody1FromJSON(jsonString: string): SafeParseResult<ResponseBody1, SDKValidationError>;
1619
1648
  /** @internal */
1620
1649
  export declare const FetchInteractionResponse$inboundSchema: z.ZodMiniType<FetchInteractionResponse, unknown>;
1621
1650
  export declare function fetchInteractionResponseFromJSON(jsonString: string): SafeParseResult<FetchInteractionResponse, SDKValidationError>;