@shware/http 2.12.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/error/detail.cjs +22 -23
  2. package/dist/error/detail.cjs.map +1 -1
  3. package/dist/error/detail.d.cts +23 -22
  4. package/dist/error/detail.d.cts.map +1 -1
  5. package/dist/error/detail.d.mts +23 -22
  6. package/dist/error/detail.d.mts.map +1 -1
  7. package/dist/error/detail.mjs +22 -23
  8. package/dist/error/detail.mjs.map +1 -1
  9. package/dist/error/index.cjs +8 -9
  10. package/dist/error/index.cjs.map +1 -1
  11. package/dist/error/index.d.cts +9 -8
  12. package/dist/error/index.d.cts.map +1 -1
  13. package/dist/error/index.d.mts +9 -8
  14. package/dist/error/index.d.mts.map +1 -1
  15. package/dist/error/index.mjs +8 -9
  16. package/dist/error/index.mjs.map +1 -1
  17. package/dist/error/parse.cjs +9 -8
  18. package/dist/error/parse.cjs.map +1 -1
  19. package/dist/error/parse.d.cts.map +1 -1
  20. package/dist/error/parse.d.mts.map +1 -1
  21. package/dist/error/parse.mjs +9 -8
  22. package/dist/error/parse.mjs.map +1 -1
  23. package/dist/error/status.cjs +1 -1
  24. package/dist/error/status.cjs.map +1 -1
  25. package/dist/error/status.mjs +1 -1
  26. package/dist/error/status.mjs.map +1 -1
  27. package/dist/google-one-tap/index.cjs +20 -5
  28. package/dist/google-one-tap/index.cjs.map +1 -1
  29. package/dist/google-one-tap/index.d.cts +2 -1
  30. package/dist/google-one-tap/index.d.cts.map +1 -1
  31. package/dist/google-one-tap/index.d.mts +2 -1
  32. package/dist/google-one-tap/index.d.mts.map +1 -1
  33. package/dist/google-one-tap/index.mjs +20 -5
  34. package/dist/google-one-tap/index.mjs.map +1 -1
  35. package/dist/hono/csrf.cjs +2 -2
  36. package/dist/hono/csrf.cjs.map +1 -1
  37. package/dist/hono/csrf.mjs +2 -2
  38. package/dist/hono/csrf.mjs.map +1 -1
  39. package/dist/hono/handler.cjs +2 -2
  40. package/dist/hono/handler.cjs.map +1 -1
  41. package/dist/hono/handler.mjs +3 -3
  42. package/dist/hono/handler.mjs.map +1 -1
  43. package/dist/hono/validator.cjs +1 -1
  44. package/dist/hono/validator.cjs.map +1 -1
  45. package/dist/hono/validator.d.cts.map +1 -1
  46. package/dist/hono/validator.d.mts.map +1 -1
  47. package/dist/hono/validator.mjs +1 -1
  48. package/dist/hono/validator.mjs.map +1 -1
  49. package/dist/index.cjs +1 -1
  50. package/dist/index.d.cts +1 -1
  51. package/dist/index.d.mts +1 -1
  52. package/dist/index.mjs +1 -1
  53. package/dist/iso/{iso_3601_1.cjs → iso-3601-1.cjs} +2 -2
  54. package/dist/iso/{iso_3601_1.cjs.map → iso-3601-1.cjs.map} +1 -1
  55. package/dist/iso/{iso_3601_1.d.mts → iso-3601-1.d.cts} +2 -2
  56. package/dist/iso/iso-3601-1.d.cts.map +1 -0
  57. package/dist/iso/{iso_3601_1.d.cts → iso-3601-1.d.mts} +2 -2
  58. package/dist/iso/iso-3601-1.d.mts.map +1 -0
  59. package/dist/iso/{iso_3601_1.mjs → iso-3601-1.mjs} +2 -2
  60. package/dist/iso/{iso_3601_1.mjs.map → iso-3601-1.mjs.map} +1 -1
  61. package/dist/polyfills/index.d.cts +1 -1
  62. package/dist/polyfills/index.d.mts +1 -1
  63. package/dist/response.cjs +3 -2
  64. package/dist/response.cjs.map +1 -1
  65. package/dist/response.d.cts.map +1 -1
  66. package/dist/response.d.mts.map +1 -1
  67. package/dist/response.mjs +3 -2
  68. package/dist/response.mjs.map +1 -1
  69. package/package.json +4 -4
  70. package/dist/iso/iso_3601_1.d.cts.map +0 -1
  71. package/dist/iso/iso_3601_1.d.mts.map +0 -1
