@algorandfoundation/algokit-client-generator 2.6.0 → 2.6.1-beta.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 (128) hide show
  1. package/bin/cli.mjs +4 -0
  2. package/cli.cjs +75 -0
  3. package/cli.d.ts +0 -1
  4. package/cli.mjs +54 -0
  5. package/client/app-types.cjs +152 -0
  6. package/client/app-types.d.ts +0 -1
  7. package/client/app-types.mjs +131 -0
  8. package/client/call-client.cjs +332 -0
  9. package/client/call-client.d.ts +0 -1
  10. package/client/{call-client.js → call-client.mjs} +107 -135
  11. package/client/call-composer-types.cjs +141 -0
  12. package/client/call-composer-types.d.ts +0 -1
  13. package/client/{call-composer-types.js → call-composer-types.mjs} +33 -58
  14. package/client/call-composer.cjs +145 -0
  15. package/client/call-composer.d.ts +0 -1
  16. package/client/call-composer.mjs +124 -0
  17. package/client/call-factory.cjs +138 -0
  18. package/client/call-factory.d.ts +0 -1
  19. package/client/{call-factory.js → call-factory.mjs} +31 -56
  20. package/client/deploy-types.cjs +94 -0
  21. package/client/deploy-types.d.ts +0 -1
  22. package/client/deploy-types.mjs +91 -0
  23. package/client/generate.cjs +37 -0
  24. package/client/generate.d.ts +0 -1
  25. package/client/generate.mjs +35 -0
  26. package/client/generator-context.cjs +37 -0
  27. package/client/generator-context.d.ts +0 -1
  28. package/client/generator-context.mjs +16 -0
  29. package/client/helpers/{get-call-config-summary.js → get-call-config-summary.cjs} +7 -25
  30. package/client/helpers/get-call-config-summary.d.ts +1 -2
  31. package/client/helpers/get-call-config-summary.mjs +54 -0
  32. package/client/helpers/{get-equivalent-type.js → get-equivalent-type.cjs} +20 -20
  33. package/client/helpers/get-equivalent-type.d.ts +0 -1
  34. package/client/helpers/get-equivalent-type.mjs +56 -0
  35. package/client/{imports.js → imports.cjs} +3 -4
  36. package/client/imports.d.ts +0 -1
  37. package/client/imports.mjs +27 -0
  38. package/client/{utility-types.js → utility-types.cjs} +26 -25
  39. package/client/utility-types.d.ts +0 -1
  40. package/client/utility-types.mjs +47 -0
  41. package/dev.d.ts +0 -1
  42. package/index.cjs +13 -0
  43. package/index.d.ts +0 -1
  44. package/index.mjs +3 -0
  45. package/output/{writer.js → writer.cjs} +44 -38
  46. package/output/writer.d.ts +0 -1
  47. package/output/writer.mjs +139 -0
  48. package/package.json +7 -4
  49. package/schema/application.schema.json.cjs +374 -0
  50. package/schema/application.schema.json.mjs +363 -0
  51. package/schema/contract.schema.json.cjs +159 -0
  52. package/schema/contract.schema.json.mjs +148 -0
  53. package/schema/load.cjs +25 -0
  54. package/schema/load.d.ts +0 -1
  55. package/schema/load.mjs +22 -0
  56. package/tests/approval-tests.spec.d.ts +0 -1
  57. package/tests/util.d.ts +1 -0
  58. package/util/boom.cjs +7 -0
  59. package/util/boom.d.ts +0 -1
  60. package/util/boom.mjs +5 -0
  61. package/util/color-console.cjs +18 -0
  62. package/util/color-console.d.ts +0 -1
  63. package/util/color-console.mjs +16 -0
  64. package/util/not-falsy.d.ts +0 -1
  65. package/util/sanitization.cjs +17 -0
  66. package/util/sanitization.d.ts +0 -1
  67. package/util/sanitization.mjs +11 -0
  68. package/bin/cli.js +0 -4
  69. package/cli.d.ts.map +0 -1
  70. package/cli.js +0 -79
  71. package/cli.js.map +0 -1
  72. package/client/app-types.d.ts.map +0 -1
  73. package/client/app-types.js +0 -161
  74. package/client/app-types.js.map +0 -1
  75. package/client/call-client.d.ts.map +0 -1
  76. package/client/call-client.js.map +0 -1
  77. package/client/call-composer-types.d.ts.map +0 -1
  78. package/client/call-composer-types.js.map +0 -1
  79. package/client/call-composer.d.ts.map +0 -1
  80. package/client/call-composer.js +0 -151
  81. package/client/call-composer.js.map +0 -1
  82. package/client/call-factory.d.ts.map +0 -1
  83. package/client/call-factory.js.map +0 -1
  84. package/client/deploy-types.d.ts.map +0 -1
  85. package/client/deploy-types.js +0 -95
  86. package/client/deploy-types.js.map +0 -1
  87. package/client/generate.d.ts.map +0 -1
  88. package/client/generate.js +0 -37
  89. package/client/generate.js.map +0 -1
  90. package/client/generator-context.d.ts.map +0 -1
  91. package/client/generator-context.js +0 -41
  92. package/client/generator-context.js.map +0 -1
  93. package/client/helpers/get-call-config-summary.d.ts.map +0 -1
  94. package/client/helpers/get-call-config-summary.js.map +0 -1
  95. package/client/helpers/get-equivalent-type.d.ts.map +0 -1
  96. package/client/helpers/get-equivalent-type.js.map +0 -1
  97. package/client/imports.d.ts.map +0 -1
  98. package/client/imports.js.map +0 -1
  99. package/client/utility-types.d.ts.map +0 -1
  100. package/client/utility-types.js.map +0 -1
  101. package/dev.d.ts.map +0 -1
  102. package/dev.js +0 -5
  103. package/dev.js.map +0 -1
  104. package/index.d.ts.map +0 -1
  105. package/index.js +0 -12
  106. package/index.js.map +0 -1
  107. package/output/writer.d.ts.map +0 -1
  108. package/output/writer.js.map +0 -1
  109. package/schema/application.schema.json +0 -354
  110. package/schema/contract.schema.json +0 -139
  111. package/schema/load.d.ts.map +0 -1
  112. package/schema/load.js +0 -51
  113. package/schema/load.js.map +0 -1
  114. package/tests/approval-tests.spec.d.ts.map +0 -1
  115. package/tests/approval-tests.spec.js +0 -24
  116. package/tests/approval-tests.spec.js.map +0 -1
  117. package/util/boom.d.ts.map +0 -1
  118. package/util/boom.js +0 -8
  119. package/util/boom.js.map +0 -1
  120. package/util/color-console.d.ts.map +0 -1
  121. package/util/color-console.js +0 -20
  122. package/util/color-console.js.map +0 -1
  123. package/util/not-falsy.d.ts.map +0 -1
  124. package/util/not-falsy.js +0 -6
  125. package/util/not-falsy.js.map +0 -1
  126. package/util/sanitization.d.ts.map +0 -1
  127. package/util/sanitization.js +0 -17
  128. package/util/sanitization.js.map +0 -1