@@ -1,18 +1,17 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/error/detail.ts
3
- let DetailType = /* @__PURE__ */ function(DetailType) {
4
- DetailType["ERROR_INFO"] = "type.googleapis.com/google.rpc.ErrorInfo";
5
- DetailType["RETRY_INFO"] = "type.googleapis.com/google.rpc.RetryInfo";
6
- DetailType["DEBUG_INFO"] = "type.googleapis.com/google.rpc.DebugInfo";
7
- DetailType["QUOTA_FAILURE"] = "type.googleapis.com/google.rpc.QuotaFailure";
8
- DetailType["PRECONDITION_FAILURE"] = "type.googleapis.com/google.rpc.PreconditionFailure";
9
- DetailType["BAD_REQUEST"] = "type.googleapis.com/google.rpc.BadRequest";
10
- DetailType["REQUEST_INFO"] = "type.googleapis.com/google.rpc.RequestInfo";
11
- DetailType["RESOURCE_INFO"] = "type.googleapis.com/google.rpc.ResourceInfo";
12
- DetailType["HELP"] = "type.googleapis.com/google.rpc.Help";
13
- DetailType["LOCALIZED_MESSAGE"] = "type.googleapis.com/google.rpc.LocalizedMessage";
14
- return DetailType;
15
- }({});
3
+ const DetailType = {
4
+ ERROR_INFO: "type.googleapis.com/google.rpc.ErrorInfo",
5
+ RETRY_INFO: "type.googleapis.com/google.rpc.RetryInfo",
6
+ DEBUG_INFO: "type.googleapis.com/google.rpc.DebugInfo",
7
+ QUOTA_FAILURE: "type.googleapis.com/google.rpc.QuotaFailure",
8
+ PRECONDITION_FAILURE: "type.googleapis.com/google.rpc.PreconditionFailure",
9
+ BAD_REQUEST: "type.googleapis.com/google.rpc.BadRequest",
10
+ REQUEST_INFO: "type.googleapis.com/google.rpc.RequestInfo",
11
+ RESOURCE_INFO: "type.googleapis.com/google.rpc.ResourceInfo",
12
+ HELP: "type.googleapis.com/google.rpc.Help",
13
+ LOCALIZED_MESSAGE: "type.googleapis.com/google.rpc.LocalizedMessage"
14
+ };
16
15
  /**
17
16
  * Example usage:
18
17
  * const details = Details.new()
@@ -27,70 +26,70 @@ var Details = class Details {
27
26
  }
28
27
  errorInfo(detail) {
29
28
  this.list.push({
30
- "@type": "type.googleapis.com/google.rpc.ErrorInfo",
29
+ "@type": DetailType.ERROR_INFO,
31
30
  ...detail
32
31
  });
33
32
  return this;
34
33
  }
35
34
  retryInfo(detail) {
36
35
  this.list.push({
37
- "@type": "type.googleapis.com/google.rpc.RetryInfo",
36
+ "@type": DetailType.RETRY_INFO,
38
37
  ...detail
39
38
  });
40
39
  return this;
41
40
  }
42
41
  debugInfo(detail) {
43
42
  this.list.push({
44
- "@type": "type.googleapis.com/google.rpc.DebugInfo",
43
+ "@type": DetailType.DEBUG_INFO,
45
44
  ...detail
46
45
  });
47
46
  return this;
48
47
  }
49
48
  quotaFailure(detail) {
50
49
  this.list.push({
51
- "@type": "type.googleapis.com/google.rpc.QuotaFailure",
50
+ "@type": DetailType.QUOTA_FAILURE,
52
51
  ...detail
53
52
  });
54
53
  return this;
55
54
  }
56
55
  preconditionFailure(detail) {
57
56
  this.list.push({
58
- "@type": "type.googleapis.com/google.rpc.PreconditionFailure",
57
+ "@type": DetailType.PRECONDITION_FAILURE,
59
58
  ...detail
60
59
  });
61
60
  return this;
62
61
  }
63
62
  badRequest(detail) {
64
63
  this.list.push({
65
- "@type": "type.googleapis.com/google.rpc.BadRequest",
64
+ "@type": DetailType.BAD_REQUEST,
66
65
  ...detail
67
66
  });
68
67
  return this;
69
68
  }
70
69
  requestInfo(detail) {
71
70
  this.list.push({
72
- "@type": "type.googleapis.com/google.rpc.RequestInfo",
71
+ "@type": DetailType.REQUEST_INFO,
73
72
  ...detail
74
73
  });
75
74
  return this;
76
75
  }
77
76
  resourceInfo(detail) {
78
77
  this.list.push({
79
- "@type": "type.googleapis.com/google.rpc.ResourceInfo",
78
+ "@type": DetailType.RESOURCE_INFO,
80
79
  ...detail
81
80
  });
82
81
  return this;
83
82
  }
84
83
  help(detail) {
85
84
  this.list.push({
86
- "@type": "type.googleapis.com/google.rpc.Help",
85
+ "@type": DetailType.HELP,
87
86
  ...detail
88
87
  });
89
88
  return this;
90
89
  }
91
90
  localizedMessage(detail) {
92
91
  this.list.push({
93
- "@type": "type.googleapis.com/google.rpc.LocalizedMessage",
92
+ "@type": DetailType.LOCALIZED_MESSAGE,
94
93
  ...detail
95
94
  });
96
95
  return this;
@@ -1 +1 @@
1
- {"version":3,"file":"detail.cjs","names":[],"sources":["../../src/error/detail.ts"],"sourcesContent":["/** reference: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto */\nimport type { ResolvedErrorReason } from './reason';\n\nexport enum DetailType {\n ERROR_INFO = 'type.googleapis.com/google.rpc.ErrorInfo',\n RETRY_INFO = 'type.googleapis.com/google.rpc.RetryInfo',\n DEBUG_INFO = 'type.googleapis.com/google.rpc.DebugInfo',\n QUOTA_FAILURE = 'type.googleapis.com/google.rpc.QuotaFailure',\n PRECONDITION_FAILURE = 'type.googleapis.com/google.rpc.PreconditionFailure',\n BAD_REQUEST = 'type.googleapis.com/google.rpc.BadRequest',\n REQUEST_INFO = 'type.googleapis.com/google.rpc.RequestInfo',\n RESOURCE_INFO = 'type.googleapis.com/google.rpc.ResourceInfo',\n HELP = 'type.googleapis.com/google.rpc.Help',\n LOCALIZED_MESSAGE = 'type.googleapis.com/google.rpc.LocalizedMessage',\n}\n\nexport interface ErrorInfo {\n '@type': DetailType.ERROR_INFO;\n reason: ResolvedErrorReason;\n domain?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface RetryInfo {\n '@type': DetailType.RETRY_INFO;\n retryDelay: number;\n}\n\nexport interface DebugInfo {\n '@type': DetailType.DEBUG_INFO;\n stackEntries: string[];\n detail: string;\n}\n\nexport interface QuotaFailure {\n '@type': DetailType.QUOTA_FAILURE;\n violations: {\n subject: string;\n description: string;\n apiService: string;\n quoteId: string;\n quoteValue: number;\n quotaMetric: string;\n quotaDimensions: Record<string, string>;\n futureQuotaValue: number;\n }[];\n}\n\nexport interface PreconditionFailure {\n '@type': DetailType.PRECONDITION_FAILURE;\n violations: { type: string; subject: string; description: string }[];\n}\n\nexport interface BadRequest {\n '@type': DetailType.BAD_REQUEST;\n fieldViolations: {\n field: string;\n description: string;\n reason: string;\n localizedMessage: Omit<LocalizedMessage, '@type'>;\n }[];\n}\n\nexport interface RequestInfo {\n '@type': DetailType.REQUEST_INFO;\n requestId: string;\n servingData: string;\n}\n\nexport interface ResourceInfo {\n '@type': DetailType.RESOURCE_INFO;\n resourceType: string;\n resourceName: string;\n owner: string;\n description: string;\n}\n\nexport interface Help {\n '@type': DetailType.HELP;\n links: { url: string; description: string }[];\n}\n\nexport interface LocalizedMessage {\n '@type': DetailType.LOCALIZED_MESSAGE;\n locale: string;\n message: string;\n}\n\nexport type Detail =\n | RetryInfo\n | DebugInfo\n | QuotaFailure\n | ErrorInfo\n | PreconditionFailure\n | BadRequest\n | RequestInfo\n | ResourceInfo\n | Help\n | LocalizedMessage;\n\n/**\n * Example usage:\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n * */\nexport class Details {\n readonly list: Detail[] = [];\n private constructor() {}\n\n static new() {\n return new Details();\n }\n\n errorInfo(detail: Omit<ErrorInfo, '@type'>) {\n this.list.push({ '@type': DetailType.ERROR_INFO, ...detail });\n return this;\n }\n\n retryInfo(detail: Omit<RetryInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RETRY_INFO, ...detail });\n return this;\n }\n\n debugInfo(detail: Omit<DebugInfo, '@type'>) {\n this.list.push({ '@type': DetailType.DEBUG_INFO, ...detail });\n return this;\n }\n\n quotaFailure(detail: Omit<QuotaFailure, '@type'>) {\n this.list.push({ '@type': DetailType.QUOTA_FAILURE, ...detail });\n return this;\n }\n\n preconditionFailure(detail: Omit<PreconditionFailure, '@type'>) {\n this.list.push({ '@type': DetailType.PRECONDITION_FAILURE, ...detail });\n return this;\n }\n\n badRequest(detail: Omit<BadRequest, '@type'>) {\n this.list.push({ '@type': DetailType.BAD_REQUEST, ...detail });\n return this;\n }\n\n requestInfo(detail: Omit<RequestInfo, '@type'>) {\n this.list.push({ '@type': DetailType.REQUEST_INFO, ...detail });\n return this;\n }\n\n resourceInfo(detail: Omit<ResourceInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RESOURCE_INFO, ...detail });\n return this;\n }\n\n help(detail: Omit<Help, '@type'>) {\n this.list.push({ '@type': DetailType.HELP, ...detail });\n return this;\n }\n\n localizedMessage(detail: Omit<LocalizedMessage, '@type'>) {\n this.list.push({ '@type': DetailType.LOCALIZED_MESSAGE, ...detail });\n return this;\n }\n}\n"],"mappings":";;AAGA,IAAY,aAAL,yBAAA,YAAA;CACL,WAAA,gBAAA;CACA,WAAA,gBAAA;CACA,WAAA,gBAAA;CACA,WAAA,mBAAA;CACA,WAAA,0BAAA;CACA,WAAA,iBAAA;CACA,WAAA,kBAAA;CACA,WAAA,mBAAA;CACA,WAAA,UAAA;CACA,WAAA,uBAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;AA4FA,IAAa,UAAb,MAAa,QAAQ;CACnB,OAA0B,CAAC;CAC3B,cAAsB,CAAC;CAEvB,OAAO,MAAM;EACX,OAAO,IAAI,QAAQ;CACrB;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAmC,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,oBAAoB,QAA4C;EAC9D,KAAK,KAAK,KAAK;GAAE,SAAA;GAA0C,GAAG;EAAO,CAAC;EACtE,OAAO;CACT;CAEA,WAAW,QAAmC;EAC5C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAiC,GAAG;EAAO,CAAC;EAC7D,OAAO;CACT;CAEA,YAAY,QAAoC;EAC9C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAkC,GAAG;EAAO,CAAC;EAC9D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAmC,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,KAAK,QAA6B;EAChC,KAAK,KAAK,KAAK;GAAE,SAAA;GAA0B,GAAG;EAAO,CAAC;EACtD,OAAO;CACT;CAEA,iBAAiB,QAAyC;EACxD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAuC,GAAG;EAAO,CAAC;EACnE,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"detail.cjs","names":[],"sources":["../../src/error/detail.ts"],"sourcesContent":["/** reference: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto */\nimport type { ResolvedErrorReason } from './reason';\n\nexport const DetailType = {\n ERROR_INFO: 'type.googleapis.com/google.rpc.ErrorInfo',\n RETRY_INFO: 'type.googleapis.com/google.rpc.RetryInfo',\n DEBUG_INFO: 'type.googleapis.com/google.rpc.DebugInfo',\n QUOTA_FAILURE: 'type.googleapis.com/google.rpc.QuotaFailure',\n PRECONDITION_FAILURE: 'type.googleapis.com/google.rpc.PreconditionFailure',\n BAD_REQUEST: 'type.googleapis.com/google.rpc.BadRequest',\n REQUEST_INFO: 'type.googleapis.com/google.rpc.RequestInfo',\n RESOURCE_INFO: 'type.googleapis.com/google.rpc.ResourceInfo',\n HELP: 'type.googleapis.com/google.rpc.Help',\n LOCALIZED_MESSAGE: 'type.googleapis.com/google.rpc.LocalizedMessage',\n} as const;\n\nexport type DetailType = (typeof DetailType)[keyof typeof DetailType];\n\nexport interface ErrorInfo {\n '@type': typeof DetailType.ERROR_INFO;\n reason: ResolvedErrorReason;\n domain?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface RetryInfo {\n '@type': typeof DetailType.RETRY_INFO;\n retryDelay: number;\n}\n\nexport interface DebugInfo {\n '@type': typeof DetailType.DEBUG_INFO;\n stackEntries: string[];\n detail: string;\n}\n\nexport interface QuotaFailure {\n '@type': typeof DetailType.QUOTA_FAILURE;\n violations: {\n subject: string;\n description: string;\n apiService: string;\n quoteId: string;\n quoteValue: number;\n quotaMetric: string;\n quotaDimensions: Record<string, string>;\n futureQuotaValue: number;\n }[];\n}\n\nexport interface PreconditionFailure {\n '@type': typeof DetailType.PRECONDITION_FAILURE;\n violations: { type: string; subject: string; description: string }[];\n}\n\nexport interface BadRequest {\n '@type': typeof DetailType.BAD_REQUEST;\n fieldViolations: {\n field: string;\n description: string;\n reason: string;\n localizedMessage: Omit<LocalizedMessage, '@type'>;\n }[];\n}\n\nexport interface RequestInfo {\n '@type': typeof DetailType.REQUEST_INFO;\n requestId: string;\n servingData: string;\n}\n\nexport interface ResourceInfo {\n '@type': typeof DetailType.RESOURCE_INFO;\n resourceType: string;\n resourceName: string;\n owner: string;\n description: string;\n}\n\nexport interface Help {\n '@type': typeof DetailType.HELP;\n links: { url: string; description: string }[];\n}\n\nexport interface LocalizedMessage {\n '@type': typeof DetailType.LOCALIZED_MESSAGE;\n locale: string;\n message: string;\n}\n\nexport type Detail =\n | RetryInfo\n | DebugInfo\n | QuotaFailure\n | ErrorInfo\n | PreconditionFailure\n | BadRequest\n | RequestInfo\n | ResourceInfo\n | Help\n | LocalizedMessage;\n\n/**\n * Example usage:\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n * */\nexport class Details {\n readonly list: Detail[] = [];\n private constructor() {}\n\n static new() {\n return new Details();\n }\n\n errorInfo(detail: Omit<ErrorInfo, '@type'>) {\n this.list.push({ '@type': DetailType.ERROR_INFO, ...detail });\n return this;\n }\n\n retryInfo(detail: Omit<RetryInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RETRY_INFO, ...detail });\n return this;\n }\n\n debugInfo(detail: Omit<DebugInfo, '@type'>) {\n this.list.push({ '@type': DetailType.DEBUG_INFO, ...detail });\n return this;\n }\n\n quotaFailure(detail: Omit<QuotaFailure, '@type'>) {\n this.list.push({ '@type': DetailType.QUOTA_FAILURE, ...detail });\n return this;\n }\n\n preconditionFailure(detail: Omit<PreconditionFailure, '@type'>) {\n this.list.push({ '@type': DetailType.PRECONDITION_FAILURE, ...detail });\n return this;\n }\n\n badRequest(detail: Omit<BadRequest, '@type'>) {\n this.list.push({ '@type': DetailType.BAD_REQUEST, ...detail });\n return this;\n }\n\n requestInfo(detail: Omit<RequestInfo, '@type'>) {\n this.list.push({ '@type': DetailType.REQUEST_INFO, ...detail });\n return this;\n }\n\n resourceInfo(detail: Omit<ResourceInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RESOURCE_INFO, ...detail });\n return this;\n }\n\n help(detail: Omit<Help, '@type'>) {\n this.list.push({ '@type': DetailType.HELP, ...detail });\n return this;\n }\n\n localizedMessage(detail: Omit<LocalizedMessage, '@type'>) {\n this.list.push({ '@type': DetailType.LOCALIZED_MESSAGE, ...detail });\n return this;\n }\n}\n"],"mappings":";;AAGA,MAAa,aAAa;CACxB,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,eAAe;CACf,sBAAsB;CACtB,aAAa;CACb,cAAc;CACd,eAAe;CACf,MAAM;CACN,mBAAmB;AACrB;;;;;;;AA8FA,IAAa,UAAb,MAAa,QAAQ;CACnB,OAA0B,CAAC;CAC3B,cAAsB,CAAC;CAEvB,OAAO,MAAM;EACX,OAAO,IAAI,QAAQ;CACrB;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAe,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,oBAAoB,QAA4C;EAC9D,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAsB,GAAG;EAAO,CAAC;EACtE,OAAO;CACT;CAEA,WAAW,QAAmC;EAC5C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAa,GAAG;EAAO,CAAC;EAC7D,OAAO;CACT;CAEA,YAAY,QAAoC;EAC9C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAc,GAAG;EAAO,CAAC;EAC9D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAe,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,KAAK,QAA6B;EAChC,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAM,GAAG;EAAO,CAAC;EACtD,OAAO;CACT;CAEA,iBAAiB,QAAyC;EACxD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAmB,GAAG;EAAO,CAAC;EACnE,OAAO;CACT;AACF"}
@@ -1,34 +1,35 @@
1
1
  import { ResolvedErrorReason } from "./reason.cjs";
2
2
  //#region src/error/detail.d.ts
3
- declare enum DetailType {
4
- ERROR_INFO = "type.googleapis.com/google.rpc.ErrorInfo",
5
- RETRY_INFO = "type.googleapis.com/google.rpc.RetryInfo",
6
- DEBUG_INFO = "type.googleapis.com/google.rpc.DebugInfo",
7
- QUOTA_FAILURE = "type.googleapis.com/google.rpc.QuotaFailure",
8
- PRECONDITION_FAILURE = "type.googleapis.com/google.rpc.PreconditionFailure",
9
- BAD_REQUEST = "type.googleapis.com/google.rpc.BadRequest",
10
- REQUEST_INFO = "type.googleapis.com/google.rpc.RequestInfo",
11
- RESOURCE_INFO = "type.googleapis.com/google.rpc.ResourceInfo",
12
- HELP = "type.googleapis.com/google.rpc.Help",
13
- LOCALIZED_MESSAGE = "type.googleapis.com/google.rpc.LocalizedMessage"
14
- }
3
+ declare const DetailType: {
4
+ readonly ERROR_INFO: 'type.googleapis.com/google.rpc.ErrorInfo';
5
+ readonly RETRY_INFO: 'type.googleapis.com/google.rpc.RetryInfo';
6
+ readonly DEBUG_INFO: 'type.googleapis.com/google.rpc.DebugInfo';
7
+ readonly QUOTA_FAILURE: 'type.googleapis.com/google.rpc.QuotaFailure';
8
+ readonly PRECONDITION_FAILURE: 'type.googleapis.com/google.rpc.PreconditionFailure';
9
+ readonly BAD_REQUEST: 'type.googleapis.com/google.rpc.BadRequest';
10
+ readonly REQUEST_INFO: 'type.googleapis.com/google.rpc.RequestInfo';
11
+ readonly RESOURCE_INFO: 'type.googleapis.com/google.rpc.ResourceInfo';
12
+ readonly HELP: 'type.googleapis.com/google.rpc.Help';
13
+ readonly LOCALIZED_MESSAGE: 'type.googleapis.com/google.rpc.LocalizedMessage';
14
+ };
15
+ type DetailType = (typeof DetailType)[keyof typeof DetailType];
15
16
  interface ErrorInfo {
16
- '@type': DetailType.ERROR_INFO;
17
+ '@type': typeof DetailType.ERROR_INFO;
17
18
  reason: ResolvedErrorReason;
18
19
  domain?: string;
19
20
  metadata?: Record<string, string>;
20
21
  }