@@ -1,58 +1,58 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEquivalentType = void 0;
4
- const algosdk_1 = require("algosdk");
1
+ 'use strict';
2
+
3
+ var algosdk = require('algosdk');
4
+
5
5
  function getEquivalentType(abiTypeStr, ioType) {
6
6
  if (abiTypeStr == 'void') {
7
7
  return 'void';
8
8
  }
9
- if ((0, algosdk_1.abiTypeIsTransaction)(abiTypeStr)) {
9
+ if (algosdk.abiTypeIsTransaction(abiTypeStr)) {
10
10
  return 'TransactionToSign | Transaction | Promise<SendTransactionResult>';
11
11
  }
12
- if (abiTypeStr == algosdk_1.ABIReferenceType.account) {
12
+ if (abiTypeStr == algosdk.ABIReferenceType.account) {
13
13
  return 'string | Uint8Array';
14
14
  }
15
- if (abiTypeStr == algosdk_1.ABIReferenceType.application || abiTypeStr == algosdk_1.ABIReferenceType.asset) {
15
+ if (abiTypeStr == algosdk.ABIReferenceType.application || abiTypeStr == algosdk.ABIReferenceType.asset) {
16
16
  return 'number | bigint';
17
17
  }
18
- const abiType = algosdk_1.ABIType.from(abiTypeStr);
18
+ const abiType = algosdk.ABIType.from(abiTypeStr);
19
19
  return abiTypeToTs(abiType, ioType);
20
20
  function abiTypeToTs(abiType, ioType) {
21
- if (abiType instanceof algosdk_1.ABIUintType) {
21
+ if (abiType instanceof algosdk.ABIUintType) {
22
22
  if (abiType.bitSize <= 51)
23
23
  return 'number';
24
24
  return ioType === 'input' ? 'bigint | number' : 'bigint';
25
25
  }
26
- if (abiType instanceof algosdk_1.ABIArrayDynamicType) {
27
- if (abiType.childType instanceof algosdk_1.ABIByteType)
26
+ if (abiType instanceof algosdk.ABIArrayDynamicType) {
27
+ if (abiType.childType instanceof algosdk.ABIByteType)
28
28
  return 'Uint8Array';
29
29
  return `${abiTypeToTs(abiType.childType, ioType)}[]`;
30
30
  }
31
- if (abiType instanceof algosdk_1.ABIArrayStaticType) {
32
- if (abiType.childType instanceof algosdk_1.ABIByteType)
31
+ if (abiType instanceof algosdk.ABIArrayStaticType) {
32
+ if (abiType.childType instanceof algosdk.ABIByteType)
33
33
  return 'Uint8Array';
34
34
  return `[${new Array(abiType.staticLength).fill(abiTypeToTs(abiType.childType, ioType)).join(', ')}]`;
35
35
  }
36
- if (abiType instanceof algosdk_1.ABIAddressType) {
36
+ if (abiType instanceof algosdk.ABIAddressType) {
37
37
  return 'string';
38
38
  }
39
- if (abiType instanceof algosdk_1.ABIBoolType) {
39
+ if (abiType instanceof algosdk.ABIBoolType) {
40
40
  return 'boolean';
41
41
  }
42
- if (abiType instanceof algosdk_1.ABIUfixedType) {
42
+ if (abiType instanceof algosdk.ABIUfixedType) {
43
43
  return 'number';
44
44
  }
45
- if (abiType instanceof algosdk_1.ABITupleType) {
45
+ if (abiType instanceof algosdk.ABITupleType) {
46
46
  return `[${abiType.childTypes.map((c) => abiTypeToTs(c, ioType)).join(', ')}]`;
47
47
  }
48
- if (abiType instanceof algosdk_1.ABIByteType) {
48
+ if (abiType instanceof algosdk.ABIByteType) {
49
49
  return 'number';
50
50
  }
51
- if (abiType instanceof algosdk_1.ABIStringType) {
51
+ if (abiType instanceof algosdk.ABIStringType) {
52
52
  return 'string';
53
53
  }
54
54
  return 'unknown';
55
55
  }
56
56
  }
57
+
57
58
  exports.getEquivalentType = getEquivalentType;
58
- //# sourceMappingURL=get-equivalent-type.js.map
@@ -1,2 +1 @@
1
1
  export declare function getEquivalentType(abiTypeStr: string, ioType: 'input' | 'output'): string;
2
- //# sourceMappingURL=get-equivalent-type.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { abiTypeIsTransaction, ABIReferenceType, ABIType, ABIUintType, ABIArrayDynamicType, ABIByteType, ABIArrayStaticType, ABIAddressType, ABIBoolType, ABIUfixedType, ABITupleType, ABIStringType } from 'algosdk';
2
+
3
+ function getEquivalentType(abiTypeStr, ioType) {
4
+ if (abiTypeStr == 'void') {
5
+ return 'void';
6
+ }
7
+ if (abiTypeIsTransaction(abiTypeStr)) {
8
+ return 'TransactionToSign | Transaction | Promise<SendTransactionResult>';
9
+ }
10
+ if (abiTypeStr == ABIReferenceType.account) {
11
+ return 'string | Uint8Array';
12
+ }
13
+ if (abiTypeStr == ABIReferenceType.application || abiTypeStr == ABIReferenceType.asset) {
14
+ return 'number | bigint';
15
+ }
16
+ const abiType = ABIType.from(abiTypeStr);
17
+ return abiTypeToTs(abiType, ioType);
18
+ function abiTypeToTs(abiType, ioType) {
19
+ if (abiType instanceof ABIUintType) {
20
+ if (abiType.bitSize <= 51)
21
+ return 'number';
22
+ return ioType === 'input' ? 'bigint | number' : 'bigint';
23
+ }
24
+ if (abiType instanceof ABIArrayDynamicType) {
25
+ if (abiType.childType instanceof ABIByteType)
26
+ return 'Uint8Array';
27
+ return `${abiTypeToTs(abiType.childType, ioType)}[]`;
28
+ }
29
+ if (abiType instanceof ABIArrayStaticType) {
30
+ if (abiType.childType instanceof ABIByteType)
31
+ return 'Uint8Array';
32
+ return `[${new Array(abiType.staticLength).fill(abiTypeToTs(abiType.childType, ioType)).join(', ')}]`;
33
+ }
34
+ if (abiType instanceof ABIAddressType) {
35
+ return 'string';
36
+ }
37
+ if (abiType instanceof ABIBoolType) {
38
+ return 'boolean';
39
+ }
40
+ if (abiType instanceof ABIUfixedType) {
41
+ return 'number';
42
+ }
43
+ if (abiType instanceof ABITupleType) {
44
+ return `[${abiType.childTypes.map((c) => abiTypeToTs(c, ioType)).join(', ')}]`;
45
+ }
46
+ if (abiType instanceof ABIByteType) {
47
+ return 'number';
48
+ }
49
+ if (abiType instanceof ABIStringType) {
50
+ return 'string';
51
+ }
52
+ return 'unknown';
53
+ }
54
+ }
55
+
56
+ export { getEquivalentType };
@@ -1,6 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.imports = void 0;
1
+ 'use strict';
2
+
4
3
  function* imports() {
5
4
  yield `import * as algokit from '@algorandfoundation/algokit-utils'
6
5
  import type {
@@ -26,5 +25,5 @@ import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, Sen
26
25
  import type { ABIResult, TransactionWithSigner } from 'algosdk'
27
26
  import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk'`;
28
27
  }
28
+
29
29
  exports.imports = imports;
30
- //# sourceMappingURL=imports.js.map
@@ -1,3 +1,2 @@
1
1
  import { DocumentParts } from '../output/writer';
2
2
  export declare function imports(): DocumentParts;
3
- //# sourceMappingURL=imports.d.ts.map
@@ -0,0 +1,27 @@
1
+ function* imports() {
2
+ yield `import * as algokit from '@algorandfoundation/algokit-utils'
3
+ import type {
4
+ ABIAppCallArg,
5
+ AppCallTransactionResult,
6
+ AppCallTransactionResultOfType,
7
+ AppCompilationResult,
8
+ AppReference,
9
+ AppState,
10
+ CoreAppCallArgs,
11
+ RawAppCallArgs,
12
+ TealTemplateParams,
13
+ } from '@algorandfoundation/algokit-utils/types/app'
14
+ import type {
15
+ AppClientCallCoreParams,
16
+ AppClientCompilationParams,
17
+ AppClientDeployCoreParams,
18
+ AppDetails,
19
+ ApplicationClient,
20
+ } from '@algorandfoundation/algokit-utils/types/app-client'
21
+ import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec'
22
+ import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction'
23
+ import type { ABIResult, TransactionWithSigner } from 'algosdk'
24
+ import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk'`;
25
+ }
26
+
27
+ export { imports };
@@ -1,49 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OnCompleteCodeMap = exports.utilityTypes = void 0;
4
- const writer_1 = require("../output/writer");
1
+ 'use strict';
2
+
3
+ var writer = require('../output/writer.cjs');
4
+
5
5
  function* utilityTypes() {
6
- yield* (0, writer_1.jsDoc)(`Defines an onCompletionAction of 'no_op'`);
6
+ yield* writer.jsDoc(`Defines an onCompletionAction of 'no_op'`);
7
7
  yield `export type OnCompleteNoOp = { onCompleteAction?: 'no_op' | OnApplicationComplete.NoOpOC }`;
8
- yield* (0, writer_1.jsDoc)(`Defines an onCompletionAction of 'opt_in'`);
8
+ yield* writer.jsDoc(`Defines an onCompletionAction of 'opt_in'`);
9
9
  yield `export type OnCompleteOptIn = { onCompleteAction: 'opt_in' | OnApplicationComplete.OptInOC }`;
10
- yield* (0, writer_1.jsDoc)(`Defines an onCompletionAction of 'close_out'`);
10
+ yield* writer.jsDoc(`Defines an onCompletionAction of 'close_out'`);
11
11
  yield `export type OnCompleteCloseOut = { onCompleteAction: 'close_out' | OnApplicationComplete.CloseOutOC }`;
12
- yield* (0, writer_1.jsDoc)(`Defines an onCompletionAction of 'delete_application'`);
12
+ yield* writer.jsDoc(`Defines an onCompletionAction of 'delete_application'`);
13
13
  yield `export type OnCompleteDelApp = { onCompleteAction: 'delete_application' | OnApplicationComplete.DeleteApplicationOC }`;
14
- yield* (0, writer_1.jsDoc)(`Defines an onCompletionAction of 'update_application'`);
14
+ yield* writer.jsDoc(`Defines an onCompletionAction of 'update_application'`);
15
15
  yield `export type OnCompleteUpdApp = { onCompleteAction: 'update_application' | OnApplicationComplete.UpdateApplicationOC }`;
16
- yield* (0, writer_1.jsDoc)('A state record containing a single unsigned integer');
16
+ yield* writer.jsDoc('A state record containing a single unsigned integer');
17
17
  yield `export type IntegerState = {`;
18
- yield writer_1.IncIndent;
19
- yield* (0, writer_1.jsDoc)('Gets the state value as a BigInt.');
18
+ yield writer.IncIndent;
19
+ yield* writer.jsDoc('Gets the state value as a BigInt.');
20
20
  yield `asBigInt(): bigint`;
21
- yield* (0, writer_1.jsDoc)('Gets the state value as a number.');
21
+ yield* writer.jsDoc('Gets the state value as a number.');
22
22
  yield `asNumber(): number`;
23
- yield writer_1.DecIndentAndCloseBlock;
24
- yield* (0, writer_1.jsDoc)('A state record containing binary data');
23
+ yield writer.DecIndentAndCloseBlock;
24
+ yield* writer.jsDoc('A state record containing binary data');
25
25
  yield `export type BinaryState = {`;
26
- yield writer_1.IncIndent;
27
- yield* (0, writer_1.jsDoc)('Gets the state value as a Uint8Array');
26
+ yield writer.IncIndent;
27
+ yield* writer.jsDoc('Gets the state value as a Uint8Array');
28
28
  yield `asByteArray(): Uint8Array`;
29
- yield* (0, writer_1.jsDoc)('Gets the state value as a string');
29
+ yield* writer.jsDoc('Gets the state value as a string');
30
30
  yield `asString(): string`;
31
- yield writer_1.DecIndentAndCloseBlock;
32
- yield writer_1.NewLine;
31
+ yield writer.DecIndentAndCloseBlock;
32
+ yield writer.NewLine;
33
33
  yield `export type AppCreateCallTransactionResult = AppCallTransactionResult & Partial<AppCompilationResult> & AppReference`;
34
34
  yield `export type AppUpdateCallTransactionResult = AppCallTransactionResult & Partial<AppCompilationResult>`;
35
- yield writer_1.NewLine;
35
+ yield writer.NewLine;
36
36
  yield `export type AppClientComposeCallCoreParams = Omit<AppClientCallCoreParams, 'sendParams'> & {`;
37
- yield* (0, writer_1.indent)(`sendParams?: Omit<SendTransactionParams, 'skipSending' | 'atc' | 'skipWaiting' | 'maxRoundsToWaitForConfirmation' | 'populateAppCallResources'>`);
37
+ yield* writer.indent(`sendParams?: Omit<SendTransactionParams, 'skipSending' | 'atc' | 'skipWaiting' | 'maxRoundsToWaitForConfirmation' | 'populateAppCallResources'>`);
38
38
  yield `}`;
39
39
  yield `export type AppClientComposeExecuteParams = Pick<SendTransactionParams, 'skipWaiting' | 'maxRoundsToWaitForConfirmation' | 'populateAppCallResources' | 'suppressLog'>`;
40
40
  }
41
- exports.utilityTypes = utilityTypes;
42
- exports.OnCompleteCodeMap = {
41
+ const OnCompleteCodeMap = {
43
42
  no_op: 'OnCompleteNoOp',
44
43
  opt_in: 'OnCompleteOptIn',
45
44
  close_out: 'OnCompleteCloseOut',
46
45
  delete_application: 'OnCompleteDelApp',
47
46
  update_application: 'OnCompleteUpdApp',
48
47
  };
49
- //# sourceMappingURL=utility-types.js.map
48
+
49
+ exports.OnCompleteCodeMap = OnCompleteCodeMap;
50
+ exports.utilityTypes = utilityTypes;
@@ -7,4 +7,3 @@ export declare const OnCompleteCodeMap: {
7
7
  delete_application: string;
8
8
  update_application: string;
9
9
  };
10
- //# sourceMappingURL=utility-types.d.ts.map
@@ -0,0 +1,47 @@
1
+ import { jsDoc, IncIndent, DecIndentAndCloseBlock, NewLine, indent } from '../output/writer.mjs';
2
+
3
+ function* utilityTypes() {
4
+ yield* jsDoc(`Defines an onCompletionAction of 'no_op'`);
5
+ yield `export type OnCompleteNoOp = { onCompleteAction?: 'no_op' | OnApplicationComplete.NoOpOC }`;
6
+ yield* jsDoc(`Defines an onCompletionAction of 'opt_in'`);
7
+ yield `export type OnCompleteOptIn = { onCompleteAction: 'opt_in' | OnApplicationComplete.OptInOC }`;
8
+ yield* jsDoc(`Defines an onCompletionAction of 'close_out'`);
9
+ yield `export type OnCompleteCloseOut = { onCompleteAction: 'close_out' | OnApplicationComplete.CloseOutOC }`;
10
+ yield* jsDoc(`Defines an onCompletionAction of 'delete_application'`);
11
+ yield `export type OnCompleteDelApp = { onCompleteAction: 'delete_application' | OnApplicationComplete.DeleteApplicationOC }`;
12
+ yield* jsDoc(`Defines an onCompletionAction of 'update_application'`);
13
+ yield `export type OnCompleteUpdApp = { onCompleteAction: 'update_application' | OnApplicationComplete.UpdateApplicationOC }`;
14
+ yield* jsDoc('A state record containing a single unsigned integer');
15
+ yield `export type IntegerState = {`;
16
+ yield IncIndent;
17
+ yield* jsDoc('Gets the state value as a BigInt.');
18
+ yield `asBigInt(): bigint`;
19
+ yield* jsDoc('Gets the state value as a number.');
20
+ yield `asNumber(): number`;
21
+ yield DecIndentAndCloseBlock;
22
+ yield* jsDoc('A state record containing binary data');
23
+ yield `export type BinaryState = {`;
24
+ yield IncIndent;
25
+ yield* jsDoc('Gets the state value as a Uint8Array');
26
+ yield `asByteArray(): Uint8Array`;
27
+ yield* jsDoc('Gets the state value as a string');
28
+ yield `asString(): string`;
29
+ yield DecIndentAndCloseBlock;
30
+ yield NewLine;
31
+ yield `export type AppCreateCallTransactionResult = AppCallTransactionResult & Partial<AppCompilationResult> & AppReference`;
32
+ yield `export type AppUpdateCallTransactionResult = AppCallTransactionResult & Partial<AppCompilationResult>`;
33
+ yield NewLine;
34
+ yield `export type AppClientComposeCallCoreParams = Omit<AppClientCallCoreParams, 'sendParams'> & {`;
35
+ yield* indent(`sendParams?: Omit<SendTransactionParams, 'skipSending' | 'atc' | 'skipWaiting' | 'maxRoundsToWaitForConfirmation' | 'populateAppCallResources'>`);
36
+ yield `}`;
37
+ yield `export type AppClientComposeExecuteParams = Pick<SendTransactionParams, 'skipWaiting' | 'maxRoundsToWaitForConfirmation' | 'populateAppCallResources' | 'suppressLog'>`;
38
+ }
39
+ const OnCompleteCodeMap = {
40
+ no_op: 'OnCompleteNoOp',
41
+ opt_in: 'OnCompleteOptIn',
42
+ close_out: 'OnCompleteCloseOut',
43
+ delete_application: 'OnCompleteDelApp',
44
+ update_application: 'OnCompleteUpdApp',
45
+ };
46
+
47
+ export { OnCompleteCodeMap, utilityTypes };
package/dev.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=dev.d.ts.map
package/index.cjs ADDED
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var load = require('./schema/load.cjs');
4
+ var generate = require('./client/generate.cjs');
5
+ var writer = require('./output/writer.cjs');
6
+
7
+
8
+
9
+ exports.loadApplicationJson = load.loadApplicationJson;
10
+ exports.validateApplicationJson = load.validateApplicationJson;
11
+ exports.generate = generate.generate;
12
+ exports.writeDocumentPartsToStream = writer.writeDocumentPartsToStream;
13
+ exports.writeDocumentPartsToString = writer.writeDocumentPartsToString;
package/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export { loadApplicationJson, validateApplicationJson } from './schema/load';
2
2
  export { generate } from './client/generate';
3
3
  export { writeDocumentPartsToStream, writeDocumentPartsToString } from './output/writer';
4
- //# sourceMappingURL=index.d.ts.map
package/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ export { loadApplicationJson, validateApplicationJson } from './schema/load.mjs';
2
+ export { generate } from './client/generate.mjs';
3
+ export { writeDocumentPartsToStream, writeDocumentPartsToString } from './output/writer.mjs';
@@ -1,14 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsDoc = exports.indent = exports.inline = exports.writeDocumentPartsToString = exports.writeDocumentPartsToStream = exports.NewLine = exports.InlineMode = exports.PropertyDelimiter = exports.RestoreLineMode = exports.NewLineMode = exports.DecIndentAndCloseBlock = exports.DecIndent = exports.IncIndent = void 0;
4
- exports.IncIndent = Symbol('Increase Indent');
5
- exports.DecIndent = Symbol('Decrease Indent');
6
- exports.DecIndentAndCloseBlock = Symbol('Decrease Indent and write a closing brace');
7
- exports.NewLineMode = Symbol('New Line Mode');
8
- exports.RestoreLineMode = Symbol('Restore Line Mode');
9
- exports.PropertyDelimiter = Symbol('Property Delimiter');
10
- exports.InlineMode = Symbol('Inline Mode');
11
- exports.NewLine = Symbol('New Line');
1
+ 'use strict';
2
+
3
+ const IncIndent = Symbol('Increase Indent');
4
+ const DecIndent = Symbol('Decrease Indent');
5
+ const DecIndentAndCloseBlock = Symbol('Decrease Indent and write a closing brace');
6
+ const NewLineMode = Symbol('New Line Mode');
7
+ const RestoreLineMode = Symbol('Restore Line Mode');
8
+ const PropertyDelimiter = Symbol('Property Delimiter');
9
+ const InlineMode = Symbol('Inline Mode');
10
+ const NewLine = Symbol('New Line');
12
11
  function writeDocumentPartsToStream(document, stream, options = {}) {
13
12
  const writer = {
14
13
  _last: '',
@@ -22,7 +21,6 @@ function writeDocumentPartsToStream(document, stream, options = {}) {
22
21
  };
23
22
  writeDocumentPartsTo(document, options, writer);
24
23
  }
25
- exports.writeDocumentPartsToStream = writeDocumentPartsToStream;
26
24
  function writeDocumentPartsToString(document, options = {}) {
27
25
  const writer = {
28
26
  result: [],
@@ -41,31 +39,27 @@ function writeDocumentPartsToString(document, options = {}) {
41
39
  writeDocumentPartsTo(document, options, writer);
42
40
  return writer.toString();
43
41
  }
44
- exports.writeDocumentPartsToString = writeDocumentPartsToString;
45
42
  function* inline(...parts) {
46
- yield exports.InlineMode;
43
+ yield InlineMode;
47
44
  for (const part of parts) {
48
45
  if (typeof part === 'string' || typeof part === 'symbol')
49
46
  yield part;
50
47
  else
51
48
  yield* part;
52
49
  }
53
- yield exports.RestoreLineMode;
50
+ yield RestoreLineMode;
54
51
  }
55
- exports.inline = inline;
56
52
  function* indent(...parts) {
57
- yield exports.IncIndent;
53
+ yield IncIndent;
58
54
  for (const part of parts) {
59
55
  if (typeof part === 'string' || typeof part === 'symbol')
60
56
  yield part;
61
57
  else
62
58
  yield* part;
63
59
  }
64
- yield exports.DecIndent;
60
+ yield DecIndent;
65
61
  }
66
- exports.indent = indent;
67
62
  function* jsDoc(docs) {
68
- var _a;
69
63
  yield `/**`;
70
64
  if (typeof docs === 'string') {
71
65
  yield ` * ${docs}`;
@@ -79,7 +73,7 @@ function* jsDoc(docs) {
79
73
  if (docs.params || docs.returns) {
80
74
  yield ' *';
81
75
  }
82
- for (const [paramName, paramDesc] of Object.entries((_a = docs.params) !== null && _a !== void 0 ? _a : {})) {
76
+ for (const [paramName, paramDesc] of Object.entries(docs.params ?? {})) {
83
77
  yield ` * @param ${paramName} ${paramDesc}`;
84
78
  }
85
79
  if (docs.returns)
@@ -87,61 +81,73 @@ function* jsDoc(docs) {
87
81
  }
88
82
  yield ' */';
89
83
  }
90
- exports.jsDoc = jsDoc;
91
84
  function writeDocumentPartsTo(document, { indent = ' ', ...options }, writer) {
92
85
  if (options.header)
93
86
  writer.write(`${options.header}\n`);
94
87
  if (options.disableEslint)
95
88
  writer.write('/* eslint-disable */\n');
96
- const lineModes = [exports.NewLineMode];
97
- const currentLineMode = () => { var _a; return (_a = lineModes.at(-1)) !== null && _a !== void 0 ? _a : exports.NewLineMode; };
89
+ const lineModes = [NewLineMode];
90
+ const currentLineMode = () => lineModes.at(-1) ?? NewLineMode;
98
91
  let curIndent = '';
99
92
  for (const part of document) {
100
93
  switch (part) {
101
- case exports.IncIndent:
94
+ case IncIndent:
102
95
  curIndent += indent;
103
96
  break;
104
- case exports.DecIndent:
97
+ case DecIndent:
105
98
  curIndent = curIndent.slice(0, -indent.length);
106
99
  break;
107
- case exports.DecIndentAndCloseBlock:
100
+ case DecIndentAndCloseBlock:
108
101
  curIndent = curIndent.slice(0, -indent.length);
109
102
  writer.write(`${curIndent}}\n`);
110
103
  break;
111
- case exports.NewLineMode:
112
- lineModes.push(exports.NewLineMode);
104
+ case NewLineMode:
105
+ lineModes.push(NewLineMode);
113
106
  if (writer.last.slice(-1)[0] !== '\n') {
114
107
  writer.write('\n');
115
108
  }
116
109
  break;
117
- case exports.InlineMode:
118
- lineModes.push(exports.InlineMode);
110
+ case InlineMode:
111
+ lineModes.push(InlineMode);
119
112
  break;
120
- case exports.RestoreLineMode:
113
+ case RestoreLineMode:
121
114
  lineModes.pop();
122
- if (currentLineMode() === exports.NewLineMode && writer.last.slice(-1)[0] !== '\n') {
115
+ if (currentLineMode() === NewLineMode && writer.last.slice(-1)[0] !== '\n') {
123
116
  writer.write('\n');
124
117
  }
125
118
  break;
126
- case exports.PropertyDelimiter:
127
- if (currentLineMode() === exports.NewLineMode) {
119
+ case PropertyDelimiter:
120
+ if (currentLineMode() === NewLineMode) {
128
121
  writer.write('\n');
129
122
  }
130
123
  else {
131
124
  writer.write(', ');
132
125
  }
133
126
  break;
134
- case exports.NewLine:
127
+ case NewLine:
135
128
  writer.write('\n');
136
129
  break;
137
130
  default:
138
131
  if (writer.last.slice(-1)[0] === '\n')
139
132
  writer.write(curIndent);
140
133
  writer.write(part);
141
- if (currentLineMode() === exports.NewLineMode)
134
+ if (currentLineMode() === NewLineMode)
142
135
  writer.write('\n');
143
136
  break;
144
137
  }
145
138
  }
146
139
  }
147
- //# sourceMappingURL=writer.js.map
140
+
141
+ exports.DecIndent = DecIndent;
142
+ exports.DecIndentAndCloseBlock = DecIndentAndCloseBlock;
143
+ exports.IncIndent = IncIndent;
144
+ exports.InlineMode = InlineMode;
145
+ exports.NewLine = NewLine;
146
+ exports.NewLineMode = NewLineMode;
147
+ exports.PropertyDelimiter = PropertyDelimiter;
148
+ exports.RestoreLineMode = RestoreLineMode;
149
+ exports.indent = indent;
150
+ exports.inline = inline;
151
+ exports.jsDoc = jsDoc;
152
+ exports.writeDocumentPartsToStream = writeDocumentPartsToStream;
153
+ exports.writeDocumentPartsToString = writeDocumentPartsToString;
@@ -25,4 +25,3 @@ export declare function jsDoc(docs: string | {
25
25
  params?: Record<string, string>;
26
26
  returns?: string;
27
27
  }): Generator<string, void, unknown>;
28
- //# sourceMappingURL=writer.d.ts.map