21
22
  interface RetryInfo {
22
- '@type': DetailType.RETRY_INFO;
23
+ '@type': typeof DetailType.RETRY_INFO;
23
24
  retryDelay: number;
24
25
  }
25
26
  interface DebugInfo {
26
- '@type': DetailType.DEBUG_INFO;
27
+ '@type': typeof DetailType.DEBUG_INFO;
27
28
  stackEntries: string[];
28
29
  detail: string;
29
30
  }
30
31
  interface QuotaFailure {
31
- '@type': DetailType.QUOTA_FAILURE;
32
+ '@type': typeof DetailType.QUOTA_FAILURE;
32
33
  violations: {
33
34
  subject: string;
34
35
  description: string;
@@ -41,7 +42,7 @@ interface QuotaFailure {
41
42
  }[];
42
43
  }
43
44
  interface PreconditionFailure {
44
- '@type': DetailType.PRECONDITION_FAILURE;
45
+ '@type': typeof DetailType.PRECONDITION_FAILURE;
45
46
  violations: {
46
47
  type: string;
47
48
  subject: string;
@@ -49,7 +50,7 @@ interface PreconditionFailure {
49
50
  }[];
50
51
  }
51
52
  interface BadRequest {
52
- '@type': DetailType.BAD_REQUEST;
53
+ '@type': typeof DetailType.BAD_REQUEST;
53
54
  fieldViolations: {
54
55
  field: string;
55
56
  description: string;
@@ -58,26 +59,26 @@ interface BadRequest {
58
59
  }[];
59
60
  }
60
61
  interface RequestInfo {
61
- '@type': DetailType.REQUEST_INFO;
62
+ '@type': typeof DetailType.REQUEST_INFO;
62
63
  requestId: string;
63
64
  servingData: string;
64
65
  }
65
66
  interface ResourceInfo {
66
- '@type': DetailType.RESOURCE_INFO;
67
+ '@type': typeof DetailType.RESOURCE_INFO;
67
68
  resourceType: string;
68
69
  resourceName: string;
69
70
  owner: string;
70
71
  description: string;
71
72
  }
72
73
  interface Help {
73
- '@type': DetailType.HELP;
74
+ '@type': typeof DetailType.HELP;
74
75
  links: {
75
76
  url: string;
76
77
  description: string;
77
78
  }[];
78
79
  }
79
80
  interface LocalizedMessage {
80
- '@type': DetailType.LOCALIZED_MESSAGE;
81
+ '@type': typeof DetailType.LOCALIZED_MESSAGE;
81
82
  locale: string;
82
83
  message: string;
83
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"detail.d.cts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;aAGY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,SAAS,WAAW;EACpB,QAAQ;EACR;EACA,WAAW;;UAGI;EACf,SAAS,WAAW;EACpB;;UAGe;EACf,SAAS,WAAW;EACpB;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;IACE;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB;;;UAIa;EACf,SAAS,WAAW;EACpB;IAAc;IAAc;IAAiB;;;UAG9B;EACf,SAAS,WAAW;EACpB;IACE;IACA;IACA;IACA,kBAAkB,KAAK;;;UAIV;EACf,SAAS,WAAW;EACpB;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;EACA;EACA;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;IAAS;IAAa;;;UAGP;EACf,SAAS,WAAW;EACpB;EACA;;KAGU,SACR,YACA,YACA,eACA,YACA,sBACA,aACA,cACA,eACA,OACA;;;;;;;cAQS;WACF,MAAM;UACR;SAEA,OAAG;EAIV,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,aAAa,QAAQ,KAAK;EAK1B,oBAAoB,QAAQ,KAAK;EAKjC,WAAW,QAAQ,KAAK;EAKxB,YAAY,QAAQ,KAAK;EAKzB,aAAa,QAAQ,KAAK;EAK1B,KAAK,QAAQ,KAAK;EAKlB,iBAAiB,QAAQ,KAAK"}
1
+ {"version":3,"file":"detail.d.cts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;cAGa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;KAGU,qBAAqB,yBAAyB;UAEzC;EACf,gBAAgB,WAAW;EAC3B,QAAQ;EACR;EACA,WAAW;;UAGI;EACf,gBAAgB,WAAW;EAC3B;;UAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB;;;UAIa;EACf,gBAAgB,WAAW;EAC3B;IAAc;IAAc;IAAiB;;;UAG9B;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA,kBAAkB,KAAK;;;UAIV;EACf,gBAAgB,WAAW;EAC3B;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;EACA;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;IAAS;IAAa;;;UAGP;EACf,gBAAgB,WAAW;EAC3B;EACA;;KAGU,SACR,YACA,YACA,eACA,YACA,sBACA,aACA,cACA,eACA,OACA;;;;;;;cAQS;WACF,MAAM;UACR;SAEA,OAAG;EAIV,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,aAAa,QAAQ,KAAK;EAK1B,oBAAoB,QAAQ,KAAK;EAKjC,WAAW,QAAQ,KAAK;EAKxB,YAAY,QAAQ,KAAK;EAKzB,aAAa,QAAQ,KAAK;EAK1B,KAAK,QAAQ,KAAK;EAKlB,iBAAiB,QAAQ,KAAK"}
@@ -1,34 +1,35 @@
1
1
  import { ResolvedErrorReason } from "./reason.mjs";
2
2
  //#region src/error/detail.d.ts
3
- declare enum DetailType {
4
- ERROR_INFO = "type.googleapis.com/google.rpc.ErrorInfo",
5
- RETRY_INFO = "type.googleapis.com/google.rpc.RetryInfo",
6
- DEBUG_INFO = "type.googleapis.com/google.rpc.DebugInfo",
7
- QUOTA_FAILURE = "type.googleapis.com/google.rpc.QuotaFailure",
8
- PRECONDITION_FAILURE = "type.googleapis.com/google.rpc.PreconditionFailure",
9
- BAD_REQUEST = "type.googleapis.com/google.rpc.BadRequest",
10
- REQUEST_INFO = "type.googleapis.com/google.rpc.RequestInfo",
11
- RESOURCE_INFO = "type.googleapis.com/google.rpc.ResourceInfo",
12
- HELP = "type.googleapis.com/google.rpc.Help",
13
- LOCALIZED_MESSAGE = "type.googleapis.com/google.rpc.LocalizedMessage"
14
- }
3
+ declare const DetailType: {
4
+ readonly ERROR_INFO: 'type.googleapis.com/google.rpc.ErrorInfo';
5
+ readonly RETRY_INFO: 'type.googleapis.com/google.rpc.RetryInfo';
6
+ readonly DEBUG_INFO: 'type.googleapis.com/google.rpc.DebugInfo';
7
+ readonly QUOTA_FAILURE: 'type.googleapis.com/google.rpc.QuotaFailure';
8
+ readonly PRECONDITION_FAILURE: 'type.googleapis.com/google.rpc.PreconditionFailure';
9
+ readonly BAD_REQUEST: 'type.googleapis.com/google.rpc.BadRequest';
10
+ readonly REQUEST_INFO: 'type.googleapis.com/google.rpc.RequestInfo';
11
+ readonly RESOURCE_INFO: 'type.googleapis.com/google.rpc.ResourceInfo';
12
+ readonly HELP: 'type.googleapis.com/google.rpc.Help';
13
+ readonly LOCALIZED_MESSAGE: 'type.googleapis.com/google.rpc.LocalizedMessage';
14
+ };
15
+ type DetailType = (typeof DetailType)[keyof typeof DetailType];
15
16
  interface ErrorInfo {
16
- '@type': DetailType.ERROR_INFO;
17
+ '@type': typeof DetailType.ERROR_INFO;
17
18
  reason: ResolvedErrorReason;
18
19
  domain?: string;
19
20
  metadata?: Record<string, string>;
20
21
  }
21
22
  interface RetryInfo {
22
- '@type': DetailType.RETRY_INFO;
23
+ '@type': typeof DetailType.RETRY_INFO;
23
24
  retryDelay: number;
24
25
  }
25
26
  interface DebugInfo {
26
- '@type': DetailType.DEBUG_INFO;
27
+ '@type': typeof DetailType.DEBUG_INFO;
27
28
  stackEntries: string[];
28
29
  detail: string;
29
30
  }
30
31
  interface QuotaFailure {
31
- '@type': DetailType.QUOTA_FAILURE;
32
+ '@type': typeof DetailType.QUOTA_FAILURE;
32
33
  violations: {
33
34
  subject: string;
34
35
  description: string;
@@ -41,7 +42,7 @@ interface QuotaFailure {
41
42
  }[];
42
43
  }
43
44
  interface PreconditionFailure {
44
- '@type': DetailType.PRECONDITION_FAILURE;
45
+ '@type': typeof DetailType.PRECONDITION_FAILURE;
45
46
  violations: {
46
47
  type: string;
47
48
  subject: string;
@@ -49,7 +50,7 @@ interface PreconditionFailure {
49
50
  }[];
50
51
  }
51
52
  interface BadRequest {
52
- '@type': DetailType.BAD_REQUEST;
53
+ '@type': typeof DetailType.BAD_REQUEST;
53
54
  fieldViolations: {
54
55
  field: string;
55
56
  description: string;
@@ -58,26 +59,26 @@ interface BadRequest {
58
59
  }[];
59
60
  }
60
61
  interface RequestInfo {
61
- '@type': DetailType.REQUEST_INFO;
62
+ '@type': typeof DetailType.REQUEST_INFO;
62
63
  requestId: string;
63
64
  servingData: string;
64
65
  }
65
66
  interface ResourceInfo {
66
- '@type': DetailType.RESOURCE_INFO;
67
+ '@type': typeof DetailType.RESOURCE_INFO;
67
68
  resourceType: string;
68
69
  resourceName: string;
69
70
  owner: string;
70
71
  description: string;
71
72
  }
72
73
  interface Help {
73
- '@type': DetailType.HELP;
74
+ '@type': typeof DetailType.HELP;
74
75
  links: {
75
76
  url: string;
76
77
  description: string;
77
78
  }[];
78
79
  }
79
80
  interface LocalizedMessage {
80
- '@type': DetailType.LOCALIZED_MESSAGE;
81
+ '@type': typeof DetailType.LOCALIZED_MESSAGE;
81
82
  locale: string;
82
83
  message: string;
83
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"detail.d.mts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;aAGY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,SAAS,WAAW;EACpB,QAAQ;EACR;EACA,WAAW;;UAGI;EACf,SAAS,WAAW;EACpB;;UAGe;EACf,SAAS,WAAW;EACpB;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;IACE;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB;;;UAIa;EACf,SAAS,WAAW;EACpB;IAAc;IAAc;IAAiB;;;UAG9B;EACf,SAAS,WAAW;EACpB;IACE;IACA;IACA;IACA,kBAAkB,KAAK;;;UAIV;EACf,SAAS,WAAW;EACpB;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;EACA;EACA;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;IAAS;IAAa;;;UAGP;EACf,SAAS,WAAW;EACpB;EACA;;KAGU,SACR,YACA,YACA,eACA,YACA,sBACA,aACA,cACA,eACA,OACA;;;;;;;cAQS;WACF,MAAM;UACR;SAEA,OAAG;EAIV,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,aAAa,QAAQ,KAAK;EAK1B,oBAAoB,QAAQ,KAAK;EAKjC,WAAW,QAAQ,KAAK;EAKxB,YAAY,QAAQ,KAAK;EAKzB,aAAa,QAAQ,KAAK;EAK1B,KAAK,QAAQ,KAAK;EAKlB,iBAAiB,QAAQ,KAAK"}
1
+ {"version":3,"file":"detail.d.mts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;cAGa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;KAGU,qBAAqB,yBAAyB;UAEzC;EACf,gBAAgB,WAAW;EAC3B,QAAQ;EACR;EACA,WAAW;;UAGI;EACf,gBAAgB,WAAW;EAC3B;;UAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB;;;UAIa;EACf,gBAAgB,WAAW;EAC3B;IAAc;IAAc;IAAiB;;;UAG9B;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA,kBAAkB,KAAK;;;UAIV;EACf,gBAAgB,WAAW;EAC3B;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;EACA;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;IAAS;IAAa;;;UAGP;EACf,gBAAgB,WAAW;EAC3B;EACA;;KAGU,SACR,YACA,YACA,eACA,YACA,sBACA,aACA,cACA,eACA,OACA;;;;;;;cAQS;WACF,MAAM;UACR;SAEA,OAAG;EAIV,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,aAAa,QAAQ,KAAK;EAK1B,oBAAoB,QAAQ,KAAK;EAKjC,WAAW,QAAQ,KAAK;EAKxB,YAAY,QAAQ,KAAK;EAKzB,aAAa,QAAQ,KAAK;EAK1B,KAAK,QAAQ,KAAK;EAKlB,iBAAiB,QAAQ,KAAK"}
@@ -1,17 +1,16 @@
1
1
  //#region src/error/detail.ts
2
- let DetailType = /* @__PURE__ */ function(DetailType) {
3
- DetailType["ERROR_INFO"] = "type.googleapis.com/google.rpc.ErrorInfo";
4
- DetailType["RETRY_INFO"] = "type.googleapis.com/google.rpc.RetryInfo";
5
- DetailType["DEBUG_INFO"] = "type.googleapis.com/google.rpc.DebugInfo";
6
- DetailType["QUOTA_FAILURE"] = "type.googleapis.com/google.rpc.QuotaFailure";
7
- DetailType["PRECONDITION_FAILURE"] = "type.googleapis.com/google.rpc.PreconditionFailure";
8
- DetailType["BAD_REQUEST"] = "type.googleapis.com/google.rpc.BadRequest";
9
- DetailType["REQUEST_INFO"] = "type.googleapis.com/google.rpc.RequestInfo";
10
- DetailType["RESOURCE_INFO"] = "type.googleapis.com/google.rpc.ResourceInfo";
11
- DetailType["HELP"] = "type.googleapis.com/google.rpc.Help";
12
- DetailType["LOCALIZED_MESSAGE"] = "type.googleapis.com/google.rpc.LocalizedMessage";
13
- return DetailType;
14
- }({});
2
+ const DetailType = {
3
+ ERROR_INFO: "type.googleapis.com/google.rpc.ErrorInfo",
4
+ RETRY_INFO: "type.googleapis.com/google.rpc.RetryInfo",
5
+ DEBUG_INFO: "type.googleapis.com/google.rpc.DebugInfo",
6
+ QUOTA_FAILURE: "type.googleapis.com/google.rpc.QuotaFailure",
7
+ PRECONDITION_FAILURE: "type.googleapis.com/google.rpc.PreconditionFailure",
8
+ BAD_REQUEST: "type.googleapis.com/google.rpc.BadRequest",
9
+ REQUEST_INFO: "type.googleapis.com/google.rpc.RequestInfo",
10
+ RESOURCE_INFO: "type.googleapis.com/google.rpc.ResourceInfo",
11
+ HELP: "type.googleapis.com/google.rpc.Help",
12
+ LOCALIZED_MESSAGE: "type.googleapis.com/google.rpc.LocalizedMessage"
13
+ };
15
14
  /**
16
15
  * Example usage:
17
16
  * const details = Details.new()
@@ -26,70 +25,70 @@ var Details = class Details {
26
25
  }
27
26
  errorInfo(detail) {
28
27
  this.list.push({
29
- "@type": "type.googleapis.com/google.rpc.ErrorInfo",
28
+ "@type": DetailType.ERROR_INFO,
30
29
  ...detail
31
30
  });
32
31
  return this;
33
32
  }
34
33
  retryInfo(detail) {
35
34
  this.list.push({
36
- "@type": "type.googleapis.com/google.rpc.RetryInfo",
35
+ "@type": DetailType.RETRY_INFO,
37
36
  ...detail
38
37
  });
39
38
  return this;
40
39
  }
41
40
  debugInfo(detail) {
42
41
  this.list.push({
43
- "@type": "type.googleapis.com/google.rpc.DebugInfo",
42
+ "@type": DetailType.DEBUG_INFO,
44
43
  ...detail
45
44
  });
46
45
  return this;
47
46
  }
48
47
  quotaFailure(detail) {
49
48
  this.list.push({
50
- "@type": "type.googleapis.com/google.rpc.QuotaFailure",
49
+ "@type": DetailType.QUOTA_FAILURE,
51
50
  ...detail
52
51
  });
53
52
  return this;
54
53
  }
55
54
  preconditionFailure(detail) {
56
55
  this.list.push({
57
- "@type": "type.googleapis.com/google.rpc.PreconditionFailure",
56
+ "@type": DetailType.PRECONDITION_FAILURE,
58
57
  ...detail
59
58
  });
60
59
  return this;
61
60
  }
62
61
  badRequest(detail) {
63
62
  this.list.push({
64
- "@type": "type.googleapis.com/google.rpc.BadRequest",
63
+ "@type": DetailType.BAD_REQUEST,
65
64
  ...detail
66
65
  });
67
66
  return this;
68
67
  }
69
68
  requestInfo(detail) {
70
69
  this.list.push({
71
- "@type": "type.googleapis.com/google.rpc.RequestInfo",
70
+ "@type": DetailType.REQUEST_INFO,
72
71
  ...detail
73
72
  });
74
73
  return this;
75
74
  }
76
75
  resourceInfo(detail) {
77
76
  this.list.push({
78
- "@type": "type.googleapis.com/google.rpc.ResourceInfo",
77
+ "@type": DetailType.RESOURCE_INFO,
79
78
  ...detail
80
79
  });
81
80
  return this;
82
81
  }
83
82
  help(detail) {
84
83
  this.list.push({
85
- "@type": "type.googleapis.com/google.rpc.Help",
84
+ "@type": DetailType.HELP,
86
85
  ...detail
87
86
  });
88
87
  return this;
89
88
  }
90
89
  localizedMessage(detail) {
91
90
  this.list.push({
92
- "@type": "type.googleapis.com/google.rpc.LocalizedMessage",
91
+ "@type": DetailType.LOCALIZED_MESSAGE,
93
92
  ...detail
94
93
  });
95
94
  return this;
@@ -1 +1 @@
1
- {"version":3,"file":"detail.mjs","names":[],"sources":["../../src/error/detail.ts"],"sourcesContent":["/** reference: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto */\nimport type { ResolvedErrorReason } from './reason';\n\nexport enum DetailType {\n ERROR_INFO = 'type.googleapis.com/google.rpc.ErrorInfo',\n RETRY_INFO = 'type.googleapis.com/google.rpc.RetryInfo',\n DEBUG_INFO = 'type.googleapis.com/google.rpc.DebugInfo',\n QUOTA_FAILURE = 'type.googleapis.com/google.rpc.QuotaFailure',\n PRECONDITION_FAILURE = 'type.googleapis.com/google.rpc.PreconditionFailure',\n BAD_REQUEST = 'type.googleapis.com/google.rpc.BadRequest',\n REQUEST_INFO = 'type.googleapis.com/google.rpc.RequestInfo',\n RESOURCE_INFO = 'type.googleapis.com/google.rpc.ResourceInfo',\n HELP = 'type.googleapis.com/google.rpc.Help',\n LOCALIZED_MESSAGE = 'type.googleapis.com/google.rpc.LocalizedMessage',\n}\n\nexport interface ErrorInfo {\n '@type': DetailType.ERROR_INFO;\n reason: ResolvedErrorReason;\n domain?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface RetryInfo {\n '@type': DetailType.RETRY_INFO;\n retryDelay: number;\n}\n\nexport interface DebugInfo {\n '@type': DetailType.DEBUG_INFO;\n stackEntries: string[];\n detail: string;\n}\n\nexport interface QuotaFailure {\n '@type': DetailType.QUOTA_FAILURE;\n violations: {\n subject: string;\n description: string;\n apiService: string;\n quoteId: string;\n quoteValue: number;\n quotaMetric: string;\n quotaDimensions: Record<string, string>;\n futureQuotaValue: number;\n }[];\n}\n\nexport interface PreconditionFailure {\n '@type': DetailType.PRECONDITION_FAILURE;\n violations: { type: string; subject: string; description: string }[];\n}\n\nexport interface BadRequest {\n '@type': DetailType.BAD_REQUEST;\n fieldViolations: {\n field: string;\n description: string;\n reason: string;\n localizedMessage: Omit<LocalizedMessage, '@type'>;\n }[];\n}\n\nexport interface RequestInfo {\n '@type': DetailType.REQUEST_INFO;\n requestId: string;\n servingData: string;\n}\n\nexport interface ResourceInfo {\n '@type': DetailType.RESOURCE_INFO;\n resourceType: string;\n resourceName: string;\n owner: string;\n description: string;\n}\n\nexport interface Help {\n '@type': DetailType.HELP;\n links: { url: string; description: string }[];\n}\n\nexport interface LocalizedMessage {\n '@type': DetailType.LOCALIZED_MESSAGE;\n locale: string;\n message: string;\n}\n\nexport type Detail =\n | RetryInfo\n | DebugInfo\n | QuotaFailure\n | ErrorInfo\n | PreconditionFailure\n | BadRequest\n | RequestInfo\n | ResourceInfo\n | Help\n | LocalizedMessage;\n\n/**\n * Example usage:\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n * */\nexport class Details {\n readonly list: Detail[] = [];\n private constructor() {}\n\n static new() {\n return new Details();\n }\n\n errorInfo(detail: Omit<ErrorInfo, '@type'>) {\n this.list.push({ '@type': DetailType.ERROR_INFO, ...detail });\n return this;\n }\n\n retryInfo(detail: Omit<RetryInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RETRY_INFO, ...detail });\n return this;\n }\n\n debugInfo(detail: Omit<DebugInfo, '@type'>) {\n this.list.push({ '@type': DetailType.DEBUG_INFO, ...detail });\n return this;\n }\n\n quotaFailure(detail: Omit<QuotaFailure, '@type'>) {\n this.list.push({ '@type': DetailType.QUOTA_FAILURE, ...detail });\n return this;\n }\n\n preconditionFailure(detail: Omit<PreconditionFailure, '@type'>) {\n this.list.push({ '@type': DetailType.PRECONDITION_FAILURE, ...detail });\n return this;\n }\n\n badRequest(detail: Omit<BadRequest, '@type'>) {\n this.list.push({ '@type': DetailType.BAD_REQUEST, ...detail });\n return this;\n }\n\n requestInfo(detail: Omit<RequestInfo, '@type'>) {\n this.list.push({ '@type': DetailType.REQUEST_INFO, ...detail });\n return this;\n }\n\n resourceInfo(detail: Omit<ResourceInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RESOURCE_INFO, ...detail });\n return this;\n }\n\n help(detail: Omit<Help, '@type'>) {\n this.list.push({ '@type': DetailType.HELP, ...detail });\n return this;\n }\n\n localizedMessage(detail: Omit<LocalizedMessage, '@type'>) {\n this.list.push({ '@type': DetailType.LOCALIZED_MESSAGE, ...detail });\n return this;\n }\n}\n"],"mappings":";AAGA,IAAY,aAAL,yBAAA,YAAA;CACL,WAAA,gBAAA;CACA,WAAA,gBAAA;CACA,WAAA,gBAAA;CACA,WAAA,mBAAA;CACA,WAAA,0BAAA;CACA,WAAA,iBAAA;CACA,WAAA,kBAAA;CACA,WAAA,mBAAA;CACA,WAAA,UAAA;CACA,WAAA,uBAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;AA4FA,IAAa,UAAb,MAAa,QAAQ;CACnB,OAA0B,CAAC;CAC3B,cAAsB,CAAC;CAEvB,OAAO,MAAM;EACX,OAAO,IAAI,QAAQ;CACrB;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAmC,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,oBAAoB,QAA4C;EAC9D,KAAK,KAAK,KAAK;GAAE,SAAA;GAA0C,GAAG;EAAO,CAAC;EACtE,OAAO;CACT;CAEA,WAAW,QAAmC;EAC5C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAiC,GAAG;EAAO,CAAC;EAC7D,OAAO;CACT;CAEA,YAAY,QAAoC;EAC9C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAkC,GAAG;EAAO,CAAC;EAC9D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAmC,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,KAAK,QAA6B;EAChC,KAAK,KAAK,KAAK;GAAE,SAAA;GAA0B,GAAG;EAAO,CAAC;EACtD,OAAO;CACT;CAEA,iBAAiB,QAAyC;EACxD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAuC,GAAG;EAAO,CAAC;EACnE,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"detail.mjs","names":[],"sources":["../../src/error/detail.ts"],"sourcesContent":["/** reference: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto */\nimport type { ResolvedErrorReason } from './reason';\n\nexport const DetailType = {\n ERROR_INFO: 'type.googleapis.com/google.rpc.ErrorInfo',\n RETRY_INFO: 'type.googleapis.com/google.rpc.RetryInfo',\n DEBUG_INFO: 'type.googleapis.com/google.rpc.DebugInfo',\n QUOTA_FAILURE: 'type.googleapis.com/google.rpc.QuotaFailure',\n PRECONDITION_FAILURE: 'type.googleapis.com/google.rpc.PreconditionFailure',\n BAD_REQUEST: 'type.googleapis.com/google.rpc.BadRequest',\n REQUEST_INFO: 'type.googleapis.com/google.rpc.RequestInfo',\n RESOURCE_INFO: 'type.googleapis.com/google.rpc.ResourceInfo',\n HELP: 'type.googleapis.com/google.rpc.Help',\n LOCALIZED_MESSAGE: 'type.googleapis.com/google.rpc.LocalizedMessage',\n} as const;\n\nexport type DetailType = (typeof DetailType)[keyof typeof DetailType];\n\nexport interface ErrorInfo {\n '@type': typeof DetailType.ERROR_INFO;\n reason: ResolvedErrorReason;\n domain?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface RetryInfo {\n '@type': typeof DetailType.RETRY_INFO;\n retryDelay: number;\n}\n\nexport interface DebugInfo {\n '@type': typeof DetailType.DEBUG_INFO;\n stackEntries: string[];\n detail: string;\n}\n\nexport interface QuotaFailure {\n '@type': typeof DetailType.QUOTA_FAILURE;\n violations: {\n subject: string;\n description: string;\n apiService: string;\n quoteId: string;\n quoteValue: number;\n quotaMetric: string;\n quotaDimensions: Record<string, string>;\n futureQuotaValue: number;\n }[];\n}\n\nexport interface PreconditionFailure {\n '@type': typeof DetailType.PRECONDITION_FAILURE;\n violations: { type: string; subject: string; description: string }[];\n}\n\nexport interface BadRequest {\n '@type': typeof DetailType.BAD_REQUEST;\n fieldViolations: {\n field: string;\n description: string;\n reason: string;\n localizedMessage: Omit<LocalizedMessage, '@type'>;\n }[];\n}\n\nexport interface RequestInfo {\n '@type': typeof DetailType.REQUEST_INFO;\n requestId: string;\n servingData: string;\n}\n\nexport interface ResourceInfo {\n '@type': typeof DetailType.RESOURCE_INFO;\n resourceType: string;\n resourceName: string;\n owner: string;\n description: string;\n}\n\nexport interface Help {\n '@type': typeof DetailType.HELP;\n links: { url: string; description: string }[];\n}\n\nexport interface LocalizedMessage {\n '@type': typeof DetailType.LOCALIZED_MESSAGE;\n locale: string;\n message: string;\n}\n\nexport type Detail =\n | RetryInfo\n | DebugInfo\n | QuotaFailure\n | ErrorInfo\n | PreconditionFailure\n | BadRequest\n | RequestInfo\n | ResourceInfo\n | Help\n | LocalizedMessage;\n\n/**\n * Example usage:\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n * */\nexport class Details {\n readonly list: Detail[] = [];\n private constructor() {}\n\n static new() {\n return new Details();\n }\n\n errorInfo(detail: Omit<ErrorInfo, '@type'>) {\n this.list.push({ '@type': DetailType.ERROR_INFO, ...detail });\n return this;\n }\n\n retryInfo(detail: Omit<RetryInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RETRY_INFO, ...detail });\n return this;\n }\n\n debugInfo(detail: Omit<DebugInfo, '@type'>) {\n this.list.push({ '@type': DetailType.DEBUG_INFO, ...detail });\n return this;\n }\n\n quotaFailure(detail: Omit<QuotaFailure, '@type'>) {\n this.list.push({ '@type': DetailType.QUOTA_FAILURE, ...detail });\n return this;\n }\n\n preconditionFailure(detail: Omit<PreconditionFailure, '@type'>) {\n this.list.push({ '@type': DetailType.PRECONDITION_FAILURE, ...detail });\n return this;\n }\n\n badRequest(detail: Omit<BadRequest, '@type'>) {\n this.list.push({ '@type': DetailType.BAD_REQUEST, ...detail });\n return this;\n }\n\n requestInfo(detail: Omit<RequestInfo, '@type'>) {\n this.list.push({ '@type': DetailType.REQUEST_INFO, ...detail });\n return this;\n }\n\n resourceInfo(detail: Omit<ResourceInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RESOURCE_INFO, ...detail });\n return this;\n }\n\n help(detail: Omit<Help, '@type'>) {\n this.list.push({ '@type': DetailType.HELP, ...detail });\n return this;\n }\n\n localizedMessage(detail: Omit<LocalizedMessage, '@type'>) {\n this.list.push({ '@type': DetailType.LOCALIZED_MESSAGE, ...detail });\n return this;\n }\n}\n"],"mappings":";AAGA,MAAa,aAAa;CACxB,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,eAAe;CACf,sBAAsB;CACtB,aAAa;CACb,cAAc;CACd,eAAe;CACf,MAAM;CACN,mBAAmB;AACrB;;;;;;;AA8FA,IAAa,UAAb,MAAa,QAAQ;CACnB,OAA0B,CAAC;CAC3B,cAAsB,CAAC;CAEvB,OAAO,MAAM;EACX,OAAO,IAAI,QAAQ;CACrB;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAe,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,oBAAoB,QAA4C;EAC9D,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAsB,GAAG;EAAO,CAAC;EACtE,OAAO;CACT;CAEA,WAAW,QAAmC;EAC5C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAa,GAAG;EAAO,CAAC;EAC7D,OAAO;CACT;CAEA,YAAY,QAAoC;EAC9C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAc,GAAG;EAAO,CAAC;EAC9D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAe,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,KAAK,QAA6B;EAChC,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAM,GAAG;EAAO,CAAC;EACtD,OAAO;CACT;CAEA,iBAAiB,QAAyC;EACxD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAmB,GAAG;EAAO,CAAC;EACnE,OAAO;CACT;AACF"}
@@ -18,15 +18,14 @@ var CheckoutCreateError = class extends Error {
18
18
  this.name = "SessionCreateError";
19
19
  }
20
20
  };
21
- let PurchaseError = /* @__PURE__ */ function(PurchaseError) {
22
- PurchaseError["LOGIN_TIMEOUT"] = "LOGIN_TIMEOUT";
23
- PurchaseError["LOGIN_CANCELED"] = "LOGIN_CANCELED";
24
- PurchaseError["CHECKOUT_CANCELED"] = "CHECKOUT_CANCELED";
25
- PurchaseError["CHECKOUT_CREATE_FAILED"] = "CHECKOUT_CREATE_FAILED";
26
- PurchaseError["CHECKOUT_SESSION_ID_NOT_FOUND"] = "CHECKOUT_SESSION_ID_NOT_FOUND";
27
- PurchaseError["UNKNOWN"] = "UNKNOWN";
28
- return PurchaseError;
29
- }({});
21
+ const PurchaseError = {
22
+ LOGIN_TIMEOUT: "LOGIN_TIMEOUT",
23
+ LOGIN_CANCELED: "LOGIN_CANCELED",
24
+ CHECKOUT_CANCELED: "CHECKOUT_CANCELED",
25
+ CHECKOUT_CREATE_FAILED: "CHECKOUT_CREATE_FAILED",
26
+ CHECKOUT_SESSION_ID_NOT_FOUND: "CHECKOUT_SESSION_ID_NOT_FOUND",
27
+ UNKNOWN: "UNKNOWN"
28
+ };
30
29
  //#endregion
31
30
  exports.CheckoutCreateError = CheckoutCreateError;
32
31
  exports.LoginCanceledError = LoginCanceledError;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/error/index.ts"],"sourcesContent":["export class LoginTimeoutError extends Error {\n constructor(timeout: number) {\n super(`Login timeout after ${timeout}ms`);\n this.name = 'LoginTimeoutError';\n }\n}\n\nexport class LoginCanceledError extends Error {\n constructor() {\n super('Login canceled by user');\n this.name = 'LoginCanceledError';\n }\n}\n\nexport class CheckoutCreateError extends Error {\n constructor() {\n super('Failed to create checkout session');\n this.name = 'SessionCreateError';\n }\n}\n\nexport enum PurchaseError {\n LOGIN_TIMEOUT = 'LOGIN_TIMEOUT',\n LOGIN_CANCELED = 'LOGIN_CANCELED',\n CHECKOUT_CANCELED = 'CHECKOUT_CANCELED',\n CHECKOUT_CREATE_FAILED = 'CHECKOUT_CREATE_FAILED',\n CHECKOUT_SESSION_ID_NOT_FOUND = 'CHECKOUT_SESSION_ID_NOT_FOUND',\n UNKNOWN = 'UNKNOWN',\n}\n"],"mappings":";;AAAA,IAAa,oBAAb,cAAuC,MAAM;CAC3C,YAAY,SAAiB;EAC3B,MAAM,uBAAuB,QAAQ,GAAG;EACxC,KAAK,OAAO;CACd;AACF;AAEA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,cAAc;EACZ,MAAM,wBAAwB;EAC9B,KAAK,OAAO;CACd;AACF;AAEA,IAAa,sBAAb,cAAyC,MAAM;CAC7C,cAAc;EACZ,MAAM,mCAAmC;EACzC,KAAK,OAAO;CACd;AACF;AAEA,IAAY,gBAAL,yBAAA,eAAA;CACL,cAAA,mBAAA;CACA,cAAA,oBAAA;CACA,cAAA,uBAAA;CACA,cAAA,4BAAA;CACA,cAAA,mCAAA;CACA,cAAA,aAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/error/index.ts"],"sourcesContent":["export class LoginTimeoutError extends Error {\n constructor(timeout: number) {\n super(`Login timeout after ${timeout}ms`);\n this.name = 'LoginTimeoutError';\n }\n}\n\nexport class LoginCanceledError extends Error {\n constructor() {\n super('Login canceled by user');\n this.name = 'LoginCanceledError';\n }\n}\n\nexport class CheckoutCreateError extends Error {\n constructor() {\n super('Failed to create checkout session');\n this.name = 'SessionCreateError';\n }\n}\n\nexport const PurchaseError = {\n LOGIN_TIMEOUT: 'LOGIN_TIMEOUT',\n LOGIN_CANCELED: 'LOGIN_CANCELED',\n CHECKOUT_CANCELED: 'CHECKOUT_CANCELED',\n CHECKOUT_CREATE_FAILED: 'CHECKOUT_CREATE_FAILED',\n CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND',\n UNKNOWN: 'UNKNOWN',\n} as const;\n\nexport type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];\n"],"mappings":";;AAAA,IAAa,oBAAb,cAAuC,MAAM;CAC3C,YAAY,SAAiB;EAC3B,MAAM,uBAAuB,QAAQ,GAAG;EACxC,KAAK,OAAO;CACd;AACF;AAEA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,cAAc;EACZ,MAAM,wBAAwB;EAC9B,KAAK,OAAO;CACd;AACF;AAEA,IAAa,sBAAb,cAAyC,MAAM;CAC7C,cAAc;EACZ,MAAM,mCAAmC;EACzC,KAAK,OAAO;CACd;AACF;AAEA,MAAa,gBAAgB;CAC3B,eAAe;CACf,gBAAgB;CAChB,mBAAmB;CACnB,wBAAwB;CACxB,+BAA+B;CAC/B,SAAS;AACX"}
@@ -8,14 +8,15 @@ declare class LoginCanceledError extends Error {
8
8
  declare class CheckoutCreateError extends Error {
9
9
  constructor();
10
10
  }
11
- declare enum PurchaseError {
12
- LOGIN_TIMEOUT = "LOGIN_TIMEOUT",
13
- LOGIN_CANCELED = "LOGIN_CANCELED",
14
- CHECKOUT_CANCELED = "CHECKOUT_CANCELED",
15
- CHECKOUT_CREATE_FAILED = "CHECKOUT_CREATE_FAILED",
16
- CHECKOUT_SESSION_ID_NOT_FOUND = "CHECKOUT_SESSION_ID_NOT_FOUND",
17
- UNKNOWN = "UNKNOWN"
18
- }
11
+ declare const PurchaseError: {
12
+ readonly LOGIN_TIMEOUT: 'LOGIN_TIMEOUT';
13
+ readonly LOGIN_CANCELED: 'LOGIN_CANCELED';
14
+ readonly CHECKOUT_CANCELED: 'CHECKOUT_CANCELED';
15
+ readonly CHECKOUT_CREATE_FAILED: 'CHECKOUT_CREATE_FAILED';
16
+ readonly CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND';
17
+ readonly UNKNOWN: 'UNKNOWN';
18
+ };
19
+ type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];
19
20
  //#endregion
20
21
  export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError };
21
22
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/error/index.ts"],"mappings":";cAAa,0BAA0B;EACrC,YAAY;;cAMD,2BAA2B;EACtC;;cAMW,4BAA4B;EACvC;;aAMU;EACV;EACA;EACA;EACA;EACA;EACA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/error/index.ts"],"mappings":";cAAa,0BAA0B;EACrC,YAAY;;cAMD,2BAA2B;EACtC;;cAMW,4BAA4B;EACvC;;cAMW;WACX;WACA;WACA;WACA;WACA;WACA;;KAGU,wBAAwB,4BAA4B"}
@@ -8,14 +8,15 @@ declare class LoginCanceledError extends Error {
8
8
  declare class CheckoutCreateError extends Error {
9
9
  constructor();
10
10
  }
11
- declare enum PurchaseError {
12
- LOGIN_TIMEOUT = "LOGIN_TIMEOUT",
13
- LOGIN_CANCELED = "LOGIN_CANCELED",
14
- CHECKOUT_CANCELED = "CHECKOUT_CANCELED",
15
- CHECKOUT_CREATE_FAILED = "CHECKOUT_CREATE_FAILED",
16
- CHECKOUT_SESSION_ID_NOT_FOUND = "CHECKOUT_SESSION_ID_NOT_FOUND",
17
- UNKNOWN = "UNKNOWN"
18
- }
11
+ declare const PurchaseError: {
12
+ readonly LOGIN_TIMEOUT: 'LOGIN_TIMEOUT';
13
+ readonly LOGIN_CANCELED: 'LOGIN_CANCELED';
14
+ readonly CHECKOUT_CANCELED: 'CHECKOUT_CANCELED';
15
+ readonly CHECKOUT_CREATE_FAILED: 'CHECKOUT_CREATE_FAILED';
16
+ readonly CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND';
17
+ readonly UNKNOWN: 'UNKNOWN';
18
+ };
19
+ type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];
19
20
  //#endregion
20
21
  export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError };
21
22
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/error/index.ts"],"mappings":";cAAa,0BAA0B;EACrC,YAAY;;cAMD,2BAA2B;EACtC;;cAMW,4BAA4B;EACvC;;aAMU;EACV;EACA;EACA;EACA;EACA;EACA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/error/index.ts"],"mappings":";cAAa,0BAA0B;EACrC,YAAY;;cAMD,2BAA2B;EACtC;;cAMW,4BAA4B;EACvC;;cAMW;WACX;WACA;WACA;WACA;WACA;WACA;;KAGU,wBAAwB,4BAA4B"}
@@ -17,15 +17,14 @@ var CheckoutCreateError = class extends Error {
17
17
  this.name = "SessionCreateError";
18
18
  }
19
19
  };
20
- let PurchaseError = /* @__PURE__ */ function(PurchaseError) {
21
- PurchaseError["LOGIN_TIMEOUT"] = "LOGIN_TIMEOUT";
22
- PurchaseError["LOGIN_CANCELED"] = "LOGIN_CANCELED";
23
- PurchaseError["CHECKOUT_CANCELED"] = "CHECKOUT_CANCELED";
24
- PurchaseError["CHECKOUT_CREATE_FAILED"] = "CHECKOUT_CREATE_FAILED";
25
- PurchaseError["CHECKOUT_SESSION_ID_NOT_FOUND"] = "CHECKOUT_SESSION_ID_NOT_FOUND";
26
- PurchaseError["UNKNOWN"] = "UNKNOWN";
27
- return PurchaseError;
28
- }({});
20
+ const PurchaseError = {
21
+ LOGIN_TIMEOUT: "LOGIN_TIMEOUT",
22
+ LOGIN_CANCELED: "LOGIN_CANCELED",
23
+ CHECKOUT_CANCELED: "CHECKOUT_CANCELED",
24
+ CHECKOUT_CREATE_FAILED: "CHECKOUT_CREATE_FAILED",
25
+ CHECKOUT_SESSION_ID_NOT_FOUND: "CHECKOUT_SESSION_ID_NOT_FOUND",
26
+ UNKNOWN: "UNKNOWN"
27
+ };
29
28
  //#endregion
30
29
  export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError };
31
